From: Tuukka Lehtonen Date: Mon, 5 Aug 2019 05:47:08 +0000 (+0300) Subject: Adapt to platform OpenDiagramFromConfigurationAdapter changes X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e30d05765c4a77632aa15b5b04ba03d334ebe574;p=simantics%2Fdistrict.git Adapt to platform OpenDiagramFromConfigurationAdapter changes gitlab simantics/platform#325 Change-Id: I535714d4a39620caeb49e67424b09b50b544de7a --- diff --git a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/OpenDiagramFromConfigurationAdapter.java b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/OpenDiagramFromConfigurationAdapter.java index 1c49acbc..e4e97d59 100644 --- a/org.simantics.district.network.ui/src/org/simantics/district/network/ui/OpenDiagramFromConfigurationAdapter.java +++ b/org.simantics.district.network.ui/src/org/simantics/district/network/ui/OpenDiagramFromConfigurationAdapter.java @@ -1,26 +1,26 @@ -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() { - return DistrictDiagramEditor.ID; - } -} +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; + } +}