Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-05-09 15:50:05 +0000
committerMichael Rennie2007-05-09 15:50:05 +0000
commit44e4a08afc044ea2a539652c95f499aca6014787 (patch)
tree70e31e51f724946fc2870de52ffc2a13a80ae787 /org.eclipse.debug.ui
parent7f20f126d552029fd898d5287fb65f3789690dd9 (diff)
downloadeclipse.platform.debug-44e4a08afc044ea2a539652c95f499aca6014787.tar.gz
eclipse.platform.debug-44e4a08afc044ea2a539652c95f499aca6014787.tar.xz
eclipse.platform.debug-44e4a08afc044ea2a539652c95f499aca6014787.zip
Bug 184865
[help] help topic for Select Configuration Type dialog
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugCheckboxSelectionDialog.java95
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugListSelectionDialog.java101
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugSelectionDialog.java75
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java31
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java12
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java44
9 files changed, 288 insertions, 73 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
index d95b12694..b34f2fbb3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
@@ -115,6 +115,7 @@ public interface IDebugHelpContextIds {
public static final String SELECT_LAUNCH_METHOD_DIALOG = PREFIX + "select_launch_method_dialog"; //$NON-NLS-1$
public static final String SELECT_LAUNCH_CONFIGURATION_DIALOG = PREFIX + "select_launch_configuration_dialog"; //$NON-NLS-1$
public static final String SELECT_DIRECTORY_SOURCE_CONTAINER_DIALOG = PREFIX + "select_directory_source_container_dialog"; //$NON-NLS-1$
+ public static final String SELECT_CONFIGURATION_TYPE_DIALOG = PREFIX + "select_configuration_type_dialog"; //$NON-NLS-1$
// Property pages
public static final String PROCESS_PROPERTY_PAGE = PREFIX + "process_property_page_context"; //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugCheckboxSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugCheckboxSelectionDialog.java
new file mode 100644
index 000000000..ac47164bf
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugCheckboxSelectionDialog.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2006, 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import java.util.Arrays;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+
+/**
+ * This class provides selection dialog using a checkbox table viewer.
+ *
+ * @since 3.3
+ */
+public abstract class AbstractDebugCheckboxSelectionDialog extends AbstractDebugSelectionDialog {
+
+ protected CheckboxTableViewer fTableViewer;
+ protected Table fTable;
+
+ /**
+ * Constructor
+ * @param parentShell
+ */
+ public AbstractDebugCheckboxSelectionDialog(Shell parentShell) {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ /**
+ * Create and return a viewer to use in this dialog.
+ *
+ * @param parent the composite the viewer should be created in
+ * @return the viewer to use in the dialog
+ */
+ protected StructuredViewer createViewer(Composite parent){
+ //by default return a checkbox table viewer
+ fTable = new Table(parent, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
+ fTable.setLayoutData(new GridData(GridData.FILL_BOTH));
+ fTableViewer = new CheckboxTableViewer(fTable);
+ return fTableViewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
+ */
+ protected void addViewerListeners(StructuredViewer viewer) {
+ fTableViewer.addCheckStateListener(new DefaultCheckboxListener());
+ }
+
+ /**
+ * A checkbox state listener that ensures that exactly one element is checked
+ * and enables the OK button when this is the case.
+ *
+ */
+ private class DefaultCheckboxListener implements ICheckStateListener{
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ fTableViewer.setCheckedElements(new Object[] {event.getElement()});
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.SelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ Object[] elements = fTableViewer.getCheckedElements();
+ setResult(Arrays.asList(elements));
+ super.okPressed();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugListSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugListSelectionDialog.java
new file mode 100644
index 000000000..6c7be5e4d
--- /dev/null
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugListSelectionDialog.java
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.debug.internal.ui.launchConfigurations;
+
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Shell;
+
+/**
+ * This class provides a simple selection dialog displaying items in a table.
+ *
+ * @since 3.3
+ */
+public abstract class AbstractDebugListSelectionDialog extends AbstractDebugSelectionDialog {
+
+ protected TableViewer fListViewer;
+
+ /**
+ * Constructor
+ * @param parentShell
+ */
+ public AbstractDebugListSelectionDialog(Shell parentShell) {
+ super(parentShell);
+ setShellStyle(getShellStyle() | SWT.RESIZE);
+ }
+
+ /**
+ * Create and return a viewer to use in this dialog.
+ *
+ * @param parent the composite the viewer should be created in
+ * @return the viewer to use in the dialog
+ */
+ protected StructuredViewer createViewer(Composite parent){
+ //by default return a table viewer
+ fListViewer = new TableViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ fListViewer.getTable().setLayoutData(new GridData(GridData.FILL_BOTH));
+ return fListViewer;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addViewerListeners(org.eclipse.jface.viewers.StructuredViewer)
+ */
+ protected void addViewerListeners(StructuredViewer viewer) {
+ viewer.addSelectionChangedListener(new ISelectionChangedListener(){
+ public void selectionChanged(SelectionChangedEvent event) {
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ ISelection selection = fListViewer.getSelection();
+ if (selection instanceof IStructuredSelection){
+ if (((IStructuredSelection)selection).size() == 1){
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ }
+ }
+ }
+ });
+ viewer.addDoubleClickListener(new IDoubleClickListener(){
+ public void doubleClick(DoubleClickEvent event) {
+ if (getButton(IDialogConstants.OK_ID).isEnabled()){
+ okPressed();
+ }
+ }
+ });
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.dialogs.SelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ getButton(IDialogConstants.OK_ID).setEnabled(false);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.dialogs.Dialog#okPressed()
+ */
+ protected void okPressed() {
+ ISelection selection = fViewer.getSelection();
+ if (selection instanceof IStructuredSelection) {
+ setResult(((IStructuredSelection) selection).toList());
+ }
+ super.okPressed();
+ }
+
+}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugSelectionDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugSelectionDialog.java
index d6e9f32b8..931197d2c 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugSelectionDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/AbstractDebugSelectionDialog.java
@@ -14,34 +14,31 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.DefaultLabelProvider;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICheckStateListener;
import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.swt.SWT;
+import org.eclipse.jface.viewers.StructuredViewer;
import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.SelectionDialog;
/**
- * This class provides a general selection dialog class to be specialized for
- * selections using a checkbox table viewer
+ * This class provides the framework for general selection dialog class.
+ *
+ * TODO Use this abstract class hierarchy instead of the SelectionDialog for dialogs in the debug plugin
+ *
+ * @see AbstractDebugListSelectionDialog
+ * @see AbstractDebugCheckboxSelectionDialog
*
* @since 3.3
*/
public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
- protected Table fTable = null;
- protected CheckboxTableViewer fTableViewer = null;
+ protected StructuredViewer fViewer = null;
/**
* Constructor
@@ -64,6 +61,14 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
protected abstract Object getViewerInput();
/**
+ * Create and return a viewer to use in this dialog.
+ *
+ * @param parent the composite the viewer should be created in
+ * @return the viewer to use in the dialog
+ */
+ protected abstract StructuredViewer createViewer(Composite parent);
+
+ /**
* Returns the content provider for the viewer
* @return the content provider for the viewer
*/
@@ -81,21 +86,26 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
}
/**
- * Returns the message for the viewer: i.e. Select Foo:
- * @return the message for the viewer
+ * Returns the help context id for this dialog
+ * @return the help context id for this dialog
*/
- protected String getTableViewerMessage() {
+ protected String getHelpContextId() {
//do nothing by default
return null;
}
/**
- * Returns the help context id for this dialog
- * @return the help context id for this dialog
+ * This method allows listeners to be added to the viewer after it
+ * is created.
*/
- protected String getHelpContextId() {
+ /**
+ * This method allows listeners to be added to the viewer. Called
+ * after the viewer has been created and its input set.
+ *
+ * @param viewer the viewer returned by createViewer()
+ */
+ protected void addViewerListeners(StructuredViewer viewer){
//do nothing by default
- return null;
}
/**
@@ -122,29 +132,22 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
//do nothing by default
}
- /**
+ /* (non-Javadoc)
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
initializeDialogUnits(parent);
Composite comp = (Composite) super.createDialogArea(parent);
addCustomHeaderControls(comp);
- String label = getTableViewerMessage();
+ String label = getMessage();
if(label != null) {
- SWTFactory.createLabel(comp, label, 1);
+ SWTFactory.createWrapLabel(comp, label, 1);
}
- fTable = new Table(comp, SWT.BORDER | SWT.SINGLE | SWT.CHECK);
- fTable.setLayoutData(new GridData(GridData.FILL_BOTH));
- fTableViewer = new CheckboxTableViewer(fTable);
- fTableViewer.setLabelProvider(getLabelProvider());
- fTableViewer.setContentProvider(getContentProvider());
- fTableViewer.setInput(getViewerInput());
- fTableViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- fTableViewer.setCheckedElements(new Object[] {event.getElement()});
- getButton(IDialogConstants.OK_ID).setEnabled(true);
- }
- });
+ fViewer = createViewer(comp);
+ fViewer.setLabelProvider(getLabelProvider());
+ fViewer.setContentProvider(getContentProvider());
+ fViewer.setInput(getViewerInput());
+ addViewerListeners(fViewer);
addCustomFooterControls(comp);
initializeControls();
Dialog.applyDialogFont(comp);
@@ -181,10 +184,10 @@ public abstract class AbstractDebugSelectionDialog extends SelectionDialog {
}
}
catch (NumberFormatException nfe) {
- return new Point(450, 500);
+ return new Point(300, 350);
}
}
- return new Point(450, 500);
+ return new Point(300, 350);
}
-
+
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
index 8552f1a07..6accbd929 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.java
@@ -211,7 +211,6 @@ public class LaunchConfigurationsMessages extends NLS {
public static String SelectLaunchersDialog_2;
public static String SelectLaunchersDialog_4;
public static String SelectLaunchersDialog_5;
- public static String SelectLaunchOptionsDialog_2;
public static String SelectLaunchOptionsDialog_3;
public static String SelectLaunchOptionsDialog_4;
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
index cd636095d..96f374a12 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/LaunchConfigurationsMessages.properties
@@ -187,7 +187,6 @@ FilterDropDownMenuCreator_4=Apply Window &Working Set(s)
CollapseAllLaunchConfigurationAction_0=Collapse All
CollapseAllLaunchConfigurationAction_1=Collapses all expanded launch configurations.
CollapseAllLaunchConfigurationAction_2=This action collapses all of the launch configurations currently visible and expanded.
-SelectLaunchOptionsDialog_2=The plug-in that provided the ability to launch the current launch configuration with the saved set of modes is no longer available. You must select an available set of modes that can be launched.
SelectLaunchOptionsDialog_3=Select Launch Mode
SelectLaunchOptionsDialog_4=&Select a supported mode combination:
SelectLaunchersDialog_0=Select Preferred Launcher
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
index e1ebc952d..a0cc7b0a3 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchModesDialog.java
@@ -11,7 +11,6 @@
package org.eclipse.debug.internal.ui.launchConfigurations;
import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Iterator;
import java.util.List;
import java.util.Set;
@@ -20,13 +19,11 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Shell;
/**
@@ -37,7 +34,7 @@ import org.eclipse.swt.widgets.Shell;
*
* @since 3.3
*/
-public class SelectLaunchModesDialog extends AbstractDebugSelectionDialog {
+public class SelectLaunchModesDialog extends AbstractDebugListSelectionDialog{
/**
* Builds labels for list control
@@ -67,7 +64,6 @@ public class SelectLaunchModesDialog extends AbstractDebugSelectionDialog {
*/
public SelectLaunchModesDialog(Shell parentShell, String mode, ILaunchConfiguration configuration) throws CoreException {
super(parentShell);
- super.setMessage(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_2);
super.setTitle(LaunchConfigurationsMessages.SelectLaunchOptionsDialog_3);
setShellStyle(getShellStyle() | SWT.RESIZE);
fValidModes = new ArrayList();
@@ -81,25 +77,6 @@ public class SelectLaunchModesDialog extends AbstractDebugSelectionDialog {
}
}
- /**
- * @see org.eclipse.ui.dialogs.SelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
- */
- protected void createButtonsForButtonBar(Composite parent) {
- super.createButtonsForButtonBar(parent);
- getButton(IDialogConstants.OK_ID).setEnabled(false);
- }
-
- /**
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- protected void okPressed() {
- Object[] o = fTableViewer.getCheckedElements();
- if(o.length > 0) {
- setResult(Arrays.asList(o));
- }
- super.okPressed();
- }
-
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
*/
@@ -115,12 +92,12 @@ public class SelectLaunchModesDialog extends AbstractDebugSelectionDialog {
}
/* (non-Javadoc)
- * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getTableViewerMessage()
+ * @see org.eclipse.ui.dialogs.SelectionDialog#getMessage()
*/
- protected String getTableViewerMessage() {
+ protected String getMessage() {
return LaunchConfigurationsMessages.SelectLaunchOptionsDialog_4;
}
-
+
/* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
*/
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
index be757f2ea..1b1a4f7e8 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java
@@ -21,6 +21,7 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.debug.ui.IDebugUIConstants;
+import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.viewers.IBaseLabelProvider;
import org.eclipse.jface.viewers.ILabelProvider;
@@ -48,7 +49,7 @@ import org.eclipse.swt.widgets.Text;
*
* @since 3.3
*/
-public class SelectLaunchersDialog extends AbstractDebugSelectionDialog {
+public class SelectLaunchersDialog extends AbstractDebugCheckboxSelectionDialog {
/**
* Builds labels for table control
@@ -140,6 +141,15 @@ public class SelectLaunchersDialog extends AbstractDebugSelectionDialog {
}
/* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugCheckboxSelectionDialog#createButtonsForButtonBar(org.eclipse.swt.widgets.Composite)
+ */
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ // Even if a user does not change anything, they can still press ok
+ getButton(IDialogConstants.OK_ID).setEnabled(true);
+ }
+
+ /* (non-Javadoc)
* @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#addCustomHeaderControls(org.eclipse.swt.widgets.Composite)
*/
protected void addCustomHeaderControls(Composite parent) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
index c80ea8d43..ad5806061 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/RunDebugPropertiesPage.java
@@ -30,6 +30,7 @@ import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.DefaultLabelProvider;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.SWTFactory;
+import org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugListSelectionDialog;
import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationComparator;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.dialogs.IDialogConstants;
@@ -51,8 +52,8 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ListDialog;
import org.eclipse.ui.dialogs.PropertyPage;
+import org.eclipse.ui.dialogs.SelectionDialog;
import com.ibm.icu.text.MessageFormat;
@@ -414,13 +415,42 @@ public class RunDebugPropertiesPage extends PropertyPage {
* Create a new configuration
*/
private void handleNew() {
- ListDialog dialog = new ListDialog(getShell());
+
+ final List typeCandidates = collectTypeCandidates();
+
+ SelectionDialog dialog = new AbstractDebugListSelectionDialog(getShell()){
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getDialogSettingsId()
+ */
+ protected String getDialogSettingsId() {
+ return DebugUIPlugin.getUniqueIdentifier() + ".SELECT_CONFIGURATION_TYPE_DIALOG"; //$NON-NLS-1$
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getViewerInput()
+ */
+ protected Object getViewerInput() {
+ return typeCandidates;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getMessage()
+ */
+ protected String getMessage() {
+ return DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_12;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.debug.internal.ui.launchConfigurations.AbstractDebugSelectionDialog#getHelpContextId()
+ */
+ protected String getHelpContextId() {
+ return IDebugHelpContextIds.SELECT_CONFIGURATION_TYPE_DIALOG;
+ }
+
+ };
dialog.setTitle(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_11);
- dialog.setContentProvider(new ArrayContentProvider());
- dialog.setLabelProvider(new DefaultLabelProvider());
- dialog.setAddCancelButton(true);
- dialog.setMessage(DebugPreferencesMessages.DefaultLaunchConfigurationsPropertiesPage_12);
- dialog.setInput(collectTypeCandidates());
+
if (dialog.open() == Window.OK) {
Object[] result = dialog.getResult();
if (result.length == 1) {

Back to the top