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 48339 - Missing API for which OutputListeners the output window should stop on
Summary: Missing API for which OutputListeners the output window should stop on
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 4.x
Hardware: All All
: P2 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords: API, API_REVIEW_FAST
Depends on: 43332
Blocks: 49588
  Show dependency tree
 
Reported: 2004-09-01 22:52 UTC by _ tboudreau
Modified: 2008-12-22 17:45 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
implementation (13.22 KB, patch)
2004-11-11 08:04 UTC, Milos Kleint
Details | Diff
api changes (1.47 KB, patch)
2004-11-11 08:05 UTC, Milos Kleint
Details | Diff
possible patch to ant project to keep the old behaviour (1.20 KB, patch)
2004-11-11 08:12 UTC, Milos Kleint
Details | Diff
changes document entry (4.93 KB, text/xml)
2004-11-12 14:31 UTC, Milos Kleint
Details

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2004-09-01 22:52:23 UTC
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()
Comment 1 _ tboudreau 2004-09-01 23:09:33 UTC
Adding Hans to cc
Comment 2 Jesse Glick 2004-09-01 23:46:24 UTC
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);
Comment 3 _ tboudreau 2004-10-01 02:28:37 UTC
I have included the patch for this in the patch for issue 43332 - both are extremely simple 
changes, no point in separate reviews.
Comment 4 Milos Kleint 2004-11-11 08:04:20 UTC
Created attachment 18836 [details]
implementation
Comment 5 Milos Kleint 2004-11-11 08:05:39 UTC
Created attachment 18837 [details]
api changes
Comment 6 Milos Kleint 2004-11-11 08:12:53 UTC
Created attachment 18838 [details]
possible patch to ant project to keep the old behaviour
Comment 7 Milos Kleint 2004-11-11 08:28:52 UTC
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.
Comment 8 Jaroslav Tulach 2004-11-11 10:13:15 UTC
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
Comment 9 Milos Kleint 2004-11-12 14:31:00 UTC
Created attachment 18867 [details]
changes document entry
Comment 10 Milos Kleint 2004-11-18 09:08:54 UTC
reassigning back, integrating.
Comment 11 Milos Kleint 2004-11-18 10:14:33 UTC
created an issue for terminal emulator #51625.
Comment 12 Milos Kleint 2004-11-18 14:41:10 UTC
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.