Working with action?
I'm having some doubts about how to use actions, or what are the
correct action to use.
Much of my action are to exist in the menu bar, toolbar and popup
menus for the nodes. They are exactly the same actions, they should no
be different instances. And most of them should be context aware.
If I use the wizard to create an action it will create a callable
action or a cookie action. I don't have use for cookies so I never
created cookie actions, I always created callable actions.
To make the actions context aware I was overriding the isEnabled
method, for every action. That is just what a cookie action must do
and I don't want to control what is selected and what is not.
Now I started porting some Dialogs to TopComponents, and ended up with
another type of action, an AbstractAction, that is visible in the
window menu.
So, what do I want? I need to make all this actions, that are
different instances and that are in different menus, the same object,
the same type of action, I also need them to be selection aware and I
need them to be in all three places, menu bar, toolbar and popup
menus. I also need the icons to behave accordingly, e.g. be a 16x16
icon when in the menu and a 22x22 icon when in the toolbar.
What type of action should I use and how can I make the same action
show in different places. I've read about .shadow files but I have
some trouble understanding the structure of the layer file, and what
represents what. Sorry but the tutorials are just too easy to follow,
so easy that they end up explaining nothing, I need to know how things
work in order to properly understand them, and the tutorials just tell
you where to click and what to copy, not what you are doing.
--
Best regards,
Sérgio Lopes