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