Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to make perspective invisible for user
How to make perspective invisible for user [message #511024] Fri, 29 January 2010 15:12 Go to next message
Miłosz is currently offline Miłosz
Messages: 3
Registered: October 2009
Location: Poland
Junior Member
Hi,

I have problem with hiding perspective in Eclipse RCP Application. I want to make perspective invisible for user (dynamically). It means that perspective should be not visible in 'Perspectives' toolbar and 'Open Perspective' dialog (user can't open perspective). I have found how to hide perspective:

IPerspectiveDescriptor pd = ... // perspective to hide
PerspectiveRegistry pr = (PerspectiveRegistry) PlatformUI.getWorkbench().getPerspectiveRegistry();
pr.removeExtension(null, pd);



but I don't know how to make it accessible for user again (perspective visible in 'Perspectives' toolbar and 'Open Perspective' dialog).

Any ideas ??

Thanks in advance,

Miłosz

[Updated on: Fri, 29 January 2010 20:05]

Report message to a moderator

Re: How to make perspective invisible for user [message #511090 is a reply to message #511024] Fri, 29 January 2010 13:36 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

Your best bet is to use activities. A disabled activity will hide the
perspective, and enabling it will make it visible.

The problem is you've simply removed the descriptor from the registry
.... that would probably make the system unhappy.

PW

--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Re: How to make perspective invisible for user [message #511177 is a reply to message #511090] Sat, 30 January 2010 18:51 Go to previous messageGo to next message
Wim Jongman is currently offline Wim Jongman
Messages: 418
Registered: July 2009
Senior Member
Hi Mi,

Another practice is not to supply the open perspective menu nor show the
perspective toolbar but create your own.

--

Best Regards,
Wim Jongman
-- Press CTRL-ALT-DEL to continue ...
(Eclipse Old Skool Quote Service)

> Your best bet is to use activities. A disabled activity will hide the
> perspective, and enabling it will make it visible.
>
> The problem is you've simply removed the descriptor from the registry
> .... that would probably make the system unhappy.
>
> PW
>
> --
> Paul Webster
> http://wiki.eclipse.org/Platform_Command_Framework
> http://wiki.eclipse.org/Command_Core_Expressions
> http://wiki.eclipse.org/Menu_Contributions
> http://wiki.eclipse.org/Menus_Extension_Mapping
>
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm
Re: How to make perspective invisible for user [message #511221 is a reply to message #511024] Sun, 31 January 2010 13:11 Go to previous message
Catalin Gerea is currently offline Catalin Gerea
Messages: 89
Registered: July 2009
Location: Bucharest, Romania
Member

Hello

See here how to replace the perspective switcher in your application.
http://eclipsesource.com/blogs/2009/03/31/replacing-the-pers pective-switcher-in-rcp-apps/.
In the fill() method of the PerspectiveSwitcherMenu class you can make available the perspective depending on your needs.

Hope this helps you.


Time is what you make of it.
Previous Topic:CDT new project wizard
Next Topic:Pb with IInputValidator
Goto Forum:
  


Current Time: Fri Oct 31 09:29:49 GMT 2014

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

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