Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » ToggleState default value
ToggleState default value [message #498844] Wed, 18 November 2009 18:52
Joel is currently offline JoelFriend
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

Previous Topic:PDE director throws signature exception
Next Topic:ToggleState default value
Goto Forum:
  


Current Time: Thu Apr 25 17:00:25 GMT 2024

Powered by FUDForum. Page generated in 0.03401 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top