Community
Participate
Working Groups
Build ID: 3.4GA org.eclipse.jface.internal.text.html.HTML2TextReader has been replicated as: - org.eclipse.pde.internal.ui.editor.contentassist.display.HTML2TextReader - org.eclipse.wst.sse.ui.internal.derived.HTML2TextReader And while it is in an internal package, that package has been made available to a large number of "friends" and is used directly in a number of places including JDT. It would be logical to either refactor this as public API or provide a public interface/factory etc. This would have a number of benefits: - the first being the number of friends could probably be reduced - the duplicate (and likely of date) classes could be eliminated - new consumers would have access to the API without violating bundle export rules This would also allow us to easily meet a customer request for better presentation of HTML formatted documentation in UML models. (Would be nice to have for 3.4.1 to meet product requirements, but more essential for later.)
How/where do you display HTML? Maybe you could use org.eclipse.jface.text.DefaultInformationControl.DefaultInformationControl(Shell, boolean) which internally uses the reader.
We actually want it for its ability to create (at least partially) formatted plaintext from HTML input. I could not see how to do that with DefaultInformationControl. Perhaps there is a way and I just missed it?
Also... me simply using the other class does not address the issue of duplicated code. Clearly that class does something useful that people need.
>Also... me simply using the other class does not address the issue of >duplicated code. Clearly that class does something useful that people need. In my opinion that duplication wasn't needed (will check that). What exactly are you trying to do?
We're trying to display a plaintext equivilant of an HTML fragment, mostly in diagrams.
>We're trying to display a plaintext equivilant of an HTML fragment, mostly in >diagrams. OK, so it's not inside a hover? The reason why we don't make this API is because it is only supports a very small subset of HTML (the one for simple rendering of Javadoc). Also, we got away from using this by showing the HTML directly inside the Browser widget. This gives much better HTML rendering. Wouldn't that also work in your case?
We are unable to embed the browser control in a GMF diagram (or so I've been told). Found another copy in the Ruby tooling: http://www.koders.com/?s=HTML2TextReader&la=*&li=*
>(or so I've been told). Why? >Found another copy in the Ruby tooling: Well, just because you found a copy doesn't mean it is used right and doesn't mean that they are aware of all its limitations.
Could you check if you could use the Browser widget? Because even if we made the current class API it would probably not fit all your needs (i.e. handle all your HTML tags). Also, assuming you can't use the Browser widget: would it work to use the (yet internal) org.eclipse.jface.internal.text.html.HTMLTextPresenter?
Ping.
I'm a little busy trying to ship a product... I'll try to give you a full response before the end of the week. However, there is no way we'll be embedding one or more browser controls in a diagram.
OK, next week would also be good enough.
To be disposed or fixed during 3.5.
PDE's also interested in this as we use this class: org.eclipse.pde.internal.ui.editor.contentassist.display.HTML2TextReader org.eclipse.pde.internal.ui.editor.contentassist.display.BrowserInformationControl
We looked at this and came to the conclusion to not make this API at this point. The reason is that our reader is very limited and explicitly fit to our internal needs i.e. only supports those tags we actually need. We don't want to make that state API and we don't have the resources to work on a full blown HTML2Text reader. If someone wants to contribute a complete HTML2TextReader along with test cases we are open for it.
*** Bug 265997 has been marked as a duplicate of this bug. ***
>PDE's also interested in this as we use this class: > >org.eclipse.pde.internal.ui.editor.contentassist.display.HTML2TextReader >org.eclipse.pde.internal.ui.editor.contentassist.display.BrowserInformationControl The latter is covered by bug 218482.