/** * Creates a new composite change with the given name and array * of children. * * @param name the human readable name of the change. Will * be used to display the change in the user interface * @param children the initial array of children */ public CompositeChange(String name, Change[] children) { this(name, new ArrayList<Change>(children.length)); addAll(children); }
/** * Creates a new composite change with the given name and array * of children. * * @param name the human readable name of the change. Will * be used to display the change in the user interface * @param children the initial array of children */ public CompositeChange(String name, Change[] children) { this(name, new ArrayList(children.length)); addAll(children); }
/** * Creates a new composite change with the given name and array * of children. * * @param name the human readable name of the change. Will * be used to display the change in the user interface * @param children the initial array of children */ public CompositeChange(String name, Change[] children) { this(name, new ArrayList<Change>(children.length)); addAll(children); }
public Change createCompositeChange(String name, IProgressMonitor monitor) { SubMonitor progress = SubMonitor.convert(monitor, document2textEdits.keySet().size() + document2change.keySet().size()); if(document2change.isEmpty() && document2textEdits.isEmpty()) return null; CompositeChange compositeChange = new FixedCompositeChange(name); for (IRefactoringDocument document : document2textEdits.keySet()) { Iterable<TextEdit> textEdits = document2textEdits.get(document); MultiTextEdit multiTextEdit = new MultiTextEdit(); for (TextEdit textEdit : textEdits) { multiTextEdit.addChild(textEdit); } Change change = document.createChange(name, multiTextEdit); compositeChange.add(change); progress.worked(1); } for (IRefactoringDocument document : document2change.keySet()) { Iterable<Change> documentChanges = document2change.get(document); CompositeChange documentCompositeChange = new FixedCompositeChange(name); documentCompositeChange.addAll(Iterables.toArray(documentChanges, Change.class)); compositeChange.add(documentCompositeChange); progress.worked(1); } return compositeChange; }
protected void changeExtensionPoint(CompositeChange compositeChange, IProgressMonitor monitor) { IFile file = getModificationFile(fInfo.getBase()); if (file != null) compositeChange.addAll(PDEModelUtility.changesForModelModication(getExtensionPointModification(file), monitor)); }
private void findReferences(CompositeChange compositeChange, IProgressMonitor monitor) { String pointId = getId(); IPluginModelBase[] bases = PDECore.getDefault().getExtensionsRegistry().findExtensionPlugins(pointId, true); SubMonitor subMonitor = SubMonitor.convert(monitor, bases.length); for (int i = 0; i < bases.length; i++) { IFile file = getModificationFile(bases[i]); if (file != null) { compositeChange.addAll(PDEModelUtility.changesForModelModication(getExtensionModification(file), subMonitor.split(1))); } subMonitor.setWorkRemaining(bases.length - i); } }
@Override public Change createChange(IProgressMonitor pm) throws CoreException, OperationCanceledException { CompositeChange change = new CompositeChange(MessageFormat.format(PDEUIMessages.RenamePluginProcessor_changeTitle, fInfo.getCurrentValue(), fInfo.getNewValue())); SubMonitor subMonitor = SubMonitor.convert(pm, getTotalWork()); // update manifest with new Id CreateHeaderChangeOperation op = new CreateHeaderChangeOperation(fInfo.getBase(), Constants.BUNDLE_SYMBOLICNAME, fInfo.getCurrentValue(), fInfo.getNewValue()); op.run(subMonitor.split(1)); change.add(op.getChange()); if (fInfo.isRenameProject()) { change.add(createProjectChange(subMonitor.split( 1))); } if (fInfo.isUpdateReferences()) change.addAll(createReferenceChanges(subMonitor.split(2))); return change; }
result.addAll(op.getChanges()); return result;