Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 190124 - code fold popup (tooltip) is empty
code fold popup (tooltip) is empty
Status: RESOLVED DUPLICATE of bug 189233
Product: editor
Classification: Unclassified
Component: Code folding
PC Other
: P3 (vote)
Assigned To: Miloslav Metelka
Depends on:
  Show dependency treegraph
Reported: 2010-09-03 07:59 UTC by mco
Modified: 2010-10-18 15:30 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT

editor with fold tooltip shown (7.58 KB, image/png)
2010-09-03 07:59 UTC, mco
folded code expanded (10.64 KB, image/png)
2010-09-03 07:59 UTC, mco
IDE log file (12.49 KB, application/octet-stream)
2010-09-03 08:01 UTC, mco

Note You need to log in before you can comment on or make changes to this bug.
Description mco 2010-09-03 07:59:01 UTC
Created attachment 101846 [details]
editor with fold tooltip shown


After upgrading to 6.9.1 popups that should contain folded code are empty.
It just contain line numbers, but no code (check screenshots).
Comment 1 mco 2010-09-03 07:59:48 UTC
Created attachment 101847 [details]
folded code expanded
Comment 2 mco 2010-09-03 08:01:14 UTC
Created attachment 101848 [details]
IDE log file
Comment 3 mco 2010-10-01 13:35:32 UTC

I've done some debugging and it looks like it's a view issue.

If I try to create fold with no blank characters in front of code and then pop-up gets only first chars of each line. So it looks that text is retrieved properly from editor.

I've attached debugger to running Netbeans and found out that somehow preferred size for pop-up is calculated wrong:

        JComponent popup,
        int viewWidth,
        int viewHeight,
        Rectangle cursorBounds,
        Placement originalPlacement,
        HorizontalBounds horizontalBounds)

381: Dimension prefSize = popup.getPreferredSize();
382: final int width = Math.min(viewWidth, prefSize.width);

384: popup.setSize(width, Integer.MAX_VALUE);

popup.setSize(width, Integer.MAX_VALUE);

And this gives very small value for:

FoldingToolTip.setSize(int width, int height){
111: width = Math.min(width, viewWidth);

Thus pop-up width is too small to render text.

I've compared it with 6.8 code and there pop-up width is simply set from viewWidth:

377: popup.setSize(viewWidth, height);

Sorry no time now to do some more investigation now.
Hope this helps a little bit.

Comment 4 Michel Graciano 2010-10-18 15:30:59 UTC

*** This bug has been marked as a duplicate of bug 189233 ***

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo