/** * Causes the context information of the context selected in the context selector * to be displayed in the context information popup. */ private void insertSelectedContext() { int i= fContextSelectorTable.getSelectionIndex(); if (i < 0 || i >= fContextSelectorInput.length) return; int position= fViewer.getSelectedRange().x; internalShowContextInfo(fContextSelectorInput[i], position); }
/** * Causes the context information of the context selected in the context selector * to be displayed in the context information popup. */ private void insertSelectedContext() { int i= fContextSelectorTable.getSelectionIndex(); if (i < 0 || i >= fContextSelectorInput.length) return; int position= fViewer.getSelectedRange().x; internalShowContextInfo(fContextSelectorInput[i], position); }
/** * Displays the given context information for the given offset. * * @param info the context information * @param position the offset * @since 2.0 */ public void showContextInformation(final IContextInformation info, final int position) { Control control= fViewer.getTextWidget(); BusyIndicator.showWhile(control.getDisplay(), () -> { internalShowContextInfo(info, position); hideContextSelector(); }); }
/** * Shows all possible contexts for the given cursor position of the viewer. * * @param autoActivated <code>true</code> if auto activated * @return a potential error message or <code>null</code> in case of no error */ public String showContextProposals(final boolean autoActivated) { final StyledText styledText= fViewer.getTextWidget(); BusyIndicator.showWhile(styledText.getDisplay(), () -> { int position= fViewer.getSelectedRange().x; IContextInformation[] contexts= computeContextInformation(position); int count= (contexts == null ? 0 : contexts.length); if (count == 1) { // Show context information directly internalShowContextInfo(contexts[0], position); } else if (count > 0) { // Precise context must be selected if (fLineDelimiter == null) fLineDelimiter= styledText.getLineDelimiter(); createContextSelector(); setContexts(contexts); displayContextSelector(); hideContextInfoPopup(); } }); return getErrorMessage(); }