Repository: incubator-juneau Updated Branches: refs/heads/master 58781bee5 -> 268a3e37f
Fix typos. Project: http://git-wip-us.apache.org/repos/asf/incubator-juneau/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-juneau/commit/268a3e37 Tree: http://git-wip-us.apache.org/repos/asf/incubator-juneau/tree/268a3e37 Diff: http://git-wip-us.apache.org/repos/asf/incubator-juneau/diff/268a3e37 Branch: refs/heads/master Commit: 268a3e37f110909d3e6dfcaeb1fbe6b2c4d8f55d Parents: 58781be Author: JamesBognar <[email protected]> Authored: Fri Feb 10 11:27:22 2017 -0500 Committer: JamesBognar <[email protected]> Committed: Fri Feb 10 11:27:22 2017 -0500 ---------------------------------------------------------------------- .../org/apache/juneau/dto/html5/package.html | 46 ++++++++++++++++- juneau-core/src/main/javadoc/overview.html | 53 ++++++++++++++++++-- 2 files changed, 94 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/268a3e37/juneau-core/src/main/java/org/apache/juneau/dto/html5/package.html ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/java/org/apache/juneau/dto/html5/package.html b/juneau-core/src/main/java/org/apache/juneau/dto/html5/package.html index 37d5ba1..aa362c4 100644 --- a/juneau-core/src/main/java/org/apache/juneau/dto/html5/package.html +++ b/juneau-core/src/main/java/org/apache/juneau/dto/html5/package.html @@ -89,7 +89,7 @@ that allow you to easily construct DTO instances in a minimal amount of code. </p> <p> - The following examples show how to create HTML tables. + The following examples show how to create HTML fragments: </p> <table class='styled' style='width:auto'> <tr> @@ -167,8 +167,50 @@ </table> </xt></td> </tr> + <tr> + <td class='code'> + <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*; + + Object mydiv = + <jsm>div</jsm>().align(<js>"center"</js>).onmouseover(<js>"alert(\"boo!\");"</js>) + .children( + <jsm>p</jsm>(<js>"Juneau supports "</js>, <jsm>b</jsm>(<jsm>i</jsm>(<js>"mixed"</js>)), <js>" content!"</js>) + ); + + String html = HtmlSerializer.<jsf>DEFAULT</jsf>.serialize(mydiv); + </td> + <td class='code'><xt> + <div <xa>align</xa>=<xs>'center'</xs> <xa>onmouseover</xa>=<xs>'alert("boo!");'</xs>> + <p><xv>Juneau supports </xv><b><i><xv>mixed</xv></i></b> <xv>content!</xv></p> + </table> + </xt></td> + </tr> + <tr> + <td class='code'> + <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*; + + Object myform = + <jsm>form</jsm>().action(<js>"/submit"</js>).method(<js>"POST"</js>) + .children( + <js>"Position (1-10000): "</js>, <jsm>input</jsm>(<js>"number"</js>).name(<js>"pos"</js>).value(1), <jsm>br</jsm>(), + <js>"Limit (1-10000): "</js>, <jsm>input</jsm>(<js>"number"</js>).name(<js>"limit"</js>).value(100), <jsm>br</jsm>(), + <jsm>button</jsm>(<js>"submit"</js>, <js>"Submit"</js>), + <jsm>button</jsm>(<js>"reset"</js>, <js>"Reset"</js>) + ); + + String html = HtmlSerializer.<jsf>DEFAULT</jsf>.serialize(myform); + </td> + <td class='code'><xt> + <form <xa>action</xa>=<xs>'/submit'</xs> <xa>method</xa>=<xs>'POST'</xs>> + <xv>Position (1-10000):</xv> <input <xa>name</xa>=<xs>'pos'</xs> <xa>type</xa>=<xs>'number'</xs> <xa>value</xa>=<xs>'1'</xs>/><br/> + <xv>Limit (1-10000):</xv> <input <xa>name</xa>=<xs>'pos'</xs> <xa>type</xa>=<xs>'number'</xs> <xa>value</xa>=<xs>'100'</xs>/><br/> + <button <xa>type</xa>=<xs>'submit'</xs>><xv>Submit</xv></button> + <button <xa>type</xa>=<xs>'reset'</xs>><xv>Reset</xv></button> + </form> + </xt></td> + </tr> </table> -</div> + </div> <!-- ======================================================================================================== --> <a id="Parse"></a> http://git-wip-us.apache.org/repos/asf/incubator-juneau/blob/268a3e37/juneau-core/src/main/javadoc/overview.html ---------------------------------------------------------------------- diff --git a/juneau-core/src/main/javadoc/overview.html b/juneau-core/src/main/javadoc/overview.html index b238c64..8a5032b 100644 --- a/juneau-core/src/main/javadoc/overview.html +++ b/juneau-core/src/main/javadoc/overview.html @@ -1550,11 +1550,16 @@ <td class='code'> <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*; - Object mytable = <jsm>table</jsm>( - <jsm>tr</jsm>(<jsm>th</jsm>(<js>"c1"</js>),<jsm>th</jsm>(<js>"c2"</js>)), - <jsm>tr</jsm>(<jsm>td</jsm>(<js>"v1"</js>),<jsm>td</jsm>(<js>"v2"</js>)) + <jsm>tr</jsm>( + <jsm>th</jsm>(<js>"c1"</js>), + <jsm>th</jsm>(<js>"c2"</js>) + ), + <jsm>tr</jsm>( + <jsm>td</jsm>(<js>"v1"</js>), + <jsm>td</jsm>(<js>"v2"</js>) + ) ); String html = HtmlSerializer.<jsf>DEFAULT</jsf>.serialize(mytable); @@ -1572,6 +1577,48 @@ </table> </xt></td> </tr> + <tr> + <td class='code'> + <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*; + + Object mydiv = + <jsm>div</jsm>().align(<js>"center"</js>).onmouseover(<js>"alert(\"boo!\");"</js>) + .children( + <jsm>p</jsm>(<js>"Juneau supports "</js>, <jsm>b</jsm>(<jsm>i</jsm>(<js>"mixed"</js>)), <js>" content!"</js>) + ); + + String html = HtmlSerializer.<jsf>DEFAULT</jsf>.serialize(mydiv); + </td> + <td class='code'><xt> + <div <xa>align</xa>=<xs>'center'</xs> <xa>onmouseover</xa>=<xs>'alert("boo!");'</xs>> + <p><xv>Juneau supports </xv><b><i><xv>mixed</xv></i></b> <xv>content!</xv></p> + </table> + </xt></td> + </tr> + <tr> + <td class='code'> + <jk>import static</jk> org.apache.juneau.dto.html5.HtmlBuilder.*; + + Object myform = + <jsm>form</jsm>().action(<js>"/submit"</js>).method(<js>"POST"</js>) + .children( + <js>"Position (1-10000): "</js>, <jsm>input</jsm>(<js>"number"</js>).name(<js>"pos"</js>).value(1), <jsm>br</jsm>(), + <js>"Limit (1-10000): "</js>, <jsm>input</jsm>(<js>"number"</js>).name(<js>"limit"</js>).value(100), <jsm>br</jsm>(), + <jsm>button</jsm>(<js>"submit"</js>, <js>"Submit"</js>), + <jsm>button</jsm>(<js>"reset"</js>, <js>"Reset"</js>) + ); + + String html = HtmlSerializer.<jsf>DEFAULT</jsf>.serialize(myform); + </td> + <td class='code'><xt> + <form <xa>action</xa>=<xs>'/submit'</xs> <xa>method</xa>=<xs>'POST'</xs>> + <xv>Position (1-10000):</xv> <input <xa>name</xa>=<xs>'pos'</xs> <xa>type</xa>=<xs>'number'</xs> <xa>value</xa>=<xs>'1'</xs>/><br/> + <xv>Limit (1-10000):</xv> <input <xa>name</xa>=<xs>'pos'</xs> <xa>type</xa>=<xs>'number'</xs> <xa>value</xa>=<xs>'100'</xs>/><br/> + <button <xa>type</xa>=<xs>'submit'</xs>><xv>Submit</xv></button> + <button <xa>type</xa>=<xs>'reset'</xs>><xv>Reset</xv></button> + </form> + </xt></td> + </tr> </table> <p> Using the HTML5 DTOs, you should be able to construct any valid HTML5 from full document bodies
