use of eu.esdihumboldt.hale.ui.service.project.internal.AbstractRemoveResourcesOperation in project hale by halestudio.
the class OrientInstanceService method clearInstances.
/**
* @see InstanceService#clearInstances()
*/
@Override
public void clearInstances() {
IUndoableOperation operation = new AbstractRemoveResourcesOperation("Clear source data", InstanceService.ACTION_READ_SOURCEDATA) {
/**
* @see eu.esdihumboldt.hale.ui.service.project.internal.AbstractRemoveResourcesOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
* org.eclipse.core.runtime.IAdaptable)
*/
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
notifyDatasetAboutToChange(null);
source.clear();
transformed.clear();
notifyDatasetChanged(null);
return super.execute(monitor, info);
}
};
IWorkbenchOperationSupport operationSupport = PlatformUI.getWorkbench().getOperationSupport();
operation.addContext(operationSupport.getUndoContext());
try {
operationSupport.getOperationHistory().execute(operation, null, null);
} catch (ExecutionException e) {
log.error("Error executing operation on instance service", e);
}
}
use of eu.esdihumboldt.hale.ui.service.project.internal.AbstractRemoveResourcesOperation in project hale by halestudio.
the class SchemaServiceImpl method clearSchemas.
/**
* @see SchemaService#clearSchemas(SchemaSpaceID)
*/
@Override
public void clearSchemas(final SchemaSpaceID spaceID) {
Preconditions.checkNotNull(spaceID);
IUndoableOperation operation = new AbstractRemoveResourcesOperation("Clear " + (spaceID == SchemaSpaceID.SOURCE ? "source" : "target") + " schema", spaceID == SchemaSpaceID.SOURCE ? ACTION_READ_SOURCE : ACTION_READ_TARGET) {
/**
* @see eu.esdihumboldt.hale.ui.service.project.internal.AbstractRemoveResourcesOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
* org.eclipse.core.runtime.IAdaptable)
*/
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
synchronized (spaces) {
spaces.remove(spaceID);
}
notifySchemasCleared(spaceID);
return super.execute(monitor, info);
}
};
IWorkbenchOperationSupport operationSupport = PlatformUI.getWorkbench().getOperationSupport();
operation.addContext(operationSupport.getUndoContext());
try {
operationSupport.getOperationHistory().execute(operation, null, null);
} catch (ExecutionException e) {
log.error("Error executing operation on schema service", e);
}
}
Aggregations