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

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

Introduction

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

Prototype

@Override
public boolean isDeleteEnabled() 

Source Link

Document

The TextCellEditor implementation of this CellEditor method returns true if there is a selection or if the caret is not positioned at the end of the text.

Usage

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

License:Apache License

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

    IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();/*from  w ww .ja  v  a 2  s. c o m*/
    if (activeEditor instanceof SQLEditor) {
        SQLEditor sqlEditor = (SQLEditor) activeEditor;
        TextCellEditor cellEditor = sqlEditor.getTextCellEditor();
        if (cellEditor != null && cellEditor.isActivated() && cellEditor.isDeleteEnabled()) {
            cellEditor.performDelete();
        }
    }

    return null;
}