Confusion about Action members
[email protected] Sun, 24 Jul 2005 01:33:02 +0000 (UTC)
| Newsgroups | gmane.comp.embedded.carlsbad-cubes |
|---|---|
| Message-ID | <[email protected]> |
Hi!
Can Action objects work like this?
public class MyMenuItem extends JMenuItem {
public static Action MyAction = SomeStaticClass.getAction();
}
where SomeStaticClass has a selection of general actions that can be
used by many other client classes, eg we could declare a public class
MyButton similarly and use the same action.
MyMenuItem is registered for the tag <menuitem> and MyButton for <button>
This way I wanted the Actions specified in the XML as
<menubar> <menu name='file'>
<menuitem name='open' Action='MyAction'/>
</menu>
</menubar>
to work similarly to one declared for a button.
I guess my question boils down to whether the reflection mech. is looking
only for public instance members, or also static ones.. UPDATE doesn't seem
to work even if I remove static..
thanks!
Nandan