|
Re: selectionChanged and lazy loading [message #304855 is a reply to message #304852] |
Fri, 16 June 2006 11:07 |
|
Michael Pradel wrote:
> I have a IObjectActionDelegate and want to enable/disable the action in
> selectionChanged(). It calls a method of my plugin, and I recognized a
> strange behaviour when the action is displayed before the plugin has
> been used. In this case, selectionChanged() isn't called before the
> action is displayed to the user (so that a could disable is), but after
> he has clicked on it (which I wanted to avoid).
> I know Eclipse uses lazy loading for plugins, but shouldn't the plugin
> be loaded in this case?
> Is there any other way to disable the action before the plugin is started?
What extension point did you use to create this? org.eclipse.ui.popupMenus?
You are right, the lazy loading means that your code will never get
called, until the user clicks on your action at least once (or something
else causes your plugin to load).
But you can add declarative visibility and enablement expressions that
are used before your plugin is loaded. Both objectContributions and
actions can have enablement elements, and I think objectContributions
support visibility elements as well.
Click on the extension point and you can open the extension point
documentation.
Later,
PW
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
|
|
|
|
Powered by
FUDForum. Page generated in 0.08006 seconds