Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Keppler2018-03-18 18:16:37 +0000
committerSarika Sinha2018-04-11 06:05:13 +0000
commit8129e5f2bae0679f218079fcc9b1972a0bb18c27 (patch)
tree67301ea6fa3cd372c0edf4648fe8a6c4ddb070e4
parent43efd539159cb73bde832a44de5a9b1ab959a590 (diff)
downloadeclipse.platform.debug-8129e5f2bae0679f218079fcc9b1972a0bb18c27.tar.gz
eclipse.platform.debug-8129e5f2bae0679f218079fcc9b1972a0bb18c27.tar.xz
eclipse.platform.debug-8129e5f2bae0679f218079fcc9b1972a0bb18c27.zip
Bug 532580 - Sort launchers in debug launcher selection dialogI20180412-2000I20180411-2000I20180411-0735I20180411-0530
Sort the available launchers by name. That makes the dialog more consistent with the same workspace preferences and is easier to read for the user. Change-Id: I844eaaa5b8b99513f7b8259c2be69571689aed33 Signed-off-by: Michael Keppler <Michael.Keppler@gmx.de> Bug:532580
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/SelectLaunchersDialog.java19
1 files changed, 12 insertions, 7 deletions
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 18ff7463c..01662e6ee 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.debug.internal.ui.launchConfigurations;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Set;
@@ -63,12 +64,7 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
@Override
public String getText(Object element) {
if(element instanceof ILaunchDelegate) {
- ILaunchDelegate ldp = (ILaunchDelegate) element;
- String name = ldp.getName();
- if(name == null) {
- name = ldp.getContributorName();
- }
- return name;
+ return getDelegateName((ILaunchDelegate) element);
}
return element.toString();
}
@@ -96,7 +92,8 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
super(parentShell);
super.setTitle(LaunchConfigurationsMessages.SelectLaunchersDialog_0);
setShellStyle(getShellStyle() | SWT.RESIZE);
- fDelegates = delegates;
+ fDelegates = delegates.clone();
+ Arrays.sort(fDelegates, (delegate1, delegate2) -> String.CASE_INSENSITIVE_ORDER.compare(getDelegateName(delegate1), getDelegateName(delegate2)));
fConfiguration = configuration;
fLaunchMode = launchmode;
}
@@ -314,4 +311,12 @@ public class SelectLaunchersDialog extends AbstractDebugListSelectionDialog {
protected String getViewerLabel() {
return LaunchConfigurationsMessages.SelectLaunchersDialog_launchers;
}
+
+ private String getDelegateName(ILaunchDelegate ldp) {
+ String name = ldp.getName();
+ if(name == null) {
+ name = ldp.getContributorName();
+ }
+ return name;
+ }
}

Back to the top