Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 158331

Summary: Get rid of copied HTML rendering classes
Product: [Eclipse Project] PDE Reporter: Dani Megert <daniel_megert>
Component: UIAssignee: Chris Aniszczyk <caniszczyk>
Status: RESOLVED FIXED QA Contact:
Severity: enhancement    
Priority: P3 CC: darin.eclipse, wassim.melhem
Version: 3.0   
Target Milestone: 3.6 M7   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 157461    
Bug Blocks:    
Attachments:
Description Flags
Fix none

Description Dani Megert CLA 2006-09-22 11:34:37 EDT
> 3.3 M2

PDE has copied several classes from JDT Text and/or Platform Text related to HTML rendering.

Since several plug-ins copied the same code Platform Text now offers these classes in an x-friends package: org.eclipse.jface.internal.text.html of which PDE UI is declared as friend.

NOTE: before replacing your classes I suggest to check whether they are still in sync. If there are changes ours are probably newer/better.
Comment 1 Chris Aniszczyk CLA 2006-09-22 11:37:03 EDT
ok, I'll try not to punt this back to you guys again :)
Comment 2 Dejan Glozic CLA 2006-09-22 14:53:02 EDT
Daniel, for my personal education, how is o.e.j.i.text.html rendering HTML? Is it a 'poor person's browser' or just wraps Browser widget with a fallback for NO_MORE_HANDLES?
Comment 3 Dani Megert CLA 2006-09-23 04:26:42 EDT
The classes do the following:
- have a control that allows to display HTML in hover (using Browser widget)
- code that can generate simple HTML (create lists, paragraphs, etc.)
- code that can convert simple HTML to text plus style attributes to be used in
  StyledText. This is either uses a fallback when the Browser isn't present or
  when a simple lightweight hover is desired showing HTML

Because only a little subset (the one we need) is supported we do not want to make this API. However Ant, PDE and also Debug copied several of our classes and hence I decided to group them together and all x-friends access.
Comment 4 Chris Aniszczyk CLA 2006-10-06 15:42:35 EDT
fixed.
Comment 5 Wassim Melhem CLA 2006-10-13 00:46:01 EDT
Hi Dani, thanks for the x-friendship olive branch :), but we should exercise tough love between plug-ins.

We have a single guideline when it comes to x-friends:
x-friends should not cross feature boundaries.  While this guideline is not enforced by the runtime nor PDE, it is strongly recommended to follow it for Eclipse to remain a platform for "...nothing in particular".  PDE should not get special treatment from Text (platform feature).  Neither should JDT, JDT/Debug, etc.

Given that the HTMLPrinter has so many clients inside the SDK, IMHO it's worthwhile to make it API.  If you are not ready to promote it to API, then I'd prefer if PDE reverted to having their own copy and was removed from the x-friends list.  It would not be good idea to set a precedent of violating feature boundaries on the account of this simple case.
Comment 6 Dani Megert CLA 2006-10-13 02:27:12 EDT
>Given that the HTMLPrinter has so many clients inside the SDK, IMHO it's
>worthwhile to make it API.
Sorry that won't happen. It is only a fuzzy HTMLPrinter that fits what we need at the moment and we need the freedom to change it at any time.

Sure, let me know when to remove PDE from the list.
Comment 7 Wassim Melhem CLA 2006-10-16 02:56:09 EDT
Chris, please revert the change.
Comment 8 Brian Bauman CLA 2006-10-18 16:36:26 EDT
Backed out the changes since Chris is been overworked ;-)
Comment 9 Dani Megert CLA 2010-03-01 06:53:11 EST
Reopening since this was not fixed and maintaining copies is not a good idea.

Discussed with Darin and agreed that we will use the x-friend approach here.
Comment 10 Dani Megert CLA 2010-03-01 07:28:47 EST
Created attachment 160474 [details]
Fix

NOTE: This patch needs functional testing. I quickly tested the XML proposal changes which seem to work but the type proposal is hard to verify since in most cases it never worked at all (see bug 304197).
Comment 11 Chris Aniszczyk CLA 2010-03-31 10:35:38 EDT
Looks good, I also fixed org.eclipse.pde.ds.ui which had a reference to BrowserInformationControl.
Comment 12 Chris Aniszczyk CLA 2010-03-31 10:36:00 EDT
Thanks again Dani.

> 20100331