1 package org.simantics.sysdyn.ui.wizards.functions;
\r
3 import java.util.ArrayList;
\r
4 import java.util.Collection;
\r
6 import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;
\r
7 import org.simantics.db.ReadGraph;
\r
8 import org.simantics.db.Resource;
\r
9 import org.simantics.db.common.request.ObjectsWithType;
\r
10 import org.simantics.db.exception.DatabaseException;
\r
11 import org.simantics.layer0.Layer0;
\r
12 import org.simantics.sysdyn.SysdynResource;
\r
13 import org.simantics.sysdyn.ui.browser.nodes.FunctionLibraryNode;
\r
14 import org.simantics.sysdyn.ui.browser.nodes.ModelNode;
\r
16 public class FunctionTreeLibraries extends ViewpointContributor<ModelNode> {
\r
19 public Collection<?> getContribution(ReadGraph graph, ModelNode model)
\r
20 throws DatabaseException {
\r
21 ArrayList<FunctionLibraryNode<Resource>> result = new ArrayList<FunctionLibraryNode<Resource>>();
\r
22 Layer0 l0 = Layer0.getInstance(graph);
\r
23 SysdynResource sr = SysdynResource.getInstance(graph);
\r
25 for (Resource r : graph.syncRequest(new ObjectsWithType(model.data, l0.ConsistsOf, sr.SysdynModelicaFunctionLibrary))){
\r
26 result.add(new FunctionLibraryNode<Resource>(r));
\r
33 public String getViewpointId() {
\r