From: Reino Ruusu Date: Wed, 12 Feb 2020 13:13:38 +0000 (+0200) Subject: Rename and move 'modeling.adapters.Removers' and make it API X-Git-Tag: v1.43.0~102 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F66%2F3866%2F1;p=simantics%2Fplatform.git Rename and move 'modeling.adapters.Removers' and make it API gitlab #466 Change-Id: I0e86bf7ebce158de3e1627059909040960c6ba08 --- diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/ConnectionRelationRemover.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/ConnectionRelationRemover.java index 1c69e45a9..83ec57afd 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/ConnectionRelationRemover.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/ConnectionRelationRemover.java @@ -24,7 +24,8 @@ import org.simantics.db.layer0.util.RemoverUtil; import org.simantics.diagram.stubs.DiagramResource; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingResources; -import org.simantics.modeling.adapters.Removers.ValidationResult; +import org.simantics.modeling.utils.RemoverUtils; +import org.simantics.modeling.utils.RemoverUtils.ValidationResult; /** * @author Tuukka Lehtonen @@ -45,9 +46,9 @@ public class ConnectionRelationRemover extends AbstractRemover { diagramConnectionRelation = resource; else connectionRelation = resource; - ValidationResult result = Removers.validateConnectionRelationRemoval(graph, connectionRelation, diagramConnectionRelation); + ValidationResult result = RemoverUtils.validateConnectionRelationRemoval(graph, connectionRelation, diagramConnectionRelation); if (result.inUse()) - return Removers.formatError(graph, result); + return RemoverUtils.formatError(graph, result); return null; } diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/FlagRemover.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/FlagRemover.java index c73486a56..62b70c9ae 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/FlagRemover.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/FlagRemover.java @@ -21,7 +21,8 @@ import org.simantics.db.WriteGraph; import org.simantics.db.exception.DatabaseException; import org.simantics.diagram.flag.FlagUtil; import org.simantics.diagram.stubs.DiagramResource; -import org.simantics.modeling.adapters.Removers.ValidationResult; +import org.simantics.modeling.utils.RemoverUtils; +import org.simantics.modeling.utils.RemoverUtils.ValidationResult; /** * @author Tuukka Lehtonen @@ -36,9 +37,9 @@ public class FlagRemover extends ElementRemover { public String canRemove(ReadGraph graph, Map aux) throws DatabaseException { boolean lifted = FlagUtil.isLifted(graph, resource); if (lifted) { - ValidationResult result = Removers.validateFlagRemoval(graph, resource); + ValidationResult result = RemoverUtils.validateFlagRemoval(graph, resource); if (result.inUse()) { - return Removers.formatError(graph, result); + return RemoverUtils.formatError(graph, result); } } return null; diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/TerminalRemover.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/TerminalRemover.java index ecf59e72c..deb6434c2 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/TerminalRemover.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/TerminalRemover.java @@ -20,7 +20,8 @@ import org.simantics.db.exception.DatabaseException; import org.simantics.diagram.stubs.DiagramResource; import org.simantics.layer0.Layer0; import org.simantics.modeling.ModelingResources; -import org.simantics.modeling.adapters.Removers.ValidationResult; +import org.simantics.modeling.utils.RemoverUtils; +import org.simantics.modeling.utils.RemoverUtils.ValidationResult; /** * A remover implementation for symbol terminals. @@ -48,9 +49,9 @@ public class TerminalRemover extends ElementRemover { for (Resource diagramConnectionRelation : graph.getObjects(resource, DIA.HasConnectionPoint)) { for (Resource connectionRelation : graph.getObjects(diagramConnectionRelation, MOD.DiagramConnectionRelationToConnectionRelation)) { - ValidationResult result = Removers.validateConnectionRelationRemoval(graph, connectionRelation, diagramConnectionRelation); + ValidationResult result = RemoverUtils.validateConnectionRelationRemoval(graph, connectionRelation, diagramConnectionRelation); if (result.inUse()) - return Removers.formatError(graph, result); + return RemoverUtils.formatError(graph, result); } } diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/Removers.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/utils/RemoverUtils.java similarity index 99% rename from bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/Removers.java rename to bundles/org.simantics.modeling/src/org/simantics/modeling/utils/RemoverUtils.java index 4949793b4..13fbf7b81 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/adapters/Removers.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/utils/RemoverUtils.java @@ -9,7 +9,7 @@ * Contributors: * VTT Technical Research Centre of Finland - initial API and implementation *******************************************************************************/ -package org.simantics.modeling.adapters; +package org.simantics.modeling.utils; import java.util.ArrayList; import java.util.Collection; @@ -42,7 +42,7 @@ import gnu.trove.set.hash.THashSet; /** * @author Tuukka Lehtonen */ -final class Removers { +final public class RemoverUtils { public static ValidationResult validateFlagRemoval(ReadGraph graph, Resource flag) throws DatabaseException { DiagramResource DIA = DiagramResource.getInstance(graph);