/** * 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(); }