ToggleState default value [message #498844] |
Wed, 18 November 2009 18:52 |
Joel Messages: 16 Registered: October 2009 |
Junior Member |
|
|
My command has a default value, but it seems to be ignored whether true or false. Specifically, in the handler's execute(), event.getCommand().getState(ID).getValue() always returns false the first time (before I toggle its state).
I'm using Eclipse 3.4. Here is my command extension:
Quote: |
<extension
point="org.eclipse.ui.commands">
<command
defaultHandler="mystuff.command.DisplayZonesHandler"
description="Toggles the displaying of the video zones"
id="mystuff.command.displayzones"
name="Display Zones">
<state
id="mystuff.command.displayzones.state">
<class class="org.eclipse.jface.commands.ToggleState">
<parameter name="default" value="false">
</parameter>
</class>
</state>
</command>
|
Thanks in advance.
<Edit>
Still no luck, but I set the actual state value in the handler's constructor, but the UI element does not reflect the change.
ICommandService service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class);
State state = service.getCommand("com.p21csi.fps.vision.zone.ui.command.displayzones")
.getState(STATE_ID);
state.setValue(true);
service.refreshElements("com.p21csi.fps.vision.zone.ui.command.displayzones", null);
[Updated on: Wed, 18 November 2009 19:49] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03474 seconds