Community
Participate
Working Groups
Created attachment 271071 [details] Here we see that the choice of values list still contains Class1 although it was added to the selected values list When adding an EObject via double click or the add buton in the Pane Based Selection Wizard, this EObject is not removed from the choice of values list, as it is the case for example in the FeatureEditorDialog. The method of concern here is createAddButtonListener in the class EObjectPaneBasedSelectionWizardPage
Created attachment 271089 [details] Reproduction case Reproduction scenario using the attached sample (taken from Sirius junit tests) - Open the paneBasedSelectionTest.aird session - Open the PaneBasedSelectionTestDiagram - Select one of the tools - Click on the diagram background - Use the add/remove buttons, the left pane should be dynamically updated when the user adds or removes elements using the add/remove buttons
Hi Amine, Thanks for the bug report, Note that it has not be added to a future release yet.
Hi, Please find below a fix suggestion. (For your information, I work around this by injecting the missing behavior using introspection but I really don't feel great about it ;) diff --git a/plugins/org.eclipse.sirius.common.ui/src/org/eclipse/sirius/common/ui/tools/api/selection/page/EObjectPaneBasedSelectionWizardPage.java b/plugins/org.eclipse.sirius.common.ui/src/org/eclipse/sirius/common/ui/tools/api/selection/page/EObjectPaneBasedSelectionWizardPage.java index 8869d94..ab04342 100644 --- a/plugins/org.eclipse.sirius.common.ui/src/org/eclipse/sirius/common/ui/tools/api/selection/page/EObjectPaneBasedSelectionWizardPage.java +++ b/plugins/org.eclipse.sirius.common.ui/src/org/eclipse/sirius/common/ui/tools/api/selection/page/EObjectPaneBasedSelectionWizardPage.java @@ -41,6 +41,8 @@ import org.eclipse.jface.viewers.StructuredSelection; import org.eclipse.jface.viewers.TableViewer; import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; +import org.eclipse.jface.viewers.ViewerFilter; import org.eclipse.sirius.common.tools.api.util.TreeItemWrapper; import org.eclipse.sirius.common.ui.tools.api.navigator.GroupingContentProvider; import org.eclipse.sirius.common.ui.tools.api.util.TreeItemWrapperContentProvider; @@ -184,7 +186,7 @@ createButtonListeners(); myViewerfilter.setTreeViewer(treeViewer); - + /* expand before compute prefix => see trac #1323 */ expandTreeViewer(treeViewer); @@ -234,6 +236,7 @@ } tableViewer.refresh(); tableViewer.setSelection(new StructuredSelection(tableSelection)); + treeViewer.refresh(); } } }); @@ -260,6 +263,8 @@ } tableViewer.refresh(); tableViewer.setSelection(null); + elementsToSelectText.setText(""); //$NON-NLS-1$ + initRootPrefix(); } }); } @@ -382,6 +387,18 @@ viewer.setContentProvider(contentProvider); viewer.setLabelProvider(new EObjectSelectionLabelProvider()); viewer.addFilter(this.myViewerfilter); + viewer.addFilter(new ViewerFilter() { + + @Override + public boolean select(Viewer viewer, Object parentElement, Object element) { + if(element instanceof TreeItemWrapper && ((TreeItemWrapper) element).getWrappedObject() instanceof EObject) { + EObject eObject = (EObject) ((TreeItemWrapper) element).getWrappedObject(); + return !selectedEObjects.contains(eObject); + } + return true; + } + }); + return viewer; }