Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340939

Summary: Only one instance of an Graphiti editor may exist, for each editor input
Product: [Modeling] Graphiti Reporter: Juergen Pasch <juergen.pasch>
Component: CoreAssignee: Tim Kaiser <tim.kaiser>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: michael.wenz, rhett.hudson, tim.kaiser
Version: 0.8.0Flags: tim.kaiser: indigo+
Target Milestone: 0.8.0   
Hardware: All   
OS: All   
Whiteboard: Indigo M7 theme_round_offs

Description Juergen Pasch CLA 2011-03-25 05:44:19 EDT
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."
Comment 1 Rhett Hudson CLA 2011-04-13 11:15:34 EDT
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.
Comment 2 Tim Kaiser CLA 2011-04-14 03:43:49 EDT
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.
Comment 3 Tim Kaiser CLA 2011-04-14 03:45:22 EDT
fixed in EmfService
Comment 4 Michael Wenz CLA 2011-05-27 09:26:03 EDT
Part of 0.8.0
Comment 5 Michael Wenz CLA 2011-06-24 09:14:23 EDT
Part of Graphiti Indigo 0.8.0