Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [Dltk-dev] a more general eclipse question.


  yeah - there is a bug in one of the 3.4 milestones (and 3.3 as well) that caused this to occur, the toggle isn't properly initialized. see bug https://bugs.eclipse.org/bugs/show_bug.cgi?id=216483.

  as long as you are storing the state of the toggle in the preference store, and reading it out of the preference store when the action is run, you'll be ok.

On Mon, May 19, 2008 at 11:04 AM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
I think i also already tried that, also doesnt seem to work
because my handler is created only when the action is triggered.

But thx for the pointer i will try to look into that direction a bit further.

johan



On Mon, May 19, 2008 at 4:23 PM, Jae Gangemi <jgangemi@xxxxxxxxx> wrote:

  are you using handlers to control the 'toggle' action?

  if so, i believe you want your handler to implement the IElememtUpdater interfacer so it will know the toggle state when it is initialized. see (AbstractToggleVariableHandler).

On Mon, May 19, 2008 at 9:14 AM, Johan Compagner <jcompagner@xxxxxxxxx> wrote:
Hi all,

in _javascript_ we have a few toggle commands contributed to various views

like: global method entry and exit breaks (i added also exception break, will commit that later) in the Breakpoints View
but also show xxx variables in the _javascript_ menu of the Variables view.

The big problem is that those are toggle that can be true when i shutdown eclipse
and we store that property in the plugin store/settings.

But i cant get eclipse so far that it reads that state in that i tell him tooo

I used the class ToggleState class as a state entry for the command
and then have that attached to STYLE id.
http://help.eclipse.org/help33/ntopic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/jface/commands/ToggleState.html

als see: http://wiki.eclipse.org/Menu_Contributions that has an example:

<extension point="org.eclipse.ui.commands">



<command categoryId="org.eclipse.jdt.ui.category.source"

description="%jdt.ui.ToggleMarkOccurrences.description"
id="org.eclipse.jdt.ui.edit.text.java.toggleMarkOccurrences"
name="%jdt.ui.ToggleMarkOccurrences.name">




<state id="NAME" class="org.eclipse.jface.menus.TextState" />
<state id="STYLE" class="org.eclipse.jface.commands.ToggleState:true" />
</command>




</extension>


but whatever i do the state is not correct.
If i place a breakpoint in the ToggleState class (load method)
then that load method is only triggered when i shutdown eclipse! Not when the command is initialized.

I have to do something wrong that is very obvious or something...

johan




_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae
_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev



_______________________________________________
dltk-dev mailing list
dltk-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/dltk-dev




--
-jae

Back to the top