Project: Eclipse_Platform_UI
Bug 189752 [Dialogs] TwoPaneElementSelector doesn't validate proper selection
Reported: 2007-05-29 14:53:54 | Status: verified fixed

The class TwoPaneElementSelector doesn't validate the correct object. In the validateCurrentSelection() method of AbstractElementListSelectionDialog, getSelectedElements() is called. The method getSelectedElements() is not overridden by TwoPaneElementSelector, so the following code runs: protected Object[] getSelectedElements() { Assert.isNotNull(fFilteredList); return fFilteredList.getSelection(); } As you can see, the lower list is ignored completely, and the same object is returned, regardless of what the user has selected in the lower pane. As a temporary workaround, I have overridden getSelectedElements() in a subclass of TwoPaneElementSelector as follows: protected Object[] getSelectedElements() { if(getLowerSelectedElement()!=null) return new Object[]{getLowerSelectedElement()}; return super.getSelectedElements(); }

Files changed in fix:
bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/AbstractElementListSelectionDialog.java bundles/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/dialogs/TwoPaneElementSelector.java