Community
Participate
Working Groups
It is possible to open several Graphiti editors with the same editor input. This behaviuour conflicts with User Interface Guideline 6.3: "Only one instance of an editor may exist, for each editor input, within a perspective." See it in more detail: http://wiki.eclipse.org/User_Interface_Guidelines#Editors Take notice of Guideline 6.4: "It must be possible to open a separate instance of an editor for each different input."
I think the issue may be in DiagramEditorFactory.DiagramEditorMatchingStrategy. The matches() implementation gets called as part of the IDE's determination of whether it can use an existing editor or whether it needs to open a new one. I've been working with markers and the Problem View. In this case, matches compares the URI from the editor's EditorInput with a URI created based on the IFile that was specified by the marker. But, the code used to create the URI based on the IFile held by the marker returns the URI to the Diagram in the file, not the Resource. So, it ends up comparing something that looks like 'platform:/resource/test/test.diagram#/' to something like 'platform:/resource/test/test.diagram#/0' and failing. I've tried adding .trimFragment() to both URI's before comparison and that addresses the multiple editor issue for my case.
The problem was that we used the URI x/ to identify the first root object in the file, while the resolver produced the uri x/0 to identify the first diagram in the file. URI.equals returns false since components are compared, even if both URIs specify the same referent. The fix is to use always x/0 to refer to the first root object in the diagram file.
fixed in EmfService
Part of 0.8.0
Part of Graphiti Indigo 0.8.0