diff options
author | Dani Megert | 2011-10-14 15:02:30 +0000 |
---|---|---|
committer | Dani Megert | 2011-10-14 15:02:30 +0000 |
commit | bbcd99a0bd3a04f25d41811271464ef4ad972501 (patch) | |
tree | 021f94b5d3e9ab431a992bd2f3f4cc37ed153fa7 | |
parent | 86018a2963ecbd7f8926329de9355120c17cf926 (diff) | |
download | eclipse.platform.debug-bbcd99a0bd3a04f25d41811271464ef4ad972501.tar.gz eclipse.platform.debug-bbcd99a0bd3a04f25d41811271464ef4ad972501.tar.xz eclipse.platform.debug-bbcd99a0bd3a04f25d41811271464ef4ad972501.zip |
Don't show [] if there's only one modev20111017-1052
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java | 62 |
1 files changed, 33 insertions, 29 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java index 3783607e2..de908a669 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/preferences/LaunchPerspectivePreferencePage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2006, 2008 IBM Corporation and others. + * Copyright (c) 2006, 2011 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 @@ -19,32 +19,6 @@ import java.util.List; import java.util.Map; import java.util.Set; -import org.eclipse.debug.core.DebugPlugin; -import org.eclipse.debug.core.ILaunchConfigurationType; -import org.eclipse.debug.core.ILaunchDelegate; -import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; -import org.eclipse.debug.internal.core.LaunchDelegate; -import org.eclipse.debug.internal.core.LaunchManager; -import org.eclipse.debug.internal.ui.DebugUIPlugin; -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.internal.ui.launchConfigurations.LaunchCategoryFilter; -import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; -import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager; -import org.eclipse.debug.ui.DebugUITools; -import org.eclipse.debug.ui.IDebugUIConstants; -import org.eclipse.jface.dialogs.Dialog; -import org.eclipse.jface.dialogs.MessageDialogWithToggle; -import org.eclipse.jface.preference.PreferencePage; -import org.eclipse.jface.preference.RadioGroupFieldEditor; -import org.eclipse.jface.viewers.ISelectionChangedListener; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.jface.viewers.ITreeContentProvider; -import org.eclipse.jface.viewers.SelectionChangedEvent; -import org.eclipse.jface.viewers.StructuredSelection; -import org.eclipse.jface.viewers.TreeViewer; -import org.eclipse.jface.viewers.Viewer; import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; @@ -56,6 +30,19 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Tree; import org.eclipse.swt.widgets.TreeItem; + +import org.eclipse.jface.dialogs.Dialog; +import org.eclipse.jface.dialogs.MessageDialogWithToggle; +import org.eclipse.jface.preference.PreferencePage; +import org.eclipse.jface.preference.RadioGroupFieldEditor; +import org.eclipse.jface.viewers.ISelectionChangedListener; +import org.eclipse.jface.viewers.IStructuredSelection; +import org.eclipse.jface.viewers.ITreeContentProvider; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; + import org.eclipse.ui.IPerspectiveDescriptor; import org.eclipse.ui.IPerspectiveRegistry; import org.eclipse.ui.IWorkbench; @@ -66,6 +53,23 @@ import org.eclipse.ui.activities.IActivityManagerListener; import org.eclipse.ui.activities.WorkbenchActivityHelper; import org.eclipse.ui.model.WorkbenchViewerComparator; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunchConfigurationType; +import org.eclipse.debug.core.ILaunchDelegate; +import org.eclipse.debug.internal.core.IInternalDebugCoreConstants; +import org.eclipse.debug.internal.core.LaunchDelegate; +import org.eclipse.debug.internal.core.LaunchManager; +import org.eclipse.debug.internal.ui.DebugUIPlugin; +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.internal.ui.launchConfigurations.LaunchCategoryFilter; +import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationPresentationManager; +import org.eclipse.debug.internal.ui.launchConfigurations.PerspectiveManager; + +import org.eclipse.debug.ui.DebugUITools; +import org.eclipse.debug.ui.IDebugUIConstants; + /** * The preference page for selecting and changing launch perspectives * @@ -360,7 +364,8 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I fmodes = LaunchConfigurationPresentationManager.getDefault().getLaunchModeNames(smodes); if(!fmodes.isEmpty()) { //add the mode set and create a combo - SWTFactory.createLabel(parent, fmodes.toString()+":", 1); //$NON-NLS-1$ + String modeString= fmodes.size() == 1 ? fmodes.get(0).toString() : fmodes.toString(); + SWTFactory.createLabel(parent, modeString + ":", 1); //$NON-NLS-1$ combo = SWTFactory.createCombo(parent, SWT.READ_ONLY, 1, fgPerspectiveLabels); String text = getComboSelection(smodes); if(text != null) { @@ -451,7 +456,6 @@ public class LaunchPerspectivePreferencePage extends PreferencePage implements I * Collects a list of mode sets that are common to the current selection context. It is possible * that there are no mode sets in comomon. * @param selection the current selection context - * @param list the list to fill * @return a list of mode sets or an empty list, never <code>null</code> */ protected Set collectCommonModeSets(Object[] selection) { |