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 48019 - It's hard to stick the end of content in Tomcat output
Summary: It's hard to stick the end of content in Tomcat output
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Output Window (show other bugs)
Version: 4.x
Hardware: PC Windows XP
: P3 blocker (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 52487 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-26 18:17 UTC by zikmund
Modified: 2008-12-22 15:43 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zikmund 2004-08-26 18:17:46 UTC
Build 200408251800

1) Have a Tomcat output window opened (e.g. Run
WebApp) and a JSP which logs to output e.g. line:
   <% System.out.println("test"); %>
2) Use mouse to scroll output to the beginning and
immediately to the end (without releasing mouse
button)
Notice: the cursor has moved to the beginning of
the last line
3) Run WebApp (adds a line to output)
4) ERROR A:
Output window didn't move to last added line! -
it's out of view.

5) Scroll to the last line
6) Click to the end of last line
7) Run WebApp (adds a line to output)
8) ERROR B:
Output window didn't move again!

Notice: only Ctrl-End helped to stick the end of
output.

It's quite annoying when scrolling through large
logs with stack traces!
Comment 1 _ tboudreau 2004-08-26 19:31:13 UTC
Try tonight's build - I put some fixes in for this stuff early this
morning, just after the nightly build ran.

The way the output window decides whether scrolling should be locked
to the bottom is this:  

 - On creation, lock the scrollbars to the bottom, and with every
change in the document, force them there.  
 - If the user clicks or type a key, assume there's something they
want to look at, and it would not be polite to randomly move it out of
view - unlock the scrollbars
 - If the user
    - Presses END
    - Drags the scrollbar thumb below the height of the scrollbar
    - Scrolls the mousewheel so that it's at the bottom (this is new
as of 2AM today)
  re-lock the scrollbars to the bottom


I may be mistaken, but I *think* my fixes early this morning took care
of this problem.  Reopen if not.
Comment 2 zikmund 2004-08-31 17:55:16 UTC
You're right, it should work, but only in case, that the output window
is on top.
Steps 1-8 don't work because run WebApp (F6) focuses "WebApp (run)"
output window and brings it on top. The Tomcat's output is not
scrolled automatically although the scrollbar is locked (you can check
it when you reload page in browser while Tomcat's output is on top in
IDE).
Comment 3 _ tboudreau 2004-09-01 10:23:36 UTC
Please try it with today's build - I added some code to make sure that, if locked, when you 
change output tabs, it will ensure the scroll position is at the bottom.  

I just tested this, exactly as you described - reloading a web page in the browser and then 
checking the tomcat logs.  I could not reproduce the problem.
Comment 4 _ tboudreau 2004-09-01 21:32:40 UTC
I'm going to optimistically close this issue - the code that ensures the component is 
scrolled whenever tabs are changed should be solving the problem.
Comment 5 zikmund 2004-09-02 15:16:30 UTC
Well, it still doesn't work - see more detailed steps:
1) Create new WebApp (with clean userdir)
2) Run project (F6)
3) "Bundled Tomcat (5.0.28)" output & "HTTP Monitor" window appeared
in IDE, application's index.jsp is viewed in browser
5) Go to "Bundled Tomcat (5.0.28)" output window
6) Scroll up using dragging scrollbar thumb
   Notice: using only mouse wheel works fine!
7) Scroll down to the end of output (again use dragging scrollbar thumb)
   Notice: Note that the cursor at the last line has moved from its
end to its beginning.
8) Insert 'logging' line to the opened index.jsp at line 5:
   <% System.out.println("This is log test!"); %>
9) Run project (F6)
10) "WebApp (run)" output window came on top
11) Go to "Bundled Tomcat" output window again
12) ERROR:
Last line with logged text is out of the view.

Notice: Each repeating of steps 9-11 will result additional line in
output window, but its view will not scroll to the last line
automatically until you press Ctrl-End.

Alternative scenario - steps 6-7 change to:
6) Use mouse wheel to scroll to the output start & Click the text in
the middle (or click a link or mark a text for copying, etc.)
7) Use mouse wheel to scroll to the end of window

Conclusion: The problem is, that if the cursor in output window is not
at the end of the last line, the scrolling is not locked.
Comment 6 zikmund 2004-09-02 15:31:04 UTC
I did more tests, and it's OS dependent! On Fedora 2 it works fine.
But it fails on WinXP with JDK 1.4.2_04 & 1.5.0-rc-b63.
Comment 7 _ tboudreau 2004-09-08 12:53:23 UTC
Question for you - I think I have an idea what is going on:

The output window is set up to stop auto-scrolling as soon as a hyperlinked line is 
written.  Are there any hyperlinks in the output when you have this problem?

If so, is there any unique text in all of them which is identifiable?

For 4.1, there will be an API where each hyperlink can say "I am important enough to stop 
scrolling for";  for 4.0 there is only a search for words like "User program stopped", 
"warning", and "deprecated".
Comment 8 zikmund 2004-09-08 13:57:06 UTC
It is reproducible even without any hyperlinks in output - e.g. try
last described scenario on WinXP.
Comment 9 David Simonek 2004-10-26 18:11:34 UTC
Passing to Martin, who is solving something similar I believe.
Comment 10 Martin Krauskopf 2004-11-02 11:16:59 UTC
Passing to Milos. New owner of output.
Comment 11 Milos Kleint 2004-12-15 14:01:51 UTC
*** Issue 52487 has been marked as a duplicate of this issue. ***
Comment 12 Milos Kleint 2005-11-22 08:45:44 UTC
done 

Checking in output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java;
/cvs/core/output2/src/org/netbeans/core/output2/ui/AbstractOutputPane.java,v 
<--  AbstractOutputPane.java
new revision: 1.37; previous revision: 1.36