Bug 228426 - Selection not updated when viewer's contents changed
Summary: Selection not updated when viewer's contents changed
Status: NEW
Alias: None
Product: GEF
Classification: Tools
Component: GEF-Legacy GEF (MVC) (show other bugs)
Version: 3.4   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: gef-inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-23 10:12 EDT by Pratik Shah CLA
Modified: 2013-10-17 09:44 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pratik Shah CLA 2008-04-23 10:12:34 EDT
If you call setContents(EditPart) on a graphical viewer, it should fire selection changed.  I saw a bug where the actions hold on to the previous selection since not selection change event is fired.
Comment 1 Pratik Shah CLA 2008-04-23 10:51:42 EDT
Patch for the project.

Index: src/org/eclipse/gef/ui/parts/AbstractEditPartViewer.java
===================================================================
RCS file: /cvsroot/tools/org.eclipse.gef/plugins/org.eclipse.gef/src/org/eclipse/gef/ui/parts/AbstractEditPartViewer.java,v
retrieving revision 1.51
diff -u -r1.51 AbstractEditPartViewer.java
--- src/org/eclipse/gef/ui/parts/AbstractEditPartViewer.java	18 Jun 2007 16:01:43 -0000	1.51
+++ src/org/eclipse/gef/ui/parts/AbstractEditPartViewer.java	23 Apr 2008 14:47:16 -0000
@@ -599,6 +599,7 @@
  */
 public void setContents(EditPart editpart) {
 	getRootEditPart().setContents(editpart);
+	fireSelectionChanged();
 }
 
 /**
Comment 2 Randy Hudson CLA 2008-04-24 09:50:39 EDT
Pratik, can you make a patch where the SelectionManager is told about the viewer's contents changing and then it fires the selection changed instead?
Comment 3 Anthony Hunter CLA 2008-04-24 10:09:07 EDT
Can you review the patch in Bug 227687 as we since it also applies to SelectionManager ? 
Comment 4 Alexander Nyßen CLA 2013-10-17 09:44:24 EDT
Unset target milestone as the specified one is already passed.