Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » actions enabled on a specific perspective ...
actions enabled on a specific perspective ... [message #463091] Tue, 06 February 2007 11:18 Go to next message
Eclipse UserFriend
Hi all

Hope this is the right forum.



I have got an action which implements IWorkbenchWindowActionDelegate defined
in the plugin.xml.



It works fine if I set the action as visible (I can correctly see the button
on the rcp toolbar).

What I would like is to show this action, still in the toolbar, only when a
specific perspective is enabled.



I have tried to put in the perspective code (implements IPerspectiveFactory)
the layout.addActionSet (action id) switching the visibility action flag in
the plugin.xml either false or not specified.

No way to see the action .



I have tried to use the perspective extension and there I have added the
action set id . still I cannot see the button appear on the toolbar.



What am I doing wrong?



Thanks for you help

Kar
Re: actions enabled on a specific perspective ... [message #463137 is a reply to message #463091] Tue, 06 February 2007 16:41 Go to previous messageGo to next message
Eclipse UserFriend
hi, add your IPerspectiveListener3 to WorkbenchWindow, so it will change
your toolbars accordingly.

workbenchWindow.addPerspectiveListener(new IPerspectiveListener3() {
public void perspectiveOpened(IWorkbenchPage page,
IPerspectiveDescriptor perspective) {
// show good buttons
}
public void perspectiveClosed(IWorkbenchPage page,
IPerspectiveDescriptor perspective) {
// hide bad ones ;)
}
});

KarSc napisał(a):
> Hi all
>
> Hope this is the right forum.
>
>
>
> I have got an action which implements IWorkbenchWindowActionDelegate defined
> in the plugin.xml.
>
>
>
> It works fine if I set the action as visible (I can correctly see the button
> on the rcp toolbar).
>
> What I would like is to show this action, still in the toolbar, only when a
> specific perspective is enabled.
>
>
>
> I have tried to put in the perspective code (implements IPerspectiveFactory)
> the layout.addActionSet (action id) switching the visibility action flag in
> the plugin.xml either false or not specified.
>
> No way to see the action .
>
>
>
> I have tried to use the perspective extension and there I have added the
> action set id . still I cannot see the button appear on the toolbar.
>
>
>
> What am I doing wrong?
>
>
>
> Thanks for you help
>
> Kar
>
>
>
Re: actions enabled on a specific perspective ... [message #463239 is a reply to message #463137] Wed, 07 February 2007 05:41 Go to previous message
Eclipse UserFriend
Hi Jacek,

Ok I managed to attach le listener to the workbeanchWindow ... the problem
is how to show the button now :-(

I have got an action implements the IWorkbenchWindowActionDelegate. This
action has been defined in the plugin.xml as extension
(org.eclipse.ui.actionSerts).

how do I find the action and set the visibility to true ... bear in mind
that I want this to appear either in the menu and in the main toolbar (as if
I had selected the visibility to true in the actionset fields).

I can even create an action but still I have no idea how to attach the
action in the main toolbar.

just to be clear ... this is the second plug-in which has got its own
perspective. this is not the main perspective loaded by the rcp application
where I could have played in the bar advisor.

Kar



what i have got is an
"Jacek Pospychala" <jacekp@siat.pl> wrote in message
news:eqaslp$aqd$1@utils.eclipse.org...
> hi, add your IPerspectiveListener3 to WorkbenchWindow, so it will change
> your toolbars accordingly.
>
> workbenchWindow.addPerspectiveListener(new IPerspectiveListener3() {
> public void perspectiveOpened(IWorkbenchPage page,
> IPerspectiveDescriptor perspective) {
> // show good buttons
> }
> public void perspectiveClosed(IWorkbenchPage page,
> IPerspectiveDescriptor perspective) {
> // hide bad ones ;)
> }
> });
>
> KarSc napisal(a):
>> Hi all
>>
>> Hope this is the right forum.
>>
>>
>>
>> I have got an action which implements IWorkbenchWindowActionDelegate
>> defined in the plugin.xml.
>>
>>
>>
>> It works fine if I set the action as visible (I can correctly see the
>> button on the rcp toolbar).
>>
>> What I would like is to show this action, still in the toolbar, only when
>> a specific perspective is enabled.
>>
>>
>>
>> I have tried to put in the perspective code (implements
>> IPerspectiveFactory) the layout.addActionSet (action id) switching the
>> visibility action flag in the plugin.xml either false or not specified.
>>
>> No way to see the action .
>>
>>
>>
>> I have tried to use the perspective extension and there I have added the
>> action set id . still I cannot see the button appear on the toolbar.
>>
>>
>>
>> What am I doing wrong?
>>
>>
>>
>> Thanks for you help
>>
>> Kar
>>
>>
Previous Topic:Don't want minimize and maximize button for Editor
Next Topic:How to define custom context (org.eclipse.ui.contexts)?
Goto Forum:
  


Current Time: Wed Jul 30 13:55:31 EDT 2025

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

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

Back to the top