Example usage for org.eclipse.jface.fieldassist IControlContentAdapter getCursorPosition

List of usage examples for org.eclipse.jface.fieldassist IControlContentAdapter getCursorPosition

Introduction

In this page you can find the example usage for org.eclipse.jface.fieldassist IControlContentAdapter getCursorPosition.

Prototype

public int getCursorPosition(Control control);

Source Link

Document

Get the current cursor position in the control.

Usage

From source file:custom.jface.widgets.ContentProposalAdapterPlus.java

License:Open Source License

private void recordCursorPosition() {
    if (isValid()) {
        IControlContentAdapter adapter = getControlContentAdapter();
        insertionPos = adapter.getCursorPosition(control);
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063
        if (adapter instanceof IControlContentAdapter2) {
            selectionRange = ((IControlContentAdapter2) adapter).getSelection(control);
        }/*from  w w w.  j a v  a 2 s. c  om*/

    }
}

From source file:org.csstudio.autocomplete.ui.content.ContentProposalAdapter.java

License:Open Source License

private void recordCursorPosition() {
    if (isValid()) {
        IControlContentAdapter adapter = getControlContentAdapter();
        cursorPos = adapter.getCursorPosition(control);
        // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063
        if (adapter instanceof IControlContentAdapter2) {
            selectionRange = ((IControlContentAdapter2) adapter).getSelection(control);
        }//from  w  w w.j av  a 2s  .co m

    }
}