Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to hide perspective's popup menu?
How to hide perspective's popup menu? [message #443161] Tue, 24 January 2006 05:49 Go to next message
Setya Mising name is currently offline Setya Mising name
Messages: 484
Registered: July 2009
Senior Member
Hi all,

I need to hide perspective's popup menu especially Customize, Save As,
Reset, Close, Close All. Someone suggest that we use activities to achieve
that but since the perspective popup menu is not defined declaratively in
the plugin.xml, I find it impossible to use activities because there's no
way I can get the contribution Id of the popup menu.

I also try snippet submitted in Bugs #84226 and actually it works as
expected but I don't want to use it because the appearance of the
resulting perspective bar is not the same as the original one.

Any help would be greatly appreciated.

Thanks in advanced.


Setya
Re: How to hide perspective's popup menu? [message #443233 is a reply to message #443161] Tue, 24 January 2006 21:31 Go to previous messageGo to next message
Setya Mising name is currently offline Setya Mising name
Messages: 484
Registered: July 2009
Senior Member
well, anybody?
Re: How to hide perspective's popup menu? [message #443262 is a reply to message #443233] Wed, 25 January 2006 11:44 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex Blewitt
Messages: 946
Registered: July 2009
Senior Member
It's the perspective switcher, not the perspective, that has these commands. Why not just get rid of the perspective switcher?

Alex.
Re: How to hide perspective's popup menu? [message #443282 is a reply to message #443262] Wed, 25 January 2006 22:25 Go to previous messageGo to next message
Setya Mising name is currently offline Setya Mising name
Messages: 484
Registered: July 2009
Senior Member
Thanks for the response,

> It's the perspective switcher, not the perspective,
> that has these commands. Why not just get rid of the
> perspective switcher?

Because I need the perspective switcher anyway. I want the user to be able to switch between perspectives, but I don't want them to be able to customize the perspective using Customize... menu.

Regards,

Setya
Re: How to hide perspective's popup menu? [message #443295 is a reply to message #443282] Thu, 26 January 2006 09:52 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex Blewitt
Messages: 946
Registered: July 2009
Senior Member
Write your own perspective switcher? That would seem to do it. However, the Window -> Customise Perspective would still show up.

Alex.
Re: How to hide perspective's popup menu? [message #443331 is a reply to message #443295] Thu, 26 January 2006 22:08 Go to previous messageGo to next message
Setya Mising name is currently offline Setya Mising name
Messages: 484
Registered: July 2009
Senior Member
> Write your own perspective switcher? That would seem
> to do it.

Seems like this is the only way to go, but it's kind of reinventing the wheel since I feel OK with most of the default perspective switcher facilities except its Customize... context menu.

>However, the Window -> Customise
> Perspective would still show up.
>

In my apps I do not include Customize Perspective... in my window menu.


Regards,


Setya
Re: How to hide perspective's popup menu? [message #443344 is a reply to message #443331] Fri, 27 January 2006 07:32 Go to previous messageGo to next message
Alex Blewitt is currently offline Alex Blewitt
Messages: 946
Registered: July 2009
Senior Member
Since the source is available, there's nothing to stop you recycling code for the perspective switcher in your own plugin, as long as you abide by the EPL. If you don't want to do that for your entire project, you could even refactor out the code into a separate plugin (that is EPL licensed) and then your plugins (under your licence) could then use that. It's probably as easy as commenting out the lines that add the actions to the perspective switcher, either in the XML or in the code.

Alex.
Re: How to hide perspective's popup menu? [message #559778 is a reply to message #443161] Sat, 18 September 2010 05:59 Go to previous message
Marco Lopes is currently offline Marco Lopes
Messages: 56
Registered: September 2010
Member
PerspectiveBarManager perspectiveBarManager = ((WorkbenchWindow) PlatformUI.getWorkbench()
.getActiveWorkbenchWindow()).getPerspectiveBar();
ToolBar toolBar = perspectiveBarManager.getControl();
Listener[] listeners = toolBar.getListeners(SWT.MenuDetect);
if (listeners != null)
{
for (Listener listener : listeners)
{
toolBar.removeListener(SWT.MenuDetect, listener);
}
}
Previous Topic:Write in text Editor
Next Topic:Insert Text in Editor
Goto Forum:
  


Current Time: Thu Apr 17 03:50:21 EDT 2014

Powered by FUDForum. Page generated in 0.05747 seconds