+ setEntryComparator(new ResourcesEntryComparator());
+ }
+
+ private static class ResourcesEntryComparator implements Comparator<ITimeGraphEntry> {
+ @Override
+ public int compare(ITimeGraphEntry o1, ITimeGraphEntry o2) {
+ ResourcesEntry entry1 = (ResourcesEntry) o1;
+ ResourcesEntry entry2 = (ResourcesEntry) o2;
+ if (entry1.getType() == Type.NULL && entry2.getType() == Type.NULL) {
+ /* sort trace entries alphabetically */
+ return entry1.getName().compareTo(entry2.getName());
+ }
+ /* sort resource entries by their defined order */
+ return entry1.compareTo(entry2);
+ }