use of org.eclipse.core.resources.IProject in project che by eclipse.
the class RenameJavaProjectChange method doRename.
@Override
protected void doRename(IProgressMonitor pm) throws CoreException {
try {
pm.beginTask(getName(), 2);
if (fUpdateReferences)
modifyClassPaths(new SubProgressMonitor(pm, 1));
IProject project = getProject();
if (project != null) {
IProjectDescription description = project.getDescription();
description.setName(getNewName());
project.move(description, IResource.FORCE | IResource.SHALLOW, new SubProgressMonitor(pm, 1));
}
} finally {
pm.done();
}
}
use of org.eclipse.core.resources.IProject in project che by eclipse.
the class RefactoringScopeFactory method addReferencingProjects.
/*
* Adds to <code> projects </code> IJavaProject objects for all projects directly or indirectly referencing focus. @param projects IJavaProjects will be added to this set
*/
private static void addReferencingProjects(IJavaProject focus, Set<IJavaProject> projects) throws JavaModelException {
IProject[] referencingProjects = focus.getProject().getReferencingProjects();
for (int i = 0; i < referencingProjects.length; i++) {
IJavaProject candidate = JavaCore.create(referencingProjects[i]);
if (candidate == null || projects.contains(candidate) || !candidate.exists())
// break cycle
continue;
IClasspathEntry entry = getReferencingClassPathEntry(candidate, focus);
if (entry != null) {
projects.add(candidate);
if (entry.isExported())
addReferencingProjects(candidate, projects);
}
}
}
use of org.eclipse.core.resources.IProject in project che by eclipse.
the class QualifiedNameFinder method createScope.
private static TextSearchScope createScope(String filePatterns, IProject root) {
HashSet<IProject> res = new HashSet<IProject>();
res.add(root);
addReferencingProjects(root, res);
IResource[] resArr = res.toArray(new IResource[res.size()]);
Pattern filePattern = getFilePattern(filePatterns);
return TextSearchScope.newSearchScope(resArr, filePattern, false);
}
use of org.eclipse.core.resources.IProject in project generator by mybatis.
the class WorkspaceUtilities method createProject.
private static IProject createProject(String projectName) throws CoreException {
final IProject project = getWorkspaceRoot().getProject(projectName);
IWorkspaceRunnable create = new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
project.create(null);
project.open(null);
}
};
getWorkspace().run(create, null);
return project;
}
use of org.eclipse.core.resources.IProject in project generator by mybatis.
the class WorkspaceUtilities method addJavaNature.
private static void addJavaNature(String projectName) throws CoreException {
IProject project = getWorkspaceRoot().getProject(projectName);
IProjectDescription description = project.getDescription();
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
project.setDescription(description, null);
}
Aggregations