use of org.talend.mdm.repository.model.mdmmetadata.MDMServerDef in project tmdm-studio-se by Talend.
the class ServerSorter method compare.
@Override
public int compare(Viewer viewer, Object e1, Object e2) {
MDMServerDefItem mdmItem1 = getMDMItem((IRepositoryViewObject) e1);
MDMServerDefItem mdmItem2 = getMDMItem((IRepositoryViewObject) e2);
if (mdmItem1 != null && mdmItem2 != null) {
MDMServerDef serverDef1 = mdmItem1.getServerDef();
MDMServerDef serverDef2 = mdmItem2.getServerDef();
boolean enabled1 = serverDef1.isEnabled();
boolean enabled2 = serverDef2.isEnabled();
if (enabled1 == enabled2) {
return serverDef1.getName().toLowerCase().compareTo(serverDef2.getName().toLowerCase());
} else {
return enabled1 ? -1 : 1;
}
}
return 0;
}
Aggregations