Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 328198 - [nls tooling] NLSStringHover and PropertiesFileHover should not use HTMLTextPresenter
Summary: [nls tooling] NLSStringHover and PropertiesFileHover should not use HTMLTextP...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7   Edit
Hardware: All All
: P2 normal (vote)
Target Milestone: 3.7 M3   Edit
Assignee: Deepak Azad CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-19 22:23 EDT by Deepak Azad CLA
Modified: 2010-10-26 08:54 EDT (History)
3 users (show)

See Also:


Attachments
fix (5.88 KB, text/plain)
2010-10-22 06:08 EDT, Deepak Azad CLA
no flags Details
Fix 2 (9.36 KB, patch)
2010-10-22 13:18 EDT, Markus Keller CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Deepak Azad CLA 2010-10-19 22:23:04 EDT
Whitespace information gets lost in NLSStringHover and PropertiesFileHover. For example a string like "This \t string \n has \t whitespace" is simply shown as "This string has whitespace"

Both these hovers use DefaultInformationControl which in turn uses HTMLTextPresenter by default.
Comment 1 Dani Megert CLA 2010-10-20 02:23:39 EDT
Should fix for M3 since the hover is a new M3 feature which people will try out.
Comment 2 Deepak Azad CLA 2010-10-20 02:29:22 EDT
(In reply to comment #1)
> Should fix for M3 since the hover is a new M3 feature which people will try
> out.
Sure. (Note that the problem was always there in NLSStringHover)
Comment 3 Deepak Azad CLA 2010-10-22 06:08:17 EDT
Created attachment 181483 [details]
fix
Comment 4 Deepak Azad CLA 2010-10-22 06:09:30 EDT
Dani, can you please review and commit this patch. It includes a small change in o.e.jface.text
Comment 5 Markus Keller CLA 2010-10-22 13:18:14 EDT
Created attachment 181521 [details]
Fix 2

I've removed the unnecessary PropertiesFileHoverPresenter again and replaced the call to its constructor with null.

The handling of preformatted text in HTMLPrinter and HTML2TextReader is quite broken, but I don't want to change this now since we have clients that rely on the bad semantics. Ideally, HTMLPrinter#convertToHTMLContent(String) would have taken care of this, but that method was already used by clients that create HTML for a browser as well as in places where the result ends up in HTML2TextReader. I've added warnings about that problem to HTMLPrinter.

The patch also didn't render the <b> in "<b>Warning:</b> The key is missing!" any more. Fixed in NLSStringHover#toHtml(..).

I've also added 2 fixes to render constant values in Javadocs correctly.
Comment 6 Markus Keller CLA 2010-10-22 13:19:08 EDT
Committed to HEAD.
Comment 7 Raksha Vasisht CLA 2010-10-26 08:54:09 EDT
Verified for 3.7 M3 with I20101025-1800.