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
/*******************************************************************************
 * Copyright (c) 2000, 2004 IBM Corporation and others.
 * All rights reserved. This program and the accompanying materials 
 * are made available under the terms of the Common Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/cpl-v10.html
 * 
 * Contributors:
 *     IBM Corporation - initial API and implementation
 *******************************************************************************/
package org.eclipse.jdt.internal.ui.wizards;
import java.util.List;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.operation.IRunnableContext;
import org.eclipse.ui.PlatformUI;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.search.IJavaSearchConstants;
import org.eclipse.jdt.core.search.IJavaSearchScope;
import org.eclipse.jdt.core.search.SearchEngine;
import org.eclipse.jdt.internal.corext.util.TypeInfo;
import org.eclipse.jdt.internal.ui.IJavaHelpContextIds;
import org.eclipse.jdt.internal.ui.dialogs.StatusInfo;
import org.eclipse.jdt.internal.ui.dialogs.TypeSelectionDialog;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField;
public class SuperInterfaceSelectionDialog extends TypeSelectionDialog {