Java Code Examples for org.eclipse.core.commands.operations.IUndoableOperation#getLabel()
The following examples show how to use
org.eclipse.core.commands.operations.IUndoableOperation#getLabel() .
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: WaitForRefactoringCondition.java From xtext-xtend with Eclipse Public License 2.0 | 6 votes |
@Override public boolean test() throws Exception { boolean _xblockexpression = false; { final IOperationHistory operationHistory = OperationHistoryFactory.getOperationHistory(); IUndoableOperation _xifexpression = null; if (this.isRedo) { _xifexpression = operationHistory.getRedoOperation(this.getUndoContext()); } else { _xifexpression = operationHistory.getUndoOperation(this.getUndoContext()); } String _label = null; if (_xifexpression!=null) { _label=_xifexpression.getLabel(); } final String label = _label; _xblockexpression = label.startsWith("Rename "); } return _xblockexpression; }
Example 2
Source File: UndoCommandHandler.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
@Override public boolean isEnabled() { final IEditorPart editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor() ; if(editor != null){ final IOperationHistory history = (IOperationHistory) editor.getAdapter(IOperationHistory.class); final IUndoContext context = (IUndoContext) editor.getAdapter(IUndoContext.class); if(history != null && context != null){ final IUndoableOperation[] undoHistory = history.getUndoHistory(context); if (undoHistory != null && undoHistory.length != 0) { final IUndoableOperation ctxt = undoHistory[undoHistory.length - 1]; final String ctxtLabel = ctxt.getLabel(); if(ctxtLabel != null && ctxtLabel.contains("Lane")){//Avoid Exception on undo //$NON-NLS-1$ return false ; } else { return ctxt.canUndo(); } } } else { return false; } } return false; }
Example 3
Source File: UndoManager.java From saros with GNU General Public License v2.0 | 4 votes |
protected String opInfo(IUndoableOperation operation) { return ("new " + operation.getLabel() + ": " + operation); }