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.
It is desirable to support fully colored text and better hyperlinks in OW.
Created attachment 85020 [details] API + impl in output2
Created attachment 85021 [details] just API change
Please review.
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.
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.
core-main #c2da2c80f723
Integrated into 'main-golden', will be available in build *200908041401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/c2da2c80f723 User: Tomas Holy <t_h@netbeans.org> Log: #168898: Support multiple colors/hyperlinks on single line in OW
[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.
[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.
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, IOColors.OutputType.HYPERLINK_IMPORTANT). (*) Is such customization possible? I did not find any UI for it.
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.
I am confused. I am talking about code like this: io.getErr().print(prePart); IOColorPrint.print(io, midPart, hyperlink, true, IOColors.getColor(io, IOColors.OutputType.HYPERLINK_IMPORTANT)); io.getErr().println(endPart); 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.
Yes, default color of hyperlinks depends only on "important" flag.