Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » How to load a UI PlugIn by code without UI elements being already there
How to load a UI PlugIn by code without UI elements being already there [message #758929] Fri, 25 November 2011 05:39 Go to next message
Matthias Becker is currently offline Matthias Becker
Messages: 29
Registered: July 2009
Junior Member
Hi
i am just starting with RCP/OSGI and just ran into this Problem:

I have a main application that provides a log in dialog. Depending on the credentials of the user i want to provide different UIs. Example:
- Main Application
Provides the login dialog and calls the login handler of the different "base" plug ins
- AdministrationBase
Checks if the user has the necessary rights to use the Administration dialog. If so, loads the AdministrationUI
- AdministrationUI
Provides the UI for Administration

So far this works fine but when i start the Application all menu entries defined in the PlugIn.xml of the AdministrationUI are already there before the log in is performed. I set the start level to a value > 4 and autostart to false without success. It seems that eclipse already reads the plugin.xml. So how can i tell eclipse to load the xml only then when the AdministrationBase loads the corresponding UI?
Or do i have to do this by code? If so, how can i ensure that the advisor classes are correctly executed?

Thanks
Matthias
Re: How to load a UI PlugIn by code without UI elements being already there [message #759042 is a reply to message #758929] Fri, 25 November 2011 14:00 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can use your login to set roles, an ISourceProvider to make that information available to the framework, and then use Activities/Capabilities and the enabledWhen element to hide the plugin.xml entries you don't want.

PW


Re: How to load a UI PlugIn by code without UI elements being already there [message #759223 is a reply to message #759042] Sun, 27 November 2011 14:36 Go to previous messageGo to next message
Matthias Becker is currently offline Matthias Becker
Messages: 29
Registered: July 2009
Junior Member
Hi
thanks for the reply.
OK, Is that even usable to the availability of whole perspectives/views? It seems not to but it also seems that it would violate a Eclipse paradigm...
Re: How to load a UI PlugIn by code without UI elements being already there [message #759356 is a reply to message #759223] Mon, 28 November 2011 08:31 Go to previous messageGo to next message
Paul Webster is currently offline Paul Webster
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

I'm not sure what you are asking here. Activities/Capabilities are part of the the workbench UI support, see http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Fworkbench_scalability.htm

It's one way to hide views and actions from the user.

PW


Re: How to load a UI PlugIn by code without UI elements being already there [message #764220 is a reply to message #759356] Sun, 11 December 2011 12:38 Go to previous message
Matthias Becker is currently offline Matthias Becker
Messages: 29
Registered: July 2009
Junior Member
Hi
thanks for the replies. Your replies helped me to find a way how to accomplish what i want.
working with the Eclipse RCP framework is... complex Smile

Thanks!
Matthias
Previous Topic:Equinox P2 process fail in RCP Application
Next Topic:Extension Points: "Second instance" not available
Goto Forum:
  


Current Time: Fri Aug 22 21:54:08 EDT 2014

Powered by FUDForum. Page generated in 0.01642 seconds