@Override public String getValue(String variable, IResource resource) { return resource.getWorkspace().getRoot().getLocationURI().toASCIIString(); } }
@Override public String getValue(String variable, IResource resource) { return resource.getWorkspace().getRoot().getLocationURI().toASCIIString(); } }
@Override public String getValue(String variable, IResource resource) { return resource.getWorkspace().getRoot().getLocationURI().toASCIIString(); } }
private static URI getRealLocation(String projectName, URI location) { if (location == null) { // inside workspace try { URI rootLocation= ResourcesPlugin.getWorkspace().getRoot().getLocationURI(); location= new URI(rootLocation.getScheme(), null, Path.fromPortableString(rootLocation.getPath()).append(projectName).toString(), null); } catch (URISyntaxException e) { Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$ } } return location; }
private static URI getRealLocation(String projectName, URI location) { if (location == null) { // inside workspace try { URI rootLocation= ResourcesPlugin.getWorkspace().getRoot().getLocationURI(); location= new URI(rootLocation.getScheme(), null, Path.fromPortableString(rootLocation.getPath()).append(projectName).toString(), null); } catch (URISyntaxException e) { Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$ } } return location; }
private static URI getRealLocation(String projectName, URI location) { URI theLocation = location; // Test if the project is inside workspace if (theLocation == null) { try { final URI rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocationURI(); theLocation = new URI(rootLocation.getScheme(), null, Path.fromPortableString( rootLocation.getPath()).append(projectName).toString(), null); } catch (URISyntaxException e) { Assert.isTrue(false, "Can't happen"); //$NON-NLS-1$ } } return theLocation; }
public static void createProject(IProject project, URI locationURI, IProgressMonitor monitor) throws CoreException { if (monitor == null) { monitor= new NullProgressMonitor(); } monitor.beginTask(NewWizardMessages.BuildPathsBlock_operationdesc_project, 10); // create the project try { if (!project.exists()) { IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName()); if (locationURI != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(locationURI)) { locationURI= null; } desc.setLocationURI(locationURI); project.create(desc, monitor); monitor= null; } if (!project.isOpen()) { project.open(monitor); monitor= null; } } finally { if (monitor != null) { monitor.done(); } } }
public static void createProject(IProject project, URI locationURI, IProgressMonitor monitor) throws CoreException { if (monitor == null) { monitor= new NullProgressMonitor(); } monitor.beginTask(NewWizardMessages.BuildPathsBlock_operationdesc_project, 10); // create the project try { if (!project.exists()) { IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName()); if (locationURI != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(locationURI)) { locationURI= null; } desc.setLocationURI(locationURI); project.create(desc, monitor); monitor= null; } if (!project.isOpen()) { project.open(monitor); monitor= null; } } finally { if (monitor != null) { monitor.done(); } } }
public static void createProject(IProject project, URI locationURI, IProgressMonitor monitor) throws CoreException { if (monitor == null) { monitor= new NullProgressMonitor(); } monitor.beginTask(NewWizardMessages.BuildPathsBlock_operationdesc_project, 10); // create the project try { if (!project.exists()) { IProjectDescription desc= project.getWorkspace().newProjectDescription(project.getName()); if (locationURI != null && ResourcesPlugin.getWorkspace().getRoot().getLocationURI().equals(locationURI)) { locationURI= null; } desc.setLocationURI(locationURI); project.create(desc, monitor); monitor= null; } if (!project.isOpen()) { project.open(monitor); monitor= null; } } finally { if (monitor != null) { monitor.done(); } } }
public IWorkspace investigate(final IProgressMonitor monitor, final ICanceler canceler) throws JavaModelException, InterruptedException { this.nameHitMaps.reset(); final URI locationURI = this.model.getWorkspace().getRoot().getLocationURI(); final WorkspaceBuilder builder = new WorkspaceBuilder(locationURI); // addLibraries(builder); if (canceler.isCanceled()) { throw new InterruptedException(); } addProjects(monitor, canceler, builder); addDependencies(monitor, canceler, builder); monitor.subTask("build dependencies"); //$NON-NLS-1$ final IWorkspace workspace = builder.build(); return workspace; }
projectName = uri.segment(1); } else { final URI workspaceRootURI = URI.createURI(URI.decode(workspaceRoot.getLocationURI() .toString())); URI workspaceRelative = uri.deresolve(workspaceRootURI);
if (fCurrProjectLocation == null) { // inside workspace try { URI rootLocation= ResourcesPlugin.getWorkspace().getRoot().getLocationURI(); realLocation= new URI(rootLocation.getScheme(), null, Path.fromPortableString(rootLocation.getPath()).append(fCurrProject.getName()).toString(),