Adding extension programmatically mess up presentation factory [message #671542] |
Wed, 18 May 2011 05:06  |
Eclipse User |
|
|
|
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 #671972 is a reply to message #671800] |
Thu, 19 May 2011 09:41  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.04121 seconds