Variation of Drill-Down Feature [message #1198476] |
Wed, 20 November 2013 10:41 |
Roman H Messages: 2 Registered: November 2013 |
Junior Member |
|
|
Hi everyone,
I am using Graphiti now for about a month and it works great.
What I would like to realize at the moment is the following:
I would like to have an object that can be inserted in the diagram - that`s fine.
This object should have a custom drill-down feature, which makes it possible to open an associated diagram when the feature is called. The diagram should be created and linked with the PictogramElement when it is inserted in the diagram.
What I have done so far:
- I have got a create feature, which instanciates a BO
- an add feature, which specifies a rectangle, text and so on. At the end of the add feature I create a new diagram and link it with my BO:
final Diagram diagram = Graphiti.getCreateService().createDiagram(DiagramTypeProvider.DIAGRAM_TYPE_ID, filename, true);
addedClass.eResource().getContents().add(diagram);
link(diagram, addedClass);
link(containerShape, addedClass);
- The drill-down works with the implementation of the AbstractDrillDownFeature. I just changed the getDiagram()-method of my drill-down implementation:
protected Collection<Diagram> getDiagrams() {
Resource resource = getDiagram().eResource();
// does resource contain a diagram as root object?
final EList<EObject> contents = resource.getContents();
List<Diagram> diagramCollection = new ArrayList<Diagram>();
for (final EObject object : contents) {
if (object instanceof Diagram) {
diagramCollection.add((Diagram) object);
}
}
return diagramCollection;
}
My problem is the following: As long as I did not save the diagram which contains the newly created PictogramElement (the BO of this is linked to another diagram) at least once, I can not use the Drill-Down feature. Graphiti then opens a new diagram tab, but there is only the string "No Diagram found for URI 'platform:/resource/Graphiti_Bsp/src/diagrams/newDiagram.diagram#/3" displayed.
I debugged the project. The canExecute-method returns true (otherwise no tab would be opened), so the newly created diagram is "found".
No exception is thrown while the canExecute/ execute methods are executed.
So now my question: Do you have an idea, why I have to save the diagram first before I can display it? What may I have to change such that I can open the linked diagram, even if the diagram was not saved before?
If you need more information to be able to answer my question, please just tell me
Thank you very much for your help!
|
|
|
|
|
|
|
|
|
Re: Variation of Drill-Down Feature [message #1234719 is a reply to message #1198476] |
Wed, 22 January 2014 16:58 |
Albert Steckermeier Messages: 5 Registered: November 2013 |
Junior Member |
|
|
We managed to use one EditingDomain by using a MultiPageEditor which handles the EditingDomain. So far so good. Unfortunately we now need real time update behavior. If whe change something in one Editor we want the changes to the business model objects to be visible in the other editor. Graphiti calls the updateNeeded function of our features which returns true but doesn't autoUpdate the diagram elements. DiagramtypeProvider returns isAutoUpdateAtRuntime() == true. What can we do to auto update the PictogramElements?
Best,
Albert
Edit: Problem solved!
[Updated on: Thu, 23 January 2014 23:35] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05249 seconds