Diagram Partitioning: Open on Double Click Problem! [message #196985] |
Mon, 14 July 2008 15:34  |
Eclipse User |
|
|
|
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 #218518 is a reply to message #218508] |
Thu, 12 February 2009 09:56  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.30026 seconds