|
Replies:
4
-
Last Post:
Oct 23, 2008 3:33 AM
by: alrocar
|
|
|
|
|
|
|
Disable command menu items
Posted:
Oct 13, 2008 2:44 AM
|
|
|
Hello, I need to enable/disable menu commands. I've implemented a MenuRenderer that 'ignores' my disabled commands, avoiding them to have the focus. But the better solution I think it was to ignore the action events on the menu command, for example, the mouse click event. Can you guide me to reach that behaviour on my menu commands?
Thanks.
Alberto
|
|
|
|
|
|
|
Re: Disable command menu items
Posted:
Oct 14, 2008 1:36 AM
in response to: alrocar
|
|
|
How about creating your menuaction with Action(s) and setting these actions enabled/disabled
see AbstractAction
|
|
|
|
|
|
|
|
Re: Disable command menu items
Posted:
Oct 14, 2008 6:39 AM
in response to: f_beullens
|
|
|
Thanks for your reply.
I think it would be enough for my purposes to override the actionPerformed method of my custom MenuCommand and do nothing when it was disabled.
The problem is that when a Command is clicked, the form's MenuBar is disposed. Is there any way to avoid that behaviour? (without modifying LWUIT's source code).
Regards, Alberto.
|
|
|
|
|
|
|
|
Re: Disable command menu items
Posted:
Oct 14, 2008 10:16 PM
in response to: alrocar
|
|
|
|
|
I assume you mean the dialog is disposed. Use dialog.setAutoDispose(false);
The previous poster mistakenly thought this was a Swing forum.
> Thanks for your reply. > > I think it would be enough for my purposes to override the > actionPerformed method of my custom MenuCommand and do nothing when > it was disabled. > > The problem is that when a Command is clicked, the form's MenuBar > is disposed. Is there any way to avoid that behaviour? (without > modifyinf LWUIT's source code). > > Regars, Alberto. > [Message sent by forum member 'alrocar' (alrocar)] > > http://forums.java.net/jive/thread.jspa?messageID=306740 > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@lwuit.dev.java.net > For additional commands, e-mail: users-help@lwuit.dev.java.net >
Shai Almog http://lwuit.blogspot.com/
[att1.html]
|
|
|
|
|
|
|
|
Re: Disable command menu items
Posted:
Oct 23, 2008 3:33 AM
in response to: Shai Almog
|
|
|
I didn't realized that exists showDialogMenu method inside the Form class, so I have implemented it and everything is OK.
Thanks for your answers!!
Alberto.
|
|
|
|
|