mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-20 06:35:50 +02:00
Bug 142980: Contents of System Type dropdown should be sorted in New Connection Wizard
This commit is contained in:
parent
8d270bf046
commit
7a7a212141
1 changed files with 15 additions and 2 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
package org.eclipse.rse.ui;
|
package org.eclipse.rse.ui;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import org.eclipse.jface.action.IAction;
|
import org.eclipse.jface.action.IAction;
|
||||||
|
@ -768,7 +769,10 @@ public class SystemWidgetHelpers {
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public static List createSystemTypeListBox(Composite group, Listener listener, String[] systemTypes) {
|
public static List createSystemTypeListBox(Composite group, Listener listener, String[] systemTypes) {
|
||||||
|
ArrayList arrayList = new ArrayList();
|
||||||
|
|
||||||
List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
List list = createListBox(group, listener, false, null, SystemResources.RESID_CONNECTION_SYSTEMTYPE_TIP);
|
||||||
|
|
||||||
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes);
|
String[] typeItems = ((systemTypes == null) ? RSECorePlugin.getDefault().getRegistry().getSystemTypeNames() : systemTypes);
|
||||||
|
|
||||||
if (systemTypes == null) {
|
if (systemTypes == null) {
|
||||||
|
@ -776,13 +780,22 @@ public class SystemWidgetHelpers {
|
||||||
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
|
ISubSystemConfiguration[] configurations = RSEUIPlugin.getTheSystemRegistry().getSubSystemConfigurationsBySystemType(typeItems[i]);
|
||||||
|
|
||||||
if (configurations != null && configurations.length > 0) {
|
if (configurations != null && configurations.length > 0) {
|
||||||
list.add(typeItems[i]);
|
arrayList.add(typeItems[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
systemTypes = (String[])arrayList.toArray(new String[arrayList.size()]);
|
||||||
|
Arrays.sort(systemTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
list.select(0);
|
for(int i=0; i<systemTypes.length; i++){
|
||||||
|
list.add(systemTypes[i]);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(list.getItemCount()>0){
|
||||||
|
list.select(0);
|
||||||
|
}
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue