Refine search
/** * @return Returns the scheduling rule for this operation */ public ISchedulingRule getScheduleRule() { return ResourcesPlugin.getWorkspace().getRoot(); }
/** * Returns the scheduling rule for creating the element. */ protected ISchedulingRule getSchedulingRule() { return ResourcesPlugin.getWorkspace().getRoot(); // look all by default }
/** * Runs a workspace runnable with the workspace lock. */ public WorkbenchRunnableAdapter(IWorkspaceRunnable runnable) { this(runnable, ResourcesPlugin.getWorkspace().getRoot()); }
/** * @return Returns the scheduling rule for this operation */ public ISchedulingRule getScheduleRule() { return ResourcesPlugin.getWorkspace().getRoot(); }
/** * Returns the workspace root, or <code>null</code>, if the runtime environment is stand-alone. * @return the workspace root, or <code>null</code>. */ public static IWorkspaceRoot getWorkspaceRoot() { if (workspaceRoot == null && IS_RESOURCES_BUNDLE_AVAILABLE && System.getProperty("org.eclipse.emf.ecore.plugin.EcorePlugin.doNotLoadResourcesPlugin") == null) { workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); } return workspaceRoot; }
protected IFile getOldFile(IProgressMonitor pm) throws OperationCanceledException { pm.beginTask("", 1); //$NON-NLS-1$ try { return ResourcesPlugin.getWorkspace().getRoot().getFile(fPath); } finally { pm.done(); } }
@Override protected Object getModelRoot() { if (fModelRoot == null) fModelRoot= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); return fModelRoot; }
/** * {@inheritDoc} */ protected Object getModelRoot() { if (fModelRoot == null) fModelRoot= JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()); return fModelRoot; }
/** * This method will never return null. */ private IResource getDefaultResource() { IResource prj = getProject(); if (prj != null) { return prj; } // return the workspace root return ResourcesPlugin.getWorkspace().getRoot(); }
private void verifyNoWorkspaceRootIsImported(File rootDir, IProgressMonitor monitor) { File workspaceRoot = ResourcesPlugin.getWorkspace().getRoot().getLocation().toFile(); if (rootDir.equals(workspaceRoot)) { throw new UnsupportedConfigurationException(String.format("Project %s location matches workspace root %s", rootDir.getName(), workspaceRoot.getAbsolutePath())); } }
private boolean projectNameAlreadyExistsInWorkspace(final String projectName) { IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects(); return FluentIterable.from(Arrays.asList(projects)).anyMatch(new Predicate<IProject>() { @Override public boolean apply(IProject project) { return projectName.equals(project.getName()); } }); } };
public static IJavaProject getJavaProject(String projectName) { if (projectName == null) { throw new IllegalArgumentException("null projectName"); } IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot(); IJavaModel javaModel = JavaCore.create(workspaceRoot); IJavaProject javaProject = javaModel.getJavaProject(projectName); return javaProject; }
public IProject getProject() { String name = (String) getProperty(PROJECT_NAME); if (name != null && name.length() > 0) return ResourcesPlugin.getWorkspace().getRoot().getProject(name); return null; }
protected void runSaveOperation(IWorkspaceRunnable runnable, IProgressMonitor monitor) throws SaveFailedException { try { ResourcesPlugin.getWorkspace().run(runnable, ResourcesPlugin.getWorkspace().getRoot(), IWorkspace.AVOID_UPDATE, monitor); } catch (CoreException e) { throw new SaveFailedException(e); } }
@Override public final IProject[] getProjects() { final Set<IProject> set= new HashSet<>(); final IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot(); final RefactoringDescriptorProxy[] proxies= fRefactoringHistory.getDescriptors(); for (int index= 0; index < proxies.length; index++) { final String name= proxies[index].getProject(); if (name != null && !"".equals(name)) //$NON-NLS-1$ set.add(root.getProject(name)); } return set.toArray(new IProject[set.size()]); }
/** * @see IJavaModel */ @Override public IJavaProject getJavaProject(String projectName) { return new JavaProject(ResourcesPlugin.getWorkspace().getRoot().getProject(projectName), this); } /**
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; }
private boolean hasClosedProjectsInWorkspace() { IProject[] projects= ResourcesPlugin.getWorkspace().getRoot().getProjects(); for (int i = 0; i < projects.length; i++) { if (!projects[i].isOpen()) return true; } return false; }
/** * This method will save all dirty editors. It will prompt the user if the Compare preference to save * dirty editors before viewing a patch is <code>false</code>. Clients can use this or provide their own * implementation. */ protected void saveAllEditors(){ saveAllEditors = IDE.saveAllEditors(new IResource[]{ResourcesPlugin.getWorkspace().getRoot()}, !ComparePreferencePage.getSaveAllEditors()); }
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; }