@Override public boolean verifyKey(VerifyEvent e) { if (Helper2.okToUse(fContextSelectorShell)) return contextSelectorKeyPressed(e); if (Helper2.okToUse(fContextInfoPopup)) return contextInfoPopupKeyPressed(e); return true; }
@Override public void uninstall() { if (fProposalPopup != null) fProposalPopup.hide(); if (fContextInfoPopup != null) fContextInfoPopup.hide(); manageAutoActivation(false); if (fCloser != null) { fCloser.uninstall(); fCloser= null; } fViewer= null; }
@Override public void install(ITextViewer textViewer) { Assert.isNotNull(textViewer); fViewer= textViewer; fLayoutManager= new LayoutManager(); fInternalListener= new InternalListener(); AdditionalInfoController2 controller= null; if (fInformationControlCreator != null) controller= new AdditionalInfoController2(fInformationControlCreator, OpenStrategy.getPostSelectionDelay()); fContextInfoPopup= new ContextInformationPopup2(this, fViewer); fProposalPopup= new CompletionProposalPopup2(this, fViewer, controller); manageAutoActivation(fIsAutoActivated); }
@Override public void processEvent(VerifyEvent event) { if (Helper2.okToUse(fContextSelectorShell)) contextSelectorProcessEvent(event); if (Helper2.okToUse(fContextInfoPopup)) contextInfoPopupProcessEvent(event); }
/** * Returns whether any popups controlled by the receiver have the input focus. * * @return <code>true</code> if any of the managed popups have the focus, <code>false</code> otherwise */ public boolean hasFocus() { return (fProposalPopup != null && fProposalPopup.hasFocus()) || (fContextInfoPopup != null && fContextInfoPopup.hasFocus()); }
@Override public void run() { if (showStyle == SHOW_PROPOSALS) fProposalPopup.showProposals(true); else if (showStyle == SHOW_CONTEXT_INFO) fContextInfoPopup.showContextProposals(true); } });
/** * Hides context selector and context information popup. */ public void hide() { hideContextSelector(); hideContextInfoPopup(); }
/** * Creates a new additional information controller. * * @param creator the information control creator to be used by this controller * @param delay time in milliseconds after which additional info should be displayed */ AdditionalInfoController2(IInformationControlCreator creator, int delay) { super(creator); fDelay= delay; setAnchor(ANCHOR_RIGHT); setFallbackAnchors(new Anchor[] {ANCHOR_RIGHT, ANCHOR_LEFT, ANCHOR_BOTTOM }); }
/** * Computes all possible context information for the given offset. * * @param position the offset * @return all possible context information for the given offset * @since 2.0 */ private IContextInformation[] computeContextInformation(int position) { return fContentAssistant.computeContextInformation(fViewer, position); }
@Override public void shellClosed(ShellEvent e) { if (fContentAssistant != null) fContentAssistant.hide(); } }
/** * Notifies the controller that a popup has lost focus. * * @param e the focus event */ void popupFocusLost(FocusEvent e) { fCloser.focusLost(e); }
/** * Enables the support for colored labels in the proposal popup. * <p>Completion proposals can implement {@link ICompletionProposalExtension6} * to provide colored proposal labels.</p> * * @param isEnabled if <code>true</code> the support for colored labels is enabled in the proposal popup * @since 3.4 */ public void enableColoredLabels(boolean isEnabled) { fAssistant.enableColoredLabels(isEnabled); }
@Override public void install(ITextViewer textViewer) { Assert.isNotNull(textViewer); fViewer= textViewer; fLayoutManager= new LayoutManager(); fInternalListener= new InternalListener(); AdditionalInfoController2 controller= null; if (fInformationControlCreator != null) controller= new AdditionalInfoController2(fInformationControlCreator, OpenStrategy.getPostSelectionDelay()); fContextInfoPopup= new ContextInformationPopup2(this, fViewer); fProposalPopup= new CompletionProposalPopup2(this, fViewer, controller); manageAutoActivation(fIsAutoActivated); }
@Override public void uninstall() { if (fProposalPopup != null) fProposalPopup.hide(); if (fContextInfoPopup != null) fContextInfoPopup.hide(); manageAutoActivation(false); if (fCloser != null) { fCloser.uninstall(); fCloser= null; } fViewer= null; }
@Override public boolean verifyKey(VerifyEvent e) { if (Helper2.okToUse(fContextSelectorShell)) return contextSelectorKeyPressed(e); if (Helper2.okToUse(fContextInfoPopup)) return contextInfoPopupKeyPressed(e); return true; }
@Override public void processEvent(VerifyEvent event) { if (Helper2.okToUse(fContextSelectorShell)) contextSelectorProcessEvent(event); if (Helper2.okToUse(fContextInfoPopup)) contextInfoPopupProcessEvent(event); }
/** * Returns whether any popups controlled by the receiver have the input focus. * * @return <code>true</code> if any of the managed popups have the focus, <code>false</code> otherwise */ public boolean hasFocus() { return (fProposalPopup != null && fProposalPopup.hasFocus()) || (fContextInfoPopup != null && fContextInfoPopup.hasFocus()); }