Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorskovalsky2015-03-21 01:24:13 +0000
committerSvyatoslav Kovalsky2015-03-29 20:15:01 +0000
commit175e9629ba46339afd24a051c4366855525ebefe (patch)
treebfc1648a0a08d29e6601248f10ecf924592d6350 /plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine
parentfb51bf7e59cc344770daf23dfeff5843f066f3a1 (diff)
downloadorg.eclipse.papyrus-175e9629ba46339afd24a051c4366855525ebefe.tar.gz
org.eclipse.papyrus-175e9629ba46339afd24a051c4366855525ebefe.tar.xz
org.eclipse.papyrus-175e9629ba46339afd24a051c4366855525ebefe.zip
Bug 462540 - [Element Types] State diagram should be migrated to the
elementtypes framework: - remove final state create commands Change-Id: Id559571494f0aa181804d5466d894a94371621c6 Signed-off-by: skovalsky <kovalsky@montages.com>
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine')
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/FinalStateCreateCommand.java127
-rw-r--r--plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionCompartmentItemSemanticEditPolicy.java6
2 files changed, 0 insertions, 133 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/FinalStateCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/FinalStateCreateCommand.java
deleted file mode 100644
index e394cd9acc4..00000000000
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/commands/FinalStateCreateCommand.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/**
- * Copyright (c) 2014 CEA LIST.
- *
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- */
-package org.eclipse.papyrus.uml.diagram.statemachine.edit.commands;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gmf.runtime.common.core.command.CommandResult;
-import org.eclipse.gmf.runtime.common.core.command.ICommand;
-import org.eclipse.gmf.runtime.emf.type.core.IElementType;
-import org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;
-import org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;
-import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
-import org.eclipse.gmf.runtime.notation.Diagram;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.viewpoints.policy.ModelAddData;
-import org.eclipse.papyrus.infra.viewpoints.policy.PolicyChecker;
-import org.eclipse.papyrus.uml.diagram.statemachine.providers.ElementInitializers;
-import org.eclipse.uml2.uml.FinalState;
-import org.eclipse.uml2.uml.Region;
-import org.eclipse.uml2.uml.UMLFactory;
-import org.eclipse.uml2.uml.UMLPackage;
-
-/**
- * @generated
- */
-public class FinalStateCreateCommand extends EditElementCommand {
-
- /**
- * @generated
- */
- private Diagram diagram = null;
-
- /**
- * @generated
- */
- public FinalStateCreateCommand(CreateElementRequest req, Diagram diagram) {
- super(req.getLabel(), null, req);
- this.diagram = diagram;
- }
-
- /**
- * FIXME: replace with setElementToEdit()
- *
- * @generated
- */
- @Override
- protected EObject getElementToEdit() {
- EObject container = ((CreateElementRequest) getRequest()).getContainer();
- if (container instanceof View) {
- container = ((View) container).getElement();
- }
- return container;
- }
-
- /**
- * @generated
- */
- @Override
- public boolean canExecute() {
-
- EObject target = getElementToEdit();
- ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getFinalState());
- return data.isPermitted();
-
-
- }
-
- /**
- * @generated
- */
- @Override
- protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
- FinalState newElement = UMLFactory.eINSTANCE.createFinalState();
-
- EObject target = getElementToEdit();
- ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
- if (data.isPermitted()) {
- if (data.isPathDefined()) {
- if (!data.execute(target, newElement)) {
- return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
- }
- } else {
-
- Region qualifiedTarget = (Region) target;
- qualifiedTarget.getSubvertices()
- .add(newElement);
-
- }
- } else {
- return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
- }
-
-
- ElementInitializers.getInstance().init_FinalState_5000(newElement);
-
- doConfigure(newElement, monitor, info);
-
- ((CreateElementRequest) getRequest()).setNewElement(newElement);
- return CommandResult.newOKCommandResult(newElement);
- }
-
- /**
- * @generated
- */
- protected void doConfigure(FinalState newElement, IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- IElementType elementType = ((CreateElementRequest) getRequest()).getElementType();
- ConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);
- configureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());
- configureRequest.addParameters(getRequest().getParameters());
- ICommand configureCommand = elementType.getEditCommand(configureRequest);
- if (configureCommand != null && configureCommand.canExecute()) {
- configureCommand.execute(monitor, info);
- }
- }
-}
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionCompartmentItemSemanticEditPolicy.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionCompartmentItemSemanticEditPolicy.java
index 3a4ed729e81..d478397d4ba 100644
--- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionCompartmentItemSemanticEditPolicy.java
+++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.statemachine/src/org/eclipse/papyrus/uml/diagram/statemachine/edit/policies/RegionCompartmentItemSemanticEditPolicy.java
@@ -15,7 +15,6 @@ import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.emf.type.core.IElementType;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramUtils;
-import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.FinalStateCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.PseudostateChoiceCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.PseudostateDeepHistoryCreateCommand;
import org.eclipse.papyrus.uml.diagram.statemachine.edit.commands.PseudostateEntryPointCreateCommand;
@@ -92,11 +91,6 @@ public class RegionCompartmentItemSemanticEditPolicy extends UMLBaseItemSemantic
return getGEFWrapper(new PseudostateTerminateCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
}
- if (UMLElementTypes.FinalState_5000 == requestElementType) {
-
- return getGEFWrapper(new FinalStateCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));
-
- }
if (UMLElementTypes.State_6000 == requestElementType) {
return getGEFWrapper(new StateCreateCommand(req, DiagramUtils.getDiagramFrom(getHost())));

Back to the top