1 package org.simantics.district.network.ui;
\r
3 import java.util.Collections;
\r
5 import org.simantics.db.ReadGraph;
\r
6 import org.simantics.db.Resource;
\r
7 import org.simantics.db.exception.DatabaseException;
\r
8 import org.simantics.district.network.ontology.DistrictNetworkResource;
\r
10 public class OpenDiagramFromConfigurationAdapter
\r
11 extends org.simantics.modeling.ui.diagramEditor.OpenDiagramFromConfigurationAdapter {
\r
14 public boolean canHandle(ReadGraph g, Resource r) throws DatabaseException {
\r
15 Resource diagram = getDiagram(g, r, Collections.emptySet());
\r
16 if (diagram == null)
\r
18 DistrictNetworkResource DN = DistrictNetworkResource.getInstance(g);
\r
19 return g.isInstanceOf(diagram, DN.Diagram) && !isLocked(g, diagram);
\r
23 protected String getEditorId() {
\r
24 return DistrictDiagramEditor.ID;
\r