/** * Registers a content assist listener. * The following are valid listener types: * <ul> * <li>AUTO_ASSIST * <li>CONTEXT_SELECTOR * <li>PROPOSAL_SELECTOR * <li>CONTEXT_INFO_POPUP * <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(IContentAssistListener2 listener, int type) { if (acquireWidgetToken(type)) { fListeners[type]= listener; if (getNumberOfListeners() == 1) { fCloser= new Closer(); fCloser.install(); fViewer.setEventConsumer(fInternalListener); installKeyListener(); } return true; } return false; }
/** * Notifies the controller that a popup has lost focus. * * @param e the focus event */ void popupFocusLost(FocusEvent e) { fCloser.focusLost(e); }
/** * Unregisters a content assist listener. * * @param listener the listener to unregister * @param type the type of listener * * @see #addContentAssistListener */ void removeContentAssistListener(IContentAssistListener2 listener, int type) { fListeners[type]= null; if (getNumberOfListeners() == 0) { if (fCloser != null) { fCloser.uninstall(); fCloser= null; } uninstallKeyListener(); fViewer.setEventConsumer(null); } releaseWidgetToken(type); }
/** * Registers a content assist listener. * The following are valid listener types: * <ul> * <li>AUTO_ASSIST * <li>CONTEXT_SELECTOR * <li>PROPOSAL_SELECTOR * <li>CONTEXT_INFO_POPUP * <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(IContentAssistListener2 listener, int type) { if (acquireWidgetToken(type)) { fListeners[type]= listener; if (getNumberOfListeners() == 1) { fCloser= new Closer(); fCloser.install(); fViewer.setEventConsumer(fInternalListener); installKeyListener(); } return true; } return false; }
/** * Unregisters a content assist listener. * * @param listener the listener to unregister * @param type the type of listener * * @see #addContentAssistListener */ void removeContentAssistListener(IContentAssistListener2 listener, int type) { fListeners[type]= null; if (getNumberOfListeners() == 0) { if (fCloser != null) { fCloser.uninstall(); fCloser= null; } uninstallKeyListener(); fViewer.setEventConsumer(null); } releaseWidgetToken(type); }
@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 uninstall() { if (fProposalPopup != null) fProposalPopup.hide(); if (fContextInfoPopup != null) fContextInfoPopup.hide(); manageAutoActivation(false); if (fCloser != null) { fCloser.uninstall(); fCloser= null; } fViewer= null; }
/** * Notifies the controller that a popup has lost focus. * * @param e the focus event */ void popupFocusLost(FocusEvent e) { fCloser.focusLost(e); }