Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » Multiple contributorClass for an editor.
Multiple contributorClass for an editor. [message #294635] Tue, 15 November 2005 09:47 Go to next message
Eclipse UserFriend
Originally posted by: lshah.vitria.com

Can I have multiple contributorClasses for one editor?

Here's what I am trying to do:
I have one editor which is contributed by my main plugin.
I also have a bunch of secondary plugins who want to contribute a menu/toolbar action if the editor
content is of certain type.
I don't want the secondary plugins to contribute actions and disable them if the editor content is
not of the right type. That would lead to action overload.
As I see it, the best way to do so would be have a contributor class supplied by each secondary
plugin for the editor and then contribute the action if the content is of a certain type. But that
does not seem to be possible.

What would be the best way to achieve what I want to do?

Regards,
Lokesh
Re: Multiple contributorClass for an editor. [message #294648 is a reply to message #294635] Tue, 15 November 2005 12:02 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: douglas.pollock.magma.ca

Lokesh Shah wrote:
> Can I have multiple contributorClasses for one editor?

Not afaik.


> I have one editor which is contributed by my main plugin.
> I also have a bunch of secondary plugins who want to contribute a
> menu/toolbar action if the editor content is of certain type.
> I don't want the secondary plugins to contribute actions and disable them
> if the editor content is not of the right type. That would lead to action
> overload. As I see it, the best way to do so would be have a contributor
> class supplied by each secondary plugin for the editor and then contribute
> the action if the content is of a certain type. But that does not seem to
> be possible.
>
> What would be the best way to achieve what I want to do?

In 3.1, I don't believe there is an amazingly good way to do this. You
could try defining an extension point, and then have your one contributor
read that extension point and use it to decide which contributions should
be visible.

Another possibility is to define a different editor for each of the various
content types. Then these content-type-specific editors could have their
own contributor. Common contributions could be managed by some singleton
that is shared between all of your editors.

Object contributions can be bound to the content type, but I don't believe
viewActions, editorActions or viewerContributions can be.



cheers,
d.
Re: Multiple contributorClass for an editor. [message #294652 is a reply to message #294648] Tue, 15 November 2005 13:23 Go to previous message
Eclipse UserFriend
Originally posted by: lshah.vitria.com

Thanks Douglas.
I think I'll go with defining my extension point similar to one of the existing ones.

Regards,
Lokesh

Douglas Pollock wrote:
> Lokesh Shah wrote:
>
>>Can I have multiple contributorClasses for one editor?
>
>
> Not afaik.
>
>
>
>>I have one editor which is contributed by my main plugin.
>>I also have a bunch of secondary plugins who want to contribute a
>>menu/toolbar action if the editor content is of certain type.
>>I don't want the secondary plugins to contribute actions and disable them
>>if the editor content is not of the right type. That would lead to action
>>overload. As I see it, the best way to do so would be have a contributor
>>class supplied by each secondary plugin for the editor and then contribute
>>the action if the content is of a certain type. But that does not seem to
>>be possible.
>>
>>What would be the best way to achieve what I want to do?
>
>
> In 3.1, I don't believe there is an amazingly good way to do this. You
> could try defining an extension point, and then have your one contributor
> read that extension point and use it to decide which contributions should
> be visible.
>
> Another possibility is to define a different editor for each of the various
> content types. Then these content-type-specific editors could have their
> own contributor. Common contributions could be managed by some singleton
> that is shared between all of your editors.
>
> Object contributions can be bound to the content type, but I don't believe
> viewActions, editorActions or viewerContributions can be.
>
>
>
> cheers,
> d.
>
Previous Topic:Runtime test works, exported plugin doesn't
Next Topic:Controlling CVS
Goto Forum:
  


Current Time: Sat Aug 23 05:55:19 EDT 2025

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

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

Back to the top