diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramModule.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramModule.java index f4dc135e..95adc565 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramModule.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/di/DiagramModule.java @@ -53,7 +53,7 @@ import org.eclipse.glsp.server.features.sourcemodelwatcher.SourceModelWatcher; import org.eclipse.glsp.server.features.toolpalette.ToolPaletteItemProvider; import org.eclipse.glsp.server.features.typehints.EdgeCreationChecker; -import org.eclipse.glsp.server.features.typehints.RequestCheckEdgeTargetActionHandler; +import org.eclipse.glsp.server.features.typehints.RequestCheckEdgeActionHandler; import org.eclipse.glsp.server.features.typehints.RequestTypeHintsActionHandler; import org.eclipse.glsp.server.features.undoredo.UndoRedoActionHandler; import org.eclipse.glsp.server.features.validation.ModelValidator; @@ -275,7 +275,7 @@ protected void configureActionHandlers(final MultiBinding binding binding.add(ComputedBoundsActionHandler.class); binding.add(SaveModelActionHandler.class); binding.add(UndoRedoActionHandler.class); - binding.add(RequestCheckEdgeTargetActionHandler.class); + binding.add(RequestCheckEdgeActionHandler.class); } protected Class bindActionHandlerRegistry() { diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/EdgeCreationChecker.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/EdgeCreationChecker.java index dfc5cecc..e65940e3 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/EdgeCreationChecker.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/EdgeCreationChecker.java @@ -23,15 +23,15 @@ * {@link EdgeTypeHint}s. * A dynamic edge type hint is used for cases where a plain list of allowed source and target element ids is not enough * to determine - * wether an edge beeing created is valid. In this cases the client will query the server to determine wether the edge + * wether an edge being created is valid. In this cases the client will query the server to determine wether the edge * is valid. - * The `EdegeCreationChecker` then checks the given edge information and returns wether the edge beeing created is + * The `EdgeCreationChecker` then checks the given edge information and returns wether the edge being created is * valid. */ public interface EdgeCreationChecker { /** * Checks wether the given source element for an edge beeing created is valid i.e. if the - * given source is and allowed source element for the given edge type. + * given source is an allowed source element for the given edge type. * * @return `true` if the edge source is valid, `false` otherwise */ @@ -39,7 +39,7 @@ public interface EdgeCreationChecker { /** * Checks wether the given information for an edge beeing created is valid i.e. if the - * given target is an allowed target for the given source and edge type. + * given target is an allowed target element for the given source and edge type. * * @return `true` if the edge target is valid, `false` otherwise */ diff --git a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeTargetActionHandler.java b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeActionHandler.java similarity index 88% rename from plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeTargetActionHandler.java rename to plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeActionHandler.java index c4cb257f..ee1a6ed2 100644 --- a/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeTargetActionHandler.java +++ b/plugins/org.eclipse.glsp.server/src/org/eclipse/glsp/server/features/typehints/RequestCheckEdgeActionHandler.java @@ -37,10 +37,10 @@ * Returns a valid {@link CheckEdgeResultAction} if no edge creation checker is bound or the type hint associated with * the given edge information is not dynamic. */ -public class RequestCheckEdgeTargetActionHandler extends AbstractActionHandler { +public class RequestCheckEdgeActionHandler extends AbstractActionHandler { @Inject - protected Optional edgeTargetChecker; + protected Optional edgeCreationChecker; @Inject protected DiagramConfiguration diagramConfiguration; @@ -54,7 +54,7 @@ protected List executeAction(final RequestCheckEdgeAction action) { .filter(hint -> hint.getElementTypeId().equals(action.getEdgeType()) && hint.isDynamic()).findAny() .isPresent(); - if (!edgeTargetChecker.isPresent() || !hasDynamicHint) { + if (!edgeCreationChecker.isPresent() || !hasDynamicHint) { return listOf(new CheckEdgeResultAction(true, action)); } return listOf(new CheckEdgeResultAction(validate(action), action)); @@ -73,8 +73,8 @@ protected boolean validate(final RequestCheckEdgeAction action) { + action.getTargetElementId().get()); } return targetElement.isPresent() - ? edgeTargetChecker.get().isValidTarget(action.getEdgeType(), sourceElement, targetElement.get()) - : edgeTargetChecker.get().isValidSource(action.getEdgeType(), sourceElement); + ? edgeCreationChecker.get().isValidTarget(action.getEdgeType(), sourceElement, targetElement.get()) + : edgeCreationChecker.get().isValidSource(action.getEdgeType(), sourceElement); }