/** * Answers a boolean indicating whether the main proposal popup is open. * * @return <code>true</code> if the proposal popup is open, and * <code>false</code> if it is not. * * @since 3.6 */ public boolean isProposalPopupOpen() { if (isValid() && popup != null) return true; return false; }
/** * Answers a boolean indicating whether the main proposal popup is open. * * @return <code>true</code> if the proposal popup is open, and * <code>false</code> if it is not. * * @since 3.6 */ public boolean isProposalPopupOpen() { if (isValid() && popup != null) return true; return false; }
/** * Answers a boolean indicating whether the main proposal popup is open. * * @return <code>true</code> if the proposal popup is open, and * <code>false</code> if it is not. * * @since 1.3 */ public boolean isProposalPopupOpen() { if (isValid() && popup != null) { return true; } return false; }
private void setControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; controlContentAdapter.setControlContents(control, text, cursorPosition); } }
private void setControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; controlContentAdapter.setControlContents(control, text, cursorPosition); } }
private void setControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; controlContentAdapter.setControlContents(control, text, cursorPosition); } }
/** * Sets focus to the proposal popup. If the proposal popup is not opened, * this method is ignored. If the secondary popup has focus, focus is * returned to the main proposal popup. * * @since 3.6 */ public void setProposalPopupFocus() { if (isValid() && popup != null) popup.getShell().setFocus(); }
/** * Sets focus to the proposal popup. If the proposal popup is not opened, * this method is ignored. If the secondary popup has focus, focus is returned * to the main proposal popup. * * @since 1.3 */ public void setProposalPopupFocus() { if (isValid() && popup != null) { popup.getShell().setFocus(); } }
/** * Sets focus to the proposal popup. If the proposal popup is not opened, * this method is ignored. If the secondary popup has focus, focus is * returned to the main proposal popup. * * @since 3.6 */ public void setProposalPopupFocus() { if (isValid() && popup != null) popup.getShell().setFocus(); }
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); } } }
private void insertControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; // Not all controls preserve their selection index when they lose // focus, so we must set it explicitly here to what it was before // the popup opened. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063 if (controlContentAdapter instanceof IControlContentAdapter2 && selectionRange.x != -1) { ((IControlContentAdapter2) controlContentAdapter).setSelection( control, selectionRange); } else if (insertionPos != -1) { controlContentAdapter.setCursorPosition(control, insertionPos); } controlContentAdapter.insertControlContents(control, text, cursorPosition); } }
private void insertControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; // Not all controls preserve their selection index when they lose // focus, so we must set it explicitly here to what it was before // the popup opened. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063 if (controlContentAdapter instanceof IControlContentAdapter2 && selectionRange.x != -1) { ((IControlContentAdapter2) controlContentAdapter).setSelection( control, selectionRange); } else if (insertionPos != -1) { controlContentAdapter.setCursorPosition(control, insertionPos); } controlContentAdapter.insertControlContents(control, text, cursorPosition); } }
private void insertControlContent(String text, int cursorPosition) { if (isValid()) { // should already be false, but just in case. watchModify = false; // Not all controls preserve their selection index when they lose // focus, so we must set it explicitly here to what it was before // the popup opened. // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=127108 // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=139063 if (controlContentAdapter instanceof IControlContentAdapter2 && selectionRange.x != -1) { ((IControlContentAdapter2) controlContentAdapter).setSelection( control, selectionRange); } else if (insertionPos != -1) { controlContentAdapter.setCursorPosition(control, insertionPos); } controlContentAdapter.insertControlContents(control, text, cursorPosition); } }
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; }