]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/AvailableEntries.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.diagram.profile / src / org / simantics / diagram / profile / view / AvailableEntries.java
index b3ccd567aef0ca122407e53f3eb5cced9e2dc7c6..7b96ff3772ce85ccfc5c83471bc9e3a7baea4102 100644 (file)
@@ -1,57 +1,57 @@
-/*******************************************************************************\r
- * Copyright (c) 2007, 2010 Association for Decentralized Information Management\r
- * in Industry THTH ry.\r
- * All rights reserved. This program and the accompanying materials\r
- * are made available under the terms of the Eclipse Public License v1.0\r
- * which accompanies this distribution, and is available at\r
- * http://www.eclipse.org/legal/epl-v10.html\r
- *\r
- * Contributors:\r
- *     VTT Technical Research Centre of Finland - initial API and implementation\r
- *******************************************************************************/\r
-package org.simantics.diagram.profile.view;\r
-\r
-import java.util.ArrayList;\r
-import java.util.Collection;\r
-import java.util.Collections;\r
-\r
-import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.common.request.ObjectsWithType;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.db.layer0.adapter.Instances;\r
-import org.simantics.diagram.stubs.DiagramResource;\r
-\r
-/**\r
- * @author Antti Villberg\r
- */\r
-public class AvailableEntries extends ViewpointContributor<Resource> {\r
-\r
-    @Override\r
-    public Collection<?> getContribution(ReadGraph graph, Resource runtimeDiagram) throws DatabaseException {\r
-        DiagramResource DIA = DiagramResource.getInstance(graph);\r
-\r
-        String modelURI = graph.getPossibleRelatedValue(runtimeDiagram, DIA.RuntimeDiagram_HasModelURI);\r
-        if (modelURI == null)\r
-            return Collections.emptyList();\r
-\r
-        Resource model = graph.getPossibleResource(modelURI);\r
-        if (model == null)\r
-            return Collections.emptyList();\r
-\r
-        Instances query = graph.adapt(DIA.ProfileEntry, Instances.class);\r
-\r
-        ArrayList<Resource> result = new ArrayList<Resource>();\r
-        result.addAll(query.find(graph, model));\r
-        result.addAll(graph.syncRequest(new ObjectsWithType(model, L0.ConsistsOf, DIA.ProfileEntry)));\r
-        return result;\r
-        \r
-    }\r
-\r
-    @Override\r
-    public String getViewpointId() {\r
-        return "Standard";\r
-    }\r
-\r
-}\r
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 Association for Decentralized Information Management
+ * in Industry THTH ry.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *     VTT Technical Research Centre of Finland - initial API and implementation
+ *******************************************************************************/
+package org.simantics.diagram.profile.view;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+
+import org.simantics.browsing.ui.graph.contributor.viewpoint.ViewpointContributor;
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.common.request.ObjectsWithType;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.db.layer0.adapter.Instances;
+import org.simantics.diagram.stubs.DiagramResource;
+
+/**
+ * @author Antti Villberg
+ */
+public class AvailableEntries extends ViewpointContributor<Resource> {
+
+    @Override
+    public Collection<?> getContribution(ReadGraph graph, Resource runtimeDiagram) throws DatabaseException {
+        DiagramResource DIA = DiagramResource.getInstance(graph);
+
+        String modelURI = graph.getPossibleRelatedValue(runtimeDiagram, DIA.RuntimeDiagram_HasModelURI);
+        if (modelURI == null)
+            return Collections.emptyList();
+
+        Resource model = graph.getPossibleResource(modelURI);
+        if (model == null)
+            return Collections.emptyList();
+
+        Instances query = graph.adapt(DIA.ProfileEntry, Instances.class);
+
+        ArrayList<Resource> result = new ArrayList<Resource>();
+        result.addAll(query.find(graph, model));
+        result.addAll(graph.syncRequest(new ObjectsWithType(model, L0.ConsistsOf, DIA.ProfileEntry)));
+        return result;
+        
+    }
+
+    @Override
+    public String getViewpointId() {
+        return "Standard";
+    }
+
+}