Bug 84298 Add enabled in SuperInterfaceSelectionDialog when no selection
Version: 3.1.0 Build id: I20050201-0800 The "Add" button in the Super Interfaces Selection dialog of the new class wizard is enabled when there is no selection in the dialog. 1. Open the new Class Wizard 2. Press "Add..." in the interface block 3. The Super Interface Selection dialog will show with the Add and cancel buttons enabled. Only the cancel button shuld be enabled. SuperInterfaceSelectionDialog need to override updateButtonsEnabledState to set the state of the add button. protected void updateButtonsEnableState(IStatus status) { super.updateButtonsEnableState(status); Button addButton = getButton(ADD_ID); if (addButton != null && !addButton.isDisposed()) addButton.setEnabled(!status.matches(IStatus.ERROR)); }
org.eclipse.jdt.ui/ui/org/eclipse/jdt/internal/ui/wizards/SuperInterfaceSelectionDialog.java
private static final int ADD_ID= IDialogConstants.CLIENT_ID + 1;
	
	private ListDialogField fList;
	private List fOldContent;
	
	public SuperInterfaceSelectionDialog(Shell parent, IRunnableContext context, ListDialogField list, IJavaProject p) {
		super(parent, context, IJavaSearchConstants.INTERFACE, createSearchScope(p));
		fList= list;
		
		fOldContent= fList.getElements(); 
		setStatusLineAboveButtons(true);
	}
	/*
	 * @see Dialog#createButtonsForButtonBar
	 */
	protected void createButtonsForButtonBar(Composite parent) {
		createButton(parent, ADD_ID, NewWizardMessages.getString("SuperInterfaceSelectionDialog.addButton.label"), true); 
		super.createButtonsForButtonBar(parent);
	}
	
	/*(non-Javadoc)
	 * @see org.eclipse.jface.window.Window#handleShellCloseEvent()
	 */
	protected void handleShellCloseEvent() {