use of org.eclipse.ltk.core.refactoring.participants.RenameArguments in project che by eclipse.
the class RenameResourceProcessor method checkFinalConditions.
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
*/
public RefactoringStatus checkFinalConditions(IProgressMonitor pm, CheckConditionsContext context) throws CoreException {
//$NON-NLS-1$
pm.beginTask("", 1);
try {
fRenameArguments = new RenameArguments(getNewResourceName(), isUpdateReferences());
ResourceChangeChecker checker = (ResourceChangeChecker) context.getChecker(ResourceChangeChecker.class);
IResourceChangeDescriptionFactory deltaFactory = checker.getDeltaFactory();
ResourceModifications.buildMoveDelta(deltaFactory, fResource, fRenameArguments);
return new RefactoringStatus();
} finally {
pm.done();
}
}
use of org.eclipse.ltk.core.refactoring.participants.RenameArguments in project che by eclipse.
the class ResourceModifications method getParticipants.
public RefactoringParticipant[] getParticipants(RefactoringStatus status, RefactoringProcessor processor, String[] natures, SharableParticipants shared) {
List result = new ArrayList(5);
if (fDelete != null) {
DeleteArguments arguments = new DeleteArguments();
for (Iterator iter = fDelete.iterator(); iter.hasNext(); ) {
DeleteParticipant[] deletes = ParticipantManager.loadDeleteParticipants(status, processor, iter.next(), arguments, natures, shared);
result.addAll(Arrays.asList(deletes));
}
}
if (fCreate != null) {
CreateArguments arguments = new CreateArguments();
for (Iterator iter = fCreate.iterator(); iter.hasNext(); ) {
CreateParticipant[] creates = ParticipantManager.loadCreateParticipants(status, processor, iter.next(), arguments, natures, shared);
result.addAll(Arrays.asList(creates));
}
}
if (fMove != null) {
for (int i = 0; i < fMove.size(); i++) {
Object element = fMove.get(i);
MoveArguments arguments = (MoveArguments) fMoveArguments.get(i);
MoveParticipant[] moves = ParticipantManager.loadMoveParticipants(status, processor, element, arguments, natures, shared);
result.addAll(Arrays.asList(moves));
}
}
if (fCopy != null) {
for (int i = 0; i < fCopy.size(); i++) {
Object element = fCopy.get(i);
CopyArguments arguments = (CopyArguments) fCopyArguments.get(i);
CopyParticipant[] copies = ParticipantManager.loadCopyParticipants(status, processor, element, arguments, natures, shared);
result.addAll(Arrays.asList(copies));
}
}
if (fRename != null) {
for (int i = 0; i < fRename.size(); i++) {
Object resource = fRename.get(i);
RenameArguments arguments = (RenameArguments) fRenameArguments.get(i);
RenameParticipant[] renames = ParticipantManager.loadRenameParticipants(status, processor, resource, arguments, natures, shared);
result.addAll(Arrays.asList(renames));
}
}
return (RefactoringParticipant[]) result.toArray(new RefactoringParticipant[result.size()]);
}
use of org.eclipse.ltk.core.refactoring.participants.RenameArguments in project che by eclipse.
the class RenamePackageProcessor method computeRenameModifications.
@Override
protected RenameModifications computeRenameModifications() throws CoreException {
RenameModifications result = new RenameModifications();
result.rename(fPackage, new RenameArguments(getNewElementName(), getUpdateReferences()), fRenameSubpackages);
return result;
}
use of org.eclipse.ltk.core.refactoring.participants.RenameArguments in project che by eclipse.
the class RenameTypeParameterProcessor method computeRenameModifications.
@Override
protected RenameModifications computeRenameModifications() throws CoreException {
RenameModifications result = new RenameModifications();
result.rename(fTypeParameter, new RenameArguments(getNewElementName(), getUpdateReferences()));
return result;
}
use of org.eclipse.ltk.core.refactoring.participants.RenameArguments in project bndtools by bndtools.
the class PkgRenameParticipant method initialize.
@Override
protected boolean initialize(Object element) {
IPackageFragment pkgFragment = (IPackageFragment) element;
RenameArguments args = getArguments();
pkgFragments.put(pkgFragment, args);
StringBuilder sb = new StringBuilder(256);
sb.append("Bndtools: rename package '");
sb.append(pkgFragment.getElementName());
sb.append("' ");
if (((RenamePackageProcessor) this.getProcessor()).getRenameSubpackages())
sb.append("and subpackages ");
sb.append("to '");
sb.append(args.getNewName());
sb.append("'");
changeTitle = sb.toString();
return true;
}
Aggregations