How to create a menu-item for GUI application based on Netbeans

Let’s add an item that would have the name and availability depends on something (e.g. logged in user or not)

At first you should create a new Action (it mean menu-item) with type ‘Always Enabled’ via the wizard.
layer.xml will be modified and you can find next definition

In addition, new class will be created:

You can run an application and see the new item.
But how change its?
Let’s modify LoginItemAction (we need to extend it by CallableSystemAction)

Now we need to modify layer.xml (simple to delete useless strings)