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.
Currently the output window uses a few hardcoded strings to decide if it should stop scrolling or not, when encountering a newly written hyperlink. Currently we check for "warning", "[deprecated]" or "stopped" (see issue 47030 for the last). This doesn't really work, and is certainly non-localizable. Far better to add a method to OutputListener, i.e. "isImportant(String line) or something such, and let the view query the listener if it is worthy of stopping scrolling or not. If put in place, the fix for the output window would go into org.netbeans.core.output2.OutputTab.getFirstNavigableListenerL ine()
Adding Hans to cc
Ant module could be enhanced to make such a distinction. Would require a matching addition to its API to work well: public OutputListener AntSession.createStandardHyperlink(URL file, String message, int line1, int column1, int line2, int column2, boolean important);
I have included the patch for this in the patch for issue 43332 - both are extremely simple changes, no point in separate reviews.
Created attachment 18836 [details] implementation
Created attachment 18837 [details] api changes
Created attachment 18838 [details] possible patch to ant project to keep the old behaviour
I've reworked the initial solution a bit. The only change in APIs is an additional method in OutputWriter that accepts additional boolean parameter (is Important or not). The method should be indeally abstract but because it's uncertain how many implementations are there, the method is non-abstract and in it's default impl, delegates to the println(String, OutputListener) method, ignoring the boolean parameter. Implementors of the class are encourages to implement the new method. The implementation diff shows the reworked logic of stopping at important hyperlinks, also different coloring for important and unimportant links. the ant module diff shows code that was previously in output window but with introduction of the api doesn't belong there. Another option is to keep the old important/unimportant logic in output as well, however I'd prefer not to. The only drawback is that the output window might not stop under some specific conditions, once that situation occurs the fix should happen on the client side.
Advice (until somebody else supports it as well, then I suggest to make it request): Write test to show that the output really stops scrolling when println(...,...,true) is used and that it continues to scroll when println(...,...,false) is used. Advice: Copy your previous comment (with hyperlinks) into upgrade guide for 4.1. Advice: File a bug to terminalemulator to implement the new method to prevent surprises on their side. Request: Update apichanges.xml, increase spec. version of the api, increase dependency in the output2 implementation, use @since for new method
Created attachment 18867 [details] changes document entry
reassigning back, integrating.
created an issue for terminal emulator #51625.
integrated. increased versions and updated apichanges documents. moved code to recognize important line to ant module, if any other module used the same patterns (warning, deprecated, stopped strings), it will be easier to track down if it stops working for them.