Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Manipulation of IAction instance of IViewActionDelegate
Manipulation of IAction instance of IViewActionDelegate [message #452848] Tue, 18 July 2006 09:30 Go to next message
Eclipse UserFriend
Originally posted by: nagel.trium.de

Hi all,

I have problems with an IViewActionDelegate implementation, because I want
to enable / disable the wrapped IAction instance based on changes that
cannot be sensed by the selectionChanged(IAction action, ISelection
selection) method of this class. Is it possible to get the IAction
instance (right at the beginning) so that I can set it enabled / disabled,
whenever I want?

Thanks in advance,
Lars
Re: Manipulation of IAction instance of IViewActionDelegate [message #452886 is a reply to message #452848] Tue, 18 July 2006 13:32 Go to previous messageGo to next message
Roman Porotnikov is currently offline Roman PorotnikovFriend
Messages: 18
Registered: July 2009
Junior Member
Lars Nagel wrote:

> I have problems with an IViewActionDelegate implementation, because I
> want to enable / disable the wrapped IAction instance based on changes
> that cannot be sensed by the selectionChanged(IAction action, ISelection
> selection) method of this class. Is it possible to get the IAction
> instance (right at the beginning) so that I can set it enabled /
> disabled, whenever I want?

Implement also org.eclipse.ui.IActionDelegate2 and use its method
init(IAction action) to obtain an action reference.

regards,
Roman
Re: Manipulation of IAction instance of IViewActionDelegate [message #452904 is a reply to message #452886] Tue, 18 July 2006 19:08 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: nagel.trium.de

Thank you!

Now the problem is that the init method is not called immediately when the
perspective and its view are opened. The button is marked enabled,
although it is said in a Popup that it is disabled as soon as I click on
it. How can I disable the button from the beginning (without setting
enablesFor in the XML file)?

Thanks in advance,
Lars
Re: Manipulation of IAction instance of IViewActionDelegate [message #452930 is a reply to message #452904] Wed, 19 July 2006 07:00 Go to previous message
Roman Porotnikov is currently offline Roman PorotnikovFriend
Messages: 18
Registered: July 2009
Junior Member
Hi,

Lars Nagel wrote:

> Now the problem is that the init method is not called immediately when
> the perspective and its view are opened. The button is marked enabled,
> although it is said in a Popup that it is disabled as soon as I click on
> it. How can I disable the button from the beginning (without setting
> enablesFor in the XML file)?

Try this as a sub-element of your action declaration (substitute
"your.plugin.id" with your plugin id):

<enablement>
<pluginState id="your.plugin.id" value="activated"/>
</enablement>

- so the button will be disabled until plug-in activation, and then on
activation you set the desired enablement value in init(...) - so you
can keep it disabled if you need.

regards,
Roman
Previous Topic:delete Hyperbola Perspective
Next Topic:Extension Pop-Up Menu
Goto Forum:
  


Current Time: Sun Oct 06 20:09:12 GMT 2024

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

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

Back to the top