use of org.eclipse.core.internal.resources.ResourceException in project mdw-designer by CenturyLinkCloud.
the class WorkflowProjectManager method deleteProject.
public void deleteProject(IProject project) {
WorkflowProject workflowProject = getWorkflowProject(project);
if (workflowProject != null) {
deleteProject(workflowProject);
} else {
try {
project.delete(true, true, null);
} catch (CoreException ex) {
if (ex instanceof ResourceException && ex.getMessage().startsWith("Problems encountered while deleting"))
MessageDialog.openWarning(MdwPlugin.getShell(), "Problems Deleting", "Not all resources under project '" + project.getName() + "' could be deleted.\nPlease delete the project manually on the file system.");
else
PluginMessages.uiError(ex, "Delete Project", workflowProject);
}
}
}
use of org.eclipse.core.internal.resources.ResourceException in project jbosstools-hibernate by jbosstools.
the class HibernateErrorsTest2 method tearDown.
@Override
protected void tearDown() throws Exception {
ccfg.reset();
KnownConfigurations.getInstance().removeAllConfigurations();
// super.tearDown();
waitForJobs();
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().closeAllEditors(false);
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId(// $NON-NLS-1$
"org.eclipse.ui.resourcePerspective"));
waitForJobs();
// getProject().deleteIProject();
// super.tearDown();
final IProject proj = getProject().getIProject();
String projRoot = proj.getLocation().toFile().getAbsolutePath();
File file = new File(projRoot);
deleted = false;
int nTrys = 0;
while (!deleted && nTrys++ < 5) {
ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
public void run(IProgressMonitor monitor) throws CoreException {
try {
proj.delete(true, true, null);
deleted = true;
} catch (ResourceException re) {
// waitForJobs();
delay(1000);
}
}
}, new NullProgressMonitor());
}
waitForJobs();
FilesTransfer.delete(file);
}
Aggregations