Example usage for org.eclipse.jface.viewers TextCellEditor performUndo

List of usage examples for org.eclipse.jface.viewers TextCellEditor performUndo

Introduction

In this page you can find the example usage for org.eclipse.jface.viewers TextCellEditor performUndo.

Prototype

public void performUndo() 

Source Link

Document

Performs the undo action.

Usage

From source file:de.chdev.artools.sql.handler.ResultUndoHandler.java

License:Apache License

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {

    IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();/*w  ww  .  ja  va 2 s  . co  m*/
    if (activeEditor instanceof SQLEditor) {
        SQLEditor sqlEditor = (SQLEditor) activeEditor;
        TextCellEditor cellEditor = sqlEditor.getTextCellEditor();
        if (cellEditor != null && cellEditor.isActivated() && cellEditor.isUndoEnabled()) {
            cellEditor.performUndo();
        }
    }

    return null;
}