|How to deal with two plugins contributing each other [message #765718]
||Wed, 14 December 2011 10:13
| Jan Krakora
Registered: December 2009
let's say I have a model plugin containing model classes. Then I have two UI plugins. The first one show the model in a table, the second one show the model in a list.
How can I add "show model in a list" to the first plugin and "show model in a table" to the second plugin?? They should be completely independent, so they can't add itself as dependencies.
|Re: How to deal with two plugins contributing each other [message #766068 is a reply to message #765764]
||Thu, 15 December 2011 02:14
| Daniel KrÃ¼gler
Registered: July 2009
On 2011-12-14 17:32, Behnil wrote:|
>> Simple: Don't do that.
> Well, my client needs it. I used Table and List for simplicity, but in
> fact the first UI plugin visualizes the model in graph and the second UI
> plugin visualizes model in Table.
I just recognize that I misunderstood the sentence to which I replied
that way. You might have noticed that, because both solutions were
intended to realize what you wanted to do.
>> Yes, so why doesn't the first and second UI plugin provide the
>> corresponding "show model in a ..." contribution?
> I don't understand. Those two plugins are independent each other. But I
> think its regular requirement from users to see the model in the table
> and then to open the same model in List (or graph, or something else...).
Well you have not given much context information to us: It was
completely unclear in which way the model plugin would have any
opportunity to provide these "show model in a ..." presentations,
contributions, what ever you meant.
> The situation:
Yeah, would have been great if you would have described the situation in
the first place ;-)
> You are looking at a table showing a model. The table is within an
> dialog which is from UI plugin A. Now you would like to see this model
> in graph (or list in this simplified example)
So UI plugin A has a table with a context menu, and other UI plugins can
extend this - what is the problem with such an approach?
> So you, as a user, expect a context menu item "show this model in graph
> (list)" which would open an dialog with graph (list). This dialog is
> from UI plugin B.
> This one side contribution is easy, because I can create an extension
> point in UI plugin A and let other plugins (B) to contribute theirs
> There would be an interface which contributor would implement
> in theirs contributions.
Here the fuzziness factor increases again: What interface are you
talking about? Why isn't it sufficient to depend here on types from the
> So all plugins contributing to the UI plugin A
> would be depended on that plugin.
I would expect that this is the model plugin, so what is the problem? If
it isn't you should move this dependency to a "base UI plugin" that all
real UI plugins depend on.
> But I also need "show this model in table" in context menu of the graph.
> The graph (list) is shown in a dialog which is from UI plugin B. And
> this is problem.
This shouldn't be a problem, if the mystical interface that you
mentioned above is part of the model plugin. If that doesn't work, it
should be part of a very base UI plugin that you need to supply.
> Because I can't create the same extension like in plugin A and let
> plugin A contribute to it. It would mean the plugin A is depended on
> plugin B and it's forbidden to have cycle dependencies.
Not only forbidden, but just plain bad design, because for non-obvious
reasons UI plugin A has some preferences over UI plugin B.
>> Alternatively your model plugin could provide an extension point that
>> allows other plugins to contribute a "show model in ..." extension. Both
>> UI plugins would register correspondingly.
> I think that model plugin should be just a "stupid"" container for model
> classes. It shouldn't have any UI.
Well, you didn't really explain what you mean in the first place. I
understood your explanation that the model plugin has the responsibility
to show these texts.
HTH & Greetings from Bremen,
|Re: How to deal with two plugins contributing each other [message #766106 is a reply to message #765823]
||Thu, 15 December 2011 03:32
> They are shown unfortunately in dialog. I know the way to contribute to
> menu using the org.eclipse.ui.menu extension point. But this is not the
In my understanding this would mean that there is a third UI plugin
which provides the dialog? Let's call this third plugin C. Why don't you
provide an extension point in C which A and B will extend? Then I
wouldn't do so much trouble with popup menus in plugins A and B. No, I
would provide tabs. In each tab one extension is displayed having the
name "table" or "graph" and the respective visualization of your model.
|Re: How to deal with two plugins contributing each other [message #766351 is a reply to message #766141]
||Thu, 15 December 2011 10:43
| Jan Krakora
Registered: December 2009
> In my understanding this would mean that there is a third UI plugin
> which provides the dialog? Let's call this third plugin C. Why don't you
> provide an extension point in C which A and B will extend? Then I
> wouldn't do so much trouble with popup menus in plugins A and B. No, I
> would provide tabs. In each tab one extension is displayed having the
> name "table" or "graph" and the respective visualization of your model.
No, the dialog is provided by the UI plugin A.
Powered by FUDForum
. Page generated in 0.01908 seconds