Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » enable command handler on startup
enable command handler on startup [message #332028] Wed, 01 October 2008 15:27 Go to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
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 #332046 is a reply to message #332028] Wed, 01 October 2008 18:54 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

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


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Re: enable command handler on startup [message #332081 is a reply to message #332046] Thu, 02 October 2008 12:15 Go to previous messageGo to next message
Sven Krause is currently offline Sven KrauseFriend
Messages: 64
Registered: July 2009
Member
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
>
>
Re: enable command handler on startup [message #332085 is a reply to message #332081] Thu, 02 October 2008 12:35 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Sven Krause wrote:
> 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?

The property tester "test" element has a forcePluginLoading attribute
that can force a property tester to load. I'm not a big fan, but it's
possible.

If you are going to force plugin activation using
org.eclipse.ui.startup, please make sure that you are activating a
minimal plugin with little or no UI elements in it. Once a plugin is
loaded eclipse is free to instantiate any action delegates, handlers,
and a host of other things.

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/ganymede/index.jsp?topic=/org.eclips e.platform.doc.isv/guide/workbench.htm


Previous Topic:Toolbar buttons with Eclipse Look
Next Topic:Custom install handler not getting run with Eclipse 3.4
Goto Forum:
  


Current Time: Fri Aug 16 22:47:57 GMT 2024

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

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

Back to the top