-package org.simantics.district.network.ui;\r
-\r
-import java.util.Collections;\r
-\r
-import org.simantics.db.ReadGraph;\r
-import org.simantics.db.Resource;\r
-import org.simantics.db.exception.DatabaseException;\r
-import org.simantics.district.network.ontology.DistrictNetworkResource;\r
-\r
-public class OpenDiagramFromConfigurationAdapter\r
- extends org.simantics.modeling.ui.diagramEditor.OpenDiagramFromConfigurationAdapter {\r
-\r
- @Override\r
- public boolean canHandle(ReadGraph g, Resource r) throws DatabaseException {\r
- Resource diagram = getDiagram(g, r, Collections.emptySet());\r
- if (diagram == null)\r
- return false;\r
- DistrictNetworkResource DN = DistrictNetworkResource.getInstance(g);\r
- return g.isInstanceOf(diagram, DN.Diagram) && !isLocked(g, diagram);\r
- }\r
-\r
- @Override\r
- protected String getEditorId() {\r
- return DistrictDiagramEditor.ID;\r
- }\r
-}\r
+package org.simantics.district.network.ui;
+
+import java.util.Collections;
+
+import org.simantics.db.ReadGraph;
+import org.simantics.db.Resource;
+import org.simantics.db.exception.DatabaseException;
+import org.simantics.district.network.ontology.DistrictNetworkResource;
+
+public class OpenDiagramFromConfigurationAdapter
+ extends org.simantics.modeling.ui.diagramEditor.OpenDiagramFromConfigurationAdapter {
+
+ @Override
+ public boolean canHandle(ReadGraph g, Resource r) throws DatabaseException {
+ Resource diagram = getDiagram(g, r, Collections.emptySet());
+ if (diagram == null)
+ return false;
+ DistrictNetworkResource DN = DistrictNetworkResource.getInstance(g);
+ return g.isInstanceOf(diagram, DN.Diagram) && !isLocked(g, diagram);
+ }
+
+ @Override
+ protected String getEditorId(ReadGraph g, Resource composite) throws DatabaseException {
+ return DistrictDiagramEditor.ID;
+ }
+}