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); } } }
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); } } }
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); } } }
@Override protected void closeProposalPopup() { // workaround to keep popup open String content = getControlContentAdapter().getControlContents(getControl()); int pos = getControlContentAdapter().getCursorPosition(getControl()); if( content.length() == 0 || pos == 0 ) { super.closeProposalPopup(); return; } String prefix = content.substring(0, pos); if( prefix.length() == 0 || prefix.endsWith(" ") ) { super.closeProposalPopup(); return; } }
private IContentProposal[] getProposals() { if (proposalProvider == null || !isValid()) { return null; } if (DEBUG) { System.out.println(">>> obtaining proposals from provider"); //$NON-NLS-1$ } int position = insertionPos; if (position == -1) { position = getControlContentAdapter().getCursorPosition( getControl()); } String contents = getControlContentAdapter().getControlContents( getControl()); IContentProposal[] proposals = proposalProvider.getProposals(contents, position); return proposals; }
private IContentProposal[] getProposals() { if (proposalProvider == null || !isValid()) { return null; } if (DEBUG) { System.out.println(">>> obtaining proposals from provider"); //$NON-NLS-1$ } int position = insertionPos; if (position == -1) { position = getControlContentAdapter().getCursorPosition( getControl()); } String contents = getControlContentAdapter().getControlContents( getControl()); IContentProposal[] proposals = proposalProvider.getProposals(contents, position); return proposals; }
private IContentProposal[] getProposals() { if (proposalProvider == null || !isValid()) { return null; } if (DEBUG) { System.out.println(">>> obtaining proposals from provider"); //$NON-NLS-1$ } int position = insertionPos; if (position == -1) { position = getControlContentAdapter().getCursorPosition( getControl()); } String contents = getControlContentAdapter().getControlContents( getControl()); IContentProposal[] proposals = proposalProvider.getProposals(contents, position); return proposals; }
int pos = getControlContentAdapter().getCursorPosition( getControl());
int pos = getControlContentAdapter().getCursorPosition( getControl());
int pos = getControlContentAdapter().getCursorPosition( getControl());