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.

Ok worked on it today again
And i just cant get it to work
ToggleState just doesnt work at all (3.3)
Because loadState() is only called when i close eclipse!
Never when i just start up eclipse....
I guess because getValue or something is never called on it. And i cant see a path where i can trigger that.. (because my code is not loaded)

Then i thought ok lets do it another way. Lets just make it as the GroupBy entry of the same drop down menu.. (breakpoints view)
This is the GroupBreakpointsByAction class that does that.

I configured everything the same.. the GroupBreakpointsByAction is always a DROP_DOWN_MENU
But mine just doesnt want to become that by  default .. Its a normal menu entry
until i click on it. and then close the breakpoints view and the reopen it.. Then it is a drop down

So i investigated..

Its all in the PluginAction class :

 protected boolean isOkToCreateDelegate() {
        if (getStyle() == IAction.AS_DROP_DOWN_MENU
                && !WWinPluginPulldown.class.isInstance(this)) {
            return true;
        }
       
        // test if the plugin has loaded
        String bundleId = configElement.getNamespace();
        return BundleUtility.isActive(bundleId);
    }

mine is not a AS_DROP_DOWN_MENU because i have no idea how to specify that in the plugin.xml because i only have radio/push/check options
Als getStyle() will reutrn as drop down but then the value must be an instanceof MenuCreator. And yes my action is a IMenuCreator but it isnt made yet (chicken and egg problem here)
So then it goes in the the isActive check..
And yes this is why the GroupBy of the debug ui plugin does work (because yes it is activated) but mine doesnt because i am in the jsjdtdebugger plugin which is not loaded at this time.

So how to do this correctly is beyond me. Eclipse is really trying to be to lazy if you ask me. It is fine that it is that way. But i want to override it!

Does anybody knows how to activate the jsjdt plugin if before or with the debugger (ui) plugin of eclipse?

Or how to set that it is a drop down in the plugin.xml??

johan




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

  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

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



Back to the top