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

Bug 335424

Summary: [All diagrams] Open creates a new tab, even if the diagram is already open
Product: [Modeling] Papyrus Reporter: Ansgar Radermacher <ansgar.radermacher>
Component: CoreAssignee: Project Inbox <mdt-papyrus-inbox>
Status: CLOSED DUPLICATE QA Contact:
Severity: minor    
Priority: P3 CC: arthur.daussy
Version: 0.7.1   
Target Milestone: ---   
Hardware: PC   
OS: All   
Whiteboard:

Description Ansgar Radermacher CLA 2011-01-26 04:31:31 EST
When you open a diagram, it will create a new tab, even if it is already open. Thus, multiple tabs may show the same diagram
Comment 1 Cedric Dumoulin CLA 2011-04-14 03:57:08 EDT
Which "open" are you speaking about ?
There is several ways to open a diagram, from several places.

In  general this is not a bug, this is a required behavior. Once can require having a diagram open several times, for example to be able to watch in one glance two different areas of the same diagram.

From the sashwindows system point of view, the open() method is designed to open a diagram tab. It doesn't check if the diagram is already open in another tab. It is your responsability to check if the diagram is opened before calling the method open(). The IPageMngr provide an isOpen() method for this purpose.
From a command point of view, you can do what you want: check if a diagram is already open or re-open it anyway.
In the ModelExplorer, the open command title change according to the fact that the diagram is opened or not. The title is:
-  "open" if the diagram is not open
 -  "open in new tab" if the diagram is already open
Comment 2 Ansgar Radermacher CLA 2011-05-03 11:02:35 EDT
Precision: I talk about the opening of a diagram from the model explorer. The default behavior of a double click on the diagram should be to open it or activate if not already open. Whereas it is sometimes useful to open multiple views of the same diagram, the default behavior (i.e. the behavior associated with a double click) should be to activate an already opened diagram.
Comment 3 Cedric Dumoulin CLA 2011-05-03 11:16:57 EDT
Ok, now I understand the bug :-).
Comment 4 Arthur Daussy CLA 2011-09-26 12:48:42 EDT
I'm currently working the model explorer view. This bug will be corrected with the following enhancement see:
358732: [Model Explorer] Make the model explorer view fully implemented with EMF Facet
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358732
Comment 5 Arthur Daussy CLA 2011-09-26 12:49:13 EDT

*** This bug has been marked as a duplicate of bug 358732 ***