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