use of org.eclipse.ui.operations.UndoRedoActionGroup 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.ui.operations.UndoRedoActionGroup in project hale by halestudio.
the class HaleUI method registerWorkbenchUndoRedo.
/**
* Register a view site for undo/redo in workbench context.
*
* @param site the view site
*/
public static void registerWorkbenchUndoRedo(IViewSite site) {
IUndoContext undoContext = site.getWorkbenchWindow().getWorkbench().getOperationSupport().getUndoContext();
UndoRedoActionGroup undoRedoActionGroup = new UndoRedoActionGroup(site, undoContext, true);
IActionBars actionBars = site.getActionBars();
undoRedoActionGroup.fillActionBars(actionBars);
}
use of org.eclipse.ui.operations.UndoRedoActionGroup 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);
}
use of org.eclipse.ui.operations.UndoRedoActionGroup in project eclipse.platform.text by eclipse.
the class SearchView method createActions.
private void createActions() {
fSearchesDropDownAction = new SearchHistoryDropDownAction(this);
fSearchesDropDownAction.updateEnablement();
fSearchAgainAction = new SearchAgainAction(this);
fSearchAgainAction.setEnabled(false);
fSearchAgainAction.setActionDefinitionId(IWorkbenchCommandConstants.FILE_REFRESH);
fCancelAction = new CancelSearchAction(this);
fCancelAction.setEnabled(false);
fPinSearchViewAction = new PinSearchViewAction(this);
IUndoContext workspaceContext = ResourcesPlugin.getWorkspace().getAdapter(IUndoContext.class);
fUndoRedoActionGroup = new UndoRedoActionGroup(getViewSite(), workspaceContext, true);
}
use of org.eclipse.ui.operations.UndoRedoActionGroup 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