1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-03 23:25:26 +02:00

[165674] sorting subsystem configurations to be aphabetical in order

This commit is contained in:
David McKnight 2007-07-20 20:15:48 +00:00
parent 77ea462725
commit a435e417a1

View file

@ -390,11 +390,50 @@ public class SystemRegistry implements ISystemRegistry
}
}
}
v = sortConfigurations(v);
ISubSystemConfiguration[] factories = new ISubSystemConfiguration[v.size()];
for (int idx = 0; idx < v.size(); idx++)
factories[idx] = (ISubSystemConfiguration) v.elementAt(idx);
return factories;
}
private Vector sortConfigurations(Vector v)
{
Vector sorted = new Vector(v.size());
while (v.size() > 0)
{
ISubSystemConfiguration first = firstConfiguration(v);
sorted.add(first);
v.remove(first);
}
return sorted;
}
private ISubSystemConfiguration firstConfiguration(Vector v)
{
ISubSystemConfiguration first = null;
for (int i = 0; i < v.size(); i++)
{
ISubSystemConfiguration next = (ISubSystemConfiguration)v.get(i);
if (first == null)
{
first = next;
}
else
{
String name1 = first.getName();
String name2 = next.getName();
if (name2.compareTo(name1) <= 0)
{
first = next;
}
}
}
return first;
}
// ----------------------------
// USER PREFERENCE METHODS...