capint
11/21/2016 - 5:37 PM

Eclipse >> Undoable operation >> Workspace context

Eclipse >> Undoable operation >> Workspace context

// get the operation history
IOperationHistory history = OperationHistoryFactory.getOperationHistory();

// obtain the appropriate undo context for my model
IUndoContext workspaceContext = (IUndoContext)ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
if (workspaceContext != null) {
	// create an operation and assign it the context
}