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.
[ BUILD # : 069d5678d609 ] [ JDK VERSION : 1.6.* ] When I pass the mouse point in any folded code the preview is not shown anymore. I tested it in GTK and Metal LAF.
I'm looking into this.
*** Bug 183354 has been marked as a duplicate of this bug. ***
Created attachment 96734 [details] Attempting to fix the tooltip (doesn't work) There are two problems: 1. editor.fold can't depend on editor.lib and therefore can't use ToolTipSupport. This is not a big deal, I modified ToolTipSupport to detect that the mouse hovers over a code fold and attempt to show a the preview tooltip. This however leads to the problem #2. 2. I don't seem to be able to create the preview tooltip. I'd need a view over a portion of the document, which would then be passed to FoldingToolTip component and displayed on the screen. The problem is that all my attempts to create this fragment view failed. I got to the state where I have the view, but it's either empty, uninitialized or somehow fails to compute its spans. Therefore FoldingToolTip component has a zero size and shows nothing. Any help would be appreciated. I'm attaching the patch, which shows the changes. The most interesting part is in ToolTipSupport.getExpandedView(). Thanks.
Vito, I thought that for the preview we could: 1) Determine bounds of the fold and align to full lines. 2) Pass the offset boundaries to a special constructor of DocumentView. 3) Make the FoldViewFactory sensitive to a property e.g. "tooltip" property set to Boolean.TRUE in which case it would not return any fold views for the collapsed folds so it would fallback to HighlightsViewFactory. In EditorViewFactory there's currently initProperties() but it's probably useless - it would be enough if infrastructure would set the properties values and the particular factory would just see and use a EVF.getProperty(). 4) The tooltip would have to ask the view for the tooltip in which case a new JEditorPane would be created with the DocumentView over the portion of the document. Hopefully the pane will not object again doing Ext-BasicTextUI.setView(modified-document-view) even when in fact its pane.getDocument() will be different. Or now it comes to my mind that we could even set the same document to the pane for the tooltip we would just have have an extra property on the pane e.g. pane.putClientProperty("tooltip-range", new int[] { tooltip-start-line-start-offset, tooltip-end-line-end-offset }) and the DocumentView would be sensitive to that property and instead of covering the full document's area with the views it would just cover the range.
http://hg.netbeans.org/jet-main/rev/88dbed0f347e
Integrated into 'main-golden', will be available in build *201006150001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/88dbed0f347e User: Miloslav Metelka <mmetelka@netbeans.org> Log: #183120 - No preview for folded code.