enable command handler on startup [message #332028] |
Wed, 01 October 2008 15:27  |
Eclipse User |
|
|
|
Hi,
I've bound a command handler to a menu in combination with the
visibleWhen option "checkEnabled". The plugin hosting the command handle
will not activated before the first command execution is triggered. This
ends into that my menu item is always enabled, independent on the state
the command handle would decide. How to I force the extension to
consider my handler right from front up. (The decision is dependent on
an value retrieved from an adapter for the current selection, where the
adapter is registered anywhere else.) And as second handicap: I'm
referring to a viewer that is not in my hand - so that I can't change
the menu initialization sequence...
Any ideas are welcome ... :-)
Sven
|
|
|
|
Re: enable command handler on startup [message #332081 is a reply to message #332046] |
Thu, 02 October 2008 12:15   |
Eclipse User |
|
|
|
Paul,
this delegates the problem only to the next level. The problem is
located within the plugin activation. I have an adapter factory
registered for the selection object the command shall be attached. The
handler has the enableWhen parameter set. But the adapter is not
available until the plugin is activated.
The solution was the org.eclipse.ui.startup extension that forces
equinox to load my plugin right from front up. Is it valuable to add an
expression option to the adapt parameter within the expression language?
Sven
Paul Webster wrote:
> Are you contributing your handler through org.eclipse.ui.handlers?
> You can use enabledWhen and core expressions to check if objects can
> be adapted using the <adapt/> element
>
> PW
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03883 seconds