mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-21 07:55:24 +02:00
[165674] Sort subsystem configurations by priority then Id
This commit is contained in:
parent
a961e1b480
commit
a536024f44
1 changed files with 9 additions and 4 deletions
|
@ -33,7 +33,7 @@
|
||||||
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
|
* Martin Oberhuber (Wind River) - [190271] Move ISystemViewInputProvider to Core
|
||||||
* Xuan Chen (IBM) - [194838] Move the code for comparing two objects by absolute name to a common location
|
* Xuan Chen (IBM) - [194838] Move the code for comparing two objects by absolute name to a common location
|
||||||
* David McKnight (IBM) - [165674] Sort subsystem configurations to be in deterministic order
|
* David McKnight (IBM) - [165674] Sort subsystem configurations to be in deterministic order
|
||||||
* Martin Oberhuber (Wind River) - [165674] Sort subsystem configurations by Id rather than name
|
* Martin Oberhuber (Wind River) - [165674] Sort subsystem configurations by priority then Id
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.ui.internal.model;
|
package org.eclipse.rse.ui.internal.model;
|
||||||
|
@ -265,9 +265,14 @@ public class SystemRegistry implements ISystemRegistry
|
||||||
ISubSystemConfigurationProxy[] newProxies = (ISubSystemConfigurationProxy[])proxies.clone();
|
ISubSystemConfigurationProxy[] newProxies = (ISubSystemConfigurationProxy[])proxies.clone();
|
||||||
Arrays.sort(newProxies, new Comparator(){
|
Arrays.sort(newProxies, new Comparator(){
|
||||||
public int compare(Object o1, Object o2) {
|
public int compare(Object o1, Object o2) {
|
||||||
String t1 = ((ISubSystemConfigurationProxy) o1).getId();
|
ISubSystemConfigurationProxy s1 = (ISubSystemConfigurationProxy)o1;
|
||||||
String t2 = ((ISubSystemConfigurationProxy) o2).getId();
|
ISubSystemConfigurationProxy s2 = (ISubSystemConfigurationProxy)o2;
|
||||||
return t1.compareTo(t2);
|
if (s1.getPriority() < s2.getPriority()) {
|
||||||
|
return -1;
|
||||||
|
} else if (s1.getPriority() > s2.getPriority()) {
|
||||||
|
return +1;
|
||||||
|
}
|
||||||
|
return s1.getId().compareTo(s2.getId());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
//for (int idx=0; idx<newProxies.length; idx++)
|
//for (int idx=0; idx<newProxies.length; idx++)
|
||||||
|
|
Loading…
Add table
Reference in a new issue