@Override public String showContextInformation() { promoteKeyListener(); if (fContextInfoPopup != null) return fContextInfoPopup.showContextProposals(false); return null; }
@Override public String showContextInformation() { promoteKeyListener(); if (fContextInfoPopup != null) return fContextInfoPopup.showContextProposals(false); return null; }
/** * Prepares to show content assist proposals. It returns false if auto activation has kicked in * recently. * * @param isAutoActivated whether completion was triggered by auto activation * @return <code>true</code> if the caller should continue and show the proposals, * <code>false</code> otherwise. * @since 3.2 */ private boolean prepareToShowCompletions(boolean isAutoActivated) { if (!isAutoActivated) { int gracePeriod= Math.max(fAutoActivationDelay, 200); if (System.currentTimeMillis() < fLastAutoActivation + gracePeriod) { return false; } } promoteKeyListener(); fireSessionBeginEvent(isAutoActivated); return true; }
/** * Prepares to show content assist proposals. It returns false if auto activation has kicked in * recently. * * @param isAutoActivated whether completion was triggered by auto activation * @return <code>true</code> if the caller should continue and show the proposals, * <code>false</code> otherwise. * @since 3.2 */ private boolean prepareToShowCompletions(boolean isAutoActivated) { if (!isAutoActivated) { int gracePeriod= Math.max(fAutoActivationDelay, 200); if (System.currentTimeMillis() < fLastAutoActivation + gracePeriod) { return false; } } promoteKeyListener(); fireSessionBeginEvent(isAutoActivated); return true; }
/** * Registers a content assist listener. The following are valid listener types: * <ul> * <li>AUTO_ASSIST</li> * <li>CONTEXT_SELECTOR</li> * <li>PROPOSAL_SELECTOR</li> * <li>CONTEXT_INFO_POPUP</li> * </ul> * Returns whether the listener could be added successfully. A listener can not be added if the * widget token could not be acquired. * * @param listener the listener to register * @param type the type of listener * @return <code>true</code> if the listener could be added */ boolean addContentAssistListener(IContentAssistListener listener, int type) { if (acquireWidgetToken(type)) { fListeners[type]= listener; if (fCloser == null && getNumberOfListeners() == 1) { fCloser= new Closer(); fCloser.install(); fContentAssistSubjectControlAdapter.setEventConsumer(fInternalListener); installKeyListener(); } else promoteKeyListener(); return true; } return false; }
/** * Registers a content assist listener. The following are valid listener types: * <ul> * <li>AUTO_ASSIST</li> * <li>CONTEXT_SELECTOR</li> * <li>PROPOSAL_SELECTOR</li> * <li>CONTEXT_INFO_POPUP</li> * </ul> * Returns whether the listener could be added successfully. A listener can not be added if the * widget token could not be acquired. * * @param listener the listener to register * @param type the type of listener * @return <code>true</code> if the listener could be added */ boolean addContentAssistListener(IContentAssistListener listener, int type) { if (acquireWidgetToken(type)) { fListeners[type]= listener; if (fCloser == null && getNumberOfListeners() == 1) { fCloser= new Closer(); fCloser.install(); fContentAssistSubjectControlAdapter.setEventConsumer(fInternalListener); installKeyListener(); } else promoteKeyListener(); return true; } return false; }