Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Adding extension programmatically mess up presentation factory
Adding extension programmatically mess up presentation factory [message #671542] Wed, 18 May 2011 05:06 Go to next message
Eclipse UserFriend
Hi all,

If my RCP ever tries to add extension by code, view restored during
startup will skip any customized presentation factory and use the
default one.

Minimizing and restoring the view solve the problem.

Any advice is appreacated.



Here is the code for loading dynamic extension to the registry.

------------------------------------------------------

IExtensionRegistry registry = Platform.getExtensionRegistry();
registry.addContribution(new FileInputStream("file.xml"),
ContributorFactoryOSGi .createContributor(context.getBundle()), false,
"plugin Id as string", null, ((ExtensionRegistry)
registry).getTemporaryUserToken());

------------------------------------------------------




Regards,
Hei
Re: Adding extension programmatically mess up presentation factory [message #671632 is a reply to message #671542] Wed, 18 May 2011 10:25 Go to previous messageGo to next message
Eclipse UserFriend
Where are you adding the programmatic extensions? In your IApplication? In your org.eclipse.ui.application.WorkbenchAdvisor.preStartup() ?

PW
Re: Adding extension programmatically mess up presentation factory [message #671800 is a reply to message #671632] Wed, 18 May 2011 23:32 Go to previous messageGo to next message
Eclipse UserFriend
Add in Activator.start(context)



On 18/5/2011 22:25, Paul Webster wrote:
> Where are you adding the programmatic extensions? In your
> IApplication? In your
> org.eclipse.ui.application.WorkbenchAdvisor.preStartup() ?
>
> PW
>
Re: Adding extension programmatically mess up presentation factory [message #671972 is a reply to message #671800] Thu, 19 May 2011 09:41 Go to previous message
Eclipse UserFriend
Activator.start(*) is probably not a good location. Depending on the state of your RCP app, your plugin may be activated before or during the Workbench initialization. Ideally you would want to add dynamically to the registry before you call PlatformUI.createAndRunWorkbench(*).

What is in your file.xml? What extension/extension point are you trying to add to the registry?

PW
Previous Topic:[Done] How To double click editor tab to maximize it
Next Topic:Webstart relaunch
Goto Forum:
  


Current Time: Sat Aug 30 20:58:56 EDT 2025

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

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

Back to the top