Community
Participate
Working Groups
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.
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(); } /**
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?
Can you review the patch in Bug 227687 as we since it also applies to SelectionManager ?
Unset target milestone as the specified one is already passed.