use of eu.esdihumboldt.hale.ui.service.instance.InstanceService in project hale by halestudio.
the class ProjectServiceImpl method reloadSourceData.
@Override
public void reloadSourceData() {
IRunnableWithProgress op = new IRunnableWithProgress() {
@Override
public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
monitor.beginTask("Reload source data", IProgressMonitor.UNKNOWN);
monitor.subTask("Clear loaded instances");
// drop the existing instances
InstanceService is = PlatformUI.getWorkbench().getService(InstanceService.class);
is.dropInstances();
// reload the instances
for (IOConfiguration conf : main.getResources()) {
if (InstanceIO.ACTION_LOAD_SOURCE_DATA.equals(conf.getActionId())) {
executeConfiguration(conf);
}
}
monitor.done();
}
};
try {
ThreadProgressMonitor.runWithProgressDialog(op, false);
} catch (Exception e) {
log.error("Executing data reload failed", e);
}
}
Aggregations