blob: b052e8e1ecaf843c853078c8af092e2929911834 [file] [log] [blame]
//------------------------------------------------------------------------------
// Copyright (c) 2005, 2007 IBM Corporation and others.
// 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:
// IBM Corporation - initial implementation
//------------------------------------------------------------------------------
/**
*
*/
package org.eclipse.epf.diagramming.base.commands;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gmf.runtime.emf.type.core.commands.CreateRelationshipCommand;
import org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;
import org.eclipse.uml2.uml.ActivityNode;
import org.eclipse.uml2.uml.ControlFlow;
import org.eclipse.uml2.uml.UMLPackage;
/**
* @author Shashidhar Kannoori
*
*/
public class CreateRelationShipCommandStructuredActivity extends
CreateRelationshipCommand {
/**
* @param request
*/
public CreateRelationShipCommandStructuredActivity(
CreateRelationshipRequest request, EObject element) {
super(request);
setElementToEdit(element);
// TODO Auto-generated constructor stub
}
/**
*
*/
protected EClass getEClassToEdit() {
return UMLPackage.eINSTANCE.getStructuredActivityNode();
};
/**
*
*/
protected EObject doDefaultElementCreation() {
ControlFlow newElement = (ControlFlow) super
.doDefaultElementCreation();
if (newElement != null) {
newElement.setTarget((ActivityNode) getTarget());
newElement.setSource((ActivityNode) getSource());
}
return newElement;
}
public boolean canExecute() {
// TODO Auto-generated method stub
return super.canExecute();
}
}