/** 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); }
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); }
/** * @see MultiOperation Overridden to allow special processing of <code>JavaElementDelta</code>s * and <code>fResultElements</code>. */ protected void processElements() throws JavaModelException { this.createdElements = new ArrayList(this.elementsToProcess.length); try { super.processElements(); } catch (JavaModelException jme) { throw jme; } finally { this.resultElements = new IJavaElement[this.createdElements.size()]; this.createdElements.toArray(this.resultElements); processDeltas(); } }