Community
Participate
Working Groups
build 0610 (first one) i run an external tool that dumps output to the log console. in log console i switch to the tree view. i see one node labeled 'External Tool'. i assume that is for my tool? i see the console output in the right pane. i right click to select the node, as well as check "show output of selected element only". the output in the right pane disappears. i would expect it to still be there, as the only node 'External Tool' is selected.
Related: External tool builders on a project may fail to build because of an IllegalArgumentException if the following 3 conditions are true when the build on the project occurs. 1. External tool builders on a project have been run and the output is still on the log console. 2. "Show Output Tree Structure" and "Show Output of Current Element Only" are selected. 3. One of the elements of the tree is selected. If any of the above three conditions is not true, the failure does not occur. The IllegalArgumentException which causes the failure is coming from StyledText.setStyleRanges(StyleRange[]), at the lines: if (lastEnd > content.getCharCount()) { SWT.error(SWT.ERROR_INVALID_RANGE); } This method is called in LogConsoleView.append(String, int). When an append occurs and the TextViewer of the LogConsoleView is not showing ALL the output sent to the log console, the IllegalArgumentException occurs. It is occuring because lastEnd (the end index of the last StyleRange) is greater than the character count for the content of the StyledText. The content of the StyledText is normally a DocumentAdapter to the Document of the TextViewer of the LogConsoleView (this Document represents all the output sent to the console). However, when a element is selected and "Show Output of Selected Element Only" is enabled, the content is a DocumentAdapter to a ChildDocument representing just the output of the selected element. This ChildDocument's character count will obviosly be less than the normal character count. Since the StyleRanges span the entire Document, lastEnd will be greater than the ChildDocument's character count.
Log console no longer supported. See associated feature request - bug 26386.