use of org.eclipse.core.runtime.IPath in project che by eclipse.
the class MoveResourcesRefactoringContribution method retrieveArgumentMap.
/* (non-Javadoc)
* @see org.eclipse.ltk.core.refactoring.RefactoringContribution#retrieveArgumentMap(org.eclipse.ltk.core.refactoring.RefactoringDescriptor)
*/
public Map retrieveArgumentMap(final RefactoringDescriptor descriptor) {
HashMap map = new HashMap();
if (descriptor instanceof MoveResourcesDescriptor) {
MoveResourcesDescriptor moveDescriptor = (MoveResourcesDescriptor) descriptor;
IPath[] paths = moveDescriptor.getResourcePathsToMove();
String project = moveDescriptor.getProject();
IPath destinationPath = moveDescriptor.getDestinationPath();
map.put(ATTRIBUTE_NUMBER_OF_RESOURCES, String.valueOf(paths.length));
for (int i = 0; i < paths.length; i++) {
map.put(ATTRIBUTE_ELEMENT + (i + 1), ResourceProcessors.resourcePathToHandle(project, paths[i]));
}
map.put(ATTRIBUTE_DESTINATION, ResourceProcessors.resourcePathToHandle(project, destinationPath));
//$NON-NLS-1$//$NON-NLS-2$
map.put(ATTRIBUTE_UPDATE_REFERENCES, moveDescriptor.isUpdateReferences() ? "true" : "false");
return map;
}
return null;
}
use of org.eclipse.core.runtime.IPath in project che by eclipse.
the class ResourceModifications method addMove.
/**
* Adds the given resource to the list of resources
* to be moved.
*
* @param move the resource to be moved
* @param arguments the move arguments
*/
public void addMove(IResource move, MoveArguments arguments) {
if (fMove == null) {
fMove = new ArrayList(2);
fMoveArguments = new ArrayList(2);
}
fMove.add(move);
fMoveArguments.add(arguments);
if (fIgnoreCount == 0) {
IPath destination = ((IResource) arguments.getDestination()).getFullPath().append(move.getName());
internalAdd(new MoveDescription(move, destination));
}
}
use of org.eclipse.core.runtime.IPath in project che by eclipse.
the class ResourceModifications method addRename.
/**
* Adds the given resource to the list of renamed
* resources.
*
* @param rename the resource to be renamed
* @param arguments the arguments of the rename
*/
public void addRename(IResource rename, RenameArguments arguments) {
Assert.isNotNull(rename);
Assert.isNotNull(arguments);
if (fRename == null) {
fRename = new ArrayList(2);
fRenameArguments = new ArrayList(2);
}
fRename.add(rename);
fRenameArguments.add(arguments);
if (fIgnoreCount == 0) {
IPath newPath = rename.getFullPath().removeLastSegments(1).append(arguments.getNewName());
internalAdd(new MoveDescription(rename, newPath));
}
}
use of org.eclipse.core.runtime.IPath in project che by eclipse.
the class ResourceModifications method buildCopyDelta.
public static void buildCopyDelta(IResourceChangeDescriptionFactory builder, IResource resource, CopyArguments args) {
IPath destination = ((IResource) args.getDestination()).getFullPath().append(resource.getName());
builder.copy(resource, destination);
}
use of org.eclipse.core.runtime.IPath in project che by eclipse.
the class ResourceModifications method buildMoveDelta.
public static void buildMoveDelta(IResourceChangeDescriptionFactory builder, IResource resource, MoveArguments args) {
IPath destination = ((IResource) args.getDestination()).getFullPath().append(resource.getName());
builder.move(resource, destination);
}
Aggregations