public boolean isTextSelected()
    {
        if (hexEditControl == null) return false;

        long[] selection = hexEditControl.getSelection();

        return selection[0] != selection[1];
    }
Tells whether the input has text selected

@return true: text is selected, false: no text selected
plugins/org.jkiss.dbeaver.ui.editors.hex/src/org/jkiss/dbeaver/ui/editors/binary/HexManager.java