High performance text component
Gaja Sutra
javafx at olifanz.com
Fri Aug 31 03:38:22 PDT 2012
> I don't see a problem. Why can't you simply load your RTF-String from a
> ResourceBundle and process it with a class which produces the DOM-Structure?
This is clearly what I am planning, particularly given I am already
parsing my content for generating content-editable HTML in WebView.
But not having an official way to do this (for documentation and
teaching) is a security problem for me. When someone will add
localization support to its application and load these FXML directly in
its scenegraph, will it know that localization can create nodes from any
class resolvable by classloader used by FXMLLoader? (possibly the only
classloader of its application).
A mitigating solution is OSGi to have more control on the list of
classes in your classloader (one classloader per module/plugin), but
Oracle seems to officially dislike torturing classloaders.
> Well having a StyledString-Class in JavaFX which is able to produce a
> dom-structure would be maybe a nice addition to the framework but having
> the internal representation as DOM like structure (Paragraph/Text) is
> something I'd favor because it provides much more freedom for those who
> need it.
I have no problem with the proposed DOM-like rich text API (and internal
representation); I think this is perfect as an API (not serialized).
My security problem is for the frequent combination of rich text (if it
is serialized in FXML) with less trusted source of this rich text (like
localization).
An importer from HTML or RTF will clearly solve my problem, particularly
if advertised (in official documentation) as a secure solution for
localizable rich text.
Gaja.
More information about the openjfx-dev
mailing list