private void moveEntity(BpelEntity movingEntity, BpelContainer parent) {
    if (movingEntity == null || parent == null) {
      return;
    }

    if (parent instanceof ScopeHolder) {
      // TODO m
      //            BpelContainer dad = parent.getParent();
      //            if ( dad != null ) {
      //                if (dad instanceof CompositeActivity ) {
      //                    int scopeHolderIndex = getChildIndex(parent
      //                                                , (CompositeActivity) dad);
      //                    BpelEntity movingEntityCopy = movingEntity.cut();
      //                    ((CompositeActivity)dad).insertActivity(
      //                            (ExtendableActivity) movingEntityCopy
      //                            , scopeHolderIndex);
      //                }
      //            }

    } else if (parent instanceof CompositeActivity) {
      int childIndex = EditorUtil.getChildIndex(movingEntity, (CompositeActivity) parent);
      // TODO m
      if (childIndex > 0) {
        BpelEntity movingEntityCopy = movingEntity.cut();
        ((CompositeActivity) parent)
            .insertActivity((ExtendableActivity) movingEntityCopy, childIndex - 1);
      } else if (childIndex == 0) {
        // TODO m
        //                System.out.println("childIndex == 0");
      }
    } else if (parent instanceof ActivityHolder && !(parent instanceof Process)) {
    }
  }
  private boolean isMoveable(BpelEntity entity, BpelContainer parent) {
    if (entity == null || parent == null) {
      return false;
    }
    boolean canMove = false;

    if (parent instanceof ScopeHolder) {
      // TODO m
      canMove = false;
    } else if (parent instanceof CompositeActivity) {
      int childIndex = EditorUtil.getChildIndex(entity, (CompositeActivity) parent);
      if (childIndex > 0) {
        canMove = true;
      } else if (childIndex == 0) {
        // todo m
        canMove = false;
        //                BpelContainer dad = parent.getParent();
        //                canMove = dad != null && ! (dad instanceof Process);
      }

    } else if (parent instanceof ActivityHolder && !(parent instanceof Process)) {
      // TODO m
      canMove = false;
    }

    return canMove;
  }
Beispiel #3
0
  @Override
  protected final Component getRoot(DataObject data) {
    BpelModel model = EditorUtil.getBpelModel(data);

    if (model == null) {
      return null;
    }
    return model.getProcess();
  }
Beispiel #4
0
 @Override
 protected final void gotoVisual(Component component) {
   EditorUtil.goToDesign((BpelEntity) component);
 }
Beispiel #5
0
 @Override
 protected void gotoSource(Component component) {
   EditorUtil.goToSource((BpelEntity) component);
 }
Beispiel #6
0
 @Override
 protected final Icon getIcon(Component component) {
   return EditorUtil.getIcon(component);
 }