use of org.eclipse.core.resources.IProject in project che by eclipse.
the class ClasspathManagerTest method testDownloadSources.
@Test
public void testDownloadSources() throws Exception {
String pom = "<groupId>test</groupId>" + "<artifactId>testArtifact</artifactId>" + "<version>42</version>" + "<dependencies>" + " <dependency>" + " <groupId>junit</groupId>" + " <artifactId>junit</artifactId>" + " <version>4.12</version>" + " </dependency>" + "</dependencies>";
createTestProject("test", pom);
IProject test = ResourcesPlugin.getWorkspace().getRoot().getProject("test");
mavenWorkspace.update(Collections.singletonList(test));
mavenWorkspace.waitForUpdate();
boolean downloadSources = classpathManager.downloadSources(test.getFullPath().toOSString(), "org.junit.Test");
assertTrue(downloadSources);
}
use of org.eclipse.core.resources.IProject in project che by eclipse.
the class Checks method isClasspathDelete.
public static boolean isClasspathDelete(IPackageFragmentRoot pkgRoot) {
IResource res = pkgRoot.getResource();
if (res == null)
return true;
IProject definingProject = res.getProject();
if (res.getParent() != null && pkgRoot.isArchive() && !res.getParent().equals(definingProject))
return true;
IProject occurringProject = pkgRoot.getJavaProject().getProject();
return !definingProject.equals(occurringProject);
}
use of org.eclipse.core.resources.IProject in project che by eclipse.
the class TextMatchUpdater method updateTextMatches.
private void updateTextMatches(IProgressMonitor pm) throws JavaModelException {
try {
IProject[] projectsInScope = getProjectsInScope();
//$NON-NLS-1$
pm.beginTask("", projectsInScope.length);
for (int i = 0; i < projectsInScope.length; i++) {
if (pm.isCanceled())
throw new OperationCanceledException();
addTextMatches(projectsInScope[i], new SubProgressMonitor(pm, 1));
}
} finally {
pm.done();
}
}
use of org.eclipse.core.resources.IProject in project che by eclipse.
the class RefactoringModifications method getClasspathFile.
protected IFile getClasspathFile(IResource resource) {
IProject project = resource.getProject();
if (project == null)
return null;
//$NON-NLS-1$
IResource result = project.findMember(".classpath");
if (result instanceof IFile)
return (IFile) result;
return null;
}
use of org.eclipse.core.resources.IProject in project jop by jop-devel.
the class JOPUIUtils method setProjectSetting.
public static void setProjectSetting(ILaunchConfiguration configuration, String key, String value) {
String projectName = getProjectName(configuration);
if (projectName == null) {
return;
}
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectName);
IScopeContext scopeContext = new ProjectScope(project);
Preferences projectPrefs = scopeContext.getNode(IJOPUIConstants.PLUGIN_ID);
projectPrefs.put(key, value);
}
Aggregations