Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Diagram Partitioning: Open on Double Click Problem!
Diagram Partitioning: Open on Double Click Problem! [message #196985] Mon, 14 July 2008 19:34 Go to next message
Eclipse UserFriend
Originally posted by: rolfes.daniel.web.de

Hi,
I've tried "Diagram Partitioning" according Use-Case 2 in this article:
http://wiki.eclipse.org/Diagram_Partitioning

Everything works fine but when I double Click on the Super-diagram-
Node, the subdiagram won't open.

So I debugged the code and found the following:

In class ViewService:
public final Diagram createDiagram(IAdaptable semanticAdapter, String
diagramKindType, PreferencesHint preferencesHint) {

Diagram view = (Diagram) execute(new CreateDiagramViewOperation(
semanticAdapter, diagramKindType, preferencesHint));

return view;
}

view is null after execution! So the ExecutionException("Can't create
diagram of '" + getDiagramKind() + "' kind") is thrown.

execute(..) delegates to another execute(..) method in class
ExecutionStrategy.

In class ExecutionStrategy:
public List execute(Service service, IOperation operation) {

for (int i = 0; i < PRIORITIES.length; ++i) {
List providers = service.getProviders(this, PRIORITIES[i],
operation);

if (providers.size() != 0) {
return Collections.singletonList(operation.execute((IProvider)
providers.get(0)));
}
}

return Collections.EMPTY_LIST;
}

Service service = ViewService
IOperation operation = CreateDiagramViewOperation

The Collections.EMPTY_LIST is returned. So as far as I understand, there
is no Provider for this operation CreateDiagramViewOperation found.

So what went wrong? I did the same steps as mentioned in the tutorial,
except setting different Diagram and Domain File Extensions for the
different diagrams.

Could someone help me out?


Thanks,
Daniel
Re: Diagram Partitioning: Open on Double Click Problem! [message #197329 is a reply to message #196985] Wed, 16 July 2008 10:08 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello D. Rolfes,

Due to some reasons ???ViewProvider class generated for sub-diagram was not
able to create Diagram instance for the correspondig parameter. You can try
debugging ???ViewProvider.getDiagramViewClass() generated for subdiagram
to see the reason.

-----------------
Alex Shatalin
Re: Diagram Partitioning: Open on Double Click Problem! [message #218508 is a reply to message #197329] Thu, 12 February 2009 14:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Holger.Kremss.itemis.de

Sorry for exhuming this thread, but the answer was missing. I just had
the same problem and didn't really find the solution here.

The problem is (was), that the sub-diagram node was not of the right
type. It must be type derived from the diagram root type. The
???Viewproder won't be able to create a diagram instance.

For example: The diagram root type is 'ADiagram' and you have a node of
type 'SubDiagram', than (one of) the ESuper Types for 'SubDiagram' must
be 'ADiagram' in your ecore model.

.... for those who may be interested.

Holger


Alex Shatalin schrieb:
> Hello D. Rolfes,
>
> Due to some reasons ???ViewProvider class generated for sub-diagram was
> not able to create Diagram instance for the correspondig parameter. You
> can try debugging ???ViewProvider.getDiagramViewClass() generated for
> subdiagram to see the reason.
> -----------------
> Alex Shatalin
>
>
Re: Diagram Partitioning: Open on Double Click Problem! [message #218518 is a reply to message #218508] Thu, 12 February 2009 14:56 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Holger,

> For example: The diagram root type is 'ADiagram' and you have a node
> of type 'SubDiagram', than (one of) the ESuper Types for 'SubDiagram'
> must be 'ADiagram' in your ecore model.
Right. In case ‘SubDiagram’ is not a subclass of 'ADiagram' then you have
to create separate diagram definition (.gmfmap, .gmfgen, generate code) describing
‘SubDiagram’ diagram and open this diagram instead of the root one on double-clicking
(link it with the corresponding NodeMapping by using RelatedDiagrams property
in ADiagram.gmfmap model).

If you want to open instance of ‘ADiagram’ but for an element indirectly
referenced from 'SubDiagram' node then you have to modify generated code
(OpenDiagramEditPolicy class) to create new diagram for an appropriate domain
model element.

-----------------
Alex Shatalin
Previous Topic:moving figure
Next Topic:[Announce] GMF 2.2.0M5a is available
Goto Forum:
  


Current Time: Fri Feb 26 18:56:59 GMT 2021

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

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

Back to the top