diff options
Diffstat (limited to 'plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java')
-rw-r--r-- | plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java index 3c80dbade84..0e72f51c66e 100644 --- a/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java +++ b/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.profile/src/org/eclipse/papyrus/uml/diagram/profile/edit/commands/ClassPropertyCreateCommand.java @@ -33,8 +33,6 @@ import org.eclipse.uml2.uml.StructuredClassifier; import org.eclipse.uml2.uml.UMLFactory;
import org.eclipse.uml2.uml.UMLPackage;
-
-
/**
* @generated
*/
@@ -66,21 +64,16 @@ public class ClassPropertyCreateCommand extends EditElementCommand { * @generated
*/
public boolean canExecute() {
-
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target.eClass(), UMLPackage.eINSTANCE.getProperty());
return data.isPermitted();
-
-
}
/**
* @generated
*/
protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
-
Property newElement = UMLFactory.eINSTANCE.createProperty();
-
EObject target = getElementToEdit();
ModelAddData data = PolicyChecker.getCurrent().getChildAddData(diagram, target, newElement);
if(data.isPermitted()) {
@@ -88,20 +81,14 @@ public class ClassPropertyCreateCommand extends EditElementCommand { if(!data.execute(target, newElement))
return CommandResult.newErrorCommandResult("Failed to follow the policy-specified for the insertion of the new element");
} else {
-
StructuredClassifier qualifiedTarget = (StructuredClassifier)target;
qualifiedTarget.getOwnedAttributes().add(newElement);
-
}
} else {
return CommandResult.newErrorCommandResult("The active policy restricts the addition of this element");
}
-
-
ElementInitializers.getInstance().init_Property_3002(newElement);
-
doConfigure(newElement, monitor, info);
-
((CreateElementRequest)getRequest()).setNewElement(newElement);
return CommandResult.newOKCommandResult(newElement);
}
@@ -119,5 +106,4 @@ public class ClassPropertyCreateCommand extends EditElementCommand { configureCommand.execute(monitor, info);
}
}
-
}
|