use of eu.esdihumboldt.hale.ui.service.report.ReportService in project hale by halestudio.
the class ProjectServiceImpl method internalClean.
private boolean internalClean() {
if (!changeCheck()) {
return false;
}
// reset current session descriptor
ReportService repService = PlatformUI.getWorkbench().getService(ReportService.class);
repService.updateCurrentSessionDescription();
// clean
final IRunnableWithProgress op = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
ATransaction trans = log.begin("Clean project");
CleanupService cs = HalePlatform.getService(CleanupService.class);
if (cs != null) {
cs.triggerProjectCleanup();
}
monitor.beginTask("Clean project", IProgressMonitor.UNKNOWN);
try {
synchronized (this) {
main = createDefaultProject();
projectFile = null;
projectLocation = null;
changed = false;
projectLoadContentType = null;
temporarySettings.clear();
}
updateWindowTitle();
notifyClean();
// schemas aren't valid anymore, clear property resolver
// cache
PropertyResolver.clearCache();
} finally {
monitor.done();
trans.end();
}
// clean workbench history AFTER other cleans since they can
// create operations
IWorkbenchOperationSupport os = PlatformUI.getWorkbench().getOperationSupport();
os.getOperationHistory().dispose(os.getUndoContext(), true, true, false);
// suppress the status being set to changed by the clean
synchronized (ProjectServiceImpl.this) {
changed = false;
}
updateWindowTitle();
}
};
try {
ThreadProgressMonitor.runWithProgressDialog(op, false);
} catch (Exception e) {
log.error("Error cleaning the project.", e);
}
return true;
}
Aggregations