if (e1 instanceof Template && e2 instanceof TemplateCategory) {
return 1;
}
if (e1 instanceof ITemplateElement && e2 instanceof ITemplateElement) {
ITemplateElement t1 = (ITemplateElement) e1;
ITemplateElement t2 = (ITemplateElement) e2;
// Special Case, Simple Projects category is placed above
// others
if (t1.getName().equals(SIMPLE_PROJECTS_CATEGORY)) {
return -1;
}
else if (t2.getName().equals(SIMPLE_PROJECTS_CATEGORY)) {
return 1;
}
else {
return t1.getName().compareTo(t2.getName());
}
}
return super.compare(viewer, e1, e2);
}
});