Skip to main content

Commands don't have set Methods!

2 replies [Last post]
raheman
Offline
Joined: 2008-07-20
Points: 0

Is any way to update Commandname;
there is no methods for doing that,
i wish there was setCommandName(String command) method !

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
raheman
Offline
Joined: 2008-07-20
Points: 0

Hi
Thank you Shai.

>You can implement this functionality by deriving from Command and
>adding setCommandName/getCommandName methods of your own that would
>store data in your own variable.

yes ,it is good idea.

Thanks.

Shai Almog

Hi,
the reason we didn't add such a method is that you would also expect
the text to change in all the locations where the command is used
which might be difficult.
You can implement this functionality by deriving from Command and
adding setCommandName/getCommandName methods of your own that would
store data in your own variable. This will work for some use cases
such as menu commands after closing and reopening the menu. It won't
work for changing menu text while the menu is running (might work if
selection passes through the command) and won't work for buttons.

> Is any way to update Commandname;
> there is no methods for doing that,
> i wish there was setCommandName(String command) method !
> [Message sent by forum member 'raheman' (raheman)]
>
> http://forums.java.net/jive/thread.jspa?messageID=289523

Shai Almog
http://lwuit.blogspot.com/

[att1.html]