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.SharedFunctionLibraryNode;
\r
15 public class FunctionTreeSharedLibraries extends ViewpointContributor<SharedFunctionsFolderNode> {
\r
18 public Collection<?> getContribution(ReadGraph graph, SharedFunctionsFolderNode folder)
\r
19 throws DatabaseException {
\r
20 ArrayList<SharedFunctionLibraryNode> result = new ArrayList<SharedFunctionLibraryNode>();
\r
21 Layer0 l0 = Layer0.getInstance(graph);
\r
22 SysdynResource sr = SysdynResource.getInstance(graph);
\r
23 Resource sharedlibrary = graph.getPossibleResource("http://SharedOntologies");
\r
24 for (Resource r : graph.syncRequest(new ObjectsWithType(sharedlibrary, l0.ConsistsOf, sr.SharedFunctionOntology))){
\r
25 result.add(new SharedFunctionLibraryNode(r));
\r
31 public String getViewpointId() {
\r