This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 168898

Summary: Support multiple colors/hyperlinks on single line in OW
Product: platform Reporter: t_h <t_h>
Component: Output WindowAssignee: t_h <t_h>
Severity: blocker CC: apireviews, t_h
Priority: P2 Keywords: API, API_REVIEW_FAST
Version: 6.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 167386    
Attachments: API + impl in output2
just API change

Description t_h 2009-07-21 15:30:17 UTC
It is desirable to support fully colored text and better hyperlinks in OW.
Comment 1 t_h 2009-07-21 15:41:23 UTC
Created attachment 85020 [details]
API + impl in output2
Comment 2 t_h 2009-07-21 15:42:47 UTC
Created attachment 85021 [details]
just API change
Comment 3 t_h 2009-07-21 15:50:09 UTC
Please review.
Comment 4 Jesse Glick 2009-07-21 23:11:03 UTC
Why does this "block" issue #167386? Isn't this just a superset of that request?

[JG01] The SPI print method says that color may be null, but the API methods do not say this.
Comment 5 t_h 2009-07-22 11:10:21 UTC
Yes, it is superset of issue #167386. I wanted to express relation between them by 'depends on'.

[JG01] - I will specify it also in API methods.
Comment 6 t_h 2009-08-04 08:14:59 UTC
core-main #c2da2c80f723
Comment 7 Quality Engineering 2009-08-04 17:49:40 UTC
Integrated into 'main-golden', will be available in build *200908041401* on (upload may still be in progress)
User: Tomas Holy <>
Log: #168898: Support multiple colors/hyperlinks on single line in OW
Comment 8 Jesse Glick 2009-08-04 20:59:09 UTC
[JG02] A limitation I have discovered: there is no apparent way to request the standard error color (red or whatever it
is currently set to): if you pass null for the color param, the text is printed in black, like standard output, or blue
if hyperlinked.

IOColorLines does not provide such a facility either, but in that case you can simply use io.getErr().println(...) to
ensure the default error or error link color is used.

If all your non-hyperlinked text is at the end of the line, as in StandardLogger (see fix of issue #167386), there is a
partial workaround (it would arguably be preferable for the hyperlinks to appear in red rather than blue but at least
the remainder of the line is in red); but if some non-hyperlinked text should precede the hyperlink (yet still be part
of process error output), as in JavaAntLogger, there is no viable workaround and the stack trace line looks like it came
from stdout rather than stderr.
Comment 9 t_h 2009-08-04 21:44:02 UTC
[JG02] You can use io.getErr().print(...) to print in standard error color text around hyperlinks. The default color of
both hyperlinks type (normal/important) were changed to blue (see issue #167262). You can still specify color directly
or use IOColors to customize defaults per io.
Comment 10 Jesse Glick 2009-08-04 22:14:58 UTC
io.getErr().print(String) is indeed helpful in JavaAntLogger - thanks for tip. The other issue is that if the user
customizes the error hyperlink color to differ from the plain hyperlink color (*), uses of IOColorPrint to hyperlink
partial lines will not honor this if passing null, so you need to use IOColors.getColor(io,

(*) Is such customization possible? I did not find any UI for it.
Comment 11 t_h 2009-08-05 08:18:45 UTC
If default color for "normal" or "important" hyperlink is changed (via IOColors.setColor(), there is no UI currently)
IOColorPrint honors this change for both hyperlink types (for text past and future). It is enough to pass null color as
you mentioned.
Comment 12 Jesse Glick 2009-08-05 16:34:50 UTC
I am confused. I am talking about code like this:

IOColorPrint.print(io, midPart, hyperlink, true, IOColors.getColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT));

I want the call to IOColorPrint to look like stderr, not stdout. Whether the hyperlink is important or not is an
orthogonal issue. Or is coloration of hyperlinks dependent on the "important" flag rather than stdout vs. stderr? If so,
this seems inconsistent to me, but I guess I should just pass null and forget about it.
Comment 13 t_h 2009-08-05 17:42:25 UTC
Yes, default color of hyperlinks depends only on "important" flag.