@Override public void run() { fInvocationOffset= fContentAssistSubjectControlAdapter.getSelectedRange().x; fFilterOffset= fInvocationOffset; fLastCompletionOffset= fFilterOffset; fFilteredProposals= computeProposals(fInvocationOffset); int count= (fFilteredProposals == null ? 0 : fFilteredProposals.length); if (count == 0 && hideWhenNoProposals(false)) return; if (count == 1 && canAutoInsert(fFilteredProposals[0])) { insertProposal(fFilteredProposals[0], (char) 0, 0, fInvocationOffset); hide(); } else { ensureDocumentListenerInstalled(); if (count > 0 && completeCommonPrefix()) hide(); else { fComputedProposals= fFilteredProposals; createProposalSelector(); setProposals(fComputedProposals, false); displayProposals(); } } } });
hide(); } else { createProposalSelector();
@Override public void hide() { super.hide(); cancelFutures(); }
/** * Hides any open pop-ups. * * @since 3.0 */ protected void hide() { if (fProposalPopup != null) fProposalPopup.hide(); if (fContextInfoPopup != null) fContextInfoPopup.hide(); }
/** * Hides any open pop-ups. * * @since 3.0 */ protected void hide() { if (fProposalPopup != null) fProposalPopup.hide(); if (fContextInfoPopup != null) fContextInfoPopup.hide(); }
@Override public void run() { fInvocationOffset= fContentAssistSubjectControlAdapter.getSelectedRange().x; fFilterOffset= fInvocationOffset; fLastCompletionOffset= fFilterOffset; fComputedProposals= computeProposals(fInvocationOffset); int count= (fComputedProposals == null ? 0 : fComputedProposals.length); if (count == 0 && hideWhenNoProposals(autoActivated)) return; if (count == 1 && !autoActivated && canAutoInsert(fComputedProposals[0])) { insertProposal(fComputedProposals[0], (char) 0, 0, fInvocationOffset); hide(); } else { createProposalSelector(); setProposals(fComputedProposals, false); displayProposals(); } } });
/** * Takes the selected proposal and applies it. * * @param stateMask the state mask * @since 3.2 */ private void insertSelectedProposalWithMask(int stateMask) { ICompletionProposal p= getSelectedProposal(); hide(); if (p != null) insertProposal(p, (char) 0, stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x); }
/** * Takes the selected proposal and applies it. * * @param stateMask the state mask * @since 3.2 */ private void insertSelectedProposalWithMask(int stateMask) { ICompletionProposal p= getSelectedProposal(); hide(); if (p != null) insertProposal(p, (char) 0, stateMask, fContentAssistSubjectControlAdapter.getSelectedRange().x); }
@Override public void run() { if (!fIsFilterPending) return; fIsFilterPending= false; if (!Helper.okToUse(fContentAssistSubjectControlAdapter.getControl())) return; int offset= fContentAssistSubjectControlAdapter.getSelectedRange().x; ICompletionProposal[] proposals= null; try { if (offset > -1) { DocumentEvent event= TextUtilities.mergeProcessedDocumentEvents(fDocumentEvents); proposals= computeFilteredProposals(offset, event); } } catch (BadLocationException x) { } finally { fDocumentEvents.clear(); } fFilterOffset= offset; if (proposals != null && proposals.length > 0) setProposals(proposals, fIsFilteredSubset); else hide(); } };
if (canAutoInsert(fFilteredProposals.get(0))) { insertProposal(fFilteredProposals.get(0), (char) 0, 0, fFilterOffset); hide(); return true; if (canAutoInsert(proposal) && rightCasePostfix.length() > 0) { insertProposal(proposal, (char) 0, 0, fInvocationOffset); hide(); return true; if (canAutoInsert(proposal)) { insertProposal(proposal, (char) 0, 0, fInvocationOffset); hide(); return true;
if (canAutoInsert(fFilteredProposals[0])) { insertProposal(fFilteredProposals[0], (char) 0, 0, fFilterOffset); hide(); return true; if (canAutoInsert(proposal) && rightCasePostfix.length() > 0) { insertProposal(proposal, (char) 0, 0, fInvocationOffset); hide(); return true; if (canAutoInsert(proposal)) { insertProposal(proposal, (char) 0, 0, fInvocationOffset); hide(); return true;
/** * Hides the popup and returns <code>true</code> if the popup is configured * to never display an empty list. Returns <code>false</code> otherwise. * * @param autoActivated whether the invocation was auto-activated * @return <code>false</code> if an empty list should be displayed, <code>true</code> otherwise * @since 3.2 */ boolean hideWhenNoProposals(boolean autoActivated) { if (autoActivated || !fContentAssistant.isShowEmptyList()) { if (!autoActivated) { Control control= fContentAssistSubjectControlAdapter.getControl(); if (control != null && !control.isDisposed()) control.getDisplay().beep(); } hide(); return true; } return false; }
/** * Hides the popup and returns <code>true</code> if the popup is configured * to never display an empty list. Returns <code>false</code> otherwise. * * @param autoActivated whether the invocation was auto-activated * @return <code>false</code> if an empty list should be displayed, <code>true</code> otherwise * @since 3.2 */ private boolean hideWhenNoProposals(boolean autoActivated) { if (autoActivated || !fContentAssistant.isShowEmptyList()) { if (!autoActivated) { Control control= fContentAssistSubjectControlAdapter.getControl(); if (control != null && !control.isDisposed()) control.getDisplay().beep(); } hide(); return true; } return false; }
setProposals(proposals, fIsFilteredSubset); else { hide(); if (fContentAssistant.isAutoActivation() && offset > 0 && event != null) { try {