|
Re: Adapter not used, caused by plugin not activated. [message #753636 is a reply to message #753631] |
Fri, 28 October 2011 03:28   |
Eclipse User |
|
|
|
On 2011-10-28 09:09, mlentwojt wrote:
> Hello,
>
> I created an AdapterFactory (using extension
> org.eclipse.runtime.adapters) which adapt java.util.List
[..]
> This adapter is declared in a plugin common, because in will be used by
> many other plugins.
>
>
> In a second plugin, I define a view which will render a list of object
> in a TreeViewer.
[..]
> The object categorie has its own adapterFactory ...
>
> The problem is that no categories was displayed in the viewer. After
> step by step debugging, I found the cause : The common plugin is not
> loaded so the CommonAdapterFactory is not used to render the List of
> Categorie.
> The only solution I found is to force common plugin activation at start
> up of the application (using extension org.eclipse.ui.startup)
>
> I don't like activate plugin at start up (because useless if this plugin
> will not be used ...) so I would like to know if it exist another
> solution ?
IMO this is a fundamental defect of the org.eclipse.runtime.adapters
extension point. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=82973
for an old bug about this. There seems to be not much interest in fixing
this, even though there would be a very simple solution (suggested in
the bug report by me) to introduce a new optional attribute to the
extension point, e.g. "force" that has the effect of enforcing
activation of the contributing plugin, if the "pattern" described in the
plugin.xml could match. Given that other extension points do already
have such a flag (usually named "forcePluginActivation", so this should
be the name here as well), this clearly shows the need for sometimes
breaking the lazy-loading strategy.
Examples for other extension points that have such a flag are:
org.eclipse.ui.activities
org.eclipse.core.expressions.definitions
org.eclipse.core.resources.modelProviders
org.eclipse.ltk.core.refactoring.createParticipants
I don't think that it should be too hard to implement
"forcePluginActivation" for org.eclipse.runtime.adapters as well.
Just vote for it ;-)
Greetings from Bremen,
Daniel Krügler
|
|
|
|
Powered by
FUDForum. Page generated in 0.03572 seconds