Bug 19949 - [ExternalTools] log console "show output of selected element only" not working
Summary: [ExternalTools] log console "show output of selected element only" not working
Status: RESOLVED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Ant (show other bugs)
Version: 2.0   Edit
Hardware: PC Windows 2000
: P2 major (vote)
Target Milestone: ---   Edit
Assignee: Platform-Ant-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: ui
Depends on:
Blocks:
 
Reported: 2002-06-11 17:22 EDT by Chris McLaren CLA
Modified: 2002-11-15 11:07 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris McLaren CLA 2002-06-11 17:22:01 EDT
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.
Comment 1 Ryan Cooper CLA 2002-06-12 15:24:13 EDT
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.
Comment 2 Darin Wright CLA 2002-11-15 11:07:38 EST
Log console no longer supported. See associated feature request - bug 26386.