Search in sources :

Example 16 with IPath

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));
    }
}
Also used : IPath(org.eclipse.core.runtime.IPath) ArrayList(java.util.ArrayList)

Example 17 with IPath

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);
}
Also used : IPath(org.eclipse.core.runtime.IPath)

Example 18 with IPath

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);
}
Also used : IPath(org.eclipse.core.runtime.IPath)

Example 19 with IPath

use of org.eclipse.core.runtime.IPath in project che by eclipse.

the class FileUndoState method createResourceHandle.

public IResource createResourceHandle() {
    IWorkspaceRoot workspaceRoot = parent.getWorkspace().getRoot();
    IPath fullPath = parent.getFullPath().append(name);
    return workspaceRoot.getFile(fullPath);
}
Also used : IWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot) IPath(org.eclipse.core.runtime.IPath)

Example 20 with IPath

use of org.eclipse.core.runtime.IPath in project che by eclipse.

the class FolderUndoState method createResourceHandle.

public IResource createResourceHandle() {
    IWorkspaceRoot workspaceRoot = getWorkspace().getRoot();
    IPath folderPath = parent.getFullPath().append(name);
    return workspaceRoot.getFolder(folderPath);
}
Also used : IWorkspaceRoot(org.eclipse.core.resources.IWorkspaceRoot) IPath(org.eclipse.core.runtime.IPath)

Aggregations

IPath (org.eclipse.core.runtime.IPath)500 Path (org.eclipse.core.runtime.Path)128 File (java.io.File)106 IFile (org.eclipse.core.resources.IFile)89 IResource (org.eclipse.core.resources.IResource)80 CoreException (org.eclipse.core.runtime.CoreException)74 ArrayList (java.util.ArrayList)72 IFolder (org.eclipse.core.resources.IFolder)63 IProject (org.eclipse.core.resources.IProject)60 IOException (java.io.IOException)57 IClasspathEntry (org.eclipse.jdt.core.IClasspathEntry)51 IWorkspaceRoot (org.eclipse.core.resources.IWorkspaceRoot)40 IStatus (org.eclipse.core.runtime.IStatus)33 IJavaProject (org.eclipse.jdt.core.IJavaProject)33 URL (java.net.URL)26 InputStream (java.io.InputStream)23 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)23 Status (org.eclipse.core.runtime.Status)23 HashSet (java.util.HashSet)22 Test (org.junit.Test)22