}
}
static class PageBlockComparator implements Comparator {
public int compare(Object o1, Object o2) {
IPHPPreferencePageBlock firstBlock = (IPHPPreferencePageBlock) o1;
IPHPPreferencePageBlock secondBlock = (IPHPPreferencePageBlock) o2;
if (firstBlock != null && secondBlock != null) {
boolean firstIsPDT = firstBlock.getClass().getName()
.startsWith(PDT_PREFIX);
boolean secondIsPDT = secondBlock.getClass().getName()
.startsWith(PDT_PREFIX);
if (firstIsPDT) {
if (!secondIsPDT) {
return -1;
}
} else {
if (secondIsPDT) {
return 1;
}
}
return firstBlock.getComparableName().compareTo(
secondBlock.getComparableName());
}
if (firstBlock == null) {
return secondBlock == null ? 0 : -1;
}
return 1;