use of org.eclipse.core.commands.operations.IUndoContext 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.IUndoContext 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.IUndoContext in project translationstudio8 by heartsome.
the class UndoRedoActionProvider method init.
/*
* (non-Javadoc)
*
* @see org.eclipse.ui.navigator.CommonActionProvider#init(org.eclipse.ui.navigator.ICommonActionExtensionSite)
*/
public void init(ICommonActionExtensionSite anActionSite) {
IUndoContext workspaceContext = (IUndoContext) ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
undoRedoGroup = new UndoRedoActionGroup(((ICommonViewerWorkbenchSite) anActionSite.getViewSite()).getSite(), workspaceContext, true);
}
Aggregations