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

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

Introduction

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

Prototype

@Override
public boolean isCopyEnabled() 

Source Link

Document

The TextCellEditor implementation of this CellEditor method returns true if the current selection is not empty.

Usage

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

License:Apache License

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

    IEditorPart activeEditor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
            .getActiveEditor();/*w  w w. j  a v  a2  s.c  om*/
    if (activeEditor instanceof SQLEditor) {
        SQLEditor sqlEditor = (SQLEditor) activeEditor;
        TextCellEditor cellEditor = sqlEditor.getTextCellEditor();
        if (cellEditor != null && cellEditor.isActivated() && cellEditor.isCopyEnabled()) {
            cellEditor.performCopy();
        }
    }

    return null;
}