Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsMultiple EditPartProviders for Diagram Partitioning
https://www.eclipse.org/forums/index.php/mv/msg/65221/205195/#msg_205195
I was trying to add two EditPartProviders for two different editors
(diagram partitioning) but through one plugin.xml. That is, I wanted one
EditPartProvider for "Component" diagrams, and another EditPartProvider
for "Wire" diagrams.
My model is like so:
- Component, can contain Wires
- abstract Wire
- NavigateWire implements Wire
But it wasn't working. Only the first was (the Component) and nothing
was happening with the Wire. I tried changing the value class
"my.model.NavigateWire" to "my.model.Wire" and this also didn't help.
However, I tried removing the whole second <method> block, so my
plugin.xml now looks like this:
Does <method> support abstract/concrete classes, or is it something else
that I am missing? This is with Eclipse 3.3/GMF 2.0.1.
I tried putting both of them into one EditPartProvider and removed
<method> (so it would theoretically call it for both Component and
Wire), but it was still only calling it for Component and I'm not sure why.
Thanks
Jevon]]>Jevon 2008-09-11T10:26:12-00:00Re: Multiple EditPartProviders for Diagram Partitioning
https://www.eclipse.org/forums/index.php/mv/msg/65221/205293/#msg_205293
Did you properly modify all necessary .gmfgen model properties before generating
first and second diagram editors? (Search for "unique" word in http://wiki.eclipse.org/GMF_GenModel_Hints).
-----------------
Alex Shatalin]]>Alexander Shatalin2008-09-11T11:42:44-00:00Re: Multiple EditPartProviders for Diagram Partitioning
https://www.eclipse.org/forums/index.php/mv/msg/65221/205329/#msg_205329
Thank you for your quick reply!
I followed your advice and looked through that page; every property
mentioned is unique across all of my .gmfgens (I have three of them).
One "diagram file extension" was shared between two but making it unique
made no difference.
Would non-unique "contains shortcuts to" and "shortcuts provided for"
matter?
Cheers
Jevon
Alex Shatalin wrote:
> Hello Jevon,
>
> Did you properly modify all necessary .gmfgen model properties before
> generating first and second diagram editors? (Search for "unique" word
> in http://wiki.eclipse.org/GMF_GenModel_Hints).
>
> -----------------
> Alex Shatalin
>
>]]>Jevon 2008-09-11T12:16:10-00:00Re: Multiple EditPartProviders for Diagram Partitioning
https://www.eclipse.org/forums/index.php/mv/msg/65221/205351/#msg_205351
> Would non-unique "contains shortcuts to" and "shortcuts provided for"
> matter?
Should not. Then i was wrong while guessing what the reason of malfunction
is..
One more idea - m.b. the reason is in "<context views="MyOverride"/>"? Try
registering one EditPartProvider without any additional meta-information
- just:
Once you'll see it is called by framework you can restrict declaration by
additional conditions..
-----------------
Alex Shatalin]]>Alexander Shatalin2008-09-11T13:20:35-00:00Re: Multiple EditPartProviders for Diagram Partitioning
https://www.eclipse.org/forums/index.php/mv/msg/65221/207369/#msg_207369
out now...
I think there were two problems with my original attempt:
1- Incorrect editPartProvider mapping. I was trying to add an
EditPartProvider for a Diagram when I was actually adding it for a Node,
like so:
2- Incorrect imports. Because I was working with two different generated
models, its possible I was trying to refer to a class which wouldn't
exist in a given editor. For example:
public class MyEditPartProvider extends DiagramEditPartProvider {
public IGraphicalEditPart createGraphicEditPart(View view) {
final IGraphicalEditPart part = super.createGraphicEditPart(view);
While this code would work fine in a model.diagram generated editor, if
I tried to add the same EditProvider to a model.diagram.sub generated
editor, I would have to change the imports:
Alex Shatalin wrote:
> Hello Jevon,
>
>> Would non-unique "contains shortcuts to" and "shortcuts provided for"
>> matter?
> Should not. Then i was wrong while guessing what the reason of
> malfunction is..
>
> One more idea - m.b. the reason is in "<context views="MyOverride"/>"?
> Try registering one EditPartProvider without any additional
> meta-information - just:
>
> <extension point="org.eclipse.gmf.runtime.diagram.ui.editpartProviders ">
> <editpartProvider
> class=" my.diagram.wire.custom.edit.providers.MyShortcutsEditPartPro vider ">
> <Priority name="Low" />
> </editpartProvider>
> </extension>
>
> Once you'll see it is called by framework you can restrict declaration
> by additional conditions..
>
> -----------------
> Alex Shatalin
>
>]]>Jevon 2008-09-29T23:00:22-00:00