Chris Oliver's Weblog
- All
- F3
- JavaFX
- Programming
- Research
F3 and HTML
Although I'm not a fan of XML, I do consider HTML+CSS the most useful tool available for composing styled text. We plan on incorporating the Flying Saucer Java XHTML renderer into F3 eventually.
One of the things I dislike about HTML is the total lack of error reporting. If you have mistakes the output just looks funny and it's a nightmare to debug.
Since Flying Saucer requires valid XHTML and CSS it's possible to provide high quality validation for both the HTML content and CSS rules. Click the button at the bottom of this page to launch two demos:
-
The first is a (very prototypish - I spent about 1.5 days on it) demo (written
in F3) of an interactive XHTML/CSS renderer which performs XHTML and CSS
as-you-type validation (I extracted the W3C CSS validator from their Java web-app for the CSS validation).
The performance is bad right now because it's synchronously loading images, but hopefully it gives you some idea of what I have in mind. For example, you can browse www.w3.org with it, edit their style sheets and xhtml documents and see what happens.
-
Since the XHTML renderer is a Swing component it's also possible to embed arbitrary F3 widgets inside the XHTML document.
This is done with a special form of the HTML
<object>tag, for example, like this:var button = Button {text: "Click Me!"} XHTML { text: bind "<html> <body> Here's a button: <object type='f3' data='{#button}'/> </body> </html>" }The above code embeds an F3 Button (underlyingly a Swing JButton) into the HTML content. The XHTML widget is the F3 wrapper for the Flying Saucer renderer. It renders the HTML content you assign to its
textattribute.The # operator is F3's stringify operator: it converts the object reference of its operand to a URL which can later be dereferenced with the unstringify operator ?, e.g.
var num1 = 20; var s = #num1; assert s instanceof String; // passes var num2 = (Number)?s; assert num2 == num1; // passes
URL's created with
#aren't permanent but only refer to the object in memory.In addition, it's possible to create hyperlinks that call back to your application by embedding such URL's as the value of the
hrefattribute. The second demo shows examples of this (click the File->View Source menu to see the source code).The second demo is an example which floats one of the processing examples I previously posted inside the XHTML document.
Posted at 01:03PM Dec 14, 2006 by Christopher Oliver in F3 | Comments[8]

Posted by Rene Davila on December 14, 2006 at 01:43 PM PST #
That's one question that never gets an answer. F3 is very attractive to me, but if it's a year or more away then I can't afford to get too interested.
Posted by 200.122.182.106 on December 14, 2006 at 08:52 PM PST #
Posted by Ivan on December 15, 2006 at 04:29 AM PST #
Posted by Anon on December 19, 2006 at 08:12 AM PST #
Posted by falcon on December 19, 2006 at 08:26 PM PST #
Posted by Wilfred Springer on December 20, 2006 at 07:19 AM PST #
http://www.smsmatbaa.com
Posted by matbaa on June 22, 2009 at 10:13 AM PDT #
http://www.egzotik.org
http://www.kerizimcet.com
http://www.chatsiteleri.net
http://www.askfali.org
http://www.sevdaduragi.com
http://www.sohbetsi.net
http://www.bedavafilmizlesene.org
http://www.partnercafe.net
http://www.tubam.net
http://www.motifmatik.net
Posted by netlog on July 05, 2009 at 06:28 AM PDT #