Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java')
-rw-r--r--deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java106
1 files changed, 0 insertions, 106 deletions
diff --git a/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java b/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java
deleted file mode 100644
index d70a88a4bfd..00000000000
--- a/deprecated/org.eclipse.papyrus.uml.diagram.sequence_initial-kepler/custom-src/org/eclipse/papyrus/uml/diagram/sequence/validation/UMLValidationHelper.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package org.eclipse.papyrus.uml.diagram.sequence.validation;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.validation.IValidationContext;
-import org.eclipse.gmf.runtime.notation.Bounds;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.uml.diagram.sequence.part.Messages;
-import org.eclipse.papyrus.uml.diagram.sequence.part.UMLDiagramEditorPlugin;
-import org.eclipse.uml2.uml.Interaction;
-import org.eclipse.uml2.uml.InteractionFragment;
-import org.eclipse.uml2.uml.InteractionOperand;
-import org.eclipse.uml2.uml.Lifeline;
-import org.eclipse.uml2.uml.Message;
-
-/**
- * This helper performs non generated validation tasks.
- *
- * @author vhemery
- */
-public class UMLValidationHelper {
-
- /**
- * Validate modification and update the interaction operand's or interaction's fragments order if necessary.
- *
- * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
- * @param context
- * object on which update is performed
- * @param ctx
- * validation context
- * @return status
- */
- public static IStatus validateFragmentsOrder(EObject context, IValidationContext ctx) {
- if(context instanceof View) {
- return validateFragmentsOrder(((View)context).getElement(), ctx);
- } else if(context instanceof Bounds) {
- return validateFragmentsOrder(((Bounds)context).eContainer(), ctx);
- } else if(context instanceof Interaction) {
- return validateFragmentsOrder((Interaction)context, ctx);
- } else if(context instanceof InteractionOperand) {
- return validateFragmentsOrder((InteractionOperand)context, ctx);
- } else if(context instanceof InteractionFragment) {
- return validateFragmentsOrder(((InteractionFragment)context).getOwner(), ctx);
- } else if(context instanceof Message) {
- // both events are in the same container, but they may not exist
- EObject sendFragmentContainer = ((Message)context).getSendEvent().eContainer();
- EObject receiveFragmentContainer = ((Message)context).getReceiveEvent().eContainer();
- if(sendFragmentContainer != null) {
- return validateFragmentsOrder(sendFragmentContainer, ctx);
- } else if(receiveFragmentContainer != null) {
- return validateFragmentsOrder(receiveFragmentContainer, ctx);
- }
- } else if(context instanceof Lifeline) {
- // events may have changed of container while lifeline was moving
- return validateFragmentsOrder(((Lifeline)context).getInteraction(), ctx);
- }
- // no implementation for this element
- return ctx.createSuccessStatus();
- }
-
- /**
- * Validate modification and update the interaction's fragments order if necessary.
- *
- * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
- * @param context
- * element on which update is performed
- * @param ctx
- * validation context
- * @return status
- */
- public static IStatus validateFragmentsOrder(Interaction context, IValidationContext ctx) {
- try {
- FragmentOrderingKeeper keeper = new FragmentOrderingKeeper();
- return keeper.validate(context, ctx);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.FragmentOrderingKeeper_error, e);
- // avoid returning the exception, or the constraint will never be called again.
- return ctx.createSuccessStatus();
- }
- }
-
- /**
- * Validate modification and update the interaction operand's fragments order if necessary.
- *
- * @see org.eclipse.emf.validation.AbstractModelConstraint#validate(org.eclipse.emf.validation.IValidationContext)
- *
- * @param context
- * element on which update is performed
- * @param ctx
- * validation context
- * @return status
- */
- public static IStatus validateFragmentsOrder(InteractionOperand context, IValidationContext ctx) {
- try {
- FragmentOrderingKeeper keeper = new FragmentOrderingKeeper();
- return keeper.validate(context, ctx);
- } catch (Exception e) {
- UMLDiagramEditorPlugin.getInstance().logError(Messages.FragmentOrderingKeeper_error, e);
- // avoid returning the exception, or the constraint will never be called again.
- return ctx.createSuccessStatus();
- }
- }
-
-}

Back to the top