use of org.eclipse.core.commands.operations.ObjectUndoContext in project che by eclipse.
the class RefactoringCorePlugin method getUndoContext.
public static IUndoContext getUndoContext() {
if (fRefactoringUndoContext == null) {
fRefactoringUndoContext = new RefactoringUndoContext();
IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
if (workspaceContext instanceof ObjectUndoContext) {
((ObjectUndoContext) workspaceContext).addMatch(fRefactoringUndoContext);
}
IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory();
operationHistory.setLimit(fRefactoringUndoContext, 5);
}
return fRefactoringUndoContext;
}
use of org.eclipse.core.commands.operations.ObjectUndoContext in project translationstudio8 by heartsome.
the class XLIFFEditorImplWithNatTable method initializeOperationHistory.
/*
* Initialize the workbench operation history for our undo context.
*/
private void initializeOperationHistory() {
// create a unique undo context to
// represent this view's undo history
undoContext = new ObjectUndoContext(this);
// set the undo limit for this context based on the preference
HISTORY.setLimit(undoContext, 99);
// 初始化“重做、”“撤销”菜单项
undoRedoGroup = new UndoRedoActionGroup(getSite(), undoContext, true);
}
use of org.eclipse.core.commands.operations.ObjectUndoContext in project che by eclipse.
the class RefactoringCorePlugin method stop.
public void stop(BundleContext context) throws Exception {
if (fRefactoringUndoContext != null) {
IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
if (workspaceContext instanceof ObjectUndoContext) {
((ObjectUndoContext) workspaceContext).removeMatch(fRefactoringUndoContext);
}
}
if (fgUndoManager != null)
fgUndoManager.shutdown();
final RefactoringHistoryService service = RefactoringHistoryService.getInstance();
service.disconnect();
if (fRefactoringHistoryListener != null)
service.removeHistoryListener(fRefactoringHistoryListener);
RefactoringContributionManager.getInstance().disconnect();
super.stop(context);
}
use of org.eclipse.core.commands.operations.ObjectUndoContext in project tmdm-studio-se by Talend.
the class DataModelMainPage method initializeOperationHistory.
/**
* @author achen
*/
private void initializeOperationHistory() {
if (undoContext == null) {
undoContext = new ObjectUndoContext(this.toString(), xobject.getDisplayName());
}
PlatformUI.getWorkbench().getOperationSupport().getOperationHistory().setLimit(undoContext, undoLimit);
UndoRedoActionGroup undoRedoGroup = new UndoRedoActionGroup(getSite(), undoContext, true);
undoRedoGroup.fillActionBars(getEditorSite().getActionBars());
}
Aggregations