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 190124

Summary: code fold popup (tooltip) is empty
Product: editor Reporter: mco <mco>
Component: Code foldingAssignee: Miloslav Metelka <mmetelka>
Status: RESOLVED DUPLICATE    
Severity: normal CC: hmichel
Priority: P3    
Version: 6.x   
Hardware: PC   
OS: Other   
Issue Type: DEFECT Exception Reporter:
Attachments: editor with fold tooltip shown
folded code expanded
IDE log file

Description mco 2010-09-03 07:59:01 UTC
Created attachment 101846 [details]
editor with fold tooltip shown

Hi.

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
Hi.

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:

PopupManager.computeBounds(
        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.

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

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