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 88006 - Going to a method may leave all but sig line offscreen
Summary: Going to a method may leave all but sig line offscreen
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Nejedly
URL:
Keywords: SIMPLEFIX
Depends on:
Blocks:
 
Reported: 2006-10-26 00:27 UTC by _ tboudreau
Modified: 2008-12-22 14:44 UTC (History)
2 users (show)

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 _ tboudreau 2006-10-26 00:27:39 UTC
Double click a method name in Navigator.  You may end up with the caret on the
last visible line in the editor, with that being the method signature.  It ought
to scroll as much as possible into view.
Comment 1 Petr Hrebejk 2007-01-09 17:52:27 UTC
The code in java/source ends up in Line.show anyway. I thnk that this issue
shouled be solved there. If so this will work for any editor not only the Java
editor, which is the desired state.

The ideal algorithm would be to try to show the line in about 1rd of the editor
window I think. 
Comment 2 _ tboudreau 2007-01-09 19:23:11 UTC
This could probably be solved well enough without too much computation or
complexity...

Rectangle r = x.modelToView (charOffset);
r.height += 40; //pick a reasonable integer, or *= by some factor - r should be
one line's height anyway
editor.scrollRectToVisible(r);
Comment 3 Petr Nejedly 2007-10-17 10:55:24 UTC
Fixed as outlined by Tim:
openide/text/src/org/openide/text/CloneableEditorSupport.java,v1.40