use of org.eclipse.ui.operations.IWorkbenchOperationSupport in project hale by halestudio.
the class AlignmentServiceUndoSupport method executeOperation.
/**
* Execute an operation.
*
* @param operation the operation to execute
*/
protected void executeOperation(IUndoableOperation operation) {
IWorkbenchOperationSupport operationSupport = PlatformUI.getWorkbench().getOperationSupport();
// service is workbench wide, so the operation should also be workbench
// wide
operation.addContext(operationSupport.getUndoContext());
// operation.addContext(new ObjectUndoContext(alignmentService, "Alignment service"));
try {
// OperationHistoryFactory.getOperationHistory().execute(operation, null, null);
operationSupport.getOperationHistory().execute(operation, null, null);
} catch (ExecutionException e) {
log.error("Error executing operation on alignment service", e);
}
}
use of org.eclipse.ui.operations.IWorkbenchOperationSupport in project hale by halestudio.
the class EntityDefinitionServiceUndoSupport method editConditionContext.
/**
* @see eu.esdihumboldt.hale.ui.service.entity.internal.EntityDefinitionServiceDecorator#editConditionContext(eu.esdihumboldt.hale.common.align.model.EntityDefinition,
* eu.esdihumboldt.hale.common.instance.model.Filter)
*/
@Override
public EntityDefinition editConditionContext(EntityDefinition sibling, Filter filter) {
ICompositeOperation operation = new CompositeOperation("Edit condition context");
IWorkbenchOperationSupport operationSupport = PlatformUI.getWorkbench().getOperationSupport();
operation.addContext(operationSupport.getUndoContext());
operationSupport.getOperationHistory().openOperation(operation, IOperationHistory.EXECUTE);
EntityDefinition result = super.editConditionContext(sibling, filter);
operationSupport.getOperationHistory().closeOperation(result != null, true, IOperationHistory.EXECUTE);
return result;
}
use of org.eclipse.ui.operations.IWorkbenchOperationSupport in project hale by halestudio.
the class SchemaServiceImpl method toggleMappable.
/**
* @see eu.esdihumboldt.hale.ui.service.schema.SchemaService#toggleMappable(eu.esdihumboldt.hale.common.schema.SchemaSpaceID,
* java.util.Collection)
*/
@Override
public void toggleMappable(SchemaSpaceID spaceID, Collection<? extends TypeDefinition> types) {
ToggleMappableOperation operation = new ToggleMappableOperation(spaceID, types);
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);
}
}
use of org.eclipse.ui.operations.IWorkbenchOperationSupport in project hale by halestudio.
the class EntityDefinitionServiceUndoSupport method executeOperation.
/**
* Execute an operation.
*
* @param operation the operation to execute
*/
protected void executeOperation(IUndoableOperation operation) {
IWorkbenchOperationSupport operationSupport = PlatformUI.getWorkbench().getOperationSupport();
// service is workbench wide, so the operation should also be workbench
// wide
operation.addContext(operationSupport.getUndoContext());
try {
operationSupport.getOperationHistory().execute(operation, null, null);
} catch (ExecutionException e) {
log.error("Error executing operation on entity definition service", e);
}
}
use of org.eclipse.ui.operations.IWorkbenchOperationSupport 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);
}
}
Aggregations