コード例 #1
0
  public static void refreshTreeItem(EObject element) {
    WorkflowModelEditor editor =
        GenericUtils.getWorkflowModelEditor(ModelUtils.findContainingModel(element));
    if (editor == null) {
      return;
    }
    WorkflowModelOutlinePage outlinePage = (WorkflowModelOutlinePage) editor.getOutlinePage();

    if (outlinePage != null) {
      // because of SVN creates file after the label was refreshed, we refresh again
      AbstractEObjectTreeEditPart treeEditPart =
          (AbstractEObjectTreeEditPart) outlinePage.getEditPart(element);
      if (treeEditPart != null) {
        Widget widget = treeEditPart.getWidget();
        if (widget != null && !widget.isDisposed()) {
          treeEditPart.refresh();
        }
      }
    }
  }
コード例 #2
0
  public void run() {
    IModelParticipant performer = null;
    AttributeType auxiliaryAttr =
        AttributeUtil.getAttribute(activity, PredefinedConstants.ACTIVITY_IS_AUXILIARY_ATT);

    CompoundCommand cmd = new CompoundCommand();
    cmd.add(ActivityCommandFactory.getSetImplementationCommand(implType, activity));
    if (implType.equals(ActivityImplementationType.MANUAL_LITERAL)) {
      performer = GenericUtils.getLanePerformerForActivity(activity);

      if (performer != null) {
        cmd.add(
            new SetValueCmd(
                activity,
                CarnotWorkflowModelPackage.eINSTANCE.getActivityType_Performer(),
                performer));
      }
    }

    if (!ActivityUtil.isInteractive(activity, implType) && activity.getPerformer() != null) {
      cmd.add(
          new SetValueCmd(
              activity, CarnotWorkflowModelPackage.eINSTANCE.getActivityType_Performer(), null));
    }
    if (!implType.equals(ActivityImplementationType.APPLICATION_LITERAL)
        && activity.getApplication() != null) {
      cmd.add(
          new SetValueCmd(
              activity, CarnotWorkflowModelPackage.eINSTANCE.getActivityType_Application(), null));
    }

    if (auxiliaryAttr != null) {
      cmd.add(
          new DeleteValueCmd(
              auxiliaryAttr.eContainer(), auxiliaryAttr, auxiliaryAttr.eContainingFeature()));
    }
    domain.getCommandStack().execute(cmd);
  }