コード例 #1
0
ファイル: Model.java プロジェクト: eclipse/vjet.dltk
 /** Configures and runs the <code>MultiOperation</code>. */
 protected void runOperation(
     MultiOperation op,
     IModelElement[] elements,
     IModelElement[] siblings,
     String[] renamings,
     IProgressMonitor monitor)
     throws ModelException {
   op.setRenamings(renamings);
   if (siblings != null) {
     for (int i = 0; i < elements.length; i++) {
       op.setInsertBefore(elements[i], siblings[i]);
     }
   }
   op.runOperation(monitor);
 }
コード例 #2
0
ファイル: Model.java プロジェクト: eclipse/vjet.dltk
  public void rename(
      IModelElement[] elements,
      IModelElement[] destinations,
      String[] renamings,
      boolean force,
      IProgressMonitor monitor)
      throws ModelException {
    MultiOperation op;
    if (elements != null
        && elements.length > 0
        && elements[0] != null
        && elements[0].getElementType() < IModelElement.TYPE) {
      op = new RenameResourceElementsOperation(elements, destinations, renamings, force);
    } else {
      op = new RenameElementsOperation(elements, destinations, renamings, force);
    }

    op.runOperation(monitor);
  }