Project: JDT
Bug 45438 [Dialogs] TwoPaneElementSelector doesn't respect validator
Reported: 2003-10-23 09:16:00 | Status: resolved fixed

TwoPaneElementSelector doesn't properly update button enablement if setValidator(ISelectionStatusValidator) is used. AbstractElementListSelectionDialog declares: protected void handleSelectionChanged() { validateCurrentSelection(); } TwoPaneElementSelector overrides this with: protected void handleSelectionChanged() { super.handleSelectionChanged(); handleUpperSelectionChanged(); } That's not OK, since handleUpperSelectionChanged() ends in updateOkState(), which doesn't respect fValidator and wrongly re-enables my "OK" button even though my ISelectionStatusValidator returned an IStatus.ERROR. The fix is: - call validateCurrentSelection() at the end of handleUpperSelectionChanged() - simplify TwoPaneElementSelector#handleLowerSelectionChanged() to protected void handleSelectionChanged() { handleUpperSelectionChanged(); }

Files changed in fix:
org.eclipse.jdt.ui/ui refactoring/org/eclipse/jdt/internal/ui/refactoring/ChangeExceptionsControl.java