Modify the following class ${topLevelPackage}.client.scaffold. ScaffoldApp
1) Change the return type of method getTopPlaces() from HashMap to List:
2) Change definition of rtn from HashMap to List and change instance from hHshMap to ArrayList.
3) Apply sort() method to types in for loop.
protected List<ProxyListPlace> getTopPlaces() {
Set<Class<? extends EntityProxy>> types = ApplicationEntityTypesProcessor.getAll();
List<ProxyListPlace> rtn = new ArrayList<ProxyListPlace>(types.size());
for (Class<? extends EntityProxy> type : sort(types)) {
rtn.add(new ProxyListPlace(type));
}
return rtn;
}
4) Add static comparator to ScaffoldApp class:
private static final Comparator<Class<? extends EntityProxy>> COMP = new Comparator<Class<? extends EntityProxy>>() {
private final Map<Class<? extends EntityProxy>, Integer> MAP = new HashMap<Class<? extends EntityProxy>, Integer>();
{
// Populate MAP with you own proxy classes.
MAP.put(AnimalProxy.class, 0);
MAP.put(ExhibitProxy.class, 1);
MAP.put(KeeperProxy.class, 2);
}
@Override
public int compare(Class<? extends EntityProxy> p1, Class<? extends EntityProxy> p2) {
return MAP.get(p1).compareTo(MAP.get(p2));
}
};
5) Add sort method to ScaffoldApp class:
private Set<Class<? extends EntityProxy>> sort(Set<Class<? extends EntityProxy>> in) {
Set<Class<? extends EntityProxy>> out = new TreeSet<Class<? extends EntityProxy>>(COMP);
out.addAll(in);
return out;
}
This will now sort you entities in the left hand menu.
Enjoy.