Question concerning actionSets [message #455404] |
Mon, 25 September 2006 11:21  |
Eclipse User |
|
|
|
Hi,
I have two questions concerning actionSets. I'm developing a RCP
application and have several actions to integrate. Is it possible to add
an action via an actionSet where the enablement depends on the existence
of some specific part. When I add an action programmatically I can extend
the class PartEventAction and listen to open/close events for example. I
need the same for an action added via an actionSet. Is this possible? My
second question refer to the enablement of actions, too. The enablement of
my actions differ in the number of selected elements in my editor. After
studying the possibilities of enablement I'm wondering why it is not
possible to say that the action should be enabled when three or more
elements are selected. I think this is only possible for one (+) or two
(multiple, 2+) selected elements. I tried 3+, but the action enables
never. Is this correct or is there a possibility to say this?
Thanks in advance,
Ingo
|
|
|
|
|
Re: Question concerning actionSets [message #455496 is a reply to message #455444] |
Tue, 26 September 2006 21:18   |
Eclipse User |
|
|
|
Ingo Kroh wrote:
> Hi Paul,
>
> I use this extension point already, but the user can change the
> visibility via the Edit Actionsets Action, which I want to use in my
> application. And when the user sets the visibility always true, the
> action is enabled although no editor is open.
In your init(*) method, you can add your action as an IPartListener2 to
the workbench page and check for the part you are interested in.
Save your enablement state, and then when you get a selectionChanged(*)
call you can update the IAction state, and on a run(*) you can update
the IAction state and return immediately.
If you mean is there a way to do enablement declaratively for actionSet
actions, not in 3.2.
In 3.3 there we hope to change the way enablement works for actions so
that they have the same application context to draw on as handlers.
Then you could check for a specific part id.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=154130
Later,
PW
|
|
|
|
|
Re: Question concerning actionSets [message #455528 is a reply to message #455514] |
Thu, 28 September 2006 10:24  |
Eclipse User |
|
|
|
Hi Paul,
I try your solution. Anyway I think it's circumstantial if you want add an
action via an ActionSet and make it dependent whether a particular part is
open or not. I know I could do this programmatically, but then I lose the
possibility to let the user decide whether the ActionSet is visible or
not. I hope this is better in Eclipse 3.3.
So long,
Ingo
|
|
|
Powered by
FUDForum. Page generated in 0.04865 seconds