High performance text component

Tom Schindl tom.schindl at bestsolution.at
Fri Aug 31 00:51:54 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?

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.


Am 30.08.12 14:40, schrieb Gaja Sutra:
> I have a concern for localization support of FXML against the split of
> each paragraph in multiple FXML span tags.
> By example, your first sample <p>Hello <b>Bold</b> <i>World</i></p>, can
> become in french <p>Bonjour <i>Monde</i> <b>Gras</b></p>, with different
> order of bold and italic styles. Like this case, FXML containing rich
> text will probably be separate for each language.
> I understand DOM-like API for manipulation but I think it will be more
> complex to localize than some annotated string.
> By example with a syntax like RTF/LaTeX <p>Hello \strong{Bold}
> \em{World}</p> and <p>Bonjour \em{Monde} \strong{Gras}</p>, you can
> localize only by substituting the string in the bundle, because your
> styles is not in FXML structure but only in the String containing text.
> NB: In this case, your command annotating text is associated, by
> example, to a custom CSS pseudo-class:
> p:strong {-fx-font-weight: bold;}
> p:em {-fx-font-style: italic;}
> NB: I know RTF/LaTeX syntax is not really beautiful. I am choosing this
> syntax only because special characters are not the same than XML and
> because ${...} is more frequently used for executing content (variable
> evaluation, etc.).

B e s t S o l u t i o n . a t                        EDV Systemhaus GmbH
tom schindl                 geschäftsführer/CEO
eduard-bodem-gasse 5-7/1   A-6020 innsbruck     fax      ++43 512 935833
http://www.BestSolution.at                      phone    ++43 512 935834

More information about the openjfx-dev mailing list