Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » toggle state
toggle state [message #549942] Wed, 28 July 2010 10:18 Go to next message
Missing name Mising name is currently offline Missing name Mising name
Messages: 100
Registered: March 2010
Senior Member
Hello.

I have made a command, it's represents for toggle button in the main toolbar, but it has a state (true or false, select or not select).

But I have a problem I don't want remember the state between sesions of eclipse, what do I make???

My command:

 <command
            category="Favorites"
            categoryId="com.quaityeclipse.favorites.commands.category"
            description="Open tha Favorites view if it is not already visible"
            id="com.quaityeclipse.favorites.commands.openView"
            name="Open Favorites View">
                 
        <state
                   class="org.eclipse.ui.handlers.RegistryToggleState:false"
                   id="org.eclipse.ui.commands.toggleState">
        </state>
</command>


I want the toggle false when the sesion begins.

Thanks a lot
Jose
Re: toggle state [message #551035 is a reply to message #549942] Wed, 04 August 2010 18:26 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Jose,

What does the handler code say?

--

Best Regards,
Wim Jongman

Eclipse Twitter
-- Too much coding lately, I find myself ending sentences with a semicolon
Ian Bull


> Hello.
>
> I have made a command, it's represents for toggle button in the main
toolbar, but it has a state (true or false, select or not select).
>
> But I have a problem I don't want remember the state between sesions of
eclipse, what do I make???
>
> My command:
>
>
> <command
> category="Favorites"
> categoryId="com.quaityeclipse.favorites.commands.category"
> description="Open tha Favorites view if it is not already visible"
> id="com.quaityeclipse.favorites.commands.openView"
> name="Open Favorites View">
>
> <state
> class="org.eclipse.ui.handlers.RegistryToggleState:false"
> id="org.eclipse.ui.commands.toggleState">
> </state>
> </command>
>
>
> I want the toggle false when the sesion begins.
>
> Thanks a lot
> Jose
Re: toggle state [message #551346 is a reply to message #549942] Fri, 06 August 2010 01:06 Go to previous messageGo to next message
Prakash G.R. is currently offline Prakash G.R.
Messages: 621
Registered: July 2009
Senior Member
On 28/07/10 7:48 PM, Jose wrote:

> I have made a command, it's represents for toggle button in the main
> toolbar, but it has a state (true or false, select or not select).
>
> But I have a problem I don't want remember the state between sesions of
> eclipse, what do I make???

Add this parameter to the command's state:

<parameter
name="persisted"
value="false">
</parameter>

See: http://bit.ly/CommandsTutorial for more details

--
- Prakash
Platform UI Team, IBM

www.eclipse-tips.com
Re: toggle state [message #551712 is a reply to message #551346] Mon, 09 August 2010 05:57 Go to previous message
Missing name Mising name is currently offline Missing name Mising name
Messages: 100
Registered: March 2010
Senior Member
Hello.

Thanks for your answer.

I have made this:

 <command
            category="Favorites"
            categoryId="com.quaityeclipse.favorites.commands.category"
            description="Open tha Favorites view if it is not already visible"
            id="com.quaityeclipse.favorites.commands.openView"
            name="Open Favorites View">
            <state
            class="org.eclipse.ui.handlers.RegistryToggleState:false"
            id="org.eclipse.ui.commands.toggleState">
            <parameter
			name="persisted"
			value="false">
	    </parameter>
            </state>
      </command>


But the state is remember still.

Is my code wrong?

Thanks a lot
Jose
Previous Topic:toolbar command enablement
Next Topic:Problem closing a view unless it is active
Goto Forum:
  


Current Time: Fri Jul 25 07:30:59 EDT 2014

Powered by FUDForum. Page generated in 0.02211 seconds