- EditorAdapter[] editorAdapters = EditorRegistry.getInstance().getAdaptersFor(g, node);
-
- Arrays.sort(editorAdapters, new Comparator<EditorAdapter>() {
- @Override
- public int compare(EditorAdapter o1, EditorAdapter o2) {
- // Sort in descending priority order
- return -(o1.getPriority() - o2.getPriority());
- }
- });
+ // Get adapters in descending priority order
+ EditorAdapter[] editorAdapters = EditorRegistry.getInstance().getAdaptersFor(e.getGraph(), selection);
+ if (editorAdapters.length > 1)
+ Arrays.sort(editorAdapters, (o1,o2) -> -(o1.getPriority() - o2.getPriority()));