本文整理匯總了Java中org.eclipse.core.resources.IProject.delete方法的典型用法代碼示例。如果您正苦於以下問題:Java IProject.delete方法的具體用法?Java IProject.delete怎麽用?Java IProject.delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.core.resources.IProject
的用法示例。
在下文中一共展示了IProject.delete方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testProject
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@Test
public void testProject() throws CoreException, IOException, PgCodekeeperUIException,
InterruptedException{
try(TempDir tempDir = new TempDir(workspacePath.toPath(), "dbSourceProjectTest")){
File dir = tempDir.get().toFile();
// create empty project in temp dir
IProject project = createProjectInWorkspace(dir.getName());
// populate project with data
new ModelExporter(dir, dbPredefined, ApgdiffConsts.UTF_8).exportFull();
project.refreshLocal(IResource.DEPTH_INFINITE, null);
// testing itself
assertEquals("Project name differs", dir.getName(), project.getName());
performTest(DbSource.fromProject(new PgDbProject(project)));
project.delete(false, true, null);
}
}
示例2: deleteProjects
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private static void deleteProjects(final IProject[] projects, StringBuilder error) {
for (final IProject project : projects) {
if (project.exists()) {
try {
project.delete(true, true, new NullProgressMonitor());
} catch (CoreException e) {
error.append(e.getMessage());
}
}
}
}
示例3: deleteProjectPluginResource
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
public void deleteProjectPluginResource(boolean deleteContent, String projectName) throws CoreException {
cacheIProject.remove(projectName);
IWorkspace myWorkspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot myWorkspaceRoot = myWorkspace.getRoot();
IProject resourceProject = myWorkspaceRoot.getProject(projectName);
if (resourceProject.exists()) {
resourceProject.delete(deleteContent, false, null);
}
}
示例4: cleanUp
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
@AfterClass
public static void cleanUp(){
IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
for (IProject iProject : projects) {
try {
iProject.delete(true, true, null);
} catch (CoreException e) {
e.printStackTrace();
}
}
}
示例5: createJavaProject
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
private IJavaProject createJavaProject(String name) throws CoreException {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(name);
if (project.exists())
project.delete(true, null);
project.create(null);
project.open(null);
IProjectDescription description = project.getDescription();
description.setNatureIds(new String[] { JavaCore.NATURE_ID });
project.setDescription(description, null);
IJavaProject javaProject = JavaCore.create(project);
javaProject.setRawClasspath(new IClasspathEntry[] { JavaCore.newVariableEntry(new Path("JRE_LIB"), null, null) }, null);
return javaProject;
}
示例6: createProject
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
protected IProject createProject(IProgressMonitor monitor) {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject(HELLO_WORLD);
try {
if (project.exists())
project.delete(true, monitor);
project.create(monitor);
project.open(monitor);
addNature(project);
} catch (Exception ex) {
ex.printStackTrace();
}
return project;
}
示例7: deleteProject
import org.eclipse.core.resources.IProject; //導入方法依賴的package包/類
/***/
public static void deleteProject(IProject project) throws CoreException {
project.delete(true, true, new NullProgressMonitor());
}