/** * Returns whether this context information popup is active. I.e., either * a context selector or context information is displayed. * * @return <code>true</code> if the context selector is active */ public boolean isActive() { return (Helper.okToUse(fContextInfoPopup) || Helper.okToUse(fContextSelectorShell)); }
/** * Returns whether this context information popup is active. I.e., either * a context selector or context information is displayed. * * @return <code>true</code> if the context selector is active */ public boolean isActive() { return (Helper.okToUse(fContextInfoPopup) || Helper.okToUse(fContextSelectorShell)); }
@Override public void keyReleased(KeyEvent e) { if (!Helper.okToUse(fProposalShell)) return; if (e.character == 0 && e.keyCode == SWT.CTRL) { // http://dev.eclipse.org/bugs/show_bug.cgi?id=34754 int index= fProposalTable.getSelectionIndex(); if (index >= 0) selectProposal(index, false); } } }
/** *Returns whether the context selector has the focus. * * @return <code>true</code> if the context selector has the focus */ public boolean hasFocus() { if (Helper.okToUse(fContextSelectorShell)) return fContextSelectorShell.getDisplay().getActiveShell() == fContextSelectorShell; return false; }
@Override public void keyReleased(KeyEvent e) { if (!Helper.okToUse(fProposalShell)) return; if (e.character == 0 && e.keyCode == SWT.CTRL) { // http://dev.eclipse.org/bugs/show_bug.cgi?id=34754 int index= fProposalTable.getSelectionIndex(); if (index >= 0) selectProposal(index, false); } } }
/** * Requests the proposal shell to take focus. * * @since 3.0 */ public void setFocus() { if (Helper.okToUse(fProposalShell)) { fProposalShell.setFocus(); } }
/** *Returns whether the context selector has the focus. * * @return <code>true</code> if the context selector has the focus */ public boolean hasFocus() { if (Helper.okToUse(fContextSelectorShell)) return fContextSelectorShell.getDisplay().getActiveShell() == fContextSelectorShell; return false; }
@Override public void keyPressed(KeyEvent e) { if (!Helper.okToUse(fProposalShell)) return; if (e.character == 0 && e.keyCode == SWT.CTRL) { // http://dev.eclipse.org/bugs/show_bug.cgi?id=34754 int index= fProposalTable.getSelectionIndex(); if (index >= 0) selectProposal(index, true); } }
@Override public void keyPressed(KeyEvent e) { if (!Helper.okToUse(fProposalShell)) return; if (e.character == 0 && e.keyCode == SWT.CTRL) { // http://dev.eclipse.org/bugs/show_bug.cgi?id=34754 int index= fProposalTable.getSelectionIndex(); if (index >= 0) selectProposal(index, true); } }
/** * Requests the proposal shell to take focus. * * @since 3.0 */ public void setFocus() { if (Helper.okToUse(fProposalShell)) { fProposalShell.setFocus(); } }
/** * Installs a key listener on the text viewer's widget. */ private void installKeyListener() { if (!fVerifyKeyListenerHooked) { if (Helper.okToUse(fContentAssistSubjectControlAdapter.getControl())) { fVerifyKeyListenerHooked= fContentAssistSubjectControlAdapter.prependVerifyKeyListener(fInternalListener); } } }
@Override public void focusGained(FocusEvent e) { if (Helper.okToUse(control)) { if (fCommandKeyListener == null) { fCommandKeyListener= new CommandKeyListener(commandSequence); fProposalTable.addKeyListener(fCommandKeyListener); } } } @Override
@Override public void focusGained(FocusEvent e) { if (Helper.okToUse(control)) { if (fCommandKeyListener == null) { fCommandKeyListener= new CommandKeyListener(commandSequence); fProposalTable.addKeyListener(fCommandKeyListener); } } } @Override
@Override public void run() { if (Helper.okToUse(fTable) && !fTable.isFocusControl() && !fScrollbarClicked && fContentAssistant != null) fContentAssistant.popupFocusLost(e); } });
/** * Uninstall the key listener from the text viewer's widget. * * @since 3.0 */ private void uninstallVerifyKeyListener() { if (fVerifyKeyListenerHooked) { if (Helper.okToUse(fContentAssistSubjectControlAdapter.getControl())) fContentAssistSubjectControlAdapter.removeVerifyKeyListener(fInternalListener); fVerifyKeyListenerHooked= false; } }
@Override public void focusLost(final FocusEvent e) { fScrollbarClicked= false; Display d= fTable.getDisplay(); d.asyncExec(() -> { if (Helper.okToUse(fTable) && !fTable.isFocusControl() && !fScrollbarClicked && fContentAssistant != null) fContentAssistant.popupFocusLost(e); }); }