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 - code fold popup (tooltip) is empty
Summary: code fold popup (tooltip) is empty
Status: RESOLVED DUPLICATE of bug 189233
Alias: None
Product: editor
Classification: Unclassified
Component: Code folding (show other bugs)
Version: 6.x
Hardware: PC Other
: P3 normal (vote)
Assignee: Miloslav Metelka
URL:
Keywords:
Depends on:
Blocks:
 
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
Exception Reporter:


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

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

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 ***