Esempio n. 1
0
 public Set<Node> getNodes() {
   Set<Node> nodes = new HashSet<Node>();
   for (org.eclipse.uml2.uml.ActivityNode n : uml_activity.getNodes()) {
     nodes.add(NodeFactory.getInstance(n));
   }
   return nodes;
 }
 private List<ActivityNode> getActivityOwnedNodes(Activity activity) {
   List<ActivityNode> ownedNodes = (List<ActivityNode>) activity.getNodes();
   if (!isOlderThanUML2_4_0()) {
     ownedNodes =
         (List<ActivityNode>)
             ReflectionHelper.invokeMethodWithoutExceptionWithReturn(
                 activity, "getOwnedNodes", new Class[] {}, new Object[] {});
   }
   return ownedNodes;
 }
  /** @generated */
  protected CommandResult doExecuteWithResultGen(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    JoinNode newElement = UMLFactory.eINSTANCE.createJoinNode();

    Activity owner = (Activity) getElementToEdit();
    owner.getNodes().add(newElement);
    ActivityPartition childHolder = (ActivityPartition) getElementToEdit();
    childHolder.getNodes().add(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
  }
  /** @generated */
  protected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info)
      throws ExecutionException {
    ValueSpecificationAction newElement = UMLFactory.eINSTANCE.createValueSpecificationAction();

    Activity owner = (Activity) getElementToEdit();
    owner.getNodes().add(newElement);

    ElementInitializers.getInstance().init_ValueSpecificationAction_3089(newElement);

    doConfigure(newElement, monitor, info);

    ((CreateElementRequest) getRequest()).setNewElement(newElement);
    return CommandResult.newOKCommandResult(newElement);
  }