/** *Hides the context information popup. */ private void hideContextInfoPopup() { if (Helper2.okToUse(fContextInfoPopup)) { int size= fContextFrameStack.size(); if (size > 0) { fContextFrameStack.pop(); -- size; } if (size > 0) { ContextFrame current= fContextFrameStack.peek(); internalShowContextFrame(current, false); } else { fContentAssistant.removeContentAssistListener(this, ContentAssistant2.CONTEXT_INFO_POPUP); fContextInfoPopup.setVisible(false); fContextInfoPopup.dispose(); fContextInfoPopup= null; if (fTextPresentation != null) { fTextPresentation.clear(); fTextPresentation= null; } } } if (fContextInfoPopup == null) fContentAssistant.contextInformationClosed(); }
/** *Hides the context information popup. */ private void hideContextInfoPopup() { if (Helper2.okToUse(fContextInfoPopup)) { int size= fContextFrameStack.size(); if (size > 0) { fContextFrameStack.pop(); -- size; } if (size > 0) { ContextFrame current= fContextFrameStack.peek(); internalShowContextFrame(current, false); } else { fContentAssistant.removeContentAssistListener(this, ContentAssistant2.CONTEXT_INFO_POPUP); fContextInfoPopup.setVisible(false); fContextInfoPopup.dispose(); fContextInfoPopup= null; if (fTextPresentation != null) { fTextPresentation.clear(); fTextPresentation= null; } } } if (fContextInfoPopup == null) fContentAssistant.contextInformationClosed(); }
/** * Displays the given context information for the given offset. * * @param information the context information * @param offset the offset * @since 2.0 */ private void internalShowContextInfo(IContextInformation information, int offset) { IContextInformationValidator validator= fContentAssistant.getContextInformationValidator(fViewer, offset); if (validator != null) { ContextFrame current= new ContextFrame(); current.fInformation= information; current.fBeginOffset= (information instanceof IContextInformationExtension) ? ((IContextInformationExtension) information).getContextInformationPosition() : offset; if (current.fBeginOffset == -1) current.fBeginOffset= offset; current.fOffset= offset; current.fVisibleOffset= fViewer.getTextWidget().getSelectionRange().x - (offset - current.fBeginOffset); current.fValidator= validator; current.fPresenter= fContentAssistant.getContextInformationPresenter(fViewer, offset); fContextFrameStack.push(current); internalShowContextFrame(current, fContextFrameStack.size() == 1); } }
/** * Displays the given context information for the given offset. * * @param information the context information * @param offset the offset * @since 2.0 */ private void internalShowContextInfo(IContextInformation information, int offset) { IContextInformationValidator validator= fContentAssistant.getContextInformationValidator(fViewer, offset); if (validator != null) { ContextFrame current= new ContextFrame(); current.fInformation= information; current.fBeginOffset= (information instanceof IContextInformationExtension) ? ((IContextInformationExtension) information).getContextInformationPosition() : offset; if (current.fBeginOffset == -1) current.fBeginOffset= offset; current.fOffset= offset; current.fVisibleOffset= fViewer.getTextWidget().getSelectionRange().x - (offset - current.fBeginOffset); current.fValidator= validator; current.fPresenter= fContentAssistant.getContextInformationPresenter(fViewer, offset); fContextFrameStack.push(current); internalShowContextFrame(current, fContextFrameStack.size() == 1); } }