package org.simantics.plant3d.utils;
import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
import java.util.List;
import org.simantics.Simantics;
});
}
+ public static List<Item> filterUserComponents(List<Item> items) {
+ List<Item> result = new ArrayList<Item>(items.size());
+ for (Item i : items) {
+ if (!i.isCode())
+ result.add(i);
+ }
+ return result;
+ }
+
private static List<Item> getItems(ReadGraph graph, Resource lib, Resource type) throws DatabaseException{
Plant3D p3d = Plant3D.getInstance(graph);
Layer0 l0 = Layer0.getInstance(graph);
}
}
}
+ Collections.sort(result, new Comparator<Item>() {
+ @Override
+ public int compare(Item o1, Item o2) {
+ return o1.getName().compareTo(o2.getName());
+ }
+ });
return result;
}
- private static Item createItem(ReadGraph graph, Resource r) throws DatabaseException {
+ public static Item createItem(ReadGraph graph, Resource r) throws DatabaseException {
Layer0 l0 = Layer0.getInstance(graph);
Plant3D p3d = Plant3D.getInstance(graph);
String name = graph.getRelatedValue(r, l0.HasName);