Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332964 - DiagramEditorInternal's selectionChanged() method assumes EMF based BOs
Summary: DiagramEditorInternal's selectionChanged() method assumes EMF based BOs
Status: CLOSED FIXED
Alias: None
Product: Graphiti
Classification: Modeling
Component: Core (show other bugs)
Version: 0.7.0   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 0.8.0   Edit
Assignee: Michael Wenz CLA
QA Contact:
URL:
Whiteboard: Indigo M4 theme_round_offs
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-20 12:38 EST by Shenxue Zhou CLA
Modified: 2011-06-24 09:06 EDT (History)
3 users (show)

See Also:
michael.wenz: indigo+
juergen.pasch: iplog+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2010-12-20 12:38:23 EST
In DiagramEditorInternal's selectionChanged() method, it made assumptions about the business objects being EOjects when translating Diagram's selections into PE selections. This won't work if the BOs are not EMF based.

Also the first line of the method:

if (getSite().getPage().isPartVisible(this))

is problematic if the diagram editor is part of a multi-page editor. It needs to be 

if (getSite().getPage().isPartVisible(part))
Comment 1 Michael Wenz CLA 2010-12-21 10:45:21 EST
You're right, there needs to be some special handling on non-EMF domain objects. That's missing currently.

Unfortunatly the check for the visible part cannot be changed in the way you suggest: the passed part refers to the part that triggered the selection change and can be e.g. the outline or the project explorer if the selection come from there. We will check for alternatives, though.

Michael
Comment 2 Michael Wenz CLA 2010-12-22 06:54:35 EST
I added special handling for the selection of the pictogram elements of non-EMF domain objects and modified the check for the active editor in a way that it also allows updating the selection if the diagram editor is contained in a multi-page editor.

Michael
Comment 3 Shenxue Zhou CLA 2010-12-22 12:06:50 EST
If the diagram editor is contained inside a multi-page editor, in order to check whether the current page is the diagram editor, try the following code snippet:

MultiPageEditorPart me = (MultiPageEditorPart)part;
if (me.getSelectedPage() instanceof DiagramEditor)
{
    // the current page of the multi-page editor is indeed the diagram editor
    // ........ 
}
Comment 4 Michael Wenz CLA 2011-01-12 10:22:56 EST
Thanks for this hint, I added the check for the selected page.

Michael
Comment 5 Juergen Pasch CLA 2011-04-15 09:02:25 EDT
Set flag iplog.
Comment 6 Michael Wenz CLA 2011-06-24 09:06:10 EDT
Part of Graphiti Indigo 0.8.0