Java Code Examples for org.eclipse.core.commands.operations.IOperationHistory#canRedo()
The following examples show how to use
org.eclipse.core.commands.operations.IOperationHistory#canRedo() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CellEditorGlobalActionHanlder.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
public void runWithEvent(Event event) { TeActiveCellEditor.commit(); IOperationHistory history = OperationHistoryFactory.getOperationHistory(); IUndoContext context = PlatformUI.getWorkbench().getOperationSupport().getUndoContext(); if (history.canRedo(context)) { try { history.redo(context, null, null); updateActionsEnableState(); } catch (ExecutionException e) { e.printStackTrace(); } } }
Example 2
Source File: CellEditorGlobalActionHanlder.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Update the state. */ public void updateEnabledState() { IOperationHistory opHisotry = OperationHistoryFactory.getOperationHistory(); IUndoContext context = PlatformUI.getWorkbench().getOperationSupport().getUndoContext(); if (opHisotry.canRedo(context)) { setEnabled(true); return; } if (viewer != null && !viewer.getTextWidget().isDisposed()) { setEnabled(viewer.canDoOperation(ITextOperationTarget.REDO)); return; } setEnabled(false); }
Example 3
Source File: RedoCommandHandler.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public boolean isEnabled() { IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() ; IOperationHistory history = (IOperationHistory) editor.getAdapter(IOperationHistory.class); IUndoContext context = (IUndoContext) editor.getAdapter(IUndoContext.class); if(history != null && context != null ){ return history.canRedo(context); } else { return false; } }