]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.diagram.profile/src/org/simantics/diagram/profile/view/AvailableGroups.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.diagram.profile / src / org / simantics / diagram / profile / view / AvailableGroups.java
index 67c16a7543562e6d9aaf6fdbc20f3db75e628307..2e9f16a13ef37f8432b350274fb58d76dd3f3952 100644 (file)
@@ -1,49 +1,49 @@
-/*******************************************************************************\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
-public class AvailableGroups extends ViewpointContributor<Resource> {\r
-\r
-    @Override\r
-    public Collection<?> getContribution(ReadGraph graph, Resource runtimeDiagram) throws DatabaseException {\r
-       \r
-        DiagramResource dr = DiagramResource.getInstance(graph);\r
-        String modelURI = graph.getPossibleRelatedValue((Resource)runtimeDiagram, dr.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(dr.Group, 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, dr.Group)));\r
-        return result; \r
-       \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;
+
+public class AvailableGroups extends ViewpointContributor<Resource> {
+
+    @Override
+    public Collection<?> getContribution(ReadGraph graph, Resource runtimeDiagram) throws DatabaseException {
+       
+        DiagramResource dr = DiagramResource.getInstance(graph);
+        String modelURI = graph.getPossibleRelatedValue((Resource)runtimeDiagram, dr.RuntimeDiagram_HasModelURI);
+        if (modelURI == null)
+            return Collections.emptyList();
+
+        Resource model = graph.getPossibleResource(modelURI);
+        if (model == null)
+            return Collections.emptyList();
+
+        Instances query = graph.adapt(dr.Group, Instances.class);
+        
+        ArrayList<Resource> result = new ArrayList<Resource>();
+        result.addAll(query.find(graph, model));
+        result.addAll(graph.syncRequest(new ObjectsWithType(model, L0.ConsistsOf, dr.Group)));
+        return result; 
+       
+    }
+
+}