private static File getRawLocationFile(IPath simplePath) { IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(simplePath); File file = null; if (resource != null) { file = ResourcesPlugin.getWorkspace().getRoot().findMember( simplePath).getRawLocation().toFile(); } else { file = simplePath.toFile(); } return file; }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
/** * Helper method - returns the {@link IResource} corresponding to the provided {@link IPath}, * or <code>null</code> if no such resource exists. */ public static IResource getWorkspaceTarget(IPath path) { if (path == null || path.getDevice() != null) return null; IWorkspace workspace = ResourcesPlugin.getWorkspace(); if (workspace == null) return null; return workspace.getRoot().findMember(path); }
private boolean isWorkspacePath(IPath path) { if (path == null || path.getDevice() != null) return false; IWorkspace workspace= ResourcesPlugin.getWorkspace(); if (workspace == null) return false; return workspace.getRoot().findMember(path) != null; }
@Override public IResource getResource() { IPath fullPath= fFileState.getFullPath(); return ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath); } }
/** * gets the container form the specified path * @param path the path to get the container from * @return the container for the specified path or null if one cannot be determined */ private IContainer getContainer(String path) { Path containerPath = new Path(path); return (IContainer) getWorkspaceRoot().findMember(containerPath); }
private String makeAbsolute(String input, ILaunchConfiguration configuration) throws CoreException { IResource member = ResourcesPlugin.getWorkspace().getRoot().findMember(input); if (member != null) { return member.getLocation().toPortableString(); } return input; }
public void refreshFile(File f) throws Exception { String path = toLocal(f); IResource r = ResourcesPlugin.getWorkspace().getRoot().findMember(path); if (r != null) { r.refreshLocal(IResource.DEPTH_INFINITE, null); } }
private IResource getResource() { IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath); if (resource == null && fResourcePath.segmentCount() == 1) { resource= ResourcesPlugin.getWorkspace().getRoot().getProject(fResourcePath.segment(0)); } return resource; }
private IResource getResource() { IResource resource= ResourcesPlugin.getWorkspace().getRoot().findMember(fResourcePath); if (resource == null && fResourcePath.segmentCount() == 1) { resource= ResourcesPlugin.getWorkspace().getRoot().getProject(fResourcePath.segment(0)); } return resource; }
private String getExpandedPath(String path) { if (path == null || path.length() == 0) return null; IResource resource = PDECore.getWorkspace().getRoot().findMember(new Path(path)); if (resource != null) { IPath fullPath = resource.getLocation(); return fullPath == null ? null : fullPath.toOSString(); } return null; }
@Override public void buildDelta(IResourceChangeDescriptionFactory builder) { IResource existing= ResourcesPlugin.getWorkspace().getRoot().findMember(fDestination); if (existing != null && !existing.equals(fResource)) { builder.delete(existing); } builder.copy(fResource, fDestination); } @Override
private IPathVariableManager getManager(IPath workspacePath) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IResource resource = workspaceRoot.findMember(workspacePath); if (resource != null) return resource.getPathVariableManager(); return workspaceRoot.getFile(workspacePath).getPathVariableManager(); }
@Override public void buildDelta(IResourceChangeDescriptionFactory builder) { IResource existing= ResourcesPlugin.getWorkspace().getRoot().findMember(fDestination); if (existing != null && !existing.equals(fResource)) { builder.delete(existing); } builder.move(fResource, fDestination); } @Override
private IPathVariableManager getManager(IPath workspacePath) { IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IResource resource = workspaceRoot.findMember(workspacePath); if (resource != null) return resource.getPathVariableManager(); return workspaceRoot.getFile(workspacePath).getPathVariableManager(); }
private IResource getFile() { String value = text.getText(); if (value.length() == 0) return null; IPath path = getProject().getFullPath().append(value); return getProject().getWorkspace().getRoot().findMember(path); }
@Override public Object getNewElement() { IPath newPath= fProject.getPath().removeLastSegments(1).append(getNewElementName()); return JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().findMember(newPath)); }
@Override public Object getNewElement() { IPath newPath= fProject.getPath().removeLastSegments(1).append(getNewElementName()); return JavaCore.create(ResourcesPlugin.getWorkspace().getRoot().findMember(newPath)); }
static public IResource findWorkspaceResource(IPath path) { IWorkspaceRoot ws = ResourcesPlugin.getWorkspace().getRoot(); IPath wsPath = ws.getLocation(); if (wsPath.isPrefixOf(path)) { path = path.removeFirstSegments(wsPath.segmentCount()); path = path.setDevice(null); } return ws.findMember(path); }
public static class ClasspathResolutionBreakpointListener { public void breakpoint(int bp) { // override in listener implementation } }