diff --git a/.classpath b/.classpath index 7efb6c629..f30875f6e 100644 --- a/.classpath +++ b/.classpath @@ -1,6 +1,6 @@ - + diff --git a/build.xml b/build.xml index 838d71a97..d89600314 100644 --- a/build.xml +++ b/build.xml @@ -1,7 +1,7 @@ - + @@ -211,10 +211,15 @@ - - - - + + + + + + + + + diff --git a/doc/userguide/jwt.css b/doc/userguide/jwt.css new file mode 100644 index 000000000..93a4b3c6c --- /dev/null +++ b/doc/userguide/jwt.css @@ -0,0 +1,437 @@ +/*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */ +/* Modified for Emweb by Roel Standaert */ +@import url('https://fonts.googleapis.com/css2?family=Righteous&family=Roboto:ital,wght@0,400;0,700;1,400;1,700&family=Source+Code+Pro:wght@400;700&display=swap'); + +:root { + --title-font: "Righteous", sans-serif; + --body-font: "Roboto", sans-serif; + --mono-font: "Source Code Pro", monospace; + --accent-color1: #a81018; + --accent-color2: #d2141e; +} + +html{font-family:sans-serif;-webkit-text-size-adjust:100%} +a{background:none} +a:focus{outline:thin dotted} +a:active,a:hover{outline:0} +h1{font-size:2em;margin:.67em 0} +b,strong{font-weight:bold} +abbr{font-size:.9em} +abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none} +dfn{font-style:italic} +hr{height:0} +mark{background:#ff0;color:#000} +code,kbd,pre,samp{font-family:monospace;font-size:1em} +pre{white-space:pre-wrap} +q{quotes:"\201C" "\201D" "\2018" "\2019"} +small{font-size:80%} +sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} +sup{top:-.5em} +sub{bottom:-.25em} +img{border:0} +svg:not(:root){overflow:hidden} +figure{margin:0} +audio,video{display:inline-block} +audio:not([controls]){display:none;height:0} +fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} +legend{border:0;padding:0} +button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} +button,input{line-height:normal} +button,select{text-transform:none} +button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer} +button[disabled],html input[disabled]{cursor:default} +input[type=checkbox],input[type=radio]{padding:0} +button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} +textarea{overflow:auto;vertical-align:top} +table{border-collapse:collapse;border-spacing:0} +*,::before,::after{box-sizing:border-box} +html,body{font-size:100%} +body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:var(--body-font);line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased} +a:hover{cursor:pointer} +img,object,embed{max-width:100%;height:auto} +object,embed{height:100%} +img{-ms-interpolation-mode:bicubic} +.left{float:left!important} +.right{float:right!important} +.text-left{text-align:left!important} +.text-right{text-align:right!important} +.text-center{text-align:center!important} +.text-justify{text-align:justify!important} +.hide{display:none} +img,object,svg{display:inline-block;vertical-align:middle} +textarea{height:auto;min-height:50px} +select{width:100%} +.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:var(--accent-color1);font-weight:400;margin-top:0;margin-bottom:.25em} +div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0} +a{color:var(--accent-color2);text-decoration:underline;line-height:inherit} +a:hover,a:focus{color:var(--accent-color1)} +a img{border:0} +p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility} +p aside{font-size:.875em;line-height:1.35;font-style:italic} +h1,h2,h3{font-family:var(--title-font);font-weight:400;text-transform:uppercase;font-style:normal;color:var(--accent-color2);text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} +#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:var(--body-font);text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em} +h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0} +h1{font-size:2.125em} +h2{font-size:1.6875em} +h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em} +h4,h5{font-size:1.125em} +h6{font-size:1em} +hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em} +em,i{font-style:italic;line-height:inherit} +strong,b{font-weight:bold;line-height:inherit} +small{font-size:60%;line-height:inherit} +code{font-family:var(--mono-font);font-weight:400;color:rgba(0,0,0,.9)} +ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit} +ul,ol{margin-left:1.5em} +ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0} +ul.square li ul,ul.circle li ul,ul.disc li ul{list-style:inherit} +ul.square{list-style-type:square} +ul.circle{list-style-type:circle} +ul.disc{list-style-type:disc} +ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0} +dl dt{margin-bottom:.3125em;font-weight:bold} +dl dd{margin-bottom:1.25em} +blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd} +blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)} +@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2} + h1{font-size:2.75em} + h2{font-size:2.3125em} + h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em} + h4{font-size:1.4375em}} +table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal} +table thead,table tfoot{background:#f7f8f7} +table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left} +table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)} +table tr.even,table tr.alt{background:#f8f8f7} +table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6} +h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em} +h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400} +.center{margin-left:auto;margin-right:auto} +.stretch{width:100%} +.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table} +.clearfix::after,.float-group::after{clear:both} +:not(pre).nobreak{word-wrap:normal} +:not(pre).nowrap{white-space:nowrap} +:not(pre).pre-wrap{white-space:pre-wrap} +:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed} +pre{color:rgba(0,0,0,.9);font-family:var(--mono-font);line-height:1.45;text-rendering:optimizeSpeed} +pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit} +pre>code{display:block} +pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal} +em em{font-style:normal} +strong strong{font-weight:400} +.keyseq{color:rgba(51,51,51,.8)} +kbd{font-family:var(--mono-font);display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap} +.keyseq kbd:first-child{margin-left:0} +.keyseq kbd:last-child{margin-right:0} +.menuseq,.menuref{color:#000} +.menuseq b:not(.caret),.menuref{font-weight:inherit} +.menuseq{word-spacing:-.02em} +.menuseq b.caret{font-size:1.25em;line-height:.8} +.menuseq i.caret{font-weight:bold;text-align:center;width:.45em} +b.button::before,b.button::after{position:relative;top:-1px;font-weight:400} +b.button::before{content:"[";padding:0 3px 0 2px} +b.button::after{content:"]";padding:0 2px 0 3px} +p a>code:hover{color:rgba(0,0,0,.9)} +#header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em} +#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table} +#header::after,#content::after,#footnotes::after,#footer::after{clear:both} +#content{margin-top:1.25em} +#content::before{content:none} +#header>h1:first-child{margin-top:2.25rem;margin-bottom:0} +#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf} +#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px} +#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap} +#header .details span:first-child{margin-left:-.125em} +#header .details span.email a{color:rgba(0,0,0,.85)} +#header .details br{display:none} +#header .details br+span::before{content:"\00a0\2013\00a0"} +#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)} +#header .details br+span#revremark::before{content:"\00a0|\00a0"} +#header #revnumber{text-transform:capitalize} +#header #revnumber::after{content:"\00a0"} +#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem} +#toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em} +#toc>ul{margin-left:.125em} +#toc ul.sectlevel0>li>a{font-style:italic} +#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0} +#toc ul{font-family:var(--body-font);list-style-type:none} +#toc li{line-height:1.3334;margin-top:.3334em} +#toc a{text-decoration:none} +#toc a:active{text-decoration:underline} +#toctitle{color:#000;font-size:1.2em} +@media screen and (min-width:768px){#toctitle{font-size:1.375em} + body.toc2{padding-left:15em;padding-right:0} + #toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto} + #toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em} + #toc.toc2>ul{font-size:.9em;margin-bottom:0} + #toc.toc2 ul ul{margin-left:0;padding-left:1em} + #toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em} + body.toc2.toc-right{padding-left:0;padding-right:15em} + body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}} +@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0} + #toc.toc2{width:20em} + #toc.toc2 #toctitle{font-size:1.375em} + #toc.toc2>ul{font-size:.95em} + #toc.toc2 ul ul{padding-left:1.25em} + body.toc2.toc-right{padding-left:0;padding-right:20em}} +#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px} +#content #toc>:first-child{margin-top:0} +#content #toc>:last-child{margin-bottom:0} +#footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em} +#footer-text{color:hsla(0,0%,100%,.8);line-height:1.44} +#content{margin-bottom:.625em} +.sect1{padding-bottom:.625em} +@media screen and (min-width:768px){#content{margin-bottom:1.25em} + .sect1{padding-bottom:1.25em}} +.sect1:last-child{padding-bottom:0} +.sect1+.sect1{border-top:1px solid #e7e7e9} +#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400} +#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em} +#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible} +#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:var(--accent-color2);text-decoration:none} +#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221} +details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em} +details{margin-left:1.25rem} +details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;-webkit-tap-highlight-color:transparent} +details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)} +details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)} +details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem} +.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:var(--body-font);font-size:1rem;font-style:italic} +table.tableblock.fit-content>caption.title{white-space:nowrap;width:0} +.paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)} +.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%} +.admonitionblock>table td.icon{text-align:center;width:80px} +.admonitionblock>table td.icon img{max-width:none} +.admonitionblock>table td.icon .title{font-weight:bold;font-family:var(--body-font);text-transform:uppercase} +.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere} +.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0} +.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px} +.exampleblock>.content>:first-child{margin-top:0} +.exampleblock>.content>:last-child{margin-bottom:0} +.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px} +.sidebarblock>:first-child{margin-top:0} +.sidebarblock>:last-child{margin-bottom:0} +.sidebarblock>.content>.title{margin-top:0;text-align:center} +.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0} +.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em} +@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}} +@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}} +.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8} +.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)} +.listingblock>.content{position:relative} +.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5} +.listingblock:hover code[data-lang]::before{display:block} +.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5} +.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"} +.listingblock pre.highlightjs{padding:0} +.listingblock pre.highlightjs>code{padding:1em;border-radius:4px} +.listingblock pre.prettyprint{border-width:0} +.prettyprint{background:#f7f7f8} +pre.prettyprint .linenums{line-height:1.45;margin-left:2em} +pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0} +pre.prettyprint li code[data-lang]::before{opacity:1} +pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none} +table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none} +table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal} +table.linenotable td.code{padding-left:.75em} +table.linenotable td.linenos{border-right:1px solid;opacity:.35;padding-right:.5em} +pre.pygments .lineno{border-right:1px solid;opacity:.35;display:inline-block;margin-right:.75em} +pre.pygments .lineno::before{content:"";margin-right:-.125em} +.quoteblock{margin:0 1em 1.25em 1.5em;display:table} +.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em} +.quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify} +.quoteblock blockquote{margin:0;padding:0;border:0} +.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:var(--accent-color1);text-shadow:0 1px 2px rgba(0,0,0,.1)} +.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0} +.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right} +.verseblock{margin:0 1em 1.25em} +.verseblock pre{font-family:var(--body-font);font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:400;text-rendering:optimizeLegibility} +.verseblock pre strong{font-weight:400} +.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex} +.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic} +.quoteblock .attribution br,.verseblock .attribution br{display:none} +.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)} +.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none} +.quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0} +.quoteblock.abstract{margin:0 1em 1.25em;display:block} +.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center} +.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf} +.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0} +.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem} +.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0} +p.tableblock:last-child{margin-bottom:0} +td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere} +td.tableblock>.content>:last-child{margin-bottom:-1.25em} +table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede} +table.grid-all>*>tr>*{border-width:1px} +table.grid-cols>*>tr>*{border-width:0 1px} +table.grid-rows>*>tr>*{border-width:1px 0} +table.frame-all{border-width:1px} +table.frame-ends{border-width:1px 0} +table.frame-sides{border-width:0 1px} +table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0} +table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0} +table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0} +table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0} +table.stripes-all tr,table.stripes-odd tr:nth-of-type(odd),table.stripes-even tr:nth-of-type(even),table.stripes-hover tr:hover{background:#f8f8f7} +th.halign-left,td.halign-left{text-align:left} +th.halign-right,td.halign-right{text-align:right} +th.halign-center,td.halign-center{text-align:center} +th.valign-top,td.valign-top{vertical-align:top} +th.valign-bottom,td.valign-bottom{vertical-align:bottom} +th.valign-middle,td.valign-middle{vertical-align:middle} +table thead th,table tfoot th{font-weight:bold} +tbody tr th{background:#f7f8f7} +tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold} +p.tableblock>code:only-child{background:none;padding:0} +p.tableblock{font-size:1em} +ol{margin-left:1.75em} +ul li ol{margin-left:1.5em} +dl dd{margin-left:1.125em} +dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0} +ol>li p,ul>li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em} +ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none} +ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em} +ul.unstyled,ol.unstyled{margin-left:0} +ul.checklist>li>p:first-child{margin-left:-1em} +ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em} +ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em} +ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em} +ul.inline>li{margin-left:1.25em} +.unstyled dl dt{font-weight:400;font-style:normal} +ol.arabic{list-style-type:decimal} +ol.decimal{list-style-type:decimal-leading-zero} +ol.loweralpha{list-style-type:lower-alpha} +ol.upperalpha{list-style-type:upper-alpha} +ol.lowerroman{list-style-type:lower-roman} +ol.upperroman{list-style-type:upper-roman} +ol.lowergreek{list-style-type:lower-greek} +.hdlist>table,.colist>table{border:0;background:none} +.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none} +td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em} +td.hdlist1{font-weight:bold;padding-bottom:1.25em} +td.hdlist2{word-wrap:anywhere} +.literalblock+.colist,.listingblock+.colist{margin-top:-.5em} +.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top} +.colist td:not([class]):first-child img{max-width:none} +.colist td:not([class]):last-child{padding:.25em 0} +.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd} +.imageblock.left{margin:.25em .625em 1.25em 0} +.imageblock.right{margin:.25em 0 1.25em .625em} +.imageblock>.title{margin-bottom:0} +.imageblock.thumb,.imageblock.th{border-width:6px} +.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em} +.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0} +.image.left{margin-right:.625em} +.image.right{margin-left:.625em} +a.image{text-decoration:none;display:inline-block} +a.image object{pointer-events:none} +sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super} +sup.footnote a,sup.footnoteref a{text-decoration:none} +sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline} +#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em} +#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0} +#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em} +#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em} +#footnotes .footnote:last-of-type{margin-bottom:0} +#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0} +.gist .file-data>table{border:0;background:#fff;width:100%;margin-bottom:0} +.gist .file-data>table td.line-data{width:99%} +div.unbreakable{page-break-inside:avoid} +.big{font-size:larger} +.small{font-size:smaller} +.underline{text-decoration:underline} +.overline{text-decoration:overline} +.line-through{text-decoration:line-through} +.aqua{color:#00bfbf} +.aqua-background{background:#00fafa} +.black{color:#000} +.black-background{background:#000} +.blue{color:#0000bf} +.blue-background{background:#0000fa} +.fuchsia{color:#bf00bf} +.fuchsia-background{background:#fa00fa} +.gray{color:#606060} +.gray-background{background:#7d7d7d} +.green{color:#006000} +.green-background{background:#007d00} +.lime{color:#00bf00} +.lime-background{background:#00fa00} +.maroon{color:#600000} +.maroon-background{background:#7d0000} +.navy{color:#000060} +.navy-background{background:#00007d} +.olive{color:#606000} +.olive-background{background:#7d7d00} +.purple{color:#600060} +.purple-background{background:#7d007d} +.red{color:#bf0000} +.red-background{background:#fa0000} +.silver{color:#909090} +.silver-background{background:#bcbcbc} +.teal{color:#006060} +.teal-background{background:#007d7d} +.white{color:#bfbfbf} +.white-background{background:#fafafa} +.yellow{color:#bfbf00} +.yellow-background{background:#fafa00} +span.icon>.fa{cursor:default} +a span.icon>.fa{cursor:inherit} +.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;cursor:default} +.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c} +.admonitionblock td.icon .icon-tip::before{content:"\f0eb";color:#111} +.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900} +.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400} +.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000} +.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:var(--body-font);font-style:normal;font-weight:bold} +.conum[data-value] *{color:#fff!important} +.conum[data-value]+b{display:none} +.conum[data-value]::after{content:attr(data-value)} +pre .conum[data-value]{position:relative;top:-.125em} +b.conum *{color:inherit!important} +.conum:not([data-value]):empty{display:none} +dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility} +h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em} +p strong,td.content strong,div.footnote strong{letter-spacing:-.005em} +p,blockquote,dt,td.content,span.alt,summary{font-size:1.0625rem} +p{margin-bottom:1.25rem} +.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em} +.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc} +.print-only{display:none!important} +@page{margin:1.25cm .75cm} +@media print{*{box-shadow:none!important;text-shadow:none!important} + html{font-size:80%} + a{color:inherit!important;text-decoration:underline!important} + a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important} + a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em} + abbr[title]{border-bottom:1px dotted} + abbr[title]::after{content:" (" attr(title) ")"} + pre,blockquote,tr,img,object,svg{page-break-inside:avoid} + thead{display:table-header-group} + svg{max-width:100%} + p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3} + h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid} + #header,#content,#footnotes,#footer{max-width:none} + #toc,.sidebarblock,.exampleblock>.content{background:none!important} + #toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important} + body.book #header{text-align:center} + body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em} + body.book #header .details{border:0!important;display:block;padding:0!important} + body.book #header .details span:first-child{margin-left:0!important} + body.book #header .details br{display:block} + body.book #header .details br+span::before{content:none!important} + body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important} + body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always} + .listingblock code[data-lang]::before{display:block} + #footer{padding:0 .9375em} + .hide-on-print{display:none!important} + .print-only{display:block!important} + .hide-for-print{display:none!important} + .show-for-print{display:inherit!important}} +@media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem} + .sect1{padding:0!important} + .sect1+.sect1{border:0} + #footer{background:none} + #footer-text{color:rgba(0,0,0,.6);font-size:.9em}} +@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}} diff --git a/doc/userguide/userguide.adoc b/doc/userguide/userguide.adoc new file mode 100644 index 000000000..ad5ec70c0 --- /dev/null +++ b/doc/userguide/userguide.adoc @@ -0,0 +1,588 @@ += JWt User Guide + +:jwt-github: link:https://github.com/emweb/jwt/blob/master/ +:jwt-javadoc: link:https://www.webtoolkit.eu/jwt/latest/doc/javadoc/eu/webtoolkit/jwt/ + +== Introduction + +JWt is a Java library for developing web applications. The library +uses the standard Java Servlet infrastructure, and therefore, a JWt +web application may be deployed in existing +link:https://en.wikipedia.org/wiki/Web_container[servlet containers] or +JEE web application servers. + +The API is widget-centric, and inspired by existing Graphical User +Interface (GUI) APIs: a widget is a self-contained class which +encapsulates all event handling related to a user interface +element. The library offers an abstraction of many web-specific +implementation details, including event handling and graphics +support. In this way, the library chooses a rendering strategy based on +the browser's capabilities (AJAX or plain HTML). Still, the library +supports the web semantics of URLs, bookmarks, and forward/backward +navigation and therefore also search engine interoperability. + +== Library overview + +=== Widgets + +The {jwt-javadoc}WWidget.html[`+WWidget+`] class represents a widget, +which provides an abstraction of a visual entity. The entire +user interface is specified by creating a hierarchical structure of +widgets, rooted at +{jwt-javadoc}WApplication.html#getRoot()[`+WApplication.getRoot()+`]. By +reacting to events related to these widgets, you can perform business +logic, and manipulate the widget hierarchy to update the user +interface. + +Any descendent class of {jwt-javadoc}WWidget.html[`+WWidget+`] is a +self-contained (reusable) class that encapsulates both the look and +behavior, enabling the design of the user interface in an orthogonal +way. + +==== Layout + +Widgets are layed out (with a few exceptions) following their +hierarchical structure. You have two main options for the layout of +children within a container. Either you use a CSS based layout, in +which case the CSS style properties of the container and children +together determine the result: each child manages its layout with +respect to its sibling following a (rather complex) set of +rules. Alternatively, JWt provides layout managers that may be used +for layout. + +CSS layout considers two important categories of layout. Text-like +widgets ({jwt-javadoc}WWidget.html#setInline(boolean)[inline]) flow +with sibling inline widgets in lines, wrapping at the right edge of +the parent container. In contrast, widgets displayed as a +{jwt-javadoc}WWidget.html#setInline(boolean)[block] stack vertically +with respect to sibling widgets. Block widgets allow more control over +their position and size than inline widgets, and may also float to the +left or right border of the parent container. + +Layout managers are implemented by classes that derive from +{jwt-javadoc}WLayout.html[`+WLayout+`] and are used in conjunction with +the {jwt-javadoc}WContainerWidget.html[`+WContainerWidget+`] class. + +==== Style + +For visual markup of widgets, the recommended way is to use CSS style +sheets. These allow the visual look to be defined separately from the +the rest of the application. External stylesheets may be loaded using +{jwt-javadoc}WApplication.html#useStyleSheet(eu.webtoolkit.jwt.WLink)[`+WApplication.useStyleSheet()+`] +and the external stylesheet may be manipulated using +{jwt-javadoc}WApplication.html#getStyleSheet()[`+WApplication.getStyleSheet()+`]. + +In the stylesheets, you describe rules that are prefixed by CSS +selectors. By setting matching style classes for your widgets using +{jwt-javadoc}WWidget.html#setStyleClass(java.lang.String)[`+WWidget.setStyleClass()+`], +these rules will be applied to your widgets. The recommended way for +the visual response to events is by changing the style class for the +widget. + +In addition to style sheets, Wt also supports the direct manipulation +of a widget's style, using +{jwt-javadoc}WWidget.html#getDecorationStyle()[`+WWidget.getDecorationStyle()+`]. + +==== Widget containers + +With a few exceptions, all widgets are a child of (and contained in) a +container widget such as +{jwt-javadoc}WContainerWidget.html[`+WContainerWidget+`] or +{jwt-javadoc}WTableCell.html[`+WTableCell+`]. A widget is inserted into a +`+WContainerWidget+` by adding the widget to the container using +{jwt-javadoc}WContainerWidget.html#addWidget(eu.webtoolkit.jwt.WWidget)[`+WContainerWidget.addWidget()+`], +or by passing the parent container as an argument to its +constructor. You may also add a widget to a container using a +{jwt-javadoc}WLayout.html[layout manager]. + +=== Application URL(s) + +A JWt application, like any other servlet, is deployed at a specific +location (URL) within your servlet container. +This location is configured through the `+url-pattern+` defined +in the `+servlet-mapping+` within your `+web.xml+` deployment descriptor, +and the context at which the application is deployed. In this mode, a +JWt application is a single page web application: the URL does not +change. + +A JWt application may also manage internal paths, which are URLs +_inside_ your application URL. To allow the servlet to handle all +internal paths too, you need to set an `+url-pattern+` that ends with +`+"/*"+`. Then, the internal path may be set and read using +{jwt-javadoc}WApplication.html#setInternalPath(java.lang.String)[`+WApplication.setInternalPath()+`] +and +{jwt-javadoc}WApplication.html#getInternalPath()[`+WApplication.getInternalPath()+`]. When +the internal path changes, this is reflected in the browser URL and an +entry is added to the browser history, allowing the user to use the +back and forward buttons to navigate through your application. + +When AJAX is available, the library will always avoid rerendering the +entire widget tree. For a plain HTML session, the session ID is appended +to the URL to avoid the session from reloading when the user navigates +using a {jwt-javadoc}WAnchor.html[`+WAnchor+`] to a new internal URL. + +To effectively change the internal path and obtain consistent +behavior with or without JavaScript, you should use a +{jwt-javadoc}WAnchor.html[`+WAnchor+`] to +let the user navigate to a new internal path. +The easiest way to do +this is by supplying a +{jwt-javadoc}WLink.html[`+WLink+`] with +{jwt-javadoc}LinkType.html#InternalPath[`+LinkType.InternalPath+`]. +This refers the anchor to a URL generated by +{jwt-javadoc}WApplication.html#getBookmarkUrl()[`+WApplication.getBookmarkUrl()+`] +for the new internal path (handling the plain HTML case), and binds a +JavaScript listener to its +{jwt-javadoc}WInteractWidget.html#clicked()[`+clicked()+`] signal, which changes +the internal path (handling the AJAX case). + +Finally, you can listen for path changes using the +{jwt-javadoc}WApplication.html#internalPathChanged()[`+WApplication.internalPathChanged()+`] +event to react to the user navigating through his history. + +When your applications uses internal URLs, this has consequences for +relative URLs to external resources (style sheets, images, JavaScript +files, etc.), since these are resolved taking into account the +current relative URL. All relative URLs that are known to the +application are automatically replaced by JWt with an absolute URL that +resolves these directly within the deployment location. You should use +absolute URLs in CSS or XHTML for them to work within each internal +path, since these cannot be fixed by JWt. + +=== Startup, session management and request handling + +JWt provides the abstract {jwt-javadoc}WtServlet.html[`+WtServlet+`] class +which implements the controller for an application. Every JWt +application must extend this class and implement its +{jwt-javadoc}WtServlet.html#createApplication(eu.webtoolkit.jwt.WEnvironment)[`+createApplication()+`] +to return a new {jwt-javadoc}WApplication.html[`+WApplication+`] +instance. This method is invoked by the library for every new session +(which corresponds to a new user accessing your web application). The +request arguments (as part of the +{jwt-javadoc}WEnvironment.html[`+WEnvironment+`] object) are passed to +this `+createApplication()+` function, and may be used to customize the +application or authenticate the user. See also <> for details on the application bootstrap method. + +At all times, the current `+WApplication+` instance is accessible using +the static method +{jwt-javadoc}WApplication.html#getInstance()[`+WApplication.getInstance()+`], +and is useful to inspect startup arguments and settings using +{jwt-javadoc}WApplication.html#getEnvironment()[`+getEnvironment()+`], to +set or change the application title using +{jwt-javadoc}WApplication.html#setTitle(java.lang.CharSequence)[`+setTitle()+`], +to specify a locale using +{jwt-javadoc}WApplication.html#setLocale(java.util.Locale)[`+setLocale()+`], +and many other application-wide settings. Access to this instance is +implemented using thread local storage. + +A session exits when the user browses away from the application, when +{jwt-javadoc}WApplication.html#quit()[`+WApplication.quit()+`] is called, +or when the servlet container is shut down. From this moment on, your +widget tree will be waiting to be garbage collected. Therefore, you +should release auxiliary resources held by your widgets or application +in the `+finalize()+` method of these objects. + +During the lifetime of a session, the controller implemented by +`+WtServlet+` will handle and interpret requests, invoke event handling +code, and render updates and changes to your widget tree. This is +strictly an internal affair of the library, except that it allows you +to scope the use of resources to a single request. To that extent, the +library provides a central entry point for doing things like acquiring +and releasing database connections and transactions, or have a single +place for handling internal application errors. Each request is +handled from within +{jwt-javadoc}WApplication.html#notify(eu.webtoolkit.jwt.WEvent)[`+WApplication.notify()+`], +and by reimplementing this method you may control resource usage +during each request. + +By default, servlet containers are configured to use cookies for +session tracking. This configuration disables a user to have multiple +concurrent sessions of the same application running in the same +browser. In order to achieve such behavior, you should configure your +servlet container to use URL session tracking instead. The +{jwt-javadoc}ServletInit.html[`+ServletInit+`] +`+ServletContextListener+` should take care of this, and can be configured as +a listener with the following XML in your `+web.xml+`: + +.web.xml +[source,xml] +---- + + + + eu.webtoolkit.jwt.ServletInit + + +---- + +=== Event handling + +To respond to user interactivity events, or in general to communicate +events from one widget to any other, JWt uses a signal/listener +system, which is a popular implementation of the _Observer_ pattern. + +Depending on the number of objects your signal propagates to +listeners, you need to use {jwt-javadoc}Signal.html[`+Signal+`], +{jwt-javadoc}Signal1.html[`+Signal1+`], +{jwt-javadoc}Signal2.html[`+Signal2+`], ... , {jwt-javadoc}Signal6.html[`+Signal6+`] +as a signal object. + +Listeners implement the corresponding listener class, and can be added +to a signal using `+addListener()+`. Because the listener interface only +requires the implementation of a single method, it is convenient to +use a lambda function or anonymous inner class to implement it. The +following example is taken from the hello example. + +.Adding a listener to a clicked() signal. +[source,java] +---- + nameEdit = new WLineEdit(getRoot()); + greeting = new WText(getRoot()); + + WPushButton button = new WPushButton("Greet me.", getRoot()); + + button.clicked().addListener(this, () -> { + greeting.setText("Hello there, " + nameEdit.getText()); + }); +---- + +The library defines several user event signals on various widgets, and +it is easy and convenient to add signals and listeners to widget +classes to communicate events and trigger callbacks. + +Event signals ({jwt-javadoc}EventSignal.html[`+EventSignal+`]) are signals +that may be triggered internally by the library to respond to user +interactivity events. The abstract base classes +{jwt-javadoc}WInteractWidget.html[`+WInteractWidget+`] and +{jwt-javadoc}WFormWidget.html[`+WFormWidget+`] define most of these event +signals. + +=== Server push +By default, updates to the user interface are possible only at startup, during any event (in a signal listener), +or at regular time points using {jwt-javadoc}WTimer.html[`+WTimer+`]. This is the normal JWt event loop. + +In some cases, one may want to modify the user interface from a second thread, outside the event loop. +While this may be worked around by the {jwt-javadoc}WTimer.html[`+WTimer+`], in some cases, there are +bandwidth and processing overheads associated which may be unnecessary, and which create a trade-off +with time resolution of the updates. + +When "server push" (also called "comet" in AJAX terminology) is enabled, widgets may be modified, +created, or deleted outside of the event loop (e.g. in response to execution of another thread), +and these changes are propagated by calling {jwt-javadoc}WApplication.html#triggerUpdate()[`+triggerUpdate()+`]. + +For more information, please refer to the reference documentation of +{jwt-javadoc}WApplication.html#enableUpdates(boolean)[`+WApplication.enableUpdates()+`]. +This function enables or disables server push. + +You can find a feature example on server push and a more elaborate `+simplechat+` example in the JWt source code. + +=== Optimizing client-side event handling + +By default, JWt performs all event processing server side. Every +connected event signal will cause the web browser to communicate with +the servlet container in order to invoke the listener's +implementation, and visual changes will be updated in the web page. + +However, JWt offers several options for incorporating client-side +event handling. This may in general increase responsiveness of the +application since the user gets an instant feed-back and the +communication delay is avoided. + +JWt provides a number of mechanisms to integrate JavaScript code with Java: + +* using {jwt-javadoc}JSlot.html[`+JSlot+`], you can specify the JavaScript for a + listener, when connected to an `+EventSignal+` or `+JSignal+`. +* using {jwt-javadoc}JSignal.html[`+JSignal+`], you can emit a Java signal from + JavaScript code, using a JavaScript function `+Wt.emit()+`. +* using {jwt-javadoc}WApplication.html#doJavaScript(java.lang.String)[`+WApplication.doJavaScript()+`], + you can call JavaScript code directly as part of event handling. + +[[bootstrap]] +=== Application bootstrap + +A JWt application may support both plain HTML and Ajax-enabled user +agents. When a first request is made for a new session, there is no +way of knowing whether the agent supports Ajax (and has it +enabled). The bootstrap procedure therefore has two strategies of +making the choice between a plain HTML and Ajax-enabled application +mode. + +==== Default bootstrap + +In the default bootstrap mode, for the normal case, a small bootstrap +HTML file is served, which detects presence of AJAX (and various other +environment properties). When no JavaScript +support is available, it automatically redirects the user to a plain +HTML version of the application. + +In this mode, the application is not started until the library has +determined AJAX support, which is made available in +{jwt-javadoc}WEnvironment.html#hasAjax()[`+WEnvironment.hasAjax()+`] which +is passed to the application constructor. + +In some special cases, this bootstrap is skipped and a plain HTML +version is served right away. This is for user agents that are identified as +spider bots, or user agents which are configured to not support AJAX +(well), see the +{jwt-javadoc}Configuration.html#getAjaxAgentList()[user agents] +configuration setting. + +There are some drawbacks to this bootstrap method: + +* the redirection without JavaScript support may not be supported by + all user agents. To handle this, the bootstrap page also shows a link and a redirect message + (see the + {jwt-javadoc}Configuration.html#getRedirectMessage()[redirect message] + configuration setting), which may confuse new users. +* there is an additional round trip before any contents are rendered. +* for an AJAX user interface, all contents will be loaded through + JavaScript. This has a drawback that some 3rd party JavaScript libraries do not + support being loaded on-demand. + +==== Progressive bootstrap + +While the default bootstrap already +honors the principle of graceful degradation, progressive bootstrap +implements this using the principle of +http://en.wikipedia.org/wiki/Progressive_enhancement[progressive +enhancement]. + +This bootstrap method may be enabled with the +{jwt-javadoc}Configuration.html#setProgressiveBootstrap(boolean)[progressive bootstrap] configuration setting. + +This bootstrap method will initially assume that the user agent is a +plain HTML user-agent and immediately create the application (with +{jwt-javadoc}WEnvironment.html#hasAjax()[`+WEnvironment.hasAjax()+`] +always returning `+false+`). The initial response will contain the initial +page suitable for a plain HTML user agent. + +JavaScript embedded in this page will sense for AJAX support and +trigger a second request which progresses the application to an AJAX +application (without repainting the entire user interface). To that extent, +it will change +{jwt-javadoc}WEnvironment.html#hasAjax()[`+WEnvironment.hasAjax()+`] to +return `+true+`, and invoke +{jwt-javadoc}WApplication.html#enableAjax()[`+WApplication.enableAjax()+`] +which in turn propagates +{jwt-javadoc}WWidget.html#enableAjax()[`+WWidget.enableAjax()+`] through the widget +hierarchy. This upgrade happens in the background, unnoticeable to the +user. + +This mitigates disadvantages associated with the default bootstrap, but has the +drawback of requiring consistent `+enableAjax()+` implementations and requiring more +server side processing. + +=== Painting + +JWt provides a vector graphics painting system which, depending on +browser support, uses one of three different methods to paint the +graphics (inline SVG, HTML 5 `++` element, or server side rendered PNG). +Vector graphics has as benefit a lower bandwidth usage, which is independent +of the image size and quality, and can be embedded within the HTML, +avoiding an additional round trip. To use the paint system, you need +to specialize {jwt-javadoc}WPaintedWidget.html[`+WPaintedWidget+`] and use +a {jwt-javadoc}WPainter.html[`+WPainter+`] to paint the contents of the +widget inside its +{jwt-javadoc}WPaintedWidget.html#paintEvent(eu.webtoolkit.jwt.WPaintDevice)[`+paintEvent()+`]. + +The charting library is built on top of this painting infrastructure. + +=== Deployment + +JWt uses the Java Servlet API, and thus JWt applications are all +compatible with commonly used servlet containers (Tomcat, Jetty, ...) +and JEE application servers (JBoss, Glassfish, ...). The most common +way to deploy a JWt application is by packaging the application as a +`+.war+` file and deploying it into a servlet container. Because JWt +applications are plain Java applications, without the need for code +generation or XML editing, JWt application development can be +conveniently done from your favorite Java IDE. See the +<> section for hints on how to create +war files and develop JWt applications from within Eclipse. + +=== Configuration + +JWt can be configured by changing values in the +{jwt-javadoc}Configuration.html[`+Configuration+`] object accessible via +the +{jwt-javadoc}WtServlet.html#getConfiguration()[`+WtServlet.getConfiguration()+`] +method. + +[[getting-started]] +== Getting started + +In this section, we will go through the steps to download and install +JWt, and deploy and run the examples that come bundled with it. We +will detail the procedure for the ubiquitous "Hello world" example, +but you can follow the same steps for each of the examples. + +[TIP] +==== +The examples that come with the library are each a self-contained project +that only requires the JWt library (and its dependencies) to get +going. You could structure your own projects in the same way as each +of these example projects, but it is up to you: the library does not +enforce a particular layout of your web application, it simply acts as +a library (rather than a "framework"). +==== + +We present two tracks for running your first JWt application: from +within the Eclipse IDE or from the command line. You will need to +download the JWt distribution which contains the library and its dependencies, +from the homepage's http://www.webtoolkit.eu/jwt#/download[download section]. + +=== "Hello world" from within Eclipse + +The library and all of the examples include a `+.project+` file which is +used by Eclipse to manage the build process. For deploying the web +application during development, we recommend using the +link:https://eclipse-jetty.github.io/[Eclipse Jetty] +plugin. + +==== Requirements + +To run the "Hello world" example with Eclipse you will need to install the +following: + +- Java Development Kit (version 11 or later), e.g. from https://adoptium.net/ +- Eclipse IDE from http://www.eclipse.org/downloads/ +- Eclipse Jetty plugin from https://eclipse-jetty.github.io/ + +==== Importing into Eclipse + +. Extract the JWt source distribution to a directory on your system. +. Start Eclipse. +. Right-click inside your "Project Explorer" and select "Import...". +. Select "General" -> "Existing Projects into Workspace" and click "Next". +. Click "Browse". +. Navigate to the directory where the JWt source distribution was extracted to. + Select the `+examples/hello+` directory and click "OK". ++ +[TIP] +==== +You can import multiple examples at once by selecting the `+examples+` +directory instead, and selecting multiple projects in the next step. +==== ++ +. The hello project will be visible and selected, click "Finish". +. The imported `+jwt-hello+` project becomes visible in the "Project + Explorer" tree. ++ +There are however still build errors as the JWt library and dependencies +are still missing. ++ +image:images/hello_world_import_7.png["jwt-hello project tree"] ++ +. We have provided an ant build script that copies the JWt library and +dependencies in the `+lib+` folder and also builds a `+.war+` file. ++ +Right-click on the `+build.xml+`, "Run As" -> "Ant Build". +When this is your first example, the build script will also build the +JWt library itself. ++ +. "Refresh" your jwt-hello project. The example is now built and ready to be + run. + +==== Running + +Below, we use the Eclipse Jetty plugin. You may also use any other +JEE application server (with integration in Eclipse) to which you +deploy the `+dist/jwt-hello.war+` file which has also been +built by the `+ant+` tool. + +. Open the 'Run' -> 'Run Configurations...' dialog. +. Create a new "Jetty Webapp". +. Click "Run" (your configuration settings will be saved). +. The servlet container starts listening on port 8080 +. Open your web browser and point it to http://localhost:8080/. + +image:images/hello_world_run_7.png["The example in Firefox"] + +=== "Hello world" from the command line using Ant + +To build the library and examples, we will be using _ant_, and for +deployment we will use the lightweight Jetty servlet container. + +==== Requirements + +To run the "Hello world" example from the command line you will need to +install the following: + +- Java Development Kit (version 11 or later), e.g. from https://adoptium.net/ +- Ant from https://ant.apache.org/ +- Jetty (version 9, preferably 10, or later) from https://www.eclipse.org/jetty/. + In the end, any servlet container or application server will do. + These instructions however assume Jetty. + +==== Building + +- Open you command line console. +- Extract the JWt source distribution to a directory on your system, and + navigate to this directory. +- Enter the `+examples/hello+` directory and run `+ant+`: ++ +..... +$ cd examples/hello +$ ant +..... ++ +This will build `+dist/jwt-hello.war+`, handling all of the dependencies +including JWt itself. + +==== Running + +- We'll call the location where you installed Jetty `+$JETTY_HOME+`. +- Create a `+jetty-base+` directory. We'll call this `+$JETTY_BASE+`. +- From the `+$JETTY_BASE+` directory, run `+java -jar $JETTY_HOME/start.jar --add-module=server,http,deploy+` +- Copy the `+jwt-hello.war+` to `+$JETTY_BASE/webapps/hello.war+`. +- Start Jetty: `+java -jar $JETTY_HOME/start.jar+` +- Open your preferred web browser and navigate to http://localhost:8080/hello/. + +image:images/hello_world_ant_1.png["The example in firefox"] + +=== A closer look at a JWt web application project structure + +Setting up a JWt project does not involve much, since JWt acts as a +Java library (on top of the Java servlet API). After running `+ant+` in +the JWt source distribution folder, all required jar files can be +found in the `+dist+` folder. To use JWt in your project, +you need only to include these jar files into your project library +path. + +The start point of your application is defined by extending +`+WtServlet+` which implements a Java servlet, and provides an entry +point to a JWt application. An example of this is +`+eu.webtoolkit.jwt.examples.hello.HelloMain+`. + +To deploy the web application you need to provide a `+WebRoot/WEB-INF/web.xml+` +configuration file which binds the servlet to a context path: + +.`+WebRoot/WEB-INF/web.xml+` +[source,xml] +---- + + + + eu.webtoolkit.jwt.ServletInit + + + + Hello + JWt Hello World example + JWt Hello World example + eu.webtoolkit.jwt.examples.hello.HelloMain + + + + Hello + /* + + +---- diff --git a/doc/userguide/userguide.doc b/doc/userguide/userguide.doc deleted file mode 100644 index 2387678cc..000000000 --- a/doc/userguide/userguide.doc +++ /dev/null @@ -1,564 +0,0 @@ -Jwt User Guide -============== - -Pieter Libin - -:jwt-version: 3.0.0 -:jwt-src-path: jwt-{jwt-version} -:jwt-javadoc: http://www.webtoolkit.eu/jwt/latest/doc/javadoc/eu/webtoolkit/jwt/ - -== Introduction - -JWt is a Java library for developing web applications. The library -uses the standard Java Servlet infrastructure, and therefore, a JWt -web application may be deployed in existing servlet containers or -JEE web application servers. - -The API is widget-centric, and inspired by existing Graphical User -Interface (GUI) APIs: a widget is a self-contained class which -encapsulates all event handling related to a user interface -element. The library offers an abstraction of many web-specific -implementation details, including event handling and graphics -support. In this way, the library choses a rendering strategy based on -the browser's capabilities (AJAX are plain HTML). Still, the library -supports the web semantics of URLs, bookmarks, and forward/backword -navigation and therefore also search engine interopability. - -== Library overview - -=== Widgets - -The {jwt-javadoc}WWidget.html[WWidget] class represents a widget, -which provides an abstraction of a visual entity. The entire -user-interface is specified by creating a hierarchical structure of -widgets, rooted at -{jwt-javadoc}WApplication.html#getRoot()[WApplication.getRoot()]. By -reacting to events related to these widgets, you can perform business -logic, and manipulate the widget hierarchy to update the user -interface. - -Any descendent class of {jwt-javadoc}WWidget.html[WWidget] is a -self-contained (reusable) class that encapsulates both the look and -behaviour, enabling the design of the user interface in an orthogonal -way. - -==== Layout - -Widgets are layed out (with a few exceptions) following their -hierarchical structure. You have two main options for lay-out of -children within a container. Either you use a CSS based layout, in -which case the CSS style properties of the container and children -together determine the result: each child manages its layout with -respect to its sibling following a (rather complex) set of -rules. Alternatively, JWt provides layout managers that may be used -for layout. - -CSS layout considers two important categories of layout. Text-like -widgets ({jwt-javadoc}WWidget.html#setInline(boolean)[inline]) flow -with sibling inline widgets in lines, wrapping at the right edge of -the parent container. In contrast, widgets displayed as a -{jwt-javadoc}WWidget.html#setInline(boolean)[block] stack vertically -with respect to sibling widgets. Block widgets allow more control over -their position and size than inline widgets, and may also float to the -left or right border of the parent container. - -Layout managers are implemented by classes that derive from -{jwt-javadoc}WLayout.html[WLayout] and are used in conjunction with -the {jwt-javadoc}WContainerWidget.html[WContainerWidget] class. Due to -limitations in CSS (and pedantic browser implementations), vertical -layout is not possible without JavaScript. - -==== Style - -For visual markup of widgets, the recommended way is to use CSS style -sheets. These allow the visual look to be defined seperately from the -the rest of the application. External stylesheets may be loaded using -{jwt-javadoc}WApplication.html#useStyleSheet(java.lang.String)[WApplication.useStyleSheet()] and the external stylesheet may be manipulated using {jwt-javadoc}WApplication.html#getStyleSheet()[WApplication.getStyleSheet()]. - -In the stylesheets, you describe rules that are prefixed by CSS -selectors. By setting matching style classes for your widgets using -{jwt-javadoc}WWidget.html#setStyleClass(java.lang.String)[WWidget.setStyleClass()], -these rules will be applied to your widgets. The recommended way for -the visual response to events is by changing the style class for the -widget. - -In addition to style sheets, Wt also supports the direct manipulation -of a widget's style, using -{jwt-javadoc}WWidget.html#getDecorationStyle()[WWidget.getDecorationStyle()]. - -==== Widget containers - -With a few exceptions, all widgets are child of (and contained in) a -container widget such as -{jwt-javadoc}WContainerWidget.html[WContainerWidget] or -{jwt-javadoc}WTableCell.html[WTableCell]. A widget is inserted into a -+WContainerWidget by adding the widget to the container using -{jwt-javadoc}WContainerWidget.html#addWidget(eu.webtoolkit.jwt.WWidget)[WContainerWidget.addWidget()], -or by passing the parent container as an argument to its -constructor. You may also add a widget to a container using a -{jwt-javadoc}WLayout.html[layout manager]. - -=== Application URL(s) - -A JWt application, like any other servlet, is deployed at a specific -location (URL) within your servlet container/J2EE application -server. This location is configured through the +url-pattern+ defined -in the +servlet-mapping+ within your +web.xml+ deployment descriptor, -and the context at which the application is deployed. In this mode, a -JWt application is a single page web application: the URL does not -change. - -A JWt application may also manage internal paths, which are URLs -_inside_ your application URL. To allow the servlet to handle all -internal paths too, you need to set an +url-pattern+ that ends with -+"/*"+. Then, the internal path may be set and read using -{jwt-javadoc}WApplication.html#setInternalPath()[WApplication.setInternalPath()] -and -{jwt-javadoc}WApplication.html#getInternalPath()[WApplication.getInternalPath()]. When -the internal path changes, this is reflected in the browser URL and an -entry is added to the browser history, allowing the user to use the -back and forward buttons to navigate through your application. - -When AJAX is available, the library will always avoid rerendering the -entire widget tree. To avoid rerendering only to change the URL, the -internal path is indicated using a name anchor (#) after the -deployment URL. For a plain HTML session, the session ID is appended -to the URL to avoid the session from reloading when the user navigates -using a {jwt-javadoc}WAnchor.html[WAnchor] to a new internal URL. - -To effectively change the internal path and obtain consistent -behaviour with or without JavaScript, you should use a +WAnchor+ to -let the user navigate to a new internal path. The easiest way to do -this is by using the -{jwt-javadoc}WAnchor.html#setRefInternalPath(java.lang.String)[WAnchor.setRefInternalPath()]. This -refers the anchor to a URL generated by -{jwt-javadoc}WApplication.html#getBookmarkUrl()[WApplication.getBookmarkUrl()] -for the new internal path (handling the plain HTML case), and binds a -JavaScript listener to its -{jwt-javadoc}WAnchor.html#clicked()[clicked()] signal, which changes -the internal path (handling the AJAX case). - -Finally, you can listen for path changes using the -{jwt-javadoc}WApplication.html#internalPathChanged()[WApplication.internalPathChanged()] -event to react to the user navigating through his history. - -When your applications uses internal URLs, this has consequences for -relative URLs to external resources (style sheets, images, JavaScript -files, etc...), since these are resolved taking into account the -current relative URL. All relative URLs that are known to the -application (e.g. those set in -{jwt-javadoc}WAnchor.html#setRef(java.lang.String)[WAnchor.setRef()], -{jwt-javadoc}WImage.html#setImageRef(java.lang.String)[WImage.setImageRef()], -{jwt-javadoc}WApplication.html#useStyleSheet(java.lang.String)[WApplication.useStyleSheet()], -etc...) are automatically replaced by JWt with an absolute URL that -resolves these directly within the deployment location. You should use -absolute URLs in CSS or XHTML for them to work within each internal -path, since these cannot be fixed by JWt. - -=== Startup, session management and request handling - -JWt provides the abstract {jwt-javadoc}WtServlet.html[WtServlet] class -which implements the controller for an application. Every JWt -application must extend this class and implement its -{jwt-javadoc}WtServlet.html#createApplication(eu.webtoolkit.jwt.WEnvironment)[createApplication()] -to return a new {jwt-javadoc}WApplication.html[WApplication] -instance. This method is invoked by the library for every new session -(which corresponds to a new user accessing your web application). The -request arguments (as part of the -{jwt-javadoc}WEnvironment.html[WEnvironment] object) are passed to -this createApplication function, and may be used to customize the -application or authenticate the user. See also <> for details on the application bootstrap method. - -At all times, the current +WApplication+ instance is accessible using -the static method -{jwt-javadoc}WApplication.html#getInstance()[WApplication.getInstance()], -and is useful to inspect startup arguments and settings using -{jwt-javadoc}WApplication.html#getEnvironment()[getEnvironment()], to -set or change the application title using -{jwt-javadoc}WApplication.html#setTitle(java.lang.CharSequence)[setTitle()], -to specify a locale using -{jwt-javadoc}WApplication.html#setLocale(java.util.Locale)[setLocale()], -and many other application-wide settings. Access to this instance is -implemented using thread local storage. - -A session exits when the user browses away from the application, when -{jwt-javadoc}WApplication.html#quit()[WApplication.quit()] is called, -or when the servlet container is shut down. From this moment on, your -widget tree will be waiting to be garbage collected. Therefore, you -should release auxiliary resources held by your widgets or application -in the finalize() method of these objects. - -During the lifetime of a session, the controller implemented by -+WtServlet+ will handle and interpret requests, invoke event handling -code, and render updates and changes to your widget tree. This is -strictly an internal affair of the library, except that it allows you -to scope the use of resources to a single request. To that extend, the -library provides a central entry point for doing things like acquiring -and releasing database connections and transactions, or have a single -place for handling internal application errors. Each request is -handled from within -{jwt-javadoc}WApplication.html#notify(eu.webtoolkit.jwt.WEvent)[WApplication.notify()], -and by reimplementing this method you may control resource usage -during each request. - -By default, servlet containers are configured to use cookies for -session tracking. This configuration disables a user to have multiple -concurrent sessions of the same application running in the same -browser. In order to achieve such behaviour, you should configure your -servlet container to use URL session tracking instead. This servlet -container specific configuration can be found in your servlet -container's documentation. The examples distributed with JWt contain -a configuration file for a number of servlet containers: Jetty -({jwt-src-path}/examples/hello/WebRoot/WEB-INF/jetty-web.xml), JBoss -({jwt-src-path}/examples/hello/WebRoot/WEB-INF/context.xml) and Tomcat -({jwt-src-path}/examples/hello/WebRoot/META-INF/context.xml). - -=== Event handling - -To respond to user-interactivity events, or in general to communicate -events from one widget to any other, JWt uses a signal/listener -system, which is a popular implementation of the _Observer_ pattern. - -Depending on the number of objects your signal propagates to -listeners, you need to use {jwt-javadoc}Signal.html[Signal], -{jwt-javadoc}Signal1.html[Signal1], -{jwt-javadoc}Signal2.html[Signal2], ..., -{jwt-javadoc}Signal6.html[Signal6] as a signal object. - -Listeners implement the corresponding listener class, and can be added -to a signal using +addListener()+. Because the listener interface only -requires the implementation of a single method, it is convenient to -use an anonymous inner class to implement it. The -following example is taken from the hello example. - -.Adding a listener to a clicked() signal. -[source,java] ----- - nameEdit = new WLineEdit(getRoot()); - greeting = new WText(getRoot()); - - WPushButton button = new WPushButton("Greet me.", getRoot()); - - button.clicked().addListener(this, new Signal.Listener() { - public void trigger() { - greeting.setText("Hello there, " + nameEdit.getText()); - } - }); ----- - -The library defines several user-event signals on various widgets, and -it is easy and convenient to add signals and listeners to widget -classes to communicate events and trigger callbacks. - -Event signals ({jwt-javadoc}EventSignal.html[EventSignal]) are signals -that may be triggered internally by the library to respond to user -interactivity events. The abstract base classes -{jwt-javadoc}WInteractWidget.html[WInteractWidget] and -{jwt-javadoc}WFormWidget.html[WFormWidget] define most of these event -signals. - -=== Server push -By default, updates to the user interface are possible only at startup, during any event (in a slot), or at regular time points using {jwt-javadoc}WTimer.html[WTimer]. This is the normal JWt event loop. - -In some cases, one may want to modify the user interface from a second thread, outside the event loop. While this may be worked around by the {jwt-javadoc}WTimer.html[WTimer], in some cases, there are bandwidth and processing overheads associated which may be unnecessary, and which create a trade-off with time resolution of the updates. - -When "server push" (what is called 'comet' in AJAX terminology) is enabled, widgets may then be modified, created or deleted outside of the event loop (e.g. in response to execution of another thread), and these changes are propagated by calling {jwt-javadoc}WApplication.html#triggerUpdate()[triggerUpdate()]. - -For more information, please refer to the reference documentation of {jwt-javadoc}WApplication.html#enableUpdates(boolean)[WApplication.enabledUpdates()], this function enables or disables server push. - -Note that server push works only if your servlet container supports the Servlet 3.0 API. You can find a feature example on server push and a more elaborate simplechat example in the JWt source code. - -=== Optimizing client-side event handling - -By default, JWt performs all event processing server-side. Every -connected event signal will cause the web browser to communicate with -the servlet container in order to invoke the listener's -implementation, and visual changes will be updated in the web page. - -However, JWt offers several options for incorporating client-side -event handling. This may in general increase responsiveness of the -application since the user gets an instant feed-back and the -communication delay is avoided. - -JWt provides a number of mechanisms to integrate JavaScript code with Java: - -* using {jwt-javadoc}JSlot.html[JSlot], you can specify the JavaScript for a - listener, when connected to an EventSignal Using -* using {jwt-javadoc}JSignal.html[JSignal], you can emit a Java signal from - JavaScript code, using a JavaScript function +Wt.emit()+. Using -* using {jwt-javadoc}WApplication.html#doJavaScript(java.lang.String,%20boolean)[WApplication.doJavaScript()], - you can call JavaScript code directly as part of event handling. - -[[bootstrap]] -=== Application bootstrap - -A JWt application may support both plain HTML and Ajax-enabled user -agents. When a first request is made for a new session, there is no -way of knowing whether the agent supports Ajax (and has it -enabled). The bootstrap procedure therefore has two strategies of -making the choice between a plain HTML and Ajax-enabled application -mode. - -==== Default bootstrap - -In the default bootstrap mode, for the normal case, a small bootstrap -HTML file is served, which detects presence of AJAX (and various other -environment properties such as presence of an internal path as an -anchor, cookie support, and IE VML DPI setting). When no JavaScript -support is available, it automatically redirects the user to a plain -HTML version of the application. - -In this mode, the application is not started until the library has -determined AJAX support, which is made available in -{jwt-javadoc}WEnvironment.html#hasAjax()[WEnvironment.hasAjax()] which -is passed to the application constructor. - -In some special cases, this bootstrap is skipped and a plain HTML -version is served. This is for user agents that are identified as -spider bots, or user agents which are configured to not support AJAX -(well), see the -{jwt-javadoc}Configuration.html#getAjaxAgentList()[user agents] -configuration setting. - -There are some draw-backs to this bootstrap method: - -* the redirection without JavaScript support may not be supported by - all user agents. To handle this, the boostrap page also shows a link and a redirect message - (see the - {jwt-javadoc}Configuration.html#getRedirectMessage()[redirect message] - configuration setting), which may confuse new users. -* there is an additional round-trip before any contents is rendered. -* for an AJAX user interface, all contents will be loaded through - JavaScript. This has a draw-back that IE may delay applying external - stylesheets after the contents has been rendered, which might cause - some confusion, and some 3rd party JavaScript libraries do not - support being loaded on-demand (with as most notable example, Google - ads). - -==== Progressive bootstrap - -Since JWt 2.99.4, a new bootstrap method has been added (initially -proposed by Anthony roger Buck). While the default bootstrap already -honors the principle of graceful degradation, this bootstrap -implements this using the principle of -http://en.wikipedia.org/wiki/Progressive_enhancement[progressive -enhancement] (and quite literally so). - -This bootstrap method may be enabled with the {jwt-javadoc}Configuration.html#setProgressiveBootstrap(boolean)[progressive bootstrap] configuration setting. - -This bootstrap method will initially assume that the user agent is a -plain HTML user-agent and immediately create the application (with -{jwt-javadoc}WEnvironment.html#hasAjax()[WEnvironment.hasAjax()] -always returning false). The initial response will contain the initial -page suitable for a plain HTML user-agent. - -JavaScript embedded in this page will sense for AJAX support and -trigger a second request which progresses the application to an AJAX -application (without repainting the user interface). To that extent, -it will change -{jwt-javadoc}WEnvironment.html#hasAjax()[WEnvironment.hasAjax()] to -return rue, and invoke -{jwt-javadoc}WApplication.html#enableAjax()[WApplication.enableAjax()] -which in turn propagates -{jwt-javadoc}WWidget.html[WWidget.enableAjax()] through the widget -hierarchy. This upgrade happens in the back-ground, unnoticed to the -user. - -This mitigates disadvantages associated with the default bootstrap, -but has the draw-backs of being a recent development in JWt, and it -requires slightly more server-side processing. - -=== Painting - -JWt provides a vector graphics painting system which depending on the -browser support uses one of three different methods to paint the -graphics (inline SVG, inline VML or HTML 5 element). Vector -graphics has as benefit a lower bandwidth usage, which is indepedent -of the image size and quality, and can be embedded within the HTML, -avoiding an additional round-trip. To use the paint system, you need -to specialize {jwt-javadoc}WPaintedWidget.html[WPaintedWidget] and use -a {jwt-javadoc}WPainter.html[WPainter] to paint the contents of the -widget inside its -{jwt-javadoc}WPaintedWidget.html#paintEvent(eu.webtoolkit.jwt.WPaintDevice)[paintEvent()]. - -The charting library is built on top of this painting infrastructure. - -=== Deployment - -JWt uses the Java Servlet API, and thus JWt applications are all -compatible with commonly used servlet containers (Tomcat, Jetty, ...) -and JEE application servers (JBoss, Glassfish, ...). The most common -way to deploy a JWt application is by packaging the application as a -war file and deploying it into a servlet container. Because JWt -applications are plain Java applications, without the need for code -generation or XML editing, JWt application development can be -conveniently done from your favourite Java IDE. See the -<> section for hints on how to create -war files and develop JWt applications from within Eclipse. - -=== Configuration - -JWt can be configured by changing values in the -{jwt-javadoc}Configuration.html[Configuration] object accessible via -the -{jwt-javadoc}WtServlet.html#getConfiguration()[WtServlet.getConfiguration()]. - -[[getting-started]] -== Getting started - -In this section, we will go through the steps to download and install -JWt, and deploy and run the examples that come bundled with it. We -will detail the procedure for the ubiquitious 'Hello world' example, -but you can follow the same steps for each of the examples. - -[TIP] - -The examples that come with the library are each a self-contained project -which only require the JWt library (and its dependencies) to get -going. You could structure your own projects in the same way as each -of these example projects, but it is up to you: the library does not -enforce a particular layout of your web application, it simply acts as -a library (rather than a 'framework'). - -We present two tracks for running your first JWt application: from -within the Eclipse IDE or from the command line. You will need to -download the JWt distribution which contains the library and its dependencies, -from the homepage's http://www.webtoolkit.eu/jwt#/download[download section]. - -=== 'Hello world' from within Eclipse - -The library and all of the examples include a +.project+ file which is -used by Eclipse to manage the build process. For deploying the web -application during development, we recommend using the 'run-jetty-run' -plugin. - -==== Requirements -To run the 'Hello world' example with Eclipse you will need to install the -following softwares: - -- Java Standard Edition Development Kit (version 5.0 or later) from http://java.sun.com/javase/downloads/ -- Eclipse IDE (Java/JEE Edition 3.4.2 or later) from http://www.eclipse.org/downloads/ -- run-jetty-run plugin (1.1.1 or later) from http://code.google.com/p/run-jetty-run/ - -==== Importing into Eclipse - -. Extract the JWt source distribution to a directory on your system. -. Start Eclipse. -. Right-click inside your 'Project Explorer' and select 'Import' -> 'Import...'. -. Select 'General' -> 'Existing Projects into Workspace' and click 'Next'. -. Click 'Browse'. -. Navigate to the directory where the JWt source distribution was extracted to. - Select the +examples/hello+ directory and click 'OK'. -+ -[TIP] -You can import multiple examples at once by selecting the +examples+ -directory instead, and selecting multiple projects in the next step. -+ -. The hello project will be visible and selected, click 'Finish'. -. The imported +jwt-hello+ project becomes visible in the 'Project - Explorer' tree. -+ -There are however still build errors as the JWt library and dependencies -are still missing. -+ -image:images/hello_world_import_7.png["jwt-hello project tree"] -+ -. We have provided an ant build script that copies the JWt library and -dependencies in the +lib+ folder and also builds a 'war' file. -+ -Right-click on the +build.xml+, 'Run As' -> 'Ant Build'. -When this is your first example, the build script will also build the -JWt library itself. -+ -. 'Refresh' your jwt-hello project. The example is now built and ready to be - run. - -==== Running - -Below, we use the 'run-jetty-run' plugin. You may also use any other -JEE application server (with integration in Eclipse) to which you -deploy the +dist/jwt-hello.war+ file which has also been -built by the ant tool. - -. Open the 'Run' -> 'Run Configurations...' dialog. -. Create a new 'Jetty Webapp'. -+ -Since this example does not require HTTPS, remove the HTTPS port value in the -'Ports' section. Removing this value will disable all other HTTPS related -settings. -+ -. Click on the 'Browse...' button in the 'Web Application' section and select -the 'WebRoot' folder. -+ -. Click 'Run' (your configuration settings will be saved). -+ -. The servlet container starts listening on port 8080 -. Open your web browser and point it to +http://localhost:8080/+. -+ -image:images/hello_world_run_7.png["The example in Firefox"] - -=== 'Hello world' from the command line using Ant - -To build the library and examples, we will be using _ant_, and for -deployemt we will use the light-weight _Jetty_ servlet container. - -==== Requirements -To run the 'Hello world' example from the command line you will need to -install the following softwares: - -- Java Standard Edition Development Kit (version 5.0 or later) from - http://java.sun.com/javase/downloads/ -- Ant (version 1.7.1 or later) from - http://ant.apache.org/ -- Jetty (version 6.1.18 or later) from - http://www.mortbay.org/jetty/ (in the end, any servlet container or - application server will do, these instructions however assume Jetty) - -==== Building -- Open you command line console. -- Extract the JWt source distribution to a directory on your system, and - navigate to this directory. -- Enter the +examples/hello+ directory and run 'ant': -+ -..... -$ cd examples/hello -$ ant -..... -+ -This will build +dist/jwt-hello.war+, handling all of the dependencies -including JWt itself. - -==== Running -- Copy the +jwt-hello.war+ to +jetty-install-dir/webapps/hello.war+. -- Start Jetty: - * On Unix: `jetty-install-dir/bin/jetty.sh start` - * On Windows: `java -jar jetty-install-dir\start.jar` -- Open your preferred web browser and navigate to - http://localhost:8080/hello/. - -image:images/hello_world_ant_1.png["The example in firefox"] - -=== A closer look at a JWt web application project structure - -A JWt project is a setup does not involve much, since JWt acts as a -Java library (on top of the Java servlet API). After running 'ant' in -the JWt source distrubition folder, all required jar files can be -found in the +{jwt-src-path}/dist+ folder. To use JWt in your project, -you need only to include these 4 jar files into your project library -path. - -The start point of your application is defined by extending -'WtServlet' which implements a Java servlet, and provides an entry -point to a JWt application. An example of this is -'eu.webtoolkit.jwt.examples.hello.HelloMain'. - -To deploy the web application you need to provide a +WebRoot/web.xml+ -configuration file which binds the servlet to a context path: - -=== Using server push requires the Servlet 3.0 API -Server push (used in the simplechat and serverpush feature example) relies on the asynchronous processing of requests, a feature which is only part of the Servlet API since version 3.0. Several servlet containers are currently implementing this new Servlet API, and no official releases exist. We were able to test our examples successfully on Tomcat 7.0.4 Beta. - -A note when developing your own server push applications: make sure to include the servlet-api-3.0.jar during compilation, as demonstrated in the build.xml of the serverpush feature example (examples/features/serverpush). - - diff --git a/examples/bobsmith/.classpath b/examples/bobsmith/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/bobsmith/.classpath +++ b/examples/bobsmith/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/charts/.classpath b/examples/charts/.classpath index 18bd98587..94b0980f5 100644 --- a/examples/charts/.classpath +++ b/examples/charts/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/composer/.classpath b/examples/composer/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/composer/.classpath +++ b/examples/composer/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/dialog/.classpath b/examples/dialog/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/dialog/.classpath +++ b/examples/dialog/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/dragdrop/.classpath b/examples/dragdrop/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/dragdrop/.classpath +++ b/examples/dragdrop/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/auth1/.classpath b/examples/feature/auth1/.classpath index 2f1d26da1..b55736f9b 100644 --- a/examples/feature/auth1/.classpath +++ b/examples/feature/auth1/.classpath @@ -27,8 +27,8 @@ - - + + diff --git a/examples/feature/itemmodel/.classpath b/examples/feature/itemmodel/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/feature/itemmodel/.classpath +++ b/examples/feature/itemmodel/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/mediaplayer/.classpath b/examples/feature/mediaplayer/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/feature/mediaplayer/.classpath +++ b/examples/feature/mediaplayer/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/feature/serverpush/.classpath b/examples/feature/serverpush/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/feature/serverpush/.classpath +++ b/examples/feature/serverpush/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/filetreetable/.classpath b/examples/filetreetable/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/filetreetable/.classpath +++ b/examples/filetreetable/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/form/.classpath b/examples/form/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/form/.classpath +++ b/examples/form/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/googlemap/.classpath b/examples/googlemap/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/googlemap/.classpath +++ b/examples/googlemap/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/hello-mvn/pom.xml b/examples/hello-mvn/pom.xml index f4e5932e7..6390af01a 100644 --- a/examples/hello-mvn/pom.xml +++ b/examples/hello-mvn/pom.xml @@ -29,7 +29,7 @@ eu.webtoolkit jwt - 4.10.0 + 4.10.1 diff --git a/examples/hello/.classpath b/examples/hello/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/hello/.classpath +++ b/examples/hello/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/hello/src/eu/webtoolkit/jwt/examples/hello/HelloApplication.java b/examples/hello/src/eu/webtoolkit/jwt/examples/hello/HelloApplication.java index 484444a4b..56559f21c 100644 --- a/examples/hello/src/eu/webtoolkit/jwt/examples/hello/HelloApplication.java +++ b/examples/hello/src/eu/webtoolkit/jwt/examples/hello/HelloApplication.java @@ -35,10 +35,8 @@ public HelloApplication(WEnvironment env) { final WText greeting = new WText(getRoot()); - button.clicked().addListener(this, new Signal.Listener() { - public void trigger() { - greeting.setText("Hello there, " + nameEdit.getText()); - } + button.clicked().addListener(this, () -> { + greeting.setText("Hello there, " + nameEdit.getText()); }); } } diff --git a/examples/hellowidgetset/.classpath b/examples/hellowidgetset/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/hellowidgetset/.classpath +++ b/examples/hellowidgetset/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/javascript/.classpath b/examples/javascript/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/javascript/.classpath +++ b/examples/javascript/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/mandelbrot/.classpath b/examples/mandelbrot/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/mandelbrot/.classpath +++ b/examples/mandelbrot/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/mission/.classpath b/examples/mission/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/mission/.classpath +++ b/examples/mission/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/painting/.classpath b/examples/painting/.classpath index cd4700c5d..ca62cdf13 100644 --- a/examples/painting/.classpath +++ b/examples/painting/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/planner/.classpath b/examples/planner/.classpath index 21cf2ab8e..794787700 100644 --- a/examples/planner/.classpath +++ b/examples/planner/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/simplechat/.classpath b/examples/simplechat/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/simplechat/.classpath +++ b/examples/simplechat/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/style/.classpath b/examples/style/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/style/.classpath +++ b/examples/style/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/textedit/.classpath b/examples/textedit/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/textedit/.classpath +++ b/examples/textedit/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/treeview/.classpath b/examples/treeview/.classpath index 0f311a2fa..db061cb72 100644 --- a/examples/treeview/.classpath +++ b/examples/treeview/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/treeviewdragdrop/.classpath b/examples/treeviewdragdrop/.classpath index 3c43d8bb7..05c697c41 100644 --- a/examples/treeviewdragdrop/.classpath +++ b/examples/treeviewdragdrop/.classpath @@ -4,7 +4,7 @@ - + diff --git a/examples/widgetgallery/.classpath b/examples/widgetgallery/.classpath index 10e5f6d70..1cbd92e49 100644 --- a/examples/widgetgallery/.classpath +++ b/examples/widgetgallery/.classpath @@ -3,7 +3,7 @@ - + diff --git a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml index 2e8bfd4d6..83e69a7a3 100644 --- a/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml +++ b/examples/widgetgallery/src/eu/webtoolkit/jwt/examples/widgetgallery/src.xml @@ -740,6 +740,243 @@ } }); } + + ]]> +
  void DateEditNative() {
+    WTemplate form = new WTemplate(WString.tr("dateEdit-template"));
+    form.addFunction("id", WTemplate.Functions.id);
+    final WDateEdit de1 = new WDateEdit();
+    form.bindWidget("from", de1);
+    de1.setDate(WDate.getCurrentServerDate().addDays(1));
+    de1.setNativeControl(true);
+    final WDateEdit de2 = new WDateEdit();
+    form.bindWidget("to", de2);
+    de2.setFormat("dd MM yyyy");
+    de2.getCalendar().setHorizontalHeaderFormat(CalendarHeaderFormat.SingleLetterDayNames);
+    de2.setBottom(de1.getDate());
+    de2.setNativeControl(true);
+    WPushButton button = new WPushButton("Save");
+    form.bindWidget("save", button);
+    final WText out = new WText();
+    form.bindWidget("out", out);
+    de1.changed()
+        .addListener(
+            this,
+            () -> {
+              if (de1.validate() == ValidationState.Valid) {
+                de2.setBottom(de1.getDate());
+                out.setText("Date picker 1 is changed.");
+              }
+            });
+    de2.changed()
+        .addListener(
+            this,
+            () -> {
+              if (de1.validate() == ValidationState.Valid) {
+                de1.setTop(de2.getDate());
+                out.setText("Date picker 2 is changed.");
+              }
+            });
+    button
+        .clicked()
+        .addListener(
+            this,
+            () -> {
+              if (de1.getText().length() == 0 || de2.getText().length() == 0) {
+                out.setText("You should enter two dates!");
+              } else {
+                int days = de1.getDate().getDaysTo(de2.getDate()) + 1;
+                if (days == 1) {
+                  out.setText("It's fine to take holiday just for one day!");
+                } else {
+                  if (days > 1) {
+                    out.setText(
+                        new WString("So, you want to take holiday for a period of {1} days?")
+                            .arg(days));
+                  } else {
+                    out.setText("Invalid period!");
+                  }
+                }
+              }
+            });
+  }
+
+ ]]>
+
  void DateTimeEdit() {
+    WTemplate form = new WTemplate(WString.tr("dateTimeEdit-template"));
+    form.addFunction("id", WTemplate.Functions.id);
+    final WDateTimeEdit dte1 = new WDateTimeEdit();
+    form.bindWidget("from", dte1);
+    dte1.setDateTime(
+        new WDate(
+            WDate.getCurrentServerDate().addDays(0).getYear(),
+            WDate.getCurrentServerDate().addDays(0).getMonth(),
+            WDate.getCurrentServerDate().addDays(0).getDay(),
+            WTime.getCurrentTime().getHour(),
+            WTime.getCurrentTime().getMinute(),
+            WTime.getCurrentTime().getSecond(),
+            WTime.getCurrentTime().getMsec()));
+    dte1.setFormat("yyyy-MM-dd HH:mm");
+    form.bindString("from-format", dte1.getFormat());
+    final WDateTimeEdit dte2 = new WDateTimeEdit();
+    form.bindWidget("to", dte2);
+    dte2.setDateTime(
+        new WDate(
+            WDate.getCurrentServerDate().getYear(),
+            WDate.getCurrentServerDate().getMonth(),
+            WDate.getCurrentServerDate().getDay(),
+            WTime.getCurrentTime().getHour(),
+            WTime.getCurrentTime().getMinute(),
+            WTime.getCurrentTime().getSecond(),
+            WTime.getCurrentTime().getMsec()));
+    dte2.setFormat("dd MM yyyy hh:mm:ss.SSS a");
+    form.bindString("to-format", dte2.getFormat());
+    dte2.setBottom(dte1.getDateTime());
+    WPushButton button = new WPushButton("Save");
+    form.bindWidget("save", button);
+    final WText out = new WText();
+    form.bindWidget("out", out);
+    dte1.changed()
+        .addListener(
+            this,
+            () -> {
+              if (dte1.validate() == ValidationState.Valid) {
+                out.setText("DateTime 1 is changed.");
+              }
+            });
+    dte2.changed()
+        .addListener(
+            this,
+            () -> {
+              if (dte2.validate() == ValidationState.Valid) {
+                out.setText("DateTime 2 is changed.");
+              }
+            });
+    button
+        .clicked()
+        .addListener(
+            this,
+            () -> {
+              if (dte1.getText().length() == 0 || dte2.getText().length() == 0) {
+                out.setText("You should enter two dates and times!");
+              } else {
+                long secs = dte1.getDateTime().getTime().secsTo(dte2.getDateTime().getTime());
+                int days = dte1.getDateTime().getDaysTo(dte2.getDateTime());
+                if (days < 0 || days == 0 && secs < 0) {
+                  out.setText(new WString("You cannot rent a car for a negative amount of time."));
+                } else {
+                  if (days >= 1) {
+                    out.setText(
+                        new WString("So, you want to rent a car for {1} day(s)?").arg(days));
+                  } else {
+                    if (secs > 60 * 60) {
+                      out.setText(
+                          new WString("So, you want you want to rent a car for {1} hour(s)?")
+                              .arg(secs / (60 * 60)));
+                    } else {
+                      if (secs == 60 * 60) {
+                        out.setText(new WString("So, you want to rent a car for a hour?"));
+                      } else {
+                        out.setText(
+                            new WString("Sorry, you can't rent a car for less than a hour."));
+                      }
+                    }
+                  }
+                }
+              }
+            });
+  }
+
+ ]]>
+
  void DateTimeNativeEdit() {
+    WTemplate form = new WTemplate(WString.tr("dateTimeEdit-template"));
+    form.addFunction("id", WTemplate.Functions.id);
+    final WDateTimeEdit dte1 = new WDateTimeEdit();
+    form.bindWidget("from", dte1);
+    dte1.setDateTime(
+        new WDate(
+            WDate.getCurrentServerDate().addDays(0).getYear(),
+            WDate.getCurrentServerDate().addDays(0).getMonth(),
+            WDate.getCurrentServerDate().addDays(0).getDay(),
+            WTime.getCurrentTime().getHour(),
+            WTime.getCurrentTime().getMinute(),
+            WTime.getCurrentTime().getSecond(),
+            WTime.getCurrentTime().getMsec()));
+    dte1.setFormat("yyyy-MM-dd HH:mm");
+    dte1.setNativeControl(true);
+    form.bindString("from-format", dte1.getFormat());
+    final WDateTimeEdit dte2 = new WDateTimeEdit();
+    form.bindWidget("to", dte2);
+    dte2.setDateTime(
+        new WDate(
+            WDate.getCurrentServerDate().getYear(),
+            WDate.getCurrentServerDate().getMonth(),
+            WDate.getCurrentServerDate().getDay(),
+            WTime.getCurrentTime().getHour(),
+            WTime.getCurrentTime().getMinute(),
+            WTime.getCurrentTime().getSecond(),
+            WTime.getCurrentTime().getMsec()));
+    dte2.setNativeControl(true);
+    dte2.setFormat("dd MM yyyy hh:mm:ss.SSS a");
+    form.bindString("to-format", dte2.getFormat());
+    dte2.setBottom(dte1.getDateTime());
+    WPushButton button = new WPushButton("Save");
+    form.bindWidget("save", button);
+    final WText out = new WText();
+    form.bindWidget("out", out);
+    dte1.changed()
+        .addListener(
+            this,
+            () -> {
+              if (dte1.validate() == ValidationState.Valid) {
+                out.setText("DateTime 1 is changed.");
+              }
+            });
+    dte2.changed()
+        .addListener(
+            this,
+            () -> {
+              if (dte2.validate() == ValidationState.Valid) {
+                out.setText("DateTime 2 is changed.");
+              }
+            });
+    button
+        .clicked()
+        .addListener(
+            this,
+            () -> {
+              if (dte1.getText().length() == 0 || dte2.getText().length() == 0) {
+                out.setText("You should enter two dates and times!");
+              } else {
+                long secs = dte1.getDateTime().getTime().secsTo(dte2.getDateTime().getTime());
+                int days = dte1.getDateTime().getDaysTo(dte2.getDateTime());
+                if (days < 0 || days == 0 && secs < 0) {
+                  out.setText(new WString("You cannot rent a car for a negative amount of time."));
+                } else {
+                  if (days >= 1) {
+                    out.setText(
+                        new WString("So, you want to rent a car for {1} day(s)?").arg(days));
+                  } else {
+                    if (secs > 60 * 60) {
+                      out.setText(
+                          new WString("So, you want you want to rent a car for {1} hour(s)?")
+                              .arg(secs / (60 * 60)));
+                    } else {
+                      if (secs == 60 * 60) {
+                        out.setText(new WString("So, you want to rent a car for a hour?"));
+                      } else {
+                        out.setText(
+                            new WString("Sorry, you can't rent a car for less than a hour."));
+                      }
+                    }
+                  }
+                }
+              }
+            });
+  }
 
]]>
} }); } + + ]]> +
  void TimeEditNative() {
+    WTemplate form = new WTemplate(WString.tr("timeEdit-template"));
+    form.addFunction("id", WTemplate.Functions.id);
+    final WTimeEdit te1 = new WTimeEdit();
+    form.bindWidget("from", te1);
+    form.bindString("from-format", te1.getFormat());
+    te1.setTime(WTime.getCurrentTime());
+    te1.setNativeControl(true);
+    final WTimeEdit te2 = new WTimeEdit();
+    form.bindWidget("to", te2);
+    te2.setFormat("h:mm:ss.SSS a");
+    te2.setTime(WTime.getCurrentTime().addSecs(60 * 15));
+    te2.setNativeControl(true);
+    form.bindString("to-format", te2.getFormat());
+    WPushButton button = new WPushButton("Save");
+    form.bindWidget("save", button);
+    final WText out = new WText();
+    form.bindWidget("out", out);
+    te1.changed()
+        .addListener(
+            this,
+            () -> {
+              if (te1.validate() == ValidationState.Valid) {
+                out.setText("Time picker 1 is changed.");
+              }
+            });
+    te2.changed()
+        .addListener(
+            this,
+            () -> {
+              if (te2.validate() == ValidationState.Valid) {
+                out.setText("Time picker 2 is changed.");
+              }
+            });
+    button
+        .clicked()
+        .addListener(
+            this,
+            () -> {
+              if (te1.getText().length() == 0 || te2.getText().length() == 0) {
+                out.setText("You should enter two times!");
+              } else {
+                long secs = te1.getTime().secsTo(te2.getTime()) + 1;
+                if (secs <= 60 * 10) {
+                  out.setText("This is a really small range of time");
+                } else {
+                  out.setText(
+                      new WString("So, you want your package to be delivered between {1} and {2}?")
+                          .arg(te1.getTime().toString())
+                          .arg(te2.getTime().toString()));
+                }
+              }
+            });
+  }
 
]]>
jwt jar Java Web Toolkit - 4.10.0 + 4.10.1 Java library for developing web applications https://webtoolkit.eu/jwt/ diff --git a/jwt-auth-4.10.0.pom b/jwt-auth-4.10.1.pom similarity index 95% rename from jwt-auth-4.10.0.pom rename to jwt-auth-4.10.1.pom index 170860d44..c436bc6ea 100644 --- a/jwt-auth-4.10.0.pom +++ b/jwt-auth-4.10.1.pom @@ -10,7 +10,7 @@ jwt-auth jar Java Web Toolkit Authentication Library - 4.10.0 + 4.10.1 Authentication library for the Java Web Toolkit https://webtoolkit.eu/jwt/ @@ -31,7 +31,7 @@ eu.webtoolkit jwt - 4.10.0 + 4.10.1 diff --git a/overview.html b/overview.html index 62d3f4bfa..c01cb5ae7 100755 --- a/overview.html +++ b/overview.html @@ -11,7 +11,7 @@ dd p { margin-top: 0px; } dd div { margin: 10px 0px; } -JWt 4.10.0 +JWt 4.10.1 @@ -25,10 +25,40 @@

Release notes

the way you build JWt, the way you configure JWt or the JWt API and behaviour. It also indicates the main changes from version to verison. +

Release 4.10.1 (September 20, 2023)

+ +

+ Wt 4.10.1 is a patch release that addresses the following issues: +

+ +
    +
  • + Issue #11804: + the WEmailValidator was corrected. There was a missing case in the client side regex that did not allow a hyphen in the domain of an email address. + The server side regex was correct, but nevertheless the case has been added to the tests. +
  • +
  • + Issue #10512: + ensures that the disabled state of any WWebWidget or WCompositeWidget is correctly propagated to its children. + Before, if a user set a widget as disabled that contained children like a WMenu, a new WMenuItem could be added, that was enabled. + For some of the affected widgets, this meant that the new item could not be selected, since the signal was not exposed, but in some cases, like with a WMenu this was still possible. + The disabled state of a widget now propagates to its children so that a disabled state can be set consistently for a parent. This doesn't actually set setDisabled() of the children. + This state can be set separately to manage the child's disabled state without regard to its parent. +
  • +
  • + Issue #11741: + this corrects a small issue where a compiler directive cause a Java function to be empty, not allowing the release of a lock. +
  • +
  • + Issue #11848: + this corrects an edge-case in WSuggestionPopup where forcibly displaying the pop-up via Java code would cause it to be unfiltered. +
  • +
+

Release 4.10.0 (May 30, 2023)

- JWt 4.10.0 mainly consists of new features that provide some convenience and a back-end improvement. + JWt 4.10.0 mainly consists of new features that provide some convenience and a back-end improvement.

New features

@@ -64,6 +94,15 @@

Other improvements

Issue #11412: shift-click to open a new window did not work for links to internal paths. Shift-click is now handled by the browser, like ctrl- and meta-click. +
  • + Issue #11562: + The + user guide + was updated to be built with Asciidoctor instead of the legacy Python implementation, + its style was updated to match the JWt website style, and the text was brought up to + date a bit. +
  • Release 4.9.2 (April 18, 2023)

    diff --git a/src/eu/webtoolkit/jwt/DomElement.java b/src/eu/webtoolkit/jwt/DomElement.java index dd28596e0..1cfdd51f9 100644 --- a/src/eu/webtoolkit/jwt/DomElement.java +++ b/src/eu/webtoolkit/jwt/DomElement.java @@ -327,7 +327,7 @@ public void setEvent( js.append("o=this;"); if (anchorClick) { js.append( - "if(e.ctrlKey||e.metaKey||e.shiftKey||(Wt4_10_0.button(e) > 1))return true;else{"); + "if(e.ctrlKey||e.metaKey||e.shiftKey||(Wt4_10_1.button(e) > 1))return true;else{"); } js.append(jsCode); if (isExposed) { @@ -434,7 +434,7 @@ public void setTimeout(int delay, int interval) { public void callMethod(final String method) { ++this.numManipulations_; if (this.var_.length() == 0) { - this.javaScript_.append("Wt4_10_0").append(".$('").append(this.id_).append("')."); + this.javaScript_.append("Wt4_10_1").append(".$('").append(this.id_).append("')."); } else { this.javaScript_.append(this.var_).append('.'); } @@ -482,7 +482,7 @@ public final void removeAllChildren() { } /** Removes the element. */ public void removeFromParent() { - this.callJavaScript("Wt4_10_0.remove('" + this.getId() + "');", true); + this.callJavaScript("Wt4_10_1.remove('" + this.getId() + "');", true); } /** Replaces the element by another element. */ public void replaceWith(DomElement newElement) { @@ -571,7 +571,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority if (this.removeAllChildren_ >= 0) { this.declare(out); if (this.removeAllChildren_ == 0) { - out.append("Wt4_10_0").append(".setHtml(").append(this.var_).append(", '');\n"); + out.append("Wt4_10_1").append(".setHtml(").append(this.var_).append(", '');\n"); } else { out.append("(Array.from(") .append(this.var_) @@ -604,18 +604,18 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority if (this.properties_.get(Property.StyleDisplay) != null) { String style = this.properties_.get(Property.StyleDisplay); if (style.equals("none")) { - out.append("Wt4_10_0.hide('").append(this.id_).append("');\n"); + out.append("Wt4_10_1.hide('").append(this.id_).append("');\n"); return this.var_; } else { if (style.equals("inline")) { - out.append("Wt4_10_0.inline('" + this.id_ + "');\n"); + out.append("Wt4_10_1.inline('" + this.id_ + "');\n"); return this.var_; } else { if (style.equals("block")) { - out.append("Wt4_10_0.block('" + this.id_ + "');\n"); + out.append("Wt4_10_1.block('" + this.id_ + "');\n"); return this.var_; } else { - out.append("Wt4_10_0.show('") + out.append("Wt4_10_1.show('") .append(this.id_) .append("', '") .append(style) @@ -632,7 +632,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } } if (this.unwrapped_) { - out.append("Wt4_10_0.unwrap('").append(this.id_).append("');\n"); + out.append("Wt4_10_1.unwrap('").append(this.id_).append("');\n"); } this.processEvents(app); this.processProperties(app); @@ -649,7 +649,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority .append(");\n"); this.replaced_.createElement(out, app, insertJs.toString()); if (this.unstubbed_) { - out.append("Wt4_10_0.unstub(") + out.append("Wt4_10_1.unstub(") .append(this.var_) .append(',') .append(varr) @@ -675,14 +675,14 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } if (!this.childrenToSave_.isEmpty()) { this.declare(out); - out.append("Wt4_10_0").append(".saveReparented(").append(this.var_).append(");"); + out.append("Wt4_10_1").append(".saveReparented(").append(this.var_).append(");"); } for (int i = 0; i < this.childrenToSave_.size(); ++i) { out.append("var c") .append(this.var_) .append((int) i) .append('=') - .append("Wt4_10_0.$('") + .append("Wt4_10_1.$('") .append(this.childrenToSave_.get(i)) .append("')"); if (app.getEnvironment().agentIsIE()) { @@ -704,7 +704,7 @@ public String asJavaScript(final EscapeOStream out, DomElement.Priority priority } this.renderInnerHtmlJS(out, app); for (int i = 0; i < this.childrenToSave_.size(); ++i) { - out.append("Wt4_10_0.replaceWith('") + out.append("Wt4_10_1.replaceWith('") .append(this.childrenToSave_.get(i)) .append("',c") .append(this.var_) @@ -1088,7 +1088,7 @@ public void declare(final EscapeOStream out) { if (this.var_.length() == 0) { out.append("var ") .append(this.getCreateVar()) - .append("=Wt4_10_0.$('") + .append("=Wt4_10_1.$('") .append(this.id_) .append("');\n"); } @@ -1320,7 +1320,7 @@ private void processEvents(WApplication app) { DomElement.EventHandler keypress = this.eventHandlers_.get(S_keypress); if (keypress != null && keypress.jsCode.length() != 0) { MapUtils.access(self.eventHandlers_, S_keypress, DomElement.EventHandler.class).jsCode = - "if (Wt4_10_0.isKeyPress(event)){" + "if (Wt4_10_1.isKeyPress(event)){" + MapUtils.access(self.eventHandlers_, S_keypress, DomElement.EventHandler.class) .jsCode + '}'; @@ -1336,7 +1336,7 @@ private void processProperties(WApplication app) { if (minw != null || maxw != null) { if (w == null) { StringBuilder expr = new StringBuilder(); - expr.append("Wt4_10_0.IEwidth(this,"); + expr.append("Wt4_10_1.IEwidth(this,"); if (minw != null) { expr.append('\'').append(minw).append('\''); self.properties_.remove(Property.StyleMinWidth); @@ -1375,7 +1375,7 @@ private void setJavaScriptProperties(final EscapeOStream out, WApplication app) if (this.willRenderInnerHtmlJS(app)) { break; } - out.append("Wt4_10_0.setHtml(").append(this.var_).append(','); + out.append("Wt4_10_1.setHtml(").append(this.var_).append(','); if (!pushed) { escaped.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote); pushed = true; @@ -1614,7 +1614,7 @@ private String addToParent( StringBuilder insertJS = new StringBuilder(); if (pos != -1) { insertJS - .append("Wt4_10_0.insertAt(") + .append("Wt4_10_1.insertAt(") .append(parentVar) .append(",") .append(this.var_) @@ -1648,7 +1648,7 @@ private void renderInnerHtmlJS(final EscapeOStream out, WApplication app) { || !this.childrenHtml_.isEmpty() || innerHTML.length() != 0) { this.declare(out); - out.append("Wt4_10_0.setHtml(").append(this.var_).append(",'"); + out.append("Wt4_10_1.setHtml(").append(this.var_).append(",'"); out.pushEscape(EscapeOStream.RuleSet.JsStringLiteralSQuote); List timeouts = new ArrayList(); EscapeOStream js = new EscapeOStream(); diff --git a/src/eu/webtoolkit/jwt/EntryPointType.java b/src/eu/webtoolkit/jwt/EntryPointType.java index 7c97a8cef..cb8b6a4a2 100644 --- a/src/eu/webtoolkit/jwt/EntryPointType.java +++ b/src/eu/webtoolkit/jwt/EntryPointType.java @@ -46,7 +46,7 @@ public enum EntryPointType { *

    * *

    Note: A {@link EntryPointType#WidgetSet WidgetSet} application requires JavaScript - * support + * support * * @see WApplication#bindWidget(WWidget widget, String domId) */ diff --git a/src/eu/webtoolkit/jwt/FlexLayoutImpl.java b/src/eu/webtoolkit/jwt/FlexLayoutImpl.java index ef659282e..77f77b4c8 100644 --- a/src/eu/webtoolkit/jwt/FlexLayoutImpl.java +++ b/src/eu/webtoolkit/jwt/FlexLayoutImpl.java @@ -84,7 +84,7 @@ public void updateDom(final DomElement parent) { } this.addedItems_.clear(); for (int i = 0; i < this.removedItems_.size(); ++i) { - div.callJavaScript("Wt4_10_0.remove('" + this.removedItems_.get(i) + "');", true); + div.callJavaScript("Wt4_10_1.remove('" + this.removedItems_.get(i) + "');", true); } this.removedItems_.clear(); div.callMethod("layout.adjust()"); @@ -153,7 +153,7 @@ public DomElement createDomElement( result.addChild(el); } StringBuilder js = new StringBuilder(); - js.append("layout=new Wt4_10_0.FlexLayout(") + js.append("layout=new Wt4_10_1.FlexLayout(") .append(app.getJavaScriptClass()) .append(",'") .append(this.elId_) diff --git a/src/eu/webtoolkit/jwt/PaintedSlider.java b/src/eu/webtoolkit/jwt/PaintedSlider.java index 86af8e3d8..cc9624d49 100644 --- a/src/eu/webtoolkit/jwt/PaintedSlider.java +++ b/src/eu/webtoolkit/jwt/PaintedSlider.java @@ -134,7 +134,7 @@ public void updateState() { char[] buf = new char[30]; StringBuilder mouseDownJS = new StringBuilder(); mouseDownJS - .append("obj.setAttribute('down', Wt4_10_0") + .append("obj.setAttribute('down', Wt4_10_1") .append(".widgetCoordinates(obj, event).") .append(u) .append(");"); @@ -168,7 +168,7 @@ public void updateState() { StringBuilder mouseMovedJS = new StringBuilder(); mouseMovedJS .append("var down = obj.getAttribute('down');") - .append("var WT = Wt4_10_0;") + .append("var WT = Wt4_10_1;") .append("if (down != null && down != '') {") .append(computeD.toString()); mouseMovedJS @@ -212,7 +212,7 @@ public void updateState() { StringBuilder mouseUpJS = new StringBuilder(); mouseUpJS .append("var down = obj.getAttribute('down');") - .append("var WT = Wt4_10_0;") + .append("var WT = Wt4_10_1;") .append("if (down != null && down != '') {") .append(computeD.toString()) .append("d += ") diff --git a/src/eu/webtoolkit/jwt/ResizeSensor.java b/src/eu/webtoolkit/jwt/ResizeSensor.java index 880da4a45..c32012b90 100644 --- a/src/eu/webtoolkit/jwt/ResizeSensor.java +++ b/src/eu/webtoolkit/jwt/ResizeSensor.java @@ -27,7 +27,7 @@ public static void applyIfNeeded(WWidget w) { loadJavaScript(app); w.setJavaScriptMember(" ResizeSensor", ""); w.setJavaScriptMember( - " ResizeSensor", "new Wt4_10_0.ResizeSensor(Wt4_10_0," + w.getJsRef() + ")"); + " ResizeSensor", "new Wt4_10_1.ResizeSensor(Wt4_10_1," + w.getJsRef() + ")"); } } diff --git a/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java b/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java index d74758bbf..616e4d012 100644 --- a/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java +++ b/src/eu/webtoolkit/jwt/StdGridLayoutImpl2.java @@ -91,7 +91,7 @@ public void updateDom(final DomElement parent) { } this.addedItems_.clear(); for (int i = 0; i < this.removedItems_.size(); ++i) { - parent.callJavaScript("Wt4_10_0.remove('" + this.removedItems_.get(i) + "');", true); + parent.callJavaScript("Wt4_10_1.remove('" + this.removedItems_.get(i) + "');", true); } this.removedItems_.clear(); parent.addChild(div); @@ -187,7 +187,7 @@ public DomElement createDomElement( } StringBuilder js = new StringBuilder(); js.append(app.getJavaScriptClass()) - .append(".layouts2.add(new Wt4_10_0.StdLayout2(") + .append(".layouts2.add(new Wt4_10_1.StdLayout2(") .append(app.getJavaScriptClass()) .append(",'") .append(this.getId()) diff --git a/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java b/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java index 1fd77b414..f40573544 100644 --- a/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java +++ b/src/eu/webtoolkit/jwt/StdWidgetItemImpl.java @@ -29,25 +29,25 @@ public StdWidgetItemImpl(WWidgetItem item) { public static String getChildrenResizeJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs10()); - return "Wt4_10_0.ChildrenResize"; + return "Wt4_10_1.ChildrenResize"; } public static String getChildrenGetPSJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs11()); - return "Wt4_10_0.ChildrenGetPS"; + return "Wt4_10_1.ChildrenGetPS"; } public static String getSecondResizeJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs12()); - return "Wt4_10_0.LastResize"; + return "Wt4_10_1.LastResize"; } public static String getSecondGetPSJS() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WtResize.js", wtjs13()); - return "Wt4_10_0.LastGetPS"; + return "Wt4_10_1.LastGetPS"; } public String getId() { diff --git a/src/eu/webtoolkit/jwt/WAbstractArea.java b/src/eu/webtoolkit/jwt/WAbstractArea.java index 1fa3f029d..89d0395bd 100644 --- a/src/eu/webtoolkit/jwt/WAbstractArea.java +++ b/src/eu/webtoolkit/jwt/WAbstractArea.java @@ -197,10 +197,28 @@ public String getStyleClass() { public void addStyleClass(final String styleClass, boolean force) { this.widget_.addStyleClass(styleClass, force); } + /** + * Adds a style class. + * + *

    Calls {@link #addStyleClass(String styleClass, boolean force) addStyleClass(styleClass, + * false)} + */ + public final void addStyleClass(final String styleClass) { + addStyleClass(styleClass, false); + } /** Removes a style class. */ public void removeStyleClass(final String styleClass, boolean force) { this.widget_.removeStyleClass(styleClass, force); } + /** + * Removes a style class. + * + *

    Calls {@link #removeStyleClass(String styleClass, boolean force) + * removeStyleClass(styleClass, false)} + */ + public final void removeStyleClass(final String styleClass) { + removeStyleClass(styleClass, false); + } /** * Sets the cursor. * diff --git a/src/eu/webtoolkit/jwt/WAbstractItemModel.java b/src/eu/webtoolkit/jwt/WAbstractItemModel.java index d612cd13f..384871a74 100644 --- a/src/eu/webtoolkit/jwt/WAbstractItemModel.java +++ b/src/eu/webtoolkit/jwt/WAbstractItemModel.java @@ -777,8 +777,8 @@ public List getAcceptDropMimeTypes() { * *

    * - *

    Note: Currently, only row selections are handled by the default - * implementation. + *

    Note: Currently, only row selections are handled by the default implementation. + * * * @see WAbstractItemModel#getMimeType() * @see WItemSelectionModel @@ -839,8 +839,8 @@ public void dropEvent( * *

    * - *

    Note: Currently, only row selections are handled by the default - * implementation. + *

    Note: Currently, only row selections are handled by the default implementation. + * * * @see WAbstractItemModel#getMimeType() * @see WItemSelectionModel diff --git a/src/eu/webtoolkit/jwt/WAbstractItemView.java b/src/eu/webtoolkit/jwt/WAbstractItemView.java index 77f429948..ef1b8bbaf 100644 --- a/src/eu/webtoolkit/jwt/WAbstractItemView.java +++ b/src/eu/webtoolkit/jwt/WAbstractItemView.java @@ -752,15 +752,13 @@ public void setDragEnabled(boolean enable) { * hoverStyleClass) WWidget#acceptDrops()}), and the target item has drop enabled (which is * controlled by the item's {@link ItemFlag#DropEnabled} flag). * - *

    Drop events must be handled in {@link WAbstractItemView#dropEvent(WDropEvent e, WModelIndex - * index) dropEvent()}. + *

    Drop events must be handled in dropEvent(). * *

    * *

    * * @see WAbstractItemView#setDragEnabled(boolean enable) - * @see WAbstractItemView#dropEvent(WDropEvent e, WModelIndex index) * @deprecated Use {@link WAbstractItemView#setEnabledDropLocations(EnumSet dropLocations) * setEnabledDropLocations()} instead. This method now enables {@link DropLocation#OnItem}. */ @@ -786,8 +784,7 @@ public void setDropsEnabled(boolean enable) { * DropLocation#OnItem} and {@link DropLocation#BetweenRows} are both enabled, the drop indication * differs depending on whether {@link ItemFlag#DropEnabled} is set on the item. * - *

    Drop events must be handled in {@link WAbstractItemView#dropEvent(WDropEvent e, WModelIndex - * index) dropEvent()}. + *

    Drop events must be handled in dropEvent(). */ public void setEnabledDropLocations(EnumSet dropLocations) { if (this.enabledDropLocations_.equals(dropLocations)) { @@ -820,7 +817,7 @@ public EnumSet getEnabledDropLocations() { * *

    * - *

    Note: The height must be specified in {@link LengthUnit#Pixel} units. + *

    Note: The height must be specified in {@link LengthUnit#Pixel} units. * * @see WAbstractItemView#setColumnWidth(int column, WLength width) */ @@ -838,7 +835,7 @@ public WLength getRowHeight() { * *

    * - *

    Note: The width must be specified in {@link LengthUnit#Pixel} units. + *

    Note: The width must be specified in {@link LengthUnit#Pixel} units. * *

    Note: The actual space occupied by each column is the column width augmented by 7 * pixels for internal padding and a border. @@ -1956,6 +1953,12 @@ protected WWidget createHeaderWidget(int column) { i.setInline(false); i.addStyleClass("Wt-label"); contents.addWidget(i); + if (this.isDisabled()) { + contents.addStyleClass("Wt-disabled"); + for (WWidget child : contents.getChildren()) { + child.addStyleClass("Wt-disabled"); + } + } int headerLevel = this.model_ != null ? this.headerLevel(column) : 0; contents.setMargin( new WLength(headerLevel * this.headerLineHeight_.toPixels()), EnumSet.of(Side.Top)); @@ -2033,6 +2036,12 @@ protected WWidget createHeaderWidget(int column) { WAbstractItemView.this.handleHeaderDblClicked(info.id, event); }); result.addWidget(main); + if (this.isDisabled()) { + result.addStyleClass("Wt-disabled"); + for (WWidget child : result.getChildren()) { + child.addStyleClass("Wt-disabled"); + } + } String sc = StringUtils.asString(index.getData(ItemDataRole.StyleClass)).toString(); if (sc.length() != 0) { result.addStyleClass(sc); diff --git a/src/eu/webtoolkit/jwt/WAbstractMedia.java b/src/eu/webtoolkit/jwt/WAbstractMedia.java index 00570be69..0cc82722b 100644 --- a/src/eu/webtoolkit/jwt/WAbstractMedia.java +++ b/src/eu/webtoolkit/jwt/WAbstractMedia.java @@ -264,7 +264,7 @@ public String getJsMediaRef() { if (this.mediaId_.length() == 0) { return "null"; } else { - return "Wt4_10_0.getElement('" + this.mediaId_ + "')"; + return "Wt4_10_1.getElement('" + this.mediaId_ + "')"; } } @@ -275,7 +275,7 @@ protected void getDomChanges(final List result, WApplication app) { if (this.sourcesChanged_) { for (int i = 0; i < this.sourcesRendered_; ++i) { media.callJavaScript( - "Wt4_10_0.remove('" + this.mediaId_ + "s" + String.valueOf(i) + "');", true); + "Wt4_10_1.remove('" + this.mediaId_ + "s" + String.valueOf(i) + "');", true); } this.sourcesRendered_ = 0; for (int i = 0; i < this.sources_.size(); ++i) { @@ -376,7 +376,7 @@ void updateMediaDom(final DomElement element, boolean all) { if (all && this.alternative_ != null) { element.setAttribute( "onerror", - "if(event.target.error && event.target.error.code==event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED){while (this.hasChildNodes())if (Wt4_10_0.hasTag(this.firstChild,'SOURCE')){this.removeChild(this.firstChild);}else{this.parentNode.insertBefore(this.firstChild, this);}this.style.display= 'none';}"); + "if(event.target.error && event.target.error.code==event.target.error.MEDIA_ERR_SRC_NOT_SUPPORTED){while (this.hasChildNodes())if (Wt4_10_1.hasTag(this.firstChild,'SOURCE')){this.removeChild(this.firstChild);}else{this.parentNode.insertBefore(this.firstChild, this);}this.style.display= 'none';}"); } if (all || this.flagsChanged_) { if (!all || this.flags_.contains(PlayerOption.Controls)) { @@ -502,7 +502,7 @@ private void renderSource( if (isLast && this.alternative_ != null) { element.setAttribute( "onerror", - "var media = this.parentNode;if(media){while (media && media.children.length)if (Wt4_10_0.hasTag(media.firstChild,'SOURCE')){media.removeChild(media.firstChild);}else{media.parentNode.insertBefore(media.firstChild, media);}media.style.display= 'none';}"); + "var media = this.parentNode;if(media){while (media && media.children.length)if (Wt4_10_1.hasTag(media.firstChild,'SOURCE')){media.removeChild(media.firstChild);}else{media.parentNode.insertBefore(media.firstChild, media);}media.style.display= 'none';}"); } else { element.setAttribute("onerror", ""); } @@ -535,7 +535,7 @@ private void loadJavaScript() { app.loadJavaScript("js/WAbstractMedia.js", wtjs1()); this.setJavaScriptMember( " WAbstractMedia", - "new Wt4_10_0.WAbstractMedia(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_10_1.WAbstractMedia(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); } } diff --git a/src/eu/webtoolkit/jwt/WAbstractProxyModel.java b/src/eu/webtoolkit/jwt/WAbstractProxyModel.java index 4a05f75a9..89c5cc99e 100644 --- a/src/eu/webtoolkit/jwt/WAbstractProxyModel.java +++ b/src/eu/webtoolkit/jwt/WAbstractProxyModel.java @@ -73,9 +73,8 @@ public WAbstractProxyModel() { * *

    Note that the source model's signals are not forwarded to the proxy model by default, * but some specializations, like {@link WBatchEditProxyModel} and {@link WSortFilterProxyModel} - * do. If you want to reimplement {@link WAbstractProxyModel#getData(WModelIndex index, - * ItemDataRole role) getData()} with no changes to row or column indices, consider the use of - * {@link WIdentityProxyModel}. + * do. If you want to reimplement data() with no changes to row or column indices, consider the + * use of {@link WIdentityProxyModel}. */ public void setSourceModel(final WAbstractItemModel sourceModel) { this.sourceModel_ = sourceModel; @@ -94,8 +93,7 @@ public WAbstractItemModel getSourceModel() { * Returns the data at a specific model index. * *

    The default proxy implementation translates the index to the source model, and calls {@link - * WAbstractProxyModel#getSourceModel() getSourceModel()}.{@link - * WAbstractProxyModel#getData(WModelIndex index, ItemDataRole role) getData()} with this index. + * WAbstractProxyModel#getSourceModel() getSourceModel()}.data() with this index. */ public Object getData(final WModelIndex index, ItemDataRole role) { return this.sourceModel_.getData(this.mapToSource(index), role); diff --git a/src/eu/webtoolkit/jwt/WAbstractSpinBox.java b/src/eu/webtoolkit/jwt/WAbstractSpinBox.java index c891aefb3..126cbfda8 100644 --- a/src/eu/webtoolkit/jwt/WAbstractSpinBox.java +++ b/src/eu/webtoolkit/jwt/WAbstractSpinBox.java @@ -273,7 +273,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WSpinBox.js", wtjs1()); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_10_0.WSpinBox(") + ss.append("new Wt4_10_1.WSpinBox(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WAggregateProxyModel.java b/src/eu/webtoolkit/jwt/WAggregateProxyModel.java index 085d1b4b1..c93fdc26f 100644 --- a/src/eu/webtoolkit/jwt/WAggregateProxyModel.java +++ b/src/eu/webtoolkit/jwt/WAggregateProxyModel.java @@ -36,6 +36,8 @@ * *

    A WTreeView using a WAggregateProxyModel * + *

    + * *

    Note: This model does not support dynamic changes to the column definition of the * source model (i.e. insertions or deletions of source model columns). */ diff --git a/src/eu/webtoolkit/jwt/WAnchor.java b/src/eu/webtoolkit/jwt/WAnchor.java index a33c2b818..14d0f092f 100644 --- a/src/eu/webtoolkit/jwt/WAnchor.java +++ b/src/eu/webtoolkit/jwt/WAnchor.java @@ -359,7 +359,11 @@ static boolean renderHRef( WInteractWidget widget, final WAnchor.LinkState linkState, final DomElement element) { WApplication app = WApplication.getInstance(); if (linkState.link.isNull() || widget.isDisabled()) { - element.removeAttribute("href"); + if (app.getEnvironment().hasJavaScript()) { + element.setAttribute("href", "javascript:void(0);"); + } else { + element.removeAttribute("href"); + } } else { String url = linkState.link.resolveUrl(app); if (linkState.link.getTarget() == LinkTarget.Self) { @@ -403,7 +407,7 @@ static void renderUrlResolution(WWidget widget, final DomElement element, boolea if (all) { element.setProperty(Property.Class, StringUtils.addWord(widget.getStyleClass(), "Wt-rr")); } else { - element.callJavaScript("Wt4_10_0.$('" + widget.getId() + "').classList.add('Wt-rr');"); + element.callJavaScript("Wt4_10_1.$('" + widget.getId() + "').classList.add('Wt-rr');"); } } diff --git a/src/eu/webtoolkit/jwt/WApplication.java b/src/eu/webtoolkit/jwt/WApplication.java index 2d67d1853..e5ec0f0da 100644 --- a/src/eu/webtoolkit/jwt/WApplication.java +++ b/src/eu/webtoolkit/jwt/WApplication.java @@ -991,20 +991,41 @@ public String makeAbsoluteUrl(final String url) { *

    * * - * + * * - * - * - * + * Internal path: /internal/path + * + * + * + * * - * - * - * + * Note that the slash between the deployment path and the internal path is shared + * + * + * + * *
    Current full pathurl argumentResult points to
    Current full path + * url argument + * Result points to + *
    http://example.com/foo/bar/internal/path
    * Deployment path: /foo/bar (no slash at the end)
    - * Internal path: /internal/path
    (empty string)http://example.com/foo/bar
    .http://example.com/foo/
    ./http://example.com/foo/
    ../http://example.com/
    (empty string) + * http://example.com/foo/bar + *
    . + * http://example.com/foo/ + *
    ./ + * http://example.com/foo/ + *
    ../ + * http://example.com/ + *
    http://example.com/foo/bar/internal/path
    * Deployment path: /foo/bar/ (with slash at the end)
    * Internal path: /internal/path
    - * Note that the slash between the deployment path and the internal path is shared
    (empty string)http://example.com/foo/bar/
    .http://example.com/foo/bar/
    ./http://example.com/foo/bar/
    ../http://example.com/foo/
    (empty string) + * http://example.com/foo/bar/ + *
    . + * http://example.com/foo/bar/ + *
    ./ + * http://example.com/foo/bar/ + *
    ../ + * http://example.com/foo/ + *
    */ public String resolveRelativeUrl(final String url) { @@ -1416,7 +1437,7 @@ WebSession getSession() { * *

    * - *

    Note: This works only if JavaScript is available on the client. + *

    Note: This works only if JavaScript is available on the client. * * @see WApplication#triggerUpdate() */ @@ -2150,9 +2171,9 @@ public void setLoadingIndicator(WLoadingIndicator indicator) { if (this.loadingIndicator_ != null) { this.domRoot_.addWidget(indicator); this.showLoadJS.setJavaScript( - "function(o,e) {Wt4_10_0.inline('" + this.loadingIndicator_.getId() + "');}"); + "function(o,e) {Wt4_10_1.inline('" + this.loadingIndicator_.getId() + "');}"); this.hideLoadJS.setJavaScript( - "function(o,e) {Wt4_10_0.hide('" + this.loadingIndicator_.getId() + "');}"); + "function(o,e) {Wt4_10_1.hide('" + this.loadingIndicator_.getId() + "');}"); this.loadingIndicator_.hide(); } } @@ -2558,7 +2579,7 @@ protected void enableAjax() { this.domRoot2_.enableAjax(); } this.doJavaScript( - "Wt4_10_0.ajaxInternalPaths(" + "Wt4_10_1.ajaxInternalPaths(" + WWebWidget.jsStringLiteral(this.resolveRelativeUrl(this.getBookmarkUrl("/"))) + ");"); } @@ -2924,7 +2945,7 @@ private void streamJavaScriptPreamble(final StringBuilder out, boolean all) { String scope = preamble.scope == JavaScriptScope.ApplicationScope ? this.getJavaScriptClass() - : "Wt4_10_0"; + : "Wt4_10_1"; if (preamble.type == JavaScriptObjectType.JavaScriptFunction) { out.append(scope) .append('.') diff --git a/src/eu/webtoolkit/jwt/WBatchEditProxyModel.java b/src/eu/webtoolkit/jwt/WBatchEditProxyModel.java index 56e527acc..cff9c50bb 100644 --- a/src/eu/webtoolkit/jwt/WBatchEditProxyModel.java +++ b/src/eu/webtoolkit/jwt/WBatchEditProxyModel.java @@ -29,8 +29,7 @@ *

    All editing operations are supported: * *

      - *
    • changing data ({@link WBatchEditProxyModel#setData(WModelIndex index, Object value, - * ItemDataRole role) setData()}) + *
    • changing data (setData()) *
    • inserting and removing rows ({@link WBatchEditProxyModel#insertRows(int row, int count, * WModelIndex parent) insertRows()} and {@link WBatchEditProxyModel#removeRows(int row, int * count, WModelIndex parent) removeRows()}) @@ -214,10 +213,9 @@ public final void setNewRowFlags(int column, ItemFlag flag, ItemFlag... flags) { /** * Configures data used to indicate a modified item. * - *

      This sets data for item data role role to be returned by {@link - * WBatchEditProxyModel#getData(WModelIndex index, ItemDataRole role) getData()} for an item that - * is dirty (e.g. because it belongs to a newly inserted row/column, or because new data has been - * set for it. + *

      This sets data for item data role role to be returned by data() + * for an item that is dirty (e.g. because it belongs to a newly inserted row/column, or because + * new data has been set for it. * *

      When role is {@link ItemDataRole#StyleClass}, the style class is appended to * any style already returned by the source model or set by {@link diff --git a/src/eu/webtoolkit/jwt/WBootstrap2Theme.java b/src/eu/webtoolkit/jwt/WBootstrap2Theme.java index 507f7e67c..184242b19 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap2Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap2Theme.java @@ -434,7 +434,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_10_0.setValidationState(") + js.append("Wt4_10_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WBootstrap3Theme.java b/src/eu/webtoolkit/jwt/WBootstrap3Theme.java index 55f65b8e0..46b8c6a04 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap3Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap3Theme.java @@ -477,7 +477,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_10_0.setValidationState(") + js.append("Wt4_10_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WBootstrap5Theme.java b/src/eu/webtoolkit/jwt/WBootstrap5Theme.java index 799e4ed40..d88ca8b5a 100644 --- a/src/eu/webtoolkit/jwt/WBootstrap5Theme.java +++ b/src/eu/webtoolkit/jwt/WBootstrap5Theme.java @@ -37,22 +37,6 @@ * layout you are recommended to use {@link WTemplate} in conjunction with Bootstrap's CSS * classes. For this we refer to Bootstrap's documentation at https://getbootstrap.com. - * - *

      Custom Sass files can be used to make your own derived theme. - * - *

      If JWt is installed into PREFIX (and the CMake option INSTALL_THEMES - * is set to ON), then you can find the source files in - * PREFIX/share/Wt/themes/bootstrap/5. - * - *

      Apart from the variables that Bootstrap defines, JWt also provides variables, defined in - * wt/_variables.scss. All of JWt's variables start with a wt- - * prefix. - * - *

      Refer to the example in examples/custom-bs-theme for more information. - * - *

      - * - * @see WApplication#setTheme(WTheme theme) */ public class WBootstrap5Theme extends WTheme { private static Logger logger = LoggerFactory.getLogger(WBootstrap5Theme.class); @@ -484,7 +468,7 @@ public void applyValidationStyle( app.loadJavaScript("js/BootstrapValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_10_0.setValidationState(") + js.append("Wt4_10_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WBoxLayout.java b/src/eu/webtoolkit/jwt/WBoxLayout.java index fe8097bf4..932b42f57 100644 --- a/src/eu/webtoolkit/jwt/WBoxLayout.java +++ b/src/eu/webtoolkit/jwt/WBoxLayout.java @@ -69,7 +69,7 @@ *

      * *

      Note: When JavaScript support is not available, not all functionality of the layout - * is available. In particular, vertical size management is not available. + * is available. In particular, vertical size management is not available. * *

      Note: When a layout is used on a first page with progressive bootstrap, then the * layout will progress only in a limited way to a full JavaScript-based layout. You can thus not @@ -161,7 +161,7 @@ public int getCount() { *

      * *

      Note: Changing the layout direction after something (a widget or nested layout) - * has been added is not supported. + * has been added is not supported. * * @see WBoxLayout#getDirection() */ diff --git a/src/eu/webtoolkit/jwt/WBrush.java b/src/eu/webtoolkit/jwt/WBrush.java index b1d8a03db..22f0cf9bf 100644 --- a/src/eu/webtoolkit/jwt/WBrush.java +++ b/src/eu/webtoolkit/jwt/WBrush.java @@ -45,7 +45,7 @@ * *

      Warning: A WBrush that is JavaScript exposed should be modified only through its * {@link WJavaScriptHandle handle}. Any attempt at modifying it will cause an exception to be - * thrown. + * thrown. * * @see WPainter#setBrush(WBrush b) * @see WPen @@ -57,7 +57,7 @@ public class WBrush extends WJavaScriptExposableObject { /** * Creates a brush. * - *

      Creates a brush with a {@link BrushStyle#None} fill style. + *

      Creates a brush with a BrushStyle::None fill style. */ public WBrush() { super(); @@ -153,7 +153,7 @@ public BrushStyle getStyle() { /** * Sets the brush color. * - *

      If the current style is a gradient style, then it is reset to {@link BrushStyle#Solid}. + *

      If the current style is a gradient style, then it is reset to BrushStyle::Solid. * *

      * @@ -181,7 +181,7 @@ public WColor getColor() { /** * Sets the brush gradient. * - *

      This also sets the style to {@link BrushStyle#Gradient}. + *

      This also sets the style to BrushStyle::Gradient. * *

      * diff --git a/src/eu/webtoolkit/jwt/WButtonGroup.java b/src/eu/webtoolkit/jwt/WButtonGroup.java index eb913e67d..16e0835a8 100644 --- a/src/eu/webtoolkit/jwt/WButtonGroup.java +++ b/src/eu/webtoolkit/jwt/WButtonGroup.java @@ -63,7 +63,7 @@ public WButtonGroup() { *

      * *

      Note: {@link WButtonGroup} should be owned by a shared_ptr before addButton is - * called on it! + * called on it! * * @see WButtonGroup#removeButton(WRadioButton button) */ diff --git a/src/eu/webtoolkit/jwt/WCalendar.java b/src/eu/webtoolkit/jwt/WCalendar.java index 926e0a876..195914d6c 100644 --- a/src/eu/webtoolkit/jwt/WCalendar.java +++ b/src/eu/webtoolkit/jwt/WCalendar.java @@ -47,12 +47,14 @@ * WCalendar with default look

      * * + * *
      * *

      * WCalendar with polished look

      *
      * + * * * */ diff --git a/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java b/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java index 2d8760b9c..e3bd8530a 100644 --- a/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java +++ b/src/eu/webtoolkit/jwt/WCanvasPaintDevice.java @@ -108,10 +108,6 @@ public void setChanged(EnumSet flags) { this.changeFlags_.addAll(flags); } - public final void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags) { - setChanged(EnumSet.of(flag, flags)); - } - public void drawArc(final WRectF rect, double startAngle, double spanAngle) { if (rect.getWidth() < EPSILON || rect.getHeight() < EPSILON) { return; @@ -194,7 +190,7 @@ public void drawImage( } int imageIndex = this.createImage(imgUri); this.js_ - .append("Wt4_10_0.gfxUtils.drawImage(ctx,images[") + .append("Wt4_10_1.gfxUtils.drawImage(ctx,images[") .append(String.valueOf(imageIndex)) .append("],") .append(WWebWidget.jsStringLiteral(imgUri)) @@ -216,7 +212,7 @@ public void drawPath(final WPainterPath path) { if (path.isJavaScriptBound()) { this.renderStateChanges(true); this.js_ - .append("Wt4_10_0.gfxUtils.drawPath(ctx,") + .append("Wt4_10_1.gfxUtils.drawPath(ctx,") .append(path.getJsRef()) .append(",") .append(this.currentNoBrush_ ? "false" : "true") @@ -234,7 +230,7 @@ public void drawStencilAlongPath( final WPainterPath stencil, final WPainterPath path, boolean softClipping) { this.renderStateChanges(true); this.js_ - .append("Wt4_10_0") + .append("Wt4_10_1") .append(".gfxUtils.drawStencilAlongPath(ctx,") .append(stencil.getJsRef()) .append(",") @@ -252,7 +248,7 @@ public void drawRect(final WRectF rectangle) { if (rectangle.isJavaScriptBound()) { this.renderStateChanges(true); this.js_ - .append("Wt4_10_0") + .append("Wt4_10_1") .append(".gfxUtils.drawRect(ctx,") .append(rectangle.getJsRef()) .append(",") @@ -285,7 +281,7 @@ public void drawText( case Html5Text: { this.js_ - .append("Wt4_10_0.gfxUtils.drawText(ctx,") + .append("Wt4_10_1.gfxUtils.drawText(ctx,") .append(rect.getJsRef()) .append(',') .append(String.valueOf(EnumUtils.valueOf(flags))) @@ -354,7 +350,7 @@ public void drawText( .append(");"); if (this.currentPen_.isJavaScriptBound()) { this.js_ - .append("ctx.fillStyle=Wt4_10_0.gfxUtils.css_text(") + .append("ctx.fillStyle=Wt4_10_1.gfxUtils.css_text(") .append(this.currentPen_.getJsRef()) .append(".color);"); } else { @@ -428,7 +424,7 @@ public void drawTextOnPath( double lineHeight, boolean softClipping) { this.renderStateChanges(true); - this.js_.append("Wt4_10_0.gfxUtils.drawTextOnPath(ctx,["); + this.js_.append("Wt4_10_1.gfxUtils.drawTextOnPath(ctx,["); for (int i = 0; i < text.size(); ++i) { if (i != 0) { this.js_.append(','); @@ -453,14 +449,6 @@ public WTextItem measureText(final CharSequence text, double maxWidth, boolean w return this.fontMetrics_.measureText(this.getPainter().getFont(), text, maxWidth, wordWrap); } - public final WTextItem measureText(final CharSequence text) { - return measureText(text, -1, false); - } - - public final WTextItem measureText(final CharSequence text, double maxWidth) { - return measureText(text, maxWidth, false); - } - public WFontMetrics getFontMetrics() { if (!(this.fontMetrics_ != null)) { this.fontMetrics_ = new ServerSideFontMetrics(); @@ -491,7 +479,7 @@ public void render( final String canvasId, DomElement text, final String updateAreasJs) { - String canvasVar = "Wt4_10_0.getElement('" + canvasId + "')"; + String canvasVar = "Wt4_10_1.getElement('" + canvasId + "')"; String paintedWidgetObjRef = paintedWidgetJsRef + ".wtObj"; StringBuilder tmp = new StringBuilder(); tmp.append(";(function(){"); @@ -669,7 +657,7 @@ private void renderStateChanges(boolean resetPathTranslation) { final WPainterPath p = this.getPainter().getClipPath(); if (!p.isEmpty()) { this.js_ - .append("Wt4_10_0") + .append("Wt4_10_1") .append(".gfxUtils.setClipPath(ctx,") .append(p.getJsRef()) .append(",") @@ -678,7 +666,7 @@ private void renderStateChanges(boolean resetPathTranslation) { .append(this.getPainter().hasClipping() ? "true" : "false") .append(");"); } else { - this.js_.append("Wt4_10_0").append(".gfxUtils.removeClipPath(ctx);"); + this.js_.append("Wt4_10_1").append(".gfxUtils.removeClipPath(ctx);"); } this.currentClipTransform_.assign(t); this.currentClipPath_.assign(p); @@ -755,7 +743,7 @@ && fequal(f.getM22(), this.currentTransform_.getM22())) { } else { if (this.getPainter().getPen().isJavaScriptBound()) { this.js_ - .append("ctx.strokeStyle=Wt4_10_0.gfxUtils.css_text(") + .append("ctx.strokeStyle=Wt4_10_1.gfxUtils.css_text(") .append(this.getPainter().getPen().getJsRef()) .append(".color);"); } else { @@ -846,7 +834,7 @@ && fequal(f.getM22(), this.currentTransform_.getM22())) { } else { if (this.currentBrush_.isJavaScriptBound()) { this.js_ - .append("ctx.fillStyle=Wt4_10_0.gfxUtils.css_text(") + .append("ctx.fillStyle=Wt4_10_1.gfxUtils.css_text(") .append(this.currentBrush_.getJsRef()) .append(".color);"); } else { diff --git a/src/eu/webtoolkit/jwt/WClientGLWidget.java b/src/eu/webtoolkit/jwt/WClientGLWidget.java index 085b31837..7843c1561 100644 --- a/src/eu/webtoolkit/jwt/WClientGLWidget.java +++ b/src/eu/webtoolkit/jwt/WClientGLWidget.java @@ -2399,7 +2399,7 @@ public void initJavaScriptMatrix4(final WGLWidget.JavaScriptMatrix4x4 mat) { public void setJavaScriptMatrix4( final WGLWidget.JavaScriptMatrix4x4 jsm, final javax.vecmath.Matrix4f m) { - this.js_.append("Wt4_10_0.glMatrix.mat4.set("); + this.js_.append("Wt4_10_1.glMatrix.mat4.set("); javax.vecmath.Matrix4f t = WebGLUtils.transpose(m); WebGLUtils.renderfv(this.js_, t, JsArrayType.Float32Array); this.js_.append(", ").append(jsm.getJsRef()).append(");"); @@ -2546,7 +2546,7 @@ public void restoreContext(final String jsRef) { public void render(final String jsRef, EnumSet flags) { if (flags.contains(RenderFlag.Full)) { StringWriter tmp = new StringWriter(); - tmp.append("{\nvar o = new Wt4_10_0.WGLWidget(") + tmp.append("{\nvar o = new Wt4_10_1.WGLWidget(") .append(WApplication.getInstance().getJavaScriptClass()) .append(",") .append(jsRef) diff --git a/src/eu/webtoolkit/jwt/WCompositeWidget.java b/src/eu/webtoolkit/jwt/WCompositeWidget.java index 93e2a163a..097355743 100644 --- a/src/eu/webtoolkit/jwt/WCompositeWidget.java +++ b/src/eu/webtoolkit/jwt/WCompositeWidget.java @@ -242,6 +242,9 @@ public void setDisabled(boolean disabled) { } public boolean isDisabled() { + if (!(this.impl_ != null)) { + return false; + } return this.impl_.isDisabled(); } diff --git a/src/eu/webtoolkit/jwt/WCssStyleSheet.java b/src/eu/webtoolkit/jwt/WCssStyleSheet.java index 31526a733..a80241812 100644 --- a/src/eu/webtoolkit/jwt/WCssStyleSheet.java +++ b/src/eu/webtoolkit/jwt/WCssStyleSheet.java @@ -177,14 +177,14 @@ public void cssText(final StringBuilder out, boolean all) { public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean all) { if (!all) { for (int i = 0; i < this.rulesRemoved_.size(); ++i) { - js.append("Wt4_10_0.removeCssRule("); + js.append("Wt4_10_1.removeCssRule("); DomElement.jsStringLiteral(js, this.rulesRemoved_.get(i), '\''); js.append(");"); } this.rulesRemoved_.clear(); for (Iterator i_it = this.rulesModified_.iterator(); i_it.hasNext(); ) { WCssRule i = i_it.next(); - js.append("{ var d= Wt4_10_0.getCssRule("); + js.append("{ var d= Wt4_10_1.getCssRule("); DomElement.jsStringLiteral(js, i.getSelector(), '\''); js.append(");if(d){"); DomElement d = DomElement.updateGiven("d", DomElementType.SPAN); @@ -203,7 +203,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a final List toProcess = this.rules_; for (int i = 0; i < toProcess.size(); ++i) { WCssRule rule = toProcess.get(i); - js.append("Wt4_10_0.addCss('").append(rule.getSelector()).append("',"); + js.append("Wt4_10_1.addCss('").append(rule.getSelector()).append("',"); DomElement.jsStringLiteral(js, rule.getDeclarations(), '\''); js.append(");\n"); } @@ -211,7 +211,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a final List toProcess = this.rulesAdded_; for (int i = 0; i < toProcess.size(); ++i) { final WCssRule rule = toProcess.get(i); - js.append("Wt4_10_0.addCss('").append(rule.getSelector()).append("',"); + js.append("Wt4_10_1.addCss('").append(rule.getSelector()).append("',"); DomElement.jsStringLiteral(js, rule.getDeclarations(), '\''); js.append(");\n"); } @@ -224,7 +224,7 @@ public void javaScriptUpdate(WApplication app, final StringBuilder js, boolean a StringBuilder css = new StringBuilder(); this.cssText(css, all); if (!(css.length() == 0)) { - js.append("Wt4_10_0.addCssText("); + js.append("Wt4_10_1.addCssText("); DomElement.jsStringLiteral(js, css.toString(), '\''); js.append(");\n"); } diff --git a/src/eu/webtoolkit/jwt/WCssTheme.java b/src/eu/webtoolkit/jwt/WCssTheme.java index 54888e4d5..d230c84a6 100644 --- a/src/eu/webtoolkit/jwt/WCssTheme.java +++ b/src/eu/webtoolkit/jwt/WCssTheme.java @@ -27,89 +27,274 @@ *

      * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
      {@link WAbstractItemView} * .Wt-itemview
      .Wt-itemview .Wt-headerdiv the header container
      .Wt-itemview .Wt-header the header
      .Wt-itemview .Wt-header .Wt-label a header label
      .Wt-itemview .Wt-header .Wt-label a header label
      .Wt-itemview .Wt-tv-rh resize handle
      .Wt-itemview .Wt-tv-sh sort handle
      .Wt-itemview .Wt-tv-sh-none sort handle, unsorted
      .Wt-itemview .Wt-tv-sh-down sort handle, descending sort
      .Wt-itemview .Wt-tv-sh-up sort handle, ascending sort
      .Wt-itemview .Wt-selected selected item (or row)
      .Wt-itemview .Wt-spacer spacer (briefly visible during scrolling)
      {@link WAbstractSpinBox} .Wt-spinbox (for the HTML4 implementation)
      {@link WCalendar} * .Wt-cal
      .Wt-cal table.d1 the table (single letter days)
      .Wt-cal table.d3 the table (three letter days)
      .Wt-cal table.dlong the table (ful day names)
      .Wt-cal th.caption a caption cell (containing month/year navigation)
      .Wt-cal th week day header cell
      .Wt-cal td day cell
      .Wt-cal-oom out-of-month day
      .Wt-cal-oom out-of-range day (ray < bottom or day > top)
      .Wt-cal-sel selected day
      .Wt-cal-now today
      {@link WDateEdit} .Wt-dateedit
      .Wt-datepicker the popup
      {@link WDatePicker} .Wt-datepicker the popup
      {@link WDialog} .Wt-dialog the dialog
      .Wt-dialog .closeicon the close icon in the titlebar
      .Wt-dialog .titlebar the titlebar
      .Wt-dialog .body the dialog body
      .Wt-dialog .footer the dialog footer
      {@link WMenuItem} .item an unselected item
      .itemselected a selected item
      .item.Wt-closable a closable item
      .item.Wt-separator a separator item
      .item.Wt-sectheader a section header item
      .item .Wt-icon the item's icon
      .item .Wt-chkbox the item's checkbox
      .item .closeicon the item's close icon
      {@link WMessageBox} .Wt-dialog see supra (WDialog)
      {@link WPanel} .Wt-panel
      .Wt-panel .titlebar the titlebar
      .Wt-panel .body the body
      {@link WPopupMenu} .Wt-popupmenu the popup menu; for the items, see supra (WMenuItem)
      {@link WPopupWidget} .Wt-outset
      {@link WProgressBar} .Wt-progressbar
      .Wt-progressbar .Wt-pgb-bar the bar
      .Wt-progressbar .Wt-pgb-label the value label
      {@link WPushButton} .Wt-btn
      {@link WSlider} * .Wt-slider-h or .Wt-slider-v for horizontal or vertical slider
      .Wt-slider-[hv] .Wt-slider-bg background element
      .Wt-slider-[hv] .fill fill to the current value
      .Wt-slider-[hv] .handle the slider handle
      .Wt-slider-[hv] .Wt-w an additional element for styling
      .Wt-slider-[hv] .Wt-e an additional element for styling
      {@link WSuggestionPopup} .Wt-suggest
      .Wt-suggest li an item
      .Wt-suggest .active an active item
      {@link WTabWidget} .Wt-tabs the header, which is a {@link WMenu}
      {@link WTableView} * .Wt-tableview see supra (WAbstractItemView)
      .Wt-tableview .Wt-contents the contents area
      .Wt-tableview .Wt-contents .Wt-tv-c a contents cell
      {@link WTreeNode} * .Wt-tree a tree node
      .Wt-tree.Wt-trunk a trunk node
      .Wt-tree.Wt-end an end node (last node within parent)
      .Wt-tree ul children list
      .Wt-tree .Wt-ctrl collapse/expand control
      .Wt-tree .Wt-ctrl.expand expand control
      .Wt-tree .Wt-ctrl.collapse collapse control
      .Wt-tree .Wt-ctrl.noexpand an item that cannot be expanded
      .Wt-tree .Wt-selected a selected node
      .Wt-tree .Wt-label the label
      {@link WTreeView} * .Wt-treeview see supra (WAbstractItemView)
      .Wt-treeview ul a node
      .Wt-treeview ul.Wt-tv-root the root node
      .Wt-treeview .Wt-tv-row a row of additional cells
      .Wt-treeview .Wt-trunk a trunk node
      .Wt-treeview .Wt-end an end node (last node within parent)
      .Wt-treeview .Wt-ctrl collapse/expand control
      .Wt-treeview .Wt-ctrl.expand expand control
      .Wt-treeview .Wt-ctrl.collapse collapse control
      .Wt-treeview .Wt-ctrl.noexpand an item that cannot be expanded
      {@link WAbstractItemView} * + * .Wt-itemview + * + *
      .Wt-itemview .Wt-headerdiv + * the header container + *
      .Wt-itemview .Wt-header + * the header + *
      .Wt-itemview .Wt-header .Wt-label + * a header label + *
      .Wt-itemview .Wt-header .Wt-label + * a header label + *
      .Wt-itemview .Wt-tv-rh + * resize handle + *
      .Wt-itemview .Wt-tv-sh + * sort handle + *
      .Wt-itemview .Wt-tv-sh-none + * sort handle, unsorted + *
      .Wt-itemview .Wt-tv-sh-down + * sort handle, descending sort + *
      .Wt-itemview .Wt-tv-sh-up + * sort handle, ascending sort + *
      .Wt-itemview .Wt-selected + * selected item (or row) + *
      .Wt-itemview .Wt-spacer + * spacer (briefly visible during scrolling) + *
      {@link WAbstractSpinBox} + * .Wt-spinbox + * (for the HTML4 implementation) + *
      {@link WCalendar} * + * .Wt-cal + * + *
      .Wt-cal table.d1 + * the table (single letter days) + *
      .Wt-cal table.d3 + * the table (three letter days) + *
      .Wt-cal table.dlong + * the table (ful day names) + *
      .Wt-cal th.caption + * a caption cell (containing month/year navigation) + *
      .Wt-cal th + * week day header cell + *
      .Wt-cal td + * day cell + *
      .Wt-cal-oom + * out-of-month day + *
      .Wt-cal-oom + * out-of-range day (ray < bottom or day > top) + *
      .Wt-cal-sel + * selected day + *
      .Wt-cal-now + * today + *
      {@link WDateEdit} + * .Wt-dateedit + * + *
      .Wt-datepicker + * the popup + *
      {@link WDatePicker} + * .Wt-datepicker + * the popup + *
      {@link WDialog} + * .Wt-dialog + * the dialog + *
      .Wt-dialog .closeicon + * the close icon in the titlebar + *
      .Wt-dialog .titlebar + * the titlebar + *
      .Wt-dialog .body + * the dialog body + *
      .Wt-dialog .footer + * the dialog footer + *
      {@link WMenuItem} + * .item + * an unselected item + *
      .itemselected + * a selected item + *
      .item.Wt-closable + * a closable item + *
      .item.Wt-separator + * a separator item + *
      .item.Wt-sectheader + * a section header item + *
      .item .Wt-icon + * the item's icon + *
      .item .Wt-chkbox + * the item's checkbox + *
      .item .closeicon + * the item's close icon + *
      {@link WMessageBox} + * .Wt-dialog + * see supra (WDialog) + *
      {@link WPanel} + * .Wt-panel + * + *
      .Wt-panel .titlebar + * the titlebar + *
      .Wt-panel .body + * the body + *
      {@link WPopupMenu} + * .Wt-popupmenu + * the popup menu; for the items, see supra (WMenuItem) + *
      {@link WPopupWidget} + * .Wt-outset + * + *
      {@link WProgressBar} + * .Wt-progressbar + * + *
      .Wt-progressbar .Wt-pgb-bar + * the bar + *
      .Wt-progressbar .Wt-pgb-label + * the value label + *
      {@link WPushButton} + * .Wt-btn + * + *
      {@link WSlider} * + * .Wt-slider-h or .Wt-slider-v + * for horizontal or vertical slider + *
      .Wt-slider-[hv] .Wt-slider-bg + * background element + *
      .Wt-slider-[hv] .fill + * fill to the current value + *
      .Wt-slider-[hv] .handle + * the slider handle + *
      .Wt-slider-[hv] .Wt-w + * an additional element for styling + *
      .Wt-slider-[hv] .Wt-e + * an additional element for styling + *
      {@link WSuggestionPopup} + * .Wt-suggest + * + *
      .Wt-suggest li + * an item + *
      .Wt-suggest .active + * an active item + *
      {@link WTabWidget} + * .Wt-tabs + * the header, which is a {@link WMenu} + *
      {@link WTableView} * + * .Wt-tableview + * see supra (WAbstractItemView) + *
      .Wt-tableview .Wt-contents + * the contents area + *
      .Wt-tableview .Wt-contents .Wt-tv-c + * a contents cell + *
      {@link WTreeNode} * + * .Wt-tree + * a tree node + *
      .Wt-tree.Wt-trunk + * a trunk node + *
      .Wt-tree.Wt-end + * an end node (last node within parent) + *
      .Wt-tree ul + * children list + *
      .Wt-tree .Wt-ctrl + * collapse/expand control + *
      .Wt-tree .Wt-ctrl.expand + * expand control + *
      .Wt-tree .Wt-ctrl.collapse + * collapse control + *
      .Wt-tree .Wt-ctrl.noexpand + * an item that cannot be expanded + *
      .Wt-tree .Wt-selected + * a selected node + *
      .Wt-tree .Wt-label + * the label + *
      {@link WTreeView} * + * .Wt-treeview + * see supra (WAbstractItemView) + *
      .Wt-treeview ul + * a node + *
      .Wt-treeview ul.Wt-tv-root + * the root node + *
      .Wt-treeview .Wt-tv-row + * a row of additional cells + *
      .Wt-treeview .Wt-trunk + * a trunk node + *
      .Wt-treeview .Wt-end + * an end node (last node within parent) + *
      .Wt-treeview .Wt-ctrl + * collapse/expand control + *
      .Wt-treeview .Wt-ctrl.expand + * expand control + *
      .Wt-treeview .Wt-ctrl.collapse + * collapse control + *
      .Wt-treeview .Wt-ctrl.noexpand + * an item that cannot be expanded + *
      * *

      * CSS selectors for these widgets are currently still hard-coded in the widget @@ -382,7 +567,7 @@ public void applyValidationStyle( app.loadJavaScript("js/CssThemeValidate.js", wtjs2()); if (app.getEnvironment().hasAjax()) { StringBuilder js = new StringBuilder(); - js.append("Wt4_10_0.setValidationState(") + js.append("Wt4_10_1.setValidationState(") .append(widget.getJsRef()) .append(",") .append(validation.getState() == ValidationState.Valid) diff --git a/src/eu/webtoolkit/jwt/WDateEdit.java b/src/eu/webtoolkit/jwt/WDateEdit.java index 4240c4f9b..29dae0c60 100644 --- a/src/eu/webtoolkit/jwt/WDateEdit.java +++ b/src/eu/webtoolkit/jwt/WDateEdit.java @@ -344,7 +344,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WDateEdit.js", wtjs1()); String jsObj = - "new Wt4_10_0.WDateEdit(" + "new Wt4_10_1.WDateEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WDateValidator.java b/src/eu/webtoolkit/jwt/WDateValidator.java index 29523e837..00c178e7d 100644 --- a/src/eu/webtoolkit/jwt/WDateValidator.java +++ b/src/eu/webtoolkit/jwt/WDateValidator.java @@ -302,7 +302,7 @@ public WString getInvalidTooLateText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WDateValidator(").append(this.isMandatory()).append(",["); + js.append("new Wt4_10_1.WDateValidator(").append(this.isMandatory()).append(",["); for (int i = 0; i < this.formats_.size(); ++i) { WDate.RegExpInfo r = WDate.formatToRegExp(this.formats_.get(i)); if (i != 0) { diff --git a/src/eu/webtoolkit/jwt/WDialog.java b/src/eu/webtoolkit/jwt/WDialog.java index cbf217405..7a0871310 100644 --- a/src/eu/webtoolkit/jwt/WDialog.java +++ b/src/eu/webtoolkit/jwt/WDialog.java @@ -72,12 +72,14 @@ * A simple custom dialog (default)

      * * + * *
      * *

      * A simple custom dialog (polished)

      *
      * + * * * * @@ -394,7 +396,7 @@ public void setResizable(boolean resizable) { Resizable.loadJavaScript(WApplication.getInstance()); this.setJavaScriptMember( " Resizable", - "(new Wt4_10_0.Resizable(Wt4_10_0," + "(new Wt4_10_1.Resizable(Wt4_10_1," + this.getJsRef() + ")).onresize(function(w, h, done) {var obj = " + this.getJsRef() @@ -695,7 +697,7 @@ protected void render(EnumSet flags) { } } this.doJavaScript( - "new Wt4_10_0.WDialog(" + "new Wt4_10_1.WDialog(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WDoubleValidator.java b/src/eu/webtoolkit/jwt/WDoubleValidator.java index a9bf4818d..725826447 100644 --- a/src/eu/webtoolkit/jwt/WDoubleValidator.java +++ b/src/eu/webtoolkit/jwt/WDoubleValidator.java @@ -248,7 +248,7 @@ public boolean isIgnoreTrailingSpaces() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WDoubleValidator(") + js.append("new Wt4_10_1.WDoubleValidator(") .append(this.isMandatory()) .append(',') .append(this.ignoreTrailingSpaces_) diff --git a/src/eu/webtoolkit/jwt/WEmailEdit.java b/src/eu/webtoolkit/jwt/WEmailEdit.java index 898e14169..88807974d 100644 --- a/src/eu/webtoolkit/jwt/WEmailEdit.java +++ b/src/eu/webtoolkit/jwt/WEmailEdit.java @@ -51,12 +51,12 @@ *

      Note: At the time of writing, Firefox does not do sanitization: https://bugzilla.mozilla.org/show_bug.cgi?id=1518162. * This may cause the browser to add the :invalid pseudo tag to inputs that are deemed - * valid by Wt. + * valid by JWt. * *

      Note: Wt does not do any Punycode encoding or decoding. At the time of writing, if * you put an internationalized email address into a {@link WEmailEdit} on Blink-based browsers like * Google Chrome, it will be converted to Punycode by the browser. Firefox and Safari do not do this - * encoding, so these email addresses will be deemed invalid by the {@link WEmailValidator}. + * encoding, so these email addresses will be deemed invalid by the {@link WEmailValidator}. */ public class WEmailEdit extends WFormWidget { private static Logger logger = LoggerFactory.getLogger(WEmailEdit.class); @@ -265,7 +265,7 @@ protected void render(EnumSet flags) { super.render(flags); WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WEmailEdit.js", wtjs1()); - super.setJavaScriptMember("wtEncodeValue", "Wt4_10_0.encodeEmailValue"); + super.setJavaScriptMember("wtEncodeValue", "Wt4_10_1.encodeEmailValue"); } void updateDom(final DomElement element, boolean all) { diff --git a/src/eu/webtoolkit/jwt/WEmailValidator.java b/src/eu/webtoolkit/jwt/WEmailValidator.java index 9791a18dd..7b2e9aa31 100644 --- a/src/eu/webtoolkit/jwt/WEmailValidator.java +++ b/src/eu/webtoolkit/jwt/WEmailValidator.java @@ -211,7 +211,7 @@ public WString getPattern() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WEmailValidator(") + js.append("new Wt4_10_1.WEmailValidator(") .append(this.isMandatory()) .append(',') .append(this.isMultiple()) @@ -255,6 +255,6 @@ static WJavaScriptPreamble wtjs1() { JavaScriptScope.WtClassScope, JavaScriptObjectType.JavaScriptConstructor, "WEmailValidator", - "(function(t,e,a,n,i,l){const r=(()=>{const t=\"[a-zA-Z0-9]\",e=t+\"(?:[a-zA-Z0-9]{0,61}\"+t+\")?\";return new RegExp(\"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@\"+e+\"(?:\\\\.\"+e+\")*$\",\"u\")})(),s=a?new RegExp(\"^(?:\"+a+\")$\",\"u\"):null;function u(t){return r.test(t)&&(!s||s.test(t))}this.validate=function(a){if(0===a.length)return t?{valid:!1,message:n}:{valid:!0};let r;r=e?a.split(\",\").every(u):u(a);return r?{valid:!0}:s?{valid:!1,message:l}:{valid:!1,message:i}}})"); + "(function(t,e,a,n,i,l){const r=(()=>{const t=\"[a-zA-Z0-9]\",e=t+\"(?:[a-zA-Z0-9-]{0,61}\"+t+\")?\";return new RegExp(\"^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@\"+e+\"(?:\\\\.\"+e+\")*$\",\"u\")})(),s=a?new RegExp(\"^(?:\"+a+\")$\",\"u\"):null;function u(t){return r.test(t)&&(!s||s.test(t))}this.validate=function(a){if(0===a.length)return t?{valid:!1,message:n}:{valid:!0};let r;r=e?a.split(\",\").every(u):u(a);return r?{valid:!0}:s?{valid:!1,message:l}:{valid:!1,message:i}}})"); } } diff --git a/src/eu/webtoolkit/jwt/WEnvironment.java b/src/eu/webtoolkit/jwt/WEnvironment.java index d913e332c..acb8c3511 100644 --- a/src/eu/webtoolkit/jwt/WEnvironment.java +++ b/src/eu/webtoolkit/jwt/WEnvironment.java @@ -50,7 +50,7 @@ public class WEnvironment { /** Wt's JavaScript scope. */ public static String getJavaScriptWtScope() { - return "Wt4_10_0"; + return "Wt4_10_1"; } /** * Parameters passed to the application. @@ -445,7 +445,7 @@ public String getDeploymentPath() { *

      Example: "1.99.2" */ public static String getLibraryVersion() { - return "4.10.0"; + return "4.10.1"; } // public void libraryVersion(final bad java simple ref int series, final bad java simple ref int // major, final bad java simple ref int minor) ; diff --git a/src/eu/webtoolkit/jwt/WFileDropWidget.java b/src/eu/webtoolkit/jwt/WFileDropWidget.java index 02b359872..423ec251b 100644 --- a/src/eu/webtoolkit/jwt/WFileDropWidget.java +++ b/src/eu/webtoolkit/jwt/WFileDropWidget.java @@ -251,7 +251,7 @@ public WFileDropWidget() { *

      * *

      Remark: Since version 4.7.0, this method returns a copy of the vector because we - * changed the internal vector to hold values of type std::unique_ptr. + * changed the internal vector to hold values of type std::unique_ptr. * * @see WFileDropWidget#getCurrentIndex() */ @@ -467,7 +467,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.getJsRef() + ".destructor();"; if (!recursive) { - result += "Wt4_10_0.remove('" + this.getId() + "');"; + result += "Wt4_10_1.remove('" + this.getId() + "');"; } return result; } else { @@ -529,7 +529,7 @@ private void setup() { String maxFileSize = String.valueOf(WApplication.getInstance().getMaximumRequestSize()); this.setJavaScriptMember( " WFileDropWidget", - "new Wt4_10_0.WFileDropWidget(" + "new Wt4_10_1.WFileDropWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WFileUpload.java b/src/eu/webtoolkit/jwt/WFileUpload.java index df7b81e9d..ffef7ffab 100644 --- a/src/eu/webtoolkit/jwt/WFileUpload.java +++ b/src/eu/webtoolkit/jwt/WFileUpload.java @@ -471,7 +471,7 @@ private void onData(long current, long total) { private void onDataExceeded(long dataExceeded) { this.doJavaScript( - "Wt4_10_0.$('if" + this.getId() + "').src='" + this.fileUploadTarget_.getUrl() + "';"); + "Wt4_10_1.$('if" + this.getId() + "').src='" + this.fileUploadTarget_.getUrl() + "';"); if (this.flags_.get(BIT_UPLOADING)) { this.flags_.clear(BIT_UPLOADING); this.handleFileTooLarge(dataExceeded); @@ -532,7 +532,7 @@ void updateDom(final DomElement element, boolean all) { element.setAttribute("action", this.fileUploadTarget_.generateUrl()); String maxFileSize = String.valueOf(WApplication.getInstance().getMaximumRequestSize()); String command = - "{var submit = true;var x = Wt4_10_0.$('in" + "{var submit = true;var x = Wt4_10_1.$('in" + this.getId() + "');if (x.files != null) {for (var i = 0; i < x.files.length; i++) {var f = x.files[i];if (f.size > " + maxFileSize @@ -679,9 +679,9 @@ protected void propagateSetEnabled(boolean enabled) { String renderRemoveJs(boolean recursive) { boolean isIE = WApplication.getInstance().getEnvironment().agentIsIE(); if (this.isRendered() && isIE) { - String result = "Wt4_10_0.$('if" + this.getId() + "').innerHTML = \"\";"; + String result = "Wt4_10_1.$('if" + this.getId() + "').innerHTML = \"\";"; if (!recursive) { - result += "Wt4_10_0.remove('" + this.getId() + "');"; + result += "Wt4_10_1.remove('" + this.getId() + "');"; } return result; } else { diff --git a/src/eu/webtoolkit/jwt/WFlashObject.java b/src/eu/webtoolkit/jwt/WFlashObject.java index 9a37f46e3..55df11e0a 100644 --- a/src/eu/webtoolkit/jwt/WFlashObject.java +++ b/src/eu/webtoolkit/jwt/WFlashObject.java @@ -144,7 +144,7 @@ public void setFlashVariable(final String name, final CharSequence value) { * for example on IE when flash is not installed. */ public String getJsFlashRef() { - return "Wt4_10_0.getElement('" + this.getId() + "_flash')"; + return "Wt4_10_1.getElement('" + this.getId() + "_flash')"; } /** * Sets content to be displayed if Flash is not available. diff --git a/src/eu/webtoolkit/jwt/WFormWidget.java b/src/eu/webtoolkit/jwt/WFormWidget.java index 7fa513de2..9267718ab 100644 --- a/src/eu/webtoolkit/jwt/WFormWidget.java +++ b/src/eu/webtoolkit/jwt/WFormWidget.java @@ -334,7 +334,7 @@ protected void validatorChanged() { this.setJavaScriptMember("wtValidate", validateJS); if (!(this.validateJs_ != null)) { this.validateJs_ = new JSlot(); - this.validateJs_.setJavaScript("function(o){Wt4_10_0.validate(o)}"); + this.validateJs_.setJavaScript("function(o){Wt4_10_1.validate(o)}"); this.keyWentUp().addListener(this.validateJs_); this.changed().addListener(this.validateJs_); if (this.getDomElementType() != DomElementType.SELECT) { @@ -352,7 +352,7 @@ protected void validatorChanged() { } StringUtils.replace(inputFilter, '/', "\\/"); this.filterInput_.setJavaScript( - "function(o,e){Wt4_10_0.filter(o,e," + jsStringLiteral(inputFilter) + ")}"); + "function(o,e){Wt4_10_1.filter(o,e," + jsStringLiteral(inputFilter) + ")}"); } else { if (this.filterInput_ != null) { this.keyPressed().removeListener(this.filterInput_); @@ -394,7 +394,7 @@ private void defineJavaScript(boolean force) { app.loadJavaScript("js/WFormWidget.js", wtjs1()); this.setJavaScriptMember( " WFormWidget", - "new Wt4_10_0.WFormWidget(" + "new Wt4_10_1.WFormWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WGLWidget.java b/src/eu/webtoolkit/jwt/WGLWidget.java index aedcd681d..397f6886c 100644 --- a/src/eu/webtoolkit/jwt/WGLWidget.java +++ b/src/eu/webtoolkit/jwt/WGLWidget.java @@ -564,7 +564,7 @@ public WGLWidget.JavaScriptMatrix4x4 inverted() { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); copy.jsRef_ = - "Wt4_10_0.glMatrix.mat4.inverse(" + this.jsRef_ + ", Wt4_10_0.glMatrix.mat4.create())"; + "Wt4_10_1.glMatrix.mat4.inverse(" + this.jsRef_ + ", Wt4_10_1.glMatrix.mat4.create())"; copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.INVERT); return copy; } @@ -575,7 +575,7 @@ public WGLWidget.JavaScriptMatrix4x4 transposed() { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); copy.jsRef_ = - "Wt4_10_0.glMatrix.mat4.transpose(" + this.jsRef_ + ", Wt4_10_0.glMatrix.mat4.create())"; + "Wt4_10_1.glMatrix.mat4.transpose(" + this.jsRef_ + ", Wt4_10_1.glMatrix.mat4.create())"; copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.TRANSPOSE); return copy; } @@ -586,10 +586,10 @@ public WGLWidget.JavaScriptMatrix4x4 multiply(final javax.vecmath.Matrix4f m) { } WGLWidget.JavaScriptMatrix4x4 copy = this.clone(); StringWriter ss = new StringWriter(); - ss.append("Wt4_10_0.glMatrix.mat4.multiply(").append(this.jsRef_).append(","); + ss.append("Wt4_10_1.glMatrix.mat4.multiply(").append(this.jsRef_).append(","); javax.vecmath.Matrix4f t = WebGLUtils.transpose(m); WebGLUtils.renderfv(ss, t, this.context_.pImpl_.getArrayType()); - ss.append(", Wt4_10_0.glMatrix.mat4.create())"); + ss.append(", Wt4_10_1.glMatrix.mat4.create())"); copy.jsRef_ = ss.toString(); copy.operations_.add(WGLWidget.JavaScriptMatrix4x4.op.MULTIPLY); copy.matrices_.add(m); @@ -1511,6 +1511,14 @@ public void bufferSubDataiv( public void clear(EnumSet mask) { this.pImpl_.clear(mask); } + /** + * GL function that clears the given buffers. + * + *

      Calls {@link #clear(EnumSet mask) clear(EnumSet.of(mas, mask))} + */ + public final void clear(WGLWidget.GLenum mas, WGLWidget.GLenum... mask) { + clear(EnumSet.of(mas, mask)); + } /** * GL function that sets the clear color of the color buffer. * @@ -2814,8 +2822,8 @@ public void setJavaScriptVector(final WGLWidget.JavaScriptVector jsv, final List * is the TouchEvent. *

    * - *

    For example, if we wanted to scale some object when we scroll, we could create a - * JavaScriptMatrix4x4 called \p transform_: + *

    For example, if we wanted to scale some object when we scroll, we could create a {@link + * JavaScriptMatrix4x4} called transform_: * *

    * diff --git a/src/eu/webtoolkit/jwt/WGridLayout.java b/src/eu/webtoolkit/jwt/WGridLayout.java index baf0fc01d..304c932ca 100644 --- a/src/eu/webtoolkit/jwt/WGridLayout.java +++ b/src/eu/webtoolkit/jwt/WGridLayout.java @@ -92,7 +92,7 @@ *

    * *

    Note: When JavaScript support is not available, not all functionality of the layout - * is available. In particular, vertical size management is not available. + * is available. In particular, vertical size management is not available. * *

    Note: When a layout is used on a first page with progressive bootstrap, then the * layout will progress only in a limited way to a full JavaScript-based layout. You can thus not diff --git a/src/eu/webtoolkit/jwt/WGroupBox.java b/src/eu/webtoolkit/jwt/WGroupBox.java index 788c8aeab..1cf6ab61e 100644 --- a/src/eu/webtoolkit/jwt/WGroupBox.java +++ b/src/eu/webtoolkit/jwt/WGroupBox.java @@ -58,6 +58,8 @@ * *

    WGroupBox example * + *

    + * *

    CSS

    * *

    The widget corresponds to the HTML <fieldset> tag, and the title in a diff --git a/src/eu/webtoolkit/jwt/WHBoxLayout.java b/src/eu/webtoolkit/jwt/WHBoxLayout.java index 8cdbc93d1..48133864f 100644 --- a/src/eu/webtoolkit/jwt/WHBoxLayout.java +++ b/src/eu/webtoolkit/jwt/WHBoxLayout.java @@ -43,7 +43,7 @@ * *

    * - *

    Note: First consider if you can achieve your layout using CSS ! + *

    Note: First consider if you can achieve your layout using CSS ! * * @see WVBoxLayout */ diff --git a/src/eu/webtoolkit/jwt/WIdentityProxyModel.java b/src/eu/webtoolkit/jwt/WIdentityProxyModel.java index 169a07b74..3b8326a91 100644 --- a/src/eu/webtoolkit/jwt/WIdentityProxyModel.java +++ b/src/eu/webtoolkit/jwt/WIdentityProxyModel.java @@ -23,8 +23,7 @@ * *

    A {@link WIdentityProxyModel} simply forwards the structure of the source model, without any * transformation. {@link WIdentityProxyModel} can be used as a base class for implementing proxy - * models that reimplement {@link WAbstractProxyModel#getData(WModelIndex index, ItemDataRole role) - * WAbstractProxyModel#getData()}, but retain all other characteristics of the source model. + * models that reimplement data(), but retain all other characteristics of the source model. */ public class WIdentityProxyModel extends WAbstractProxyModel { private static Logger logger = LoggerFactory.getLogger(WIdentityProxyModel.class); diff --git a/src/eu/webtoolkit/jwt/WImage.java b/src/eu/webtoolkit/jwt/WImage.java index f256099ff..5b41aefc0 100644 --- a/src/eu/webtoolkit/jwt/WImage.java +++ b/src/eu/webtoolkit/jwt/WImage.java @@ -381,7 +381,7 @@ protected void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WImage.js", wtjs1()); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_10_0.WImage(") + ss.append("new Wt4_10_1.WImage(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WInPlaceEdit.java b/src/eu/webtoolkit/jwt/WInPlaceEdit.java index 304e748b6..9a04e111e 100644 --- a/src/eu/webtoolkit/jwt/WInPlaceEdit.java +++ b/src/eu/webtoolkit/jwt/WInPlaceEdit.java @@ -48,6 +48,8 @@ * *

    WInPlaceEdit edit mode * + *

    + * *

    CSS

    * *

    A {@link WInPlaceEdit} widget renders as a <span> containing a {@link diff --git a/src/eu/webtoolkit/jwt/WIntValidator.java b/src/eu/webtoolkit/jwt/WIntValidator.java index f8213ee54..2fb3f3b09 100644 --- a/src/eu/webtoolkit/jwt/WIntValidator.java +++ b/src/eu/webtoolkit/jwt/WIntValidator.java @@ -246,7 +246,7 @@ public boolean isIgnoreTrailingSpaces() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WIntValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_10_1.WIntValidator(").append(this.isMandatory()).append(','); if (this.bottom_ != Integer.MIN_VALUE) { js.append(this.bottom_); } else { diff --git a/src/eu/webtoolkit/jwt/WInteractWidget.java b/src/eu/webtoolkit/jwt/WInteractWidget.java index 0ad7fd846..da3f9c56d 100644 --- a/src/eu/webtoolkit/jwt/WInteractWidget.java +++ b/src/eu/webtoolkit/jwt/WInteractWidget.java @@ -404,7 +404,7 @@ public EventSignal1 gestureEnded() { * *

    * - *

    Note: When JavaScript is disabled, drag&drop does not work. + *

    Note: When JavaScript is disabled, drag&drop does not work. * * @see WWidget#dropEvent(WDropEvent event) * @see WWidget#acceptDrops(String mimeType, String hoverStyleClass) @@ -533,7 +533,7 @@ public void setPopup(boolean popup) { if (popup && WApplication.getInstance().getEnvironment().hasAjax()) { this.clicked() .addListener( - "function(o,e) { if (Wt4_10_0.WPopupWidget && o.wtPopup) {Wt4_10_0.WPopupWidget.popupClicked = o;document.dispatchEvent(new MouseEvent('click', e));Wt4_10_0.WPopupWidget.popupClicked = null; }}"); + "function(o,e) { if (Wt4_10_1.WPopupWidget && o.wtPopup) {Wt4_10_1.WPopupWidget.popupClicked = o;document.dispatchEvent(new MouseEvent('click', e));Wt4_10_1.WPopupWidget.popupClicked = null; }}"); this.clicked().preventPropagation(); } super.setPopup(popup); @@ -625,7 +625,7 @@ void updateDom(final DomElement element, boolean all) { String CheckDisabled = "if(o.classList.contains('" + app.getTheme().getDisabledClass() - + "')){Wt4_10_0.cancelEvent(e);return;}"; + + "')){Wt4_10_1.cancelEvent(e);return;}"; if (updateMouseDown) { StringBuilder js = new StringBuilder(); js.append(CheckDisabled); @@ -637,11 +637,11 @@ void updateDom(final DomElement element, boolean all) { && mouseDown.isConnected() && (mouseUp != null && mouseUp.isConnected() || mouseMove != null && mouseMove.isConnected())) { - js.append("Wt4_10_0.capture(this);"); + js.append("Wt4_10_1.capture(this);"); } if (mouseMove != null && mouseMove.isConnected() || mouseDrag != null && mouseDrag.isConnected()) { - js.append("Wt4_10_0.mouseDown(e);"); + js.append("Wt4_10_1.mouseDown(e);"); } if (mouseDown != null) { js.append(mouseDown.getJavaScript()); @@ -657,7 +657,7 @@ void updateDom(final DomElement element, boolean all) { js.append(CheckDisabled); if (mouseMove != null && mouseMove.isConnected() || mouseDrag != null && mouseDrag.isConnected()) { - js.append("Wt4_10_0.mouseUp(e);"); + js.append("Wt4_10_1.mouseUp(e);"); } if (mouseUp != null) { js.append(mouseUp.getJavaScript()); @@ -678,8 +678,8 @@ void updateDom(final DomElement element, boolean all) { if (mouseDrag != null) { actions.add( new DomElement.EventAction( - "Wt4_10_0.buttons", - mouseDrag.getJavaScript() + "Wt4_10_0.drag(e);", + "Wt4_10_1.buttons", + mouseDrag.getJavaScript() + "Wt4_10_1.drag(e);", mouseDrag.encodeCmd(), mouseDrag.isExposedSignal())); mouseDrag.updateOk(); @@ -702,7 +702,7 @@ void updateDom(final DomElement element, boolean all) { && touchStart.isConnected() && (touchEnd != null && touchEnd.isConnected() || touchMove != null && touchMove.isConnected())) { - js.append("Wt4_10_0.capture(this);"); + js.append("Wt4_10_1.capture(this);"); } if (touchStart != null) { js.append(touchStart.getJavaScript()); @@ -744,12 +744,12 @@ void updateDom(final DomElement element, boolean all) { StringBuilder js = new StringBuilder(); js.append(CheckDisabled); if (mouseDrag != null) { - js.append("if (Wt4_10_0.dragged()) return;"); + js.append("if (Wt4_10_1.dragged()) return;"); } if (mouseDblClick != null && mouseDblClick.needsUpdate(all)) { if (mouseClick != null) { if (mouseClick.isDefaultActionPrevented() || mouseClick.isPropagationPrevented()) { - js.append("Wt4_10_0.cancelEvent(e"); + js.append("Wt4_10_1.cancelEvent(e"); if (mouseClick.isDefaultActionPrevented() && mouseClick.isPropagationPrevented()) { js.append(");"); } else { @@ -761,7 +761,7 @@ void updateDom(final DomElement element, boolean all) { } } } - js.append("if(Wt4_10_0.isDblClick(o, e)) {").append(mouseDblClick.getJavaScript()); + js.append("if(Wt4_10_1.isDblClick(o, e)) {").append(mouseDblClick.getJavaScript()); if (mouseDblClick.isExposedSignal()) { js.append(app.getJavaScriptClass()) .append("._p_.update(o,'") @@ -770,7 +770,7 @@ void updateDom(final DomElement element, boolean all) { } mouseDblClick.updateOk(); js.append( - "}else{if (Wt4_10_0.isIElt9 && document.createEventObject) e = document.createEventObject(e);o.wtE1 = e;o.wtClickTimeout = setTimeout(function() {o.wtClickTimeout = null; o.wtE1 = null;"); + "}else{if (Wt4_10_1.isIElt9 && document.createEventObject) e = document.createEventObject(e);o.wtE1 = e;o.wtClickTimeout = setTimeout(function() {o.wtClickTimeout = null; o.wtE1 = null;"); if (mouseClick != null) { js.append(mouseClick.getJavaScript()); if (mouseClick.isExposedSignal()) { diff --git a/src/eu/webtoolkit/jwt/WItemSelectionModel.java b/src/eu/webtoolkit/jwt/WItemSelectionModel.java index 0ed3cecd8..0e27d5985 100644 --- a/src/eu/webtoolkit/jwt/WItemSelectionModel.java +++ b/src/eu/webtoolkit/jwt/WItemSelectionModel.java @@ -33,7 +33,7 @@ * *

    * - *

    Note: Currently this class cannot be shared between multiple views. + *

    Note: Currently this class cannot be shared between multiple views. * * @see WTreeView * @see WTableView diff --git a/src/eu/webtoolkit/jwt/WLayout.java b/src/eu/webtoolkit/jwt/WLayout.java index 399c7072e..9a103b01a 100644 --- a/src/eu/webtoolkit/jwt/WLayout.java +++ b/src/eu/webtoolkit/jwt/WLayout.java @@ -64,15 +64,9 @@ public void setPreferredImplementation(LayoutImplementation implementation) { * LayoutImplementation#JavaScript} is used. * *

    Because there are cases where {@link LayoutImplementation#Flex} does not work properly, this - * method can be used to set the global preferred implementation to {@link - * LayoutImplementation#JavaScript} instead. - * - *

    Since this is a system-wide setting, and not a per-session setting, you should call this - * function before any session is created, e.g. in main() before calling WRun(). - * - *

    - * - * @see WLayout#setPreferredImplementation(LayoutImplementation implementation) + * method can be used to set the global preferred implementation to instead. Since this is a + * system-wide setting, and not a per-session setting, you should call this function before any + * session is created, e.g. in main() before calling WRun(). setPreferredImplementation() */ public static void setDefaultImplementation(LayoutImplementation implementation) { defaultImplementation_ = implementation; @@ -221,8 +215,8 @@ public WLayoutImpl getImpl() { * *

    * - *

    Note: Only used when the layout manager is applied to a {@link - * WContainerWidget}. + *

    Note: Only used when the layout manager is applied to a {@link WContainerWidget}. + * * * @see WLayout#setContentsMargins(int left, int top, int right, int bottom) */ diff --git a/src/eu/webtoolkit/jwt/WLeafletMap.java b/src/eu/webtoolkit/jwt/WLeafletMap.java index c5f577572..91a4cf566 100644 --- a/src/eu/webtoolkit/jwt/WLeafletMap.java +++ b/src/eu/webtoolkit/jwt/WLeafletMap.java @@ -374,7 +374,7 @@ public void remove() { *

    Note: This fully rerenders the map, because it creates a new Leaflet map, so any * custom JavaScript modifying the map with e.g. {@link WCompositeWidget#doJavaScript(String js) * WCompositeWidget#doJavaScript()} is undone, much like reloading the page when - * reload-is-new-session is set to false. See is set to false. See https://leafletjs.com/reference.html#map * for a list of options. */ @@ -665,7 +665,7 @@ private void defineJavaScript() { String optionsStr = this.options_.toString(); StringBuilder ss = new StringBuilder(); EscapeOStream es = new EscapeOStream(ss); - es.append("new Wt4_10_0.WLeafletMap(") + es.append("new Wt4_10_1.WLeafletMap(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WLengthValidator.java b/src/eu/webtoolkit/jwt/WLengthValidator.java index 73fc27c75..1c7ef9153 100644 --- a/src/eu/webtoolkit/jwt/WLengthValidator.java +++ b/src/eu/webtoolkit/jwt/WLengthValidator.java @@ -196,7 +196,7 @@ public WString getInvalidTooLongText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WLengthValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_10_1.WLengthValidator(").append(this.isMandatory()).append(','); if (this.minLength_ != 0) { js.append(this.minLength_); } else { diff --git a/src/eu/webtoolkit/jwt/WLineEdit.java b/src/eu/webtoolkit/jwt/WLineEdit.java index 523704414..eb009309c 100644 --- a/src/eu/webtoolkit/jwt/WLineEdit.java +++ b/src/eu/webtoolkit/jwt/WLineEdit.java @@ -336,7 +336,7 @@ public void setSelection(int start, int length) { String s = String.valueOf(start); String e = String.valueOf(start + length); this.doJavaScript( - "Wt4_10_0.setUnicodeSelectionRange(" + this.getJsRef() + "," + s + "," + e + ")"); + "Wt4_10_1.setUnicodeSelectionRange(" + this.getJsRef() + "," + s + "," + e + ")"); } /** * Returns the current cursor position. @@ -385,22 +385,54 @@ public String getInputMask() { *

    The following characters can be used in the input mask: * * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * *
    Character Description
    A ASCII alphabetic character: A-Z, a-z (required)
    a ASCII alphabetic character: A-Z, a-z (optional)
    N ASCII alphanumeric character: A-Z, a-z, 0-9 (required)
    n ASCII alphanumeric character: A-Z, a-z, 0-9 (optional)
    XAny character (required)
    xAny character (optional)
    9Digit: 0-9 (required)
    0Digit: 0-9 (optional)
    DNonzero digit: 1-9 (required)
    dNonzero digit: 1-9 (optional)
    #Digit or sign: 0-9, -, + (required)
    H Hexadecimal character: A-F, a-f, 0-9 (required)
    h Hexadecimal character: A-F, a-f, 0-9 (optional)
    BBinary digit: 0-1 (required)
    bBinary digit: 0-1 (optional)
    Character + * Description + *
    A + * ASCII alphabetic character: A-Z, a-z (required) + *
    a + * ASCII alphabetic character: A-Z, a-z (optional) + *
    N + * ASCII alphanumeric character: A-Z, a-z, 0-9 (required) + *
    n + * ASCII alphanumeric character: A-Z, a-z, 0-9 (optional) + *
    X + * Any character (required) + *
    x + * Any character (optional) + *
    9 + * Digit: 0-9 (required) + *
    0 + * Digit: 0-9 (optional) + *
    D + * Nonzero digit: 1-9 (required) + *
    d + * Nonzero digit: 1-9 (optional) + *
    # + * Digit or sign: 0-9, -, + (required) + *
    H + * Hexadecimal character: A-F, a-f, 0-9 (required) + *
    h + * Hexadecimal character: A-F, a-f, 0-9 (optional) + *
    B + * Binary digit: 0-1 (required) + *
    b + * Binary digit: 0-1 (optional) + *
    * * The distinction between required and optional characters won't be apparent on the client @@ -410,10 +442,18 @@ public String getInputMask() { * value in some way: * * - * - * - * - * + * + * + * + * *
    CharacterDescription
    >The following characters are uppercased
    <The following characters are lowercased
    ! The casing of the following characters remains the same
    Character + * Description + *
    > + * The following characters are uppercased + *
    < + * The following characters are lowercased + *
    ! + * The casing of the following characters remains the same + *
    * * A backslash ('\') can be used to escape any of the mask characters or modifiers, so @@ -426,10 +466,18 @@ public String getInputMask() { *

    Examples: * * - * - * - * - * + * + * + * + * *
    Input maskNotes
    009.009.009.009;_
    IP address. Spaces are denoted by '_'. Will validate if there is at least one digit per segment.
    9999-99-99
    Date, in yyyy-MM-dd notation. Spaces are denoted by ' '. Will validate if all digits are filled in.
    >HH:HH:HH:HH:HH:HH;_
    MAC address. Spaces are denoted by '_'. Will validate if all hexadecimal characters are filled in. All characters will be formatted in uppercase.
    Input mask + * Notes + *
    009.009.009.009;_
    + *
    IP address. Spaces are denoted by '_'. Will validate if there is at least one digit per segment. + *
    9999-99-99
    + *
    Date, in yyyy-MM-dd notation. Spaces are denoted by ' '. Will validate if all digits are filled in. + *
    >HH:HH:HH:HH:HH:HH;_
    + *
    MAC address. Spaces are denoted by '_'. Will validate if all hexadecimal characters are filled in. All characters will be formatted in uppercase. + *
    * *

    Input masks are enforced by JavaScript on the client side. Without JavaScript or using @@ -697,7 +745,7 @@ private void defineJavaScript() { String space = ""; space += this.spaceChar_; String jsObj = - "new Wt4_10_0.WLineEdit(" + "new Wt4_10_1.WLineEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WMeasurePaintDevice.java b/src/eu/webtoolkit/jwt/WMeasurePaintDevice.java index 9390d34a5..09b9705de 100644 --- a/src/eu/webtoolkit/jwt/WMeasurePaintDevice.java +++ b/src/eu/webtoolkit/jwt/WMeasurePaintDevice.java @@ -58,10 +58,6 @@ public void setChanged(EnumSet flags) { this.device_.setChanged(flags); } - public final void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags) { - setChanged(EnumSet.of(flag, flags)); - } - public void drawArc(final WRectF rect, double startAngle, double spanAngle) { WPainterPath p = new WPainterPath(); double r = Math.max(rect.getWidth(), rect.getHeight()) / 2; @@ -164,14 +160,6 @@ public WTextItem measureText(final CharSequence text, double maxWidth, boolean w return this.device_.measureText(text, maxWidth, wordWrap); } - public final WTextItem measureText(final CharSequence text) { - return measureText(text, -1, false); - } - - public final WTextItem measureText(final CharSequence text, double maxWidth) { - return measureText(text, maxWidth, false); - } - public WFontMetrics getFontMetrics() { return this.device_.getFontMetrics(); } diff --git a/src/eu/webtoolkit/jwt/WMediaPlayer.java b/src/eu/webtoolkit/jwt/WMediaPlayer.java index 17cfac57f..086733997 100644 --- a/src/eu/webtoolkit/jwt/WMediaPlayer.java +++ b/src/eu/webtoolkit/jwt/WMediaPlayer.java @@ -767,7 +767,7 @@ protected void render(EnumSet flags) { first = false; } ss.append('}').append("});"); - ss.append("new Wt4_10_0.WMediaPlayer(") + ss.append("new Wt4_10_1.WMediaPlayer(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java b/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java index c46434c5e..a7e39ab76 100644 --- a/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java +++ b/src/eu/webtoolkit/jwt/WMediaPlayerImpl.java @@ -31,7 +31,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.player_.getJsPlayerRef() + ".jPlayer('destroy');"; if (!recursive) { - result += "Wt4_10_0.remove('" + this.getId() + "');"; + result += "Wt4_10_1.remove('" + this.getId() + "');"; } return result; } else { diff --git a/src/eu/webtoolkit/jwt/WMenuItem.java b/src/eu/webtoolkit/jwt/WMenuItem.java index 7196ee719..40017ddbb 100644 --- a/src/eu/webtoolkit/jwt/WMenuItem.java +++ b/src/eu/webtoolkit/jwt/WMenuItem.java @@ -341,7 +341,7 @@ public WLink getLink() { *

    * *

    Note: If the {@link WMenuItem#getParentMenu() parent menu} is a {@link - * WPopupMenu}, the submenu should also be a {@link WPopupMenu}. + * WPopupMenu}, the submenu should also be a {@link WPopupMenu}. * * @see WMenuItem#setSelectable(boolean selectable) */ @@ -702,7 +702,7 @@ public void enableAjax() { public void setHidden(boolean hidden, final WAnimation animation) { super.setHidden(hidden, animation); if (hidden) { - if (this.menu_ != null) { + if (this.menu_ != null && !this.menu_.isHidden()) { this.menu_.onItemHidden(this.menu_.indexOf(this), true); } } @@ -711,7 +711,7 @@ public void setHidden(boolean hidden, final WAnimation animation) { public void setDisabled(boolean disabled) { super.setDisabled(disabled); if (disabled) { - if (this.menu_ != null) { + if (this.menu_ != null && !this.menu_.isDisabled()) { this.menu_.onItemHidden(this.menu_.indexOf(this), true); } } diff --git a/src/eu/webtoolkit/jwt/WMessageBox.java b/src/eu/webtoolkit/jwt/WMessageBox.java index d2bb3afb9..de0a1521f 100644 --- a/src/eu/webtoolkit/jwt/WMessageBox.java +++ b/src/eu/webtoolkit/jwt/WMessageBox.java @@ -47,12 +47,14 @@ * Example of a WMessageBox (default)

    * * + * *
    * *

    * Example of a WMessageBox (polished)

    *
    * + * * * * diff --git a/src/eu/webtoolkit/jwt/WNavigationBar.java b/src/eu/webtoolkit/jwt/WNavigationBar.java index 19dc49eb8..9ded26ebf 100644 --- a/src/eu/webtoolkit/jwt/WNavigationBar.java +++ b/src/eu/webtoolkit/jwt/WNavigationBar.java @@ -23,7 +23,7 @@ * *

    * - *

    Note: {@link WNavigationBar} is currently only styled in the Bootstrap themes. + *

    Note: {@link WNavigationBar} is currently only styled in the Bootstrap themes. * *

    Note: When using {@link WBootstrap5Theme}, no color schemes are applied by default. * You will have to add a "bg-" style class, and "navbar-light" or diff --git a/src/eu/webtoolkit/jwt/WOverlayLoadingIndicator.java b/src/eu/webtoolkit/jwt/WOverlayLoadingIndicator.java index 37f0fd5a4..35d7e3288 100644 --- a/src/eu/webtoolkit/jwt/WOverlayLoadingIndicator.java +++ b/src/eu/webtoolkit/jwt/WOverlayLoadingIndicator.java @@ -30,8 +30,10 @@ * *

    The overlay loading indicator * + *

    + * *

    Note: For this loading indicator to render properly in IE, you need to reset the - * "body" margin to 0. Using the inline stylesheet, this could be done using: + * "body" margin to 0. Using the inline stylesheet, this could be done using: * *

    CSS

    * diff --git a/src/eu/webtoolkit/jwt/WPaintDevice.java b/src/eu/webtoolkit/jwt/WPaintDevice.java index a287d9972..3692013ae 100644 --- a/src/eu/webtoolkit/jwt/WPaintDevice.java +++ b/src/eu/webtoolkit/jwt/WPaintDevice.java @@ -65,7 +65,9 @@ public interface WPaintDevice { * *

    Calls {@link #setChanged(EnumSet flags) setChanged(EnumSet.of(flag, flags))} */ - public void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags); + public default void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags) { + setChanged(EnumSet.of(flag, flags)); + } /** * Draws an arc. * @@ -144,14 +146,18 @@ public void drawText( *

    Returns {@link #measureText(CharSequence text, double maxWidth, boolean wordWrap) * measureText(text, - 1, false)} */ - public WTextItem measureText(final CharSequence text); + public default WTextItem measureText(final CharSequence text) { + return measureText(text, -1, false); + } /** * Measures rendered text size. * *

    Returns {@link #measureText(CharSequence text, double maxWidth, boolean wordWrap) * measureText(text, maxWidth, false)} */ - public WTextItem measureText(final CharSequence text, double maxWidth); + public default WTextItem measureText(final CharSequence text, double maxWidth) { + return measureText(text, maxWidth, false); + } /** * Returns font metrics. * diff --git a/src/eu/webtoolkit/jwt/WPaintedWidget.java b/src/eu/webtoolkit/jwt/WPaintedWidget.java index ac0d6ea08..bf5a92401 100644 --- a/src/eu/webtoolkit/jwt/WPaintedWidget.java +++ b/src/eu/webtoolkit/jwt/WPaintedWidget.java @@ -27,13 +27,34 @@ *

    * * - * - * - * - * - * - * - * + * + * + * + * + * + * + * *
    BrowserMethods Default method
    Firefox 1.5+HtmlCanvas, InlineSVG, PngImage HtmlCanvas
    Internet Explorer 6.0+InlineVML, PngImage InlineVML
    Internet Explorer 9+HtmlCanvas, InlineSVG, PngImage HtmlCanvas
    SafariHtmlCanvas, InlineSVG, PngImage HtmlCanvas
    OperaInlineSVG, HtmlCanvas*, PngImage InlineSVG
    other?HtmlCanvas, PngImage
    Browser + * Methods + * Default method + *
    Firefox 1.5+ + * HtmlCanvas, InlineSVG, PngImage + * HtmlCanvas + *
    Internet Explorer 6.0+ + * InlineVML, PngImage + * InlineVML + *
    Internet Explorer 9+ + * HtmlCanvas, InlineSVG, PngImage + * HtmlCanvas + *
    Safari + * HtmlCanvas, InlineSVG, PngImage + * HtmlCanvas + *
    Opera + * InlineSVG, HtmlCanvas*, PngImage + * InlineSVG + *
    other + * ? + * HtmlCanvas, PngImage + *
    * *

    * HtmlCanvas occasionally suffers from rendering artefacts in Opera. @@ -67,7 +88,7 @@ *

    * *

    Note: A WPaintedWidget requires that it is given a size using {@link - * WPaintedWidget#resize(WLength width, WLength height) resize()} or by a layout manager. + * WPaintedWidget#resize(WLength width, WLength height) resize()} or by a layout manager. * *

    Client side interaction and repainting

    * @@ -191,7 +212,7 @@ public void resize(final WLength width, final WLength height) { *

    Note: When defining at least one area, no more events will propagate to the widget * itself. As a work-around, you can emulate this by listening for events on a {@link WRectArea} * that corresponds to the whole widget, and which is added as the last area (catching all events - * that were not caught by preceding areas). + * that were not caught by preceding areas). */ public void addArea(WAbstractArea area) { this.createAreaImage(); @@ -209,7 +230,7 @@ public void addArea(WAbstractArea area) { *

    Note: When defining at least one area, no more events will propagate to the widget * itself. As a work-around, you can emulate this by listening for events on a {@link WRectArea} * that corresponds to the whole widget, and which is added as the last area (catching all events - * that were not caught by preceding areas). + * that were not caught by preceding areas). */ public void insertArea(int index, WAbstractArea area) { this.createAreaImage(); @@ -259,7 +280,7 @@ public List getAreas() { *

    Note: This feature is currently only supported if the {@link * WPaintedWidget#getMethod() method} is HtmlCanvas. This will not cause a server roundtrip. * Instead, the resulting JavaScript of {@link WPaintedWidget#paintEvent(WPaintDevice paintDevice) - * paintEvent()} will be re-executed on the client side. + * paintEvent()} will be re-executed on the client side. * * @see WPaintedWidget#getObjJsRef() */ diff --git a/src/eu/webtoolkit/jwt/WPainter.java b/src/eu/webtoolkit/jwt/WPainter.java index 8e8a436ea..dfebeb559 100644 --- a/src/eu/webtoolkit/jwt/WPainter.java +++ b/src/eu/webtoolkit/jwt/WPainter.java @@ -680,7 +680,7 @@ public void drawPie( * *

    Draws a single point using the current pen. This is implemented by drawing a very short * line, centered around the given position. To get the result of a single point, you - * should use a pen with a {@link PenCapStyle#Square} or {@link PenCapStyle#Round} pen cap style. + * should use a pen with a Wt::PenCapStyle::Square or Wt::PenCapStyle::Round pen cap style. * *

    * @@ -839,14 +839,14 @@ public void drawRects(final List rectangles) { * *

    Note: If the clip path is not a polygon, i.e. it has rounded segments in it, an * approximation will be used instead by having the polygon pass through the control points, and - * the begin and end point of arcs. + * the begin and end point of arcs. * *

    Note: HtmlCanvas: on older browsers implementing Html5 canvas, text will be * rendered horizontally (unaffected by rotation and unaffected by the scaling component of the * transformation matrix). In that case, text is overlayed on top of painted shapes (in DOM * div's), and is not covered by shapes that are painted after the text. Use the SVG and VML * renderers (WPaintedWidget::inlineSvgVml) for the most accurate font rendering. Native HTML5 - * text rendering is supported on Firefox3+, Chrome2+ and Safari4+. + * text rendering is supported on Firefox3+, Chrome2+ and Safari4+. * *

    Note: {@link TextFlag#WordWrap}: using the {@link TextFlag#WordWrap} TextFlag is * currently only supported by the SVG backend. The code generated by the SVG backend uses @@ -1230,7 +1230,7 @@ public WPen getPen() { *

    Note: Clipping support is limited for the VML renderer. Only clipping with a * rectangle is supported for the VML renderer (see {@link WPainterPath#addRect(WRectF rectangle) * addRect()}). The rectangle must, after applying the combined transformation system, be aligned - * with the window. + * with the window. * * @see WPainter#hasClipping() * @see WPainter#setClipPath(WPainterPath clipPath) @@ -1248,7 +1248,7 @@ public void setClipping(boolean enable) { * *

    * - *

    Note: Clipping support is limited for the VML renderer. + *

    Note: Clipping support is limited for the VML renderer. * * @see WPainter#setClipping(boolean enable) * @see WPainter#setClipPath(WPainterPath clipPath) @@ -1265,7 +1265,7 @@ public boolean hasClipping() { * *

    * - *

    Note: Clipping support is limited for the VML renderer. + *

    Note: Clipping support is limited for the VML renderer. * * @see WPainter#getClipPath() * @see WPainter#setClipping(boolean enable) diff --git a/src/eu/webtoolkit/jwt/WPainterPath.java b/src/eu/webtoolkit/jwt/WPainterPath.java index 03556b156..02badca04 100644 --- a/src/eu/webtoolkit/jwt/WPainterPath.java +++ b/src/eu/webtoolkit/jwt/WPainterPath.java @@ -86,7 +86,7 @@ * *

    Warning: A WPainterPath that is JavaScript exposed should be modified only through * its {@link WJavaScriptHandle handle}. Any attempt at modifying it will cause an exception to be - * thrown. + * thrown. * * @see WPainter#drawPath(WPainterPath path) * @see WPaintedWidget#createJSPainterPath() @@ -417,7 +417,7 @@ public void addEllipse(final WRectF rect) { * *

    * - *

    Note: Some renderers only support circles (width == height) + *

    Note: Some renderers only support circles (width == height) * * @exception {@link WException} if the path {@link WJavaScriptExposableObject#isJavaScriptBound() * is JavaScript bound} @@ -729,7 +729,7 @@ public final WRectF getControlPointRect() { public WPainterPath getCrisp() { WPainterPath result = new WPainterPath(); if (this.isJavaScriptBound()) { - result.assignBinding(this, "Wt4_10_0.gfxUtils.path_crisp(" + this.getJsRef() + ')'); + result.assignBinding(this, "Wt4_10_1.gfxUtils.path_crisp(" + this.getJsRef() + ')'); } for (int i = 0; i < this.segments_.size(); ++i) { final WPainterPath.Segment segment = this.segments_.get(i); diff --git a/src/eu/webtoolkit/jwt/WPanel.java b/src/eu/webtoolkit/jwt/WPanel.java index 6d68fea02..c71bfa76e 100644 --- a/src/eu/webtoolkit/jwt/WPanel.java +++ b/src/eu/webtoolkit/jwt/WPanel.java @@ -55,7 +55,7 @@ public WPanel(WContainerWidget parentContainer) { this.impl_.bindWidget("contents", centralArea); this.setJavaScriptMember( WT_RESIZE_JS, - "function(self, w, h, s) {var hdefined = h >= 0;if (hdefined) {var mh = Wt4_10_0.px(self, 'maxHeight');if (mh > 0) h = Math.min(h, mh);}if (Wt4_10_0.boxSizing(self)) {h -= Wt4_10_0.px(self, 'borderTopWidth') + Wt4_10_0.px(self, 'borderBottomWidth');}var c = self.lastChild;var t = c.previousSibling;if (t)h -= t.offsetHeight;h -= 8;if (hdefined && h > 0) {c.lh = true;c.style.height = h + 'px';c.querySelectorAll(':scope > *').forEach(function(self) { let padding = self.getBoundingClientRect().height - Wt4_10_0.px(self, 'height');self.style.height = (h - padding) + 'px';self.lh = true;});} else {c.style.height = '';c.lh = false;for (const child of c.children) {child.style.height = '';child.lh = false;}}};"); + "function(self, w, h, s) {var hdefined = h >= 0;if (hdefined) {var mh = Wt4_10_1.px(self, 'maxHeight');if (mh > 0) h = Math.min(h, mh);}if (Wt4_10_1.boxSizing(self)) {h -= Wt4_10_1.px(self, 'borderTopWidth') + Wt4_10_1.px(self, 'borderBottomWidth');}var c = self.lastChild;var t = c.previousSibling;if (t)h -= t.offsetHeight;h -= 8;if (hdefined && h > 0) {c.lh = true;c.style.height = h + 'px';c.querySelectorAll(':scope > *').forEach(function(self) { let padding = self.getBoundingClientRect().height - Wt4_10_1.px(self, 'height');self.style.height = (h - padding) + 'px';self.lh = true;});} else {c.style.height = '';c.lh = false;for (const child of c.children) {child.style.height = '';child.lh = false;}}};"); this.setJavaScriptMember(WT_GETPS_JS, StdWidgetItemImpl.getSecondGetPSJS()); if (parentContainer != null) parentContainer.addWidget(this); } diff --git a/src/eu/webtoolkit/jwt/WPen.java b/src/eu/webtoolkit/jwt/WPen.java index 03209b0d4..e143d9c03 100644 --- a/src/eu/webtoolkit/jwt/WPen.java +++ b/src/eu/webtoolkit/jwt/WPen.java @@ -48,7 +48,7 @@ * *

    Warning: A WPen that is JavaScript exposed should be modified only through its * {@link WJavaScriptHandle handle}. Any attempt at modifying it will cause an exception to be - * thrown. + * thrown. * * @see WPainter#setPen(WPen p) * @see WBrush @@ -60,8 +60,8 @@ public class WPen extends WJavaScriptExposableObject { /** * Creates a black cosmetic pen. * - *

    Constructs a black solid pen of 0 width (i.e. cosmetic single pixel width), with {@link - * PenCapStyle#Square} line ends and {@link PenJoinStyle#Bevel} line join style. + *

    Constructs a black solid pen of 0 width (i.e. cosmetic single pixel width), with + * PenCapStyle::Square line ends and PenJoinStyle::Bevel line join style. */ public WPen() { super(); @@ -75,8 +75,8 @@ public WPen() { /** * Creates a black pen with a particular style. * - *

    Constructs a black pen of 0 width (i.e. cosmetic single pixel width), with {@link - * PenCapStyle#Square} line ends and {@link PenJoinStyle#Bevel} line join style. + *

    Constructs a black pen of 0 width (i.e. cosmetic single pixel width), with + * PenCapStyle::Square line ends and PenJoinStyle::Bevel line join style. * *

    The line style is set to style. */ @@ -92,8 +92,8 @@ public WPen(PenStyle style) { /** * Creates a solid pen of a particular color. * - *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with {@link - * PenCapStyle#Square} line ends and {@link PenJoinStyle#Bevel} line join style. + *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with + * PenCapStyle::Square line ends and PenJoinStyle::Bevel line join style. * *

    The pen color is set to color. */ @@ -109,8 +109,8 @@ public WPen(final WColor color) { /** * Creates a solid pen of a standard color. * - *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with {@link - * PenCapStyle#Square} line ends and {@link PenJoinStyle#Bevel} line join style. + *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with + * PenCapStyle::Square line ends and PenJoinStyle::Bevel line join style. * *

    The pen color is set to color. */ @@ -126,8 +126,8 @@ public WPen(StandardColor color) { /** * Creates a solid pen with a gradient color. * - *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with {@link - * PenCapStyle#Square} line ends and {@link PenJoinStyle#Bevel} line join style. + *

    Constructs a solid pen of 0 width (i.e. cosmetic single pixel width), with + * PenCapStyle::Square line ends and PenJoinStyle::Bevel line join style. * *

    The pen's color is defined by the gradient color. */ diff --git a/src/eu/webtoolkit/jwt/WPointF.java b/src/eu/webtoolkit/jwt/WPointF.java index fd05556ad..d74dbde90 100644 --- a/src/eu/webtoolkit/jwt/WPointF.java +++ b/src/eu/webtoolkit/jwt/WPointF.java @@ -40,7 +40,7 @@ * *

    Warning: A WPointF that is JavaScript exposed should be modified only through its * {@link WJavaScriptHandle handle}. Any attempt at modifying it will cause an exception to be - * thrown. + * thrown. * * @see WPaintedWidget#createJSPoint() */ diff --git a/src/eu/webtoolkit/jwt/WPopupMenu.java b/src/eu/webtoolkit/jwt/WPopupMenu.java index e283486ce..395a84808 100644 --- a/src/eu/webtoolkit/jwt/WPopupMenu.java +++ b/src/eu/webtoolkit/jwt/WPopupMenu.java @@ -86,6 +86,8 @@ * *

    WPopupMenu example (polished) * + *

    + * * @see WMenuItem */ public class WPopupMenu extends WMenu { @@ -167,7 +169,7 @@ public void popup(final WPoint p) { this.setOffsets(new WLength(42), EnumSet.of(Side.Left, Side.Top)); this.setOffsets(new WLength(-10000), EnumSet.of(Side.Left, Side.Top)); this.doJavaScript( - "Wt4_10_0.positionXY('" + "Wt4_10_1.positionXY('" + this.getId() + "'," + String.valueOf(p.getX()) @@ -417,7 +419,7 @@ protected void render(EnumSet flags) { String renderRemoveJs(boolean recursive) { String result = super.renderRemoveJs(true); - result += "Wt4_10_0.remove('" + this.getId() + "');"; + result += "Wt4_10_1.remove('" + this.getId() + "');"; return result; } @@ -496,7 +498,7 @@ private void prepareRender(WApplication app) { if (!this.cancel_.isConnected()) { app.loadJavaScript("js/WPopupMenu.js", wtjs1()); StringBuilder s = new StringBuilder(); - s.append("new Wt4_10_0.WPopupMenu(") + s.append("new Wt4_10_1.WPopupMenu(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WPopupWidget.java b/src/eu/webtoolkit/jwt/WPopupWidget.java index e91423e9e..db59ff9e3 100644 --- a/src/eu/webtoolkit/jwt/WPopupWidget.java +++ b/src/eu/webtoolkit/jwt/WPopupWidget.java @@ -226,7 +226,7 @@ private void defineJS() { app.loadJavaScript("js/WPopupWidget.js", wtjs1()); StringBuilder jsObj = new StringBuilder(); jsObj - .append("new Wt4_10_0.WPopupWidget(") + .append("new Wt4_10_1.WPopupWidget(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WRectF.java b/src/eu/webtoolkit/jwt/WRectF.java index 69ae1eb3b..8f0791b3a 100644 --- a/src/eu/webtoolkit/jwt/WRectF.java +++ b/src/eu/webtoolkit/jwt/WRectF.java @@ -42,7 +42,7 @@ * *

    Warning: A WRectF that is JavaScript exposed should be modified only through its * {@link WJavaScriptHandle handle}. Any attempt at modifying it will cause an exception to be - * thrown. + * thrown. * * @see WPaintedWidget#createJSRect() */ @@ -420,7 +420,7 @@ public WRectF getNormalized() { } WRectF result = new WRectF(x, y, w, h); if (this.isJavaScriptBound()) { - result.assignBinding(this, "Wt4_10_0.gfxUtils.rect_normalized(" + this.getJsRef() + ')'); + result.assignBinding(this, "Wt4_10_1.gfxUtils.rect_normalized(" + this.getJsRef() + ')'); } return result; } diff --git a/src/eu/webtoolkit/jwt/WRegExpValidator.java b/src/eu/webtoolkit/jwt/WRegExpValidator.java index a0fcd7e86..4cd4f94b7 100644 --- a/src/eu/webtoolkit/jwt/WRegExpValidator.java +++ b/src/eu/webtoolkit/jwt/WRegExpValidator.java @@ -41,7 +41,7 @@ *

    * *

    Note: This validator does not fully support unicode: it matches on the - * CharEncoding::UTF8-encoded representation of the string. + * CharEncoding::UTF8-encoded representation of the string. * *

    i18n

    * @@ -159,7 +159,7 @@ public WString getInvalidNoMatchText() { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WRegExpValidator(").append(this.isMandatory()).append(','); + js.append("new Wt4_10_1.WRegExpValidator(").append(this.isMandatory()).append(','); js.append(WWebWidget.jsStringLiteral(this.pattern_)).append(",'"); if ((this.regex_.flags() & Pattern.CASE_INSENSITIVE) != 0) { js.append('i'); diff --git a/src/eu/webtoolkit/jwt/WSlider.java b/src/eu/webtoolkit/jwt/WSlider.java index 2b9bd6d95..38efbc67d 100644 --- a/src/eu/webtoolkit/jwt/WSlider.java +++ b/src/eu/webtoolkit/jwt/WSlider.java @@ -32,6 +32,8 @@ * *

    Horizontal slider with ticks on both sides. * + *

    + * *

    CSS

    * *

    The non-native slider (HTML4, see {@link WSlider#setNativeControl(boolean nativeControl) diff --git a/src/eu/webtoolkit/jwt/WSortFilterProxyModel.java b/src/eu/webtoolkit/jwt/WSortFilterProxyModel.java index 761d97a9e..1110c7bb9 100644 --- a/src/eu/webtoolkit/jwt/WSortFilterProxyModel.java +++ b/src/eu/webtoolkit/jwt/WSortFilterProxyModel.java @@ -373,7 +373,7 @@ public SortOrder getSortOrder() { * *

    Note: This may be ackward when editing through the proxy model, since changing * some data may rearrange the model and thus invalidate model indexes. Therefore it is usually - * less complicated to manipulate directly the source model instead. + * less complicated to manipulate directly the source model instead. */ public void setDynamicSortFilter(boolean enable) { this.dynamic_ = enable; diff --git a/src/eu/webtoolkit/jwt/WStackedWidget.java b/src/eu/webtoolkit/jwt/WStackedWidget.java index ec7b7d9a5..d3da416ff 100644 --- a/src/eu/webtoolkit/jwt/WStackedWidget.java +++ b/src/eu/webtoolkit/jwt/WStackedWidget.java @@ -225,10 +225,10 @@ public void setCurrentWidget(WWidget widget) { * you should set it before it is first rendered. Otherwise, transition animations caused by * {@link WStackedWidget#setCurrentIndex(int index) setCurrentIndex()} may not be correctly * performed. If you do want to force this change you can use {@link WApplication#processEvents()} - * before calling {@link WStackedWidget#setCurrentIndex(int index) setCurrentIndex()}. + * before calling {@link WStackedWidget#setCurrentIndex(int index) setCurrentIndex()}. * *

    Note: It is also not supported to use a {@link AnimationEffect#Pop} animation on a - * {@link WStackedWidget}. + * {@link WStackedWidget}. * * @see WStackedWidget#setCurrentIndex(int index) */ @@ -296,7 +296,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WStackedWidget.js", wtjs1()); this.setJavaScriptMember( " WStackedWidget", - "new Wt4_10_0.WStackedWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_10_1.WStackedWidget(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); this.setJavaScriptMember(WT_RESIZE_JS, this.getJsRef() + ".wtObj.wtResize"); this.setJavaScriptMember(WT_GETPS_JS, this.getJsRef() + ".wtObj.wtGetPs"); if (this.loadAnimateJS_) { diff --git a/src/eu/webtoolkit/jwt/WStandardItem.java b/src/eu/webtoolkit/jwt/WStandardItem.java index 3cd7c445e..f4d770946 100644 --- a/src/eu/webtoolkit/jwt/WStandardItem.java +++ b/src/eu/webtoolkit/jwt/WStandardItem.java @@ -548,7 +548,7 @@ public boolean hasChildren() { *

    * *

    Note: If rows > 0, and {@link WStandardItem#getColumnCount() - * getColumnCount()} == 0, columnCount is first increased to 1 using setColumnCount(1). + * getColumnCount()} == 0, columnCount is first increased to 1 using setColumnCount(1). * * @see WStandardItem#setColumnCount(int columns) * @see WStandardItem#getRowCount() diff --git a/src/eu/webtoolkit/jwt/WStandardItemModel.java b/src/eu/webtoolkit/jwt/WStandardItemModel.java index 6b2e1ea7f..4fa6eef71 100644 --- a/src/eu/webtoolkit/jwt/WStandardItemModel.java +++ b/src/eu/webtoolkit/jwt/WStandardItemModel.java @@ -33,12 +33,10 @@ * WStandardItemModel#WStandardItemModel(int rows, int columns) WStandardItemModel()} to set the * initial table size, and use the {@link WStandardItemModel#getItem(int row, int column) getItem()} * and {@link WStandardItemModel#setItem(int row, int column, WStandardItem item) setItem()} methods - * to set data. You can change the geometry by inserting rows ({@link - * WStandardItemModel#insertRow(int row, List items) insertRow()}) or columns ({@link - * WStandardItemModel#insertColumn(int column, List items) insertColumn()}) or removing rows ({@link - * WAbstractItemModel#removeRow(int row, WModelIndex parent) WAbstractItemModel#removeRow()}) or - * columns ({@link WAbstractItemModel#removeColumn(int column, WModelIndex parent) - * WAbstractItemModel#removeColumn()}). + * to set data. You can change the geometry by inserting rows (insertRow()) or columns + * (insertColumn()) or removing rows ({@link WAbstractItemModel#removeRow(int row, WModelIndex + * parent) WAbstractItemModel#removeRow()}) or columns ({@link WAbstractItemModel#removeColumn(int + * column, WModelIndex parent) WAbstractItemModel#removeColumn()}). * *

    If you want to use the model as a tree (or tree table), then you can use the default * constructor to start with an empty tree, and use the {@link WStandardItem} API on {@link @@ -158,7 +156,6 @@ public WStandardItem getItemFromIndex(final WModelIndex index) { * *

    * - * @see WStandardItemModel#insertColumn(int column, List items) * @see WStandardItemModel#appendRow(List items) */ public void appendColumn(List items) { @@ -199,7 +196,6 @@ public void insertColumn(int column, List items) { * *

    * - * @see WStandardItemModel#insertRow(int row, List items) * @see WStandardItemModel#appendColumn(List items) */ public void appendRow(List items) { diff --git a/src/eu/webtoolkit/jwt/WSuggestionPopup.java b/src/eu/webtoolkit/jwt/WSuggestionPopup.java index 16bbde14c..a9cf4951e 100644 --- a/src/eu/webtoolkit/jwt/WSuggestionPopup.java +++ b/src/eu/webtoolkit/jwt/WSuggestionPopup.java @@ -133,7 +133,7 @@ * it to a template using {@link WTemplate#bindWidget(String varName, WWidget widget) * WTemplate#bindWidget()}, WTemplate::bindNew() or {@link WLayout#addWidget(WWidget w) * WLayout#addWidget()}. If bound this way, the placeholder is not replaced with the correct list of - * suggestions, since this causes the widget to be placed into the widget tree twice. A + * suggestions, since this causes the widget to be placed into the widget tree twice. A * screenshot of this example: * * @@ -143,12 +143,14 @@ * An example WSuggestionPopup (default)

    * * + * * *
    * *

    * An example WSuggestionPopup (polished)

    *
    * + * *
    * @@ -865,7 +867,7 @@ private void defineJavaScript() { String autoSelect = this.isAutoSelectEnabled_ ? "true" : "false"; this.setJavaScriptMember( " WSuggestionPopup", - "new Wt4_10_0.WSuggestionPopup(" + "new Wt4_10_1.WSuggestionPopup(" + app.getJavaScriptClass() + "," + this.getJsRef() @@ -901,7 +903,7 @@ static WJavaScriptPreamble wtjs1() { JavaScriptScope.WtClassScope, JavaScriptObjectType.JavaScriptConstructor, "WSuggestionPopup", - "(function(e,t,n,i,l,s,o,r,c){t.wtObj=this;const u=this,f=e.WT;let a=null,d=null,g=!1,h=null,p=null,y=s,C=null,v=null,k=!1;this.defaultValue=o;function T(){return\"object\"==typeof f.theme&&\"bootstrap\"===f.theme.type&&5===f.theme.version}function m(e){return e.classList.contains(\"Wt-suggest-onedit\")||e.classList.contains(\"Wt-suggest-dropdown\")}function L(){return\"none\"!==t.style.display}function E(i){const l=i.firstChild.firstChild,s=f.getElement(d),o=l.innerHTML,r=l.getAttribute(\"sug\");s.focus();n(s,o,r);e.emit(t,\"select\",i.id,s.id);b();d=null}let w=null;this.showPopup=function(e){t.style.display=\"block\";u.bringToFront();a=null;v=null;w=e.onkeydown;e.onkeydown=function(e){const t=e||window.event;u.editKeyDown(this,t)}};this.bringToFront=function(){const e=f.maxZIndex();if(e>t.style.zIndex){const n=e+1;t.style.zIndex=n}};function b(){t.style.display=\"none\";if(null!==d&&null!==w){f.getElement(d).onkeydown=w;w=null}}function S(e){if(!T())return 16;try{const t=getComputedStyle(e),n=parseInt(t.backgroundSize.match(/^([0-9]+)px ([0-9]+)px$/)[1],10);return n+parseInt(t.backgroundPositionX.match(/^calc[(]100% - ([0-9]+)px[)]$/)[1],10)}catch(e){return 28}}this.editMouseMove=function(e,t){if(!m(e))return;if(f.widgetCoordinates(e,t).x>e.offsetWidth-S(e)){e.classList&&e.classList.add(\"Wt-suggest-dropdown-hover\");e.style.cursor=\"default\"}else{e.classList&&e.classList.remove(\"Wt-suggest-dropdown-hover\");e.style.cursor=\"\"}};this.showAt=function(e,t){b();d=e.id;k=!0;u.refilter(t)};this.editClick=function(e,t){if(!m(e))return;if(f.widgetCoordinates(e,t).x>e.offsetWidth-S(e))if(d===e.id&&L()){b();d=null}else u.showAt(e,\"\")};function x(e,t){for(e=t?e.nextSibling:e.previousSibling;e;e=t?e.nextSibling:e.previousSibling)if(f.hasTag(e,\"LI\")&&\"none\"!==e.style.display)return e;return null}this.editKeyDown=function(e,n){if(!m(e))return!0;if(d!==e.id)if(e.classList.contains(\"Wt-suggest-onedit\")){d=e.id;k=!1}else{if(!e.classList.contains(\"Wt-suggest-dropdown\")||40!==n.keyCode){d=null;return!0}d=e.id;k=!0}if(L()){const i=a?f.getElement(a):null;if(13===n.keyCode||9===n.keyCode){if(i){E(i);f.cancelEvent(n);setTimeout((function(){e.focus()}),0)}else b();return!1}if(40===n.keyCode||38===n.keyCode||34===n.keyCode||33===n.keyCode){if(\"KEYDOWN\"===n.type.toUpperCase()){g=!0;f.cancelEvent(n,f.CancelDefaultAction)}if(\"KEYPRESS\"===n.type.toUpperCase()&&!0===g){f.cancelEvent(n);return!1}let e=i;const l=40===n.keyCode||34===n.keyCode;if(e){const s=34===n.keyCode||33===n.keyCode?t.clientHeight/i.offsetHeight:1;for(let t=0;e&&tt.scrollTop+t.clientHeight?t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight:e.offsetTop0||s){if(E.lengtht.style.zIndex){const n=e+1;t.style.zIndex=n}};function b(){t.style.display=\"none\";if(null!==d&&null!==w){f.getElement(d).onkeydown=w;w=null}}function S(e){if(!T())return 16;try{const t=getComputedStyle(e),n=parseInt(t.backgroundSize.match(/^([0-9]+)px ([0-9]+)px$/)[1],10);return n+parseInt(t.backgroundPositionX.match(/^calc[(]100% - ([0-9]+)px[)]$/)[1],10)}catch(e){return 28}}this.editMouseMove=function(e,t){if(!m(e))return;if(f.widgetCoordinates(e,t).x>e.offsetWidth-S(e)){e.classList&&e.classList.add(\"Wt-suggest-dropdown-hover\");e.style.cursor=\"default\"}else{e.classList&&e.classList.remove(\"Wt-suggest-dropdown-hover\");e.style.cursor=\"\"}};this.showAt=function(e,t){b();d=e.id;k=!0;void 0===t&&(t=\"\");u.refilter(t)};this.editClick=function(e,t){if(!m(e))return;if(f.widgetCoordinates(e,t).x>e.offsetWidth-S(e))if(d===e.id&&L()){b();d=null}else u.showAt(e,\"\")};function x(e,t){for(e=t?e.nextSibling:e.previousSibling;e;e=t?e.nextSibling:e.previousSibling)if(f.hasTag(e,\"LI\")&&\"none\"!==e.style.display)return e;return null}this.editKeyDown=function(e,n){if(!m(e))return!0;if(d!==e.id)if(e.classList.contains(\"Wt-suggest-onedit\")){d=e.id;k=!1}else{if(!e.classList.contains(\"Wt-suggest-dropdown\")||40!==n.keyCode){d=null;return!0}d=e.id;k=!0}if(L()){const i=a?f.getElement(a):null;if(13===n.keyCode||9===n.keyCode){if(i){E(i);f.cancelEvent(n);setTimeout((function(){e.focus()}),0)}else b();return!1}if(40===n.keyCode||38===n.keyCode||34===n.keyCode||33===n.keyCode){if(\"KEYDOWN\"===n.type.toUpperCase()){g=!0;f.cancelEvent(n,f.CancelDefaultAction)}if(\"KEYPRESS\"===n.type.toUpperCase()&&!0===g){f.cancelEvent(n);return!1}let e=i;const l=40===n.keyCode||34===n.keyCode;if(e){const s=34===n.keyCode||33===n.keyCode?t.clientHeight/i.offsetHeight:1;for(let t=0;e&&tt.scrollTop+t.clientHeight?t.scrollTop=e.offsetTop+e.offsetHeight-t.clientHeight:e.offsetTop0||s){if(E.length flags) { this.changeFlags_.addAll(flags); } - public final void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags) { - setChanged(EnumSet.of(flag, flags)); - } - public void drawArc(final WRectF rect, double startAngle, double spanAngle) { char[] buf = new char[30]; if (Math.abs(spanAngle - 360.0) < 0.01 || spanAngle > 360.0) { @@ -331,14 +327,6 @@ public WTextItem measureText(final CharSequence text, double maxWidth, boolean w return this.fontMetrics_.measureText(this.getPainter().getFont(), text, maxWidth, wordWrap); } - public final WTextItem measureText(final CharSequence text) { - return measureText(text, -1, false); - } - - public final WTextItem measureText(final CharSequence text, double maxWidth) { - return measureText(text, maxWidth, false); - } - public WFontMetrics getFontMetrics() { if (!(this.fontMetrics_ != null)) { this.fontMetrics_ = new ServerSideFontMetrics(); diff --git a/src/eu/webtoolkit/jwt/WTabWidget.java b/src/eu/webtoolkit/jwt/WTabWidget.java index 5caf55a7e..901e1da1a 100644 --- a/src/eu/webtoolkit/jwt/WTabWidget.java +++ b/src/eu/webtoolkit/jwt/WTabWidget.java @@ -60,12 +60,14 @@ * An example WTabWidget (default)

    * * + * *
    * *

    * An example WTabWidget (polished)

    *
    * + * * * */ diff --git a/src/eu/webtoolkit/jwt/WTableView.java b/src/eu/webtoolkit/jwt/WTableView.java index b2b690584..e30eb68d0 100644 --- a/src/eu/webtoolkit/jwt/WTableView.java +++ b/src/eu/webtoolkit/jwt/WTableView.java @@ -2171,7 +2171,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WTableView.js", wtjs1()); StringBuilder s = new StringBuilder(); - s.append("new Wt4_10_0.WTableView(") + s.append("new Wt4_10_1.WTableView(") .append(app.getJavaScriptClass()) .append(',') .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WTemplate.java b/src/eu/webtoolkit/jwt/WTemplate.java index 51520619f..147530746 100644 --- a/src/eu/webtoolkit/jwt/WTemplate.java +++ b/src/eu/webtoolkit/jwt/WTemplate.java @@ -84,7 +84,7 @@ *

    Note: The use of XML comments (<!-- ... -.) around variables that * are bound to widgets will result in bad behaviour since the template parser is ignorant about * these comments and the corresponding widgets will believe that they are rendered but aren't - * actually. + * actually. * *

    B. Functions

    * @@ -99,31 +99,18 @@ * currently three functions that are generally useful: * *
      - *
    • {@link WTemplate.Functions#tr Functions#tr} : resolves a localized strings, this is - * convenient to create a language neutral template, which contains translated strings - *
    • {@link WTemplate.Functions#id Functions#id} : resolves the id of a bound widget, this is - * convenient to bind <label> elements to a form widget using its for attribute. - *
    • {@link WTemplate.Functions#block Functions#block} : recursively renders another string as - * macro block optional arguments substituted before processing template substitution. + *
    • : resolves a localized strings, this is convenient to create a language neutral template, + * which contains translated strings Functions::id : resolves the id of a bound widget, this + * is convenient to bind <label> elements to a form widget using its for attribute. + *
    • : recursively renders another string as macro block optional arguments substituted before + * processing template substitution. For example, the following template uses the + * "tr" function to translate the age-label using the "age-label" + * internationalized key. WTemplate t = new WTemplate(); t.setTemplateText("<div> + * ${tr:age-label} ${age-input} </div>"); t.addFunction("tr", + * WTemplate.Functions.tr); t.bindWidget("age-input", ageEdit = new WLineEdit()); C. + * Conditional blocks *
    * - *

    For example, the following template uses the "tr" function to translate the - * age-label using the "age-label" internationalized key. - * - *

    - * - *

    {@code
    - * WTemplate t = new WTemplate();
    - * t.setTemplateText("
    ${tr:age-label} ${age-input}
    "); - * t.addFunction("tr", WTemplate.Functions.tr); - * t.bindWidget("age-input", ageEdit = new WLineEdit()); - * - * }
    - * - *

    - * - *

    C. Conditional blocks

    - * *

    ${<cond>} starts a conditional block with a condition name * "cond", and must be closed by a balanced ${</cond>}. * @@ -528,7 +515,7 @@ public TemplateWidgetIdMode getWidgetIdMode() { * *

    Note: Depending on the textFormat, the value is * validated according as for a {@link WText}. The default ({@link TextFormat#XHTML}) filters - * "active" content, to avoid XSS-based security risks. + * "active" content, to avoid XSS-based security risks. * * @see WTemplate#bindWidget(String varName, WWidget widget) * @see WTemplate#bindInt(String varName, int value) @@ -771,7 +758,7 @@ public Set getConditionsSet() { *

    Warning: When specializing this class, you need to make sure that you append * proper XHTML to the result, without unsafe active contents. The {@link * WTemplate#format(Writer result, String s, TextFormat textFormat) format()} methods may be used - * for this purpose. + * for this purpose. * * @see WTemplate#renderTemplate(Writer result) */ @@ -814,7 +801,7 @@ public void resolveString(final String varName, final List args, final *

    Warning: When specializing this class, you need to make sure that you append * proper XHTML to the result, without unsafe active contents. The {@link * WTemplate#format(Writer result, String s, TextFormat textFormat) format()} methods may be used - * for this purpose. + * for this purpose. * * @see WTemplate#resolveString(String varName, List args, Writer result) */ @@ -1440,7 +1427,7 @@ private static int parseArgs(final String text, int pos, final List res private void unrenderWidget(WWidget w, final DomElement el) { String removeJs = w.renderRemoveJs(false); if (removeJs.charAt(0) == '_') { - el.callJavaScript("Wt4_10_0.remove('" + removeJs.substring(1) + "');", true); + el.callJavaScript("Wt4_10_1.remove('" + removeJs.substring(1) + "');", true); } else { el.callJavaScript(removeJs, true); } diff --git a/src/eu/webtoolkit/jwt/WTextEdit.java b/src/eu/webtoolkit/jwt/WTextEdit.java index dee90d758..d3c545afd 100644 --- a/src/eu/webtoolkit/jwt/WTextEdit.java +++ b/src/eu/webtoolkit/jwt/WTextEdit.java @@ -294,7 +294,7 @@ String renderRemoveJs(boolean recursive) { if (this.isRendered()) { String result = this.getJsRef() + ".ed.remove();"; if (!recursive) { - result += "Wt4_10_0.remove('" + this.getId() + "');"; + result += "Wt4_10_1.remove('" + this.getId() + "');"; } return result; } else { @@ -395,7 +395,7 @@ private void init() { this.version_ = getTinyMCEVersion(); this.setJavaScriptMember( " WTextEdit", - "new Wt4_10_0.WTextEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_10_1.WTextEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); this.setJavaScriptMember( WT_RESIZE_JS, "function(e, w, h, s) { var obj = " diff --git a/src/eu/webtoolkit/jwt/WTimeEdit.java b/src/eu/webtoolkit/jwt/WTimeEdit.java index 567d73205..7860ef689 100644 --- a/src/eu/webtoolkit/jwt/WTimeEdit.java +++ b/src/eu/webtoolkit/jwt/WTimeEdit.java @@ -277,7 +277,7 @@ private void defineJavaScript() { WApplication app = WApplication.getInstance(); app.loadJavaScript("js/WTimeEdit.js", wtjs1()); String jsObj = - "new Wt4_10_0.WTimeEdit(" + "new Wt4_10_1.WTimeEdit(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WTimeValidator.java b/src/eu/webtoolkit/jwt/WTimeValidator.java index a1545f24e..94f618244 100644 --- a/src/eu/webtoolkit/jwt/WTimeValidator.java +++ b/src/eu/webtoolkit/jwt/WTimeValidator.java @@ -216,7 +216,7 @@ public WValidator.Result validate(final String input) { public String getJavaScriptValidate() { loadJavaScript(WApplication.getInstance()); StringBuilder js = new StringBuilder(); - js.append("new Wt4_10_0.WTimeValidator(").append(this.isMandatory()).append(",["); + js.append("new Wt4_10_1.WTimeValidator(").append(this.isMandatory()).append(",["); for (int i = 0; i < this.formats_.size(); ++i) { WTime.RegExpInfo r = WTime.formatToRegExp(this.formats_.get(i)); if (i != 0) { diff --git a/src/eu/webtoolkit/jwt/WTimerWidget.java b/src/eu/webtoolkit/jwt/WTimerWidget.java index 01e0bea11..a12d1f5ef 100644 --- a/src/eu/webtoolkit/jwt/WTimerWidget.java +++ b/src/eu/webtoolkit/jwt/WTimerWidget.java @@ -72,7 +72,7 @@ DomElementType getDomElementType() { String renderRemoveJs(boolean recursive) { return "{var obj=" + this.getJsRef() - + ";if (obj && obj.timer) {clearTimeout(obj.timer);obj.timer = null;}Wt4_10_0.remove('" + + ";if (obj && obj.timer) {clearTimeout(obj.timer);obj.timer = null;}Wt4_10_1.remove('" + this.getId() + "');}"; } diff --git a/src/eu/webtoolkit/jwt/WTouchEvent.java b/src/eu/webtoolkit/jwt/WTouchEvent.java index cba542591..4cbd19259 100644 --- a/src/eu/webtoolkit/jwt/WTouchEvent.java +++ b/src/eu/webtoolkit/jwt/WTouchEvent.java @@ -35,18 +35,15 @@ public WTouchEvent() { super(); this.jsEvent_ = new JavaScriptEvent(); } - /** Returns a list of {@link Touch} objects for every finger currently touching the screen. */ + /** Returns a list of objects for every finger currently touching the screen. */ public List getTouches() { return this.jsEvent_.touches; } - /** - * Returns a list of {@link Touch} objects for finger touches that started out within the same - * widget. - */ + /** Returns a list of objects for finger touches that started out within the same widget. */ public List getTargetTouches() { return this.jsEvent_.targetTouches; } - /** Returns a list of {@link Touch} objects for every finger involved in the event. */ + /** Returns a list of objects for every finger involved in the event. */ public List getChangedTouches() { return this.jsEvent_.changedTouches; } diff --git a/src/eu/webtoolkit/jwt/WTransform.java b/src/eu/webtoolkit/jwt/WTransform.java index 13ef97474..ef6fc8be4 100644 --- a/src/eu/webtoolkit/jwt/WTransform.java +++ b/src/eu/webtoolkit/jwt/WTransform.java @@ -237,7 +237,7 @@ public double getDy() { * *

    Note: If this transform or the given point {@link * WJavaScriptExposableObject#isJavaScriptBound() are JavaScript bound}, the resulting point will - * also be JavaScript bound. + * also be JavaScript bound. * * @see WTransform#map(double x, double y, Double tx, Double ty) */ @@ -257,7 +257,7 @@ public WPointF map(final WPointF p) { o = p; } result.assignBinding( - o, "Wt4_10_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + p.getJsRef() + ')'); + o, "Wt4_10_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + p.getJsRef() + ')'); } return result; } @@ -314,7 +314,7 @@ public WRectF map(final WRectF rect) { o = rect; } result.assignBinding( - o, "Wt4_10_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + rect.getJsRef() + ')'); + o, "Wt4_10_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + rect.getJsRef() + ')'); } return result; } @@ -341,7 +341,7 @@ public WPainterPath map(final WPainterPath path) { o = path; } result.assignBinding( - o, "Wt4_10_0.gfxUtils.transform_apply(" + this.getJsRef() + ',' + path.getJsRef() + ')'); + o, "Wt4_10_1.gfxUtils.transform_apply(" + this.getJsRef() + ',' + path.getJsRef() + ')'); } final List sourceSegments = path.getSegments(); for (int i = 0; i < sourceSegments.size(); ++i) { @@ -470,7 +470,7 @@ public WTransform translate(final WPointF p) { } else { this.assignBinding( o, - "Wt4_10_0.gfxUtils.transform_mult((function(){var p=" + "Wt4_10_1.gfxUtils.transform_mult((function(){var p=" + p.getJsRef() + ";return [1,0,0,1,p[0],p[1]];})(),(" + refBefore @@ -494,7 +494,7 @@ public WTransform multiplyAndAssign(final WTransform Y) { o = Y; } this.assignBinding( - o, "Wt4_10_0.gfxUtils.transform_mult(" + this.getJsRef() + ',' + Y.getJsRef() + ')'); + o, "Wt4_10_1.gfxUtils.transform_mult(" + this.getJsRef() + ',' + Y.getJsRef() + ')'); } double z11 = X.m_[M11] * Y.m_[M11] + X.m_[M12] * Y.m_[M21]; double z12 = X.m_[M11] * Y.m_[M12] + X.m_[M12] * Y.m_[M22]; @@ -533,7 +533,7 @@ public WTransform getAdjoint() { this.getM32() * this.getM21() - this.getM31() * this.getM22(), -(this.getM32() * this.getM11() - this.getM31() * this.getM12())); if (this.isJavaScriptBound()) { - res.assignBinding(this, "Wt4_10_0.gfxUtils.transform_adjoint(" + this.getJsRef() + ")"); + res.assignBinding(this, "Wt4_10_1.gfxUtils.transform_adjoint(" + this.getJsRef() + ")"); } return res; } @@ -556,7 +556,7 @@ public WTransform getInverted() { adj.getM31() / det, adj.getM32() / det); if (this.isJavaScriptBound()) { - res.assignBinding(this, "Wt4_10_0.gfxUtils.transform_inverted(" + this.getJsRef() + ")"); + res.assignBinding(this, "Wt4_10_1.gfxUtils.transform_inverted(" + this.getJsRef() + ")"); } return res; } else { diff --git a/src/eu/webtoolkit/jwt/WTree.java b/src/eu/webtoolkit/jwt/WTree.java index 173cb95c3..464391038 100644 --- a/src/eu/webtoolkit/jwt/WTree.java +++ b/src/eu/webtoolkit/jwt/WTree.java @@ -43,12 +43,14 @@ * An example WTree (default)

    * * + * *
    * *

    * An example WTree (polished)

    *
    * + * * * * diff --git a/src/eu/webtoolkit/jwt/WTreeNode.java b/src/eu/webtoolkit/jwt/WTreeNode.java index eb1283a9b..b8caa2aa4 100644 --- a/src/eu/webtoolkit/jwt/WTreeNode.java +++ b/src/eu/webtoolkit/jwt/WTreeNode.java @@ -838,6 +838,17 @@ private void update() { this.childCountLabel_.setText(new WString()); } } + if (this.getTree() != null + && this.getTree().isDisabled() + && this.getTree().getTreeRoot() != null) { + WTreeNode root = this.getTree().getTreeRoot(); + for (WTreeNode node : root.getChildNodes()) { + if (!node.hasStyleClass("Wt-disabled")) { + node.addStyleClass("Wt-disabled"); + node.getLabel().addStyleClass("Wt-disabled"); + } + } + } } private boolean isLastChildNode() { diff --git a/src/eu/webtoolkit/jwt/WTreeTable.java b/src/eu/webtoolkit/jwt/WTreeTable.java index e47ad8b0f..cf89fbe2b 100644 --- a/src/eu/webtoolkit/jwt/WTreeTable.java +++ b/src/eu/webtoolkit/jwt/WTreeTable.java @@ -51,6 +51,8 @@ * *

    An example WTreeTable (polished) * + *

    + * * @see WTreeTableNode * @see WTreeView */ @@ -229,6 +231,13 @@ public WWidget getHeaderWidget() { return this.headers_; } + public void setDisabled(boolean isDisabled) { + if (this.tree_ != null) { + this.tree_.setDisabled(isDisabled); + } + super.setDisabled(isDisabled); + } + protected void render(EnumSet flags) { if (flags.contains(RenderFlag.Full)) { this.defineJavaScript(); @@ -254,7 +263,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WTreeTable.js", wtjs1()); this.setJavaScriptMember( " WTreeTable", - "new Wt4_10_0.WTreeTable(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); + "new Wt4_10_1.WTreeTable(" + app.getJavaScriptClass() + "," + this.getJsRef() + ");"); } static WJavaScriptPreamble wtjs1() { diff --git a/src/eu/webtoolkit/jwt/WTreeView.java b/src/eu/webtoolkit/jwt/WTreeView.java index 969ce99e5..0e444cb17 100644 --- a/src/eu/webtoolkit/jwt/WTreeView.java +++ b/src/eu/webtoolkit/jwt/WTreeView.java @@ -472,7 +472,7 @@ public void setModel(final WAbstractItemModel model) { *

    * *

    Note: The actual space occupied by each column is the column width augmented by 7 - * pixels for internal padding and a border. + * pixels for internal padding and a border. * * @see WTreeView#setRowHeight(WLength rowHeight) */ @@ -565,7 +565,7 @@ public void setRowHeaderCount(int count) { if (useStyleLeft) { boolean rtl = app.getLayoutDirection() == LayoutDirection.RightToLeft; this.tieRowsScrollJS_.setJavaScript( - "function(obj, event) {Wt4_10_0.getCssRule('#" + "function(obj, event) {Wt4_10_1.getCssRule('#" + this.getId() + " .Wt-tv-rowc').style.left= -obj.scrollLeft " + (rtl ? "+ (obj.firstChild.offsetWidth - obj.offsetWidth)" : "") @@ -863,7 +863,7 @@ private void defineJavaScript() { app.loadJavaScript("js/WTreeView.js", wtjs1()); this.setJavaScriptMember( " WTreeView", - "new Wt4_10_0.WTreeView(" + "new Wt4_10_1.WTreeView(" + app.getJavaScriptClass() + "," + this.getJsRef() diff --git a/src/eu/webtoolkit/jwt/WTreeViewNode.java b/src/eu/webtoolkit/jwt/WTreeViewNode.java index f3d40588a..ca3c7e642 100644 --- a/src/eu/webtoolkit/jwt/WTreeViewNode.java +++ b/src/eu/webtoolkit/jwt/WTreeViewNode.java @@ -602,6 +602,29 @@ public WWidget getCellWidget(int column) { } } + void updateDom(final DomElement element, boolean all) { + if (this.view_.isDisabled()) { + this.addStyleClass("Wt-disabled"); + this.nodeWidget_.addStyleClass("Wt-disabled"); + WWidget widget = this.nodeWidget_.resolveWidget("cols-row"); + if (widget != null) { + widget.addStyleClass("Wt-disabled"); + } + widget = this.nodeWidget_.resolveWidget("expand"); + if (widget != null) { + widget.addStyleClass("Wt-disabled"); + } + widget = this.nodeWidget_.resolveWidget("no-expand"); + if (widget != null) { + widget.addStyleClass("Wt-disabled"); + } + widget = this.nodeWidget_.resolveWidget("col0"); + if (widget != null) { + widget.addStyleClass("Wt-disabled"); + } + } + } + private WTreeView view_; private WTemplate nodeWidget_; private WContainerWidget childContainer_; diff --git a/src/eu/webtoolkit/jwt/WVBoxLayout.java b/src/eu/webtoolkit/jwt/WVBoxLayout.java index 228c55f80..313ff427c 100644 --- a/src/eu/webtoolkit/jwt/WVBoxLayout.java +++ b/src/eu/webtoolkit/jwt/WVBoxLayout.java @@ -28,7 +28,7 @@ * *

    * - *

    Note: First consider if you can achieve your layout using CSS ! + *

    Note: First consider if you can achieve your layout using CSS ! * * @see WHBoxLayout */ diff --git a/src/eu/webtoolkit/jwt/WVirtualImage.java b/src/eu/webtoolkit/jwt/WVirtualImage.java index 4a79ae8be..cec0d6fc1 100644 --- a/src/eu/webtoolkit/jwt/WVirtualImage.java +++ b/src/eu/webtoolkit/jwt/WVirtualImage.java @@ -141,11 +141,11 @@ public void enableDragging() { this.impl_ .mouseWentDown() .addListener( - "function(obj, event) { var pc = Wt4_10_0.pageCoordinates(event); obj.setAttribute('dsx', pc.x); obj.setAttribute('dsy', pc.y);}"); + "function(obj, event) { var pc = Wt4_10_1.pageCoordinates(event); obj.setAttribute('dsx', pc.x); obj.setAttribute('dsy', pc.y);}"); this.impl_ .mouseMoved() .addListener( - "function(obj, event) {var WT= Wt4_10_0;var lastx = obj.getAttribute('dsx');var lasty = obj.getAttribute('dsy');if (lastx != null && lastx != '') {var nowxy = WT.pageCoordinates(event);var img = " + "function(obj, event) {var WT= Wt4_10_1;var lastx = obj.getAttribute('dsx');var lasty = obj.getAttribute('dsy');if (lastx != null && lastx != '') {var nowxy = WT.pageCoordinates(event);var img = " + this.contents_.getJsRef() + ";img.style.left = (WT.pxself(img, 'left')+nowxy.x-lastx) + 'px';img.style.top = (WT.pxself(img, 'top')+nowxy.y-lasty) + 'px';obj.setAttribute('dsx', nowxy.x);obj.setAttribute('dsy', nowxy.y);}}"); this.impl_ @@ -309,14 +309,11 @@ public Signal2 viewPortChanged() { *

    Width and height will not necesarilly equal {@link WVirtualImage#getGridImageSize() * getGridImageSize()}, if the the image is not infinite sized. * - *

    The default implementation calls {@link WVirtualImage#render(long x, long y, int width, int - * height) render()} and creates an image for the resource returned. + *

    The default implementation calls render() and creates an image for the resource returned. * *

    You should override this method if you wish to serve for example static image content. * *

    - * - * @see WVirtualImage#render(long x, long y, int width, int height) */ protected WImage createImage(long x, long y, int width, int height) { WResource r = this.render(x, y, width, height); diff --git a/src/eu/webtoolkit/jwt/WVmlImage.java b/src/eu/webtoolkit/jwt/WVmlImage.java index 8bdf5b237..ed4ce2cbc 100644 --- a/src/eu/webtoolkit/jwt/WVmlImage.java +++ b/src/eu/webtoolkit/jwt/WVmlImage.java @@ -74,10 +74,6 @@ public void setChanged(EnumSet flags) { } } - public final void setChanged(PainterChangeFlag flag, PainterChangeFlag... flags) { - setChanged(EnumSet.of(flag, flags)); - } - public void drawArc(final WRectF rect, double startAngle, double spanAngle) { this.getPainter().save(); this.getPainter().translate(rect.getCenter().getX(), rect.getCenter().getY()); @@ -420,14 +416,6 @@ public WTextItem measureText(final CharSequence text, double maxWidth, boolean w return this.fontMetrics_.measureText(this.getPainter().getFont(), text, maxWidth, wordWrap); } - public final WTextItem measureText(final CharSequence text) { - return measureText(text, -1, false); - } - - public final WTextItem measureText(final CharSequence text, double maxWidth) { - return measureText(text, maxWidth, false); - } - public WFontMetrics getFontMetrics() { if (!(this.fontMetrics_ != null)) { this.fontMetrics_ = new ServerSideFontMetrics(); diff --git a/src/eu/webtoolkit/jwt/WWebWidget.java b/src/eu/webtoolkit/jwt/WWebWidget.java index 084be98c0..3e9461baf 100644 --- a/src/eu/webtoolkit/jwt/WWebWidget.java +++ b/src/eu/webtoolkit/jwt/WWebWidget.java @@ -1283,7 +1283,7 @@ void updateDom(final DomElement element, boolean all) { app.addAutoJavaScript( "{var w = " + this.getJsRef() - + ";if (w && !Wt4_10_0.isHidden(w)) {var i = Wt4_10_0.getElement('" + + ";if (w && !Wt4_10_1.isHidden(w)) {var i = Wt4_10_1.getElement('" + i.getId() + "');i.style.width=w.clientWidth + 'px';i.style.height=w.clientHeight + 'px';}}"); element.addChild(i); @@ -1480,7 +1480,7 @@ void updateDom(final DomElement element, boolean all) { } String deferred = this.flags_.get(BIT_TOOLTIP_DEFERRED) ? "true" : "false"; element.callJavaScript( - "Wt4_10_0.toolTip(" + "Wt4_10_1.toolTip(" + app.getJavaScriptClass() + "," + jsStringLiteral(this.getId()) @@ -1523,7 +1523,7 @@ void updateDom(final DomElement element, boolean all) { if (!all && this.transientImpl_ != null) { for (int i = 0; i < this.transientImpl_.addedStyleClasses_.size(); ++i) { element.callJavaScript( - "Wt4_10_0.$('" + "Wt4_10_1.$('" + this.getId() + "').classList.add('" + this.transientImpl_.addedStyleClasses_.get(i) @@ -1531,7 +1531,7 @@ void updateDom(final DomElement element, boolean all) { } for (int i = 0; i < this.transientImpl_.removedStyleClasses_.size(); ++i) { element.callJavaScript( - "Wt4_10_0.$('" + "Wt4_10_1.$('" + this.getId() + "').classList.remove('" + this.transientImpl_.removedStyleClasses_.get(i) @@ -1543,7 +1543,7 @@ void updateDom(final DomElement element, boolean all) { for (int i = 0; i < this.transientImpl_.childRemoveChanges_.size(); ++i) { final String js = this.transientImpl_.childRemoveChanges_.get(i); if (js.charAt(0) == '_') { - element.callJavaScript("Wt4_10_0.remove('" + js.substring(1) + "');", true); + element.callJavaScript("Wt4_10_1.remove('" + js.substring(1) + "');", true); } else { element.callJavaScript(js, true); } @@ -1556,6 +1556,11 @@ void updateDom(final DomElement element, boolean all) { this.transientImpl_.specialChildRemove_ = false; } } + if (this.transientImpl_ != null) { + if (this.getParent() != null && this.getParent().isDisabled()) { + this.propagateSetEnabled(false); + } + } if (all || this.flags_.get(BIT_SELECTABLE_CHANGED)) { if (this.flags_.get(BIT_SET_UNSELECTABLE)) { element.addPropertyWord(Property.Class, "unselectable"); @@ -1638,7 +1643,7 @@ void updateDom(final DomElement element, boolean all) { if (this.flags_.get(BIT_HIDE_WITH_VISIBILITY)) { if (this.flags_.get(BIT_HIDDEN_CHANGED) || all && this.flags_.get(BIT_HIDDEN)) { if (this.flags_.get(BIT_HIDDEN)) { - element.callJavaScript("Wt4_10_0.$('" + this.getId() + "').classList.add('Wt-hidden');"); + element.callJavaScript("Wt4_10_1.$('" + this.getId() + "').classList.add('Wt-hidden');"); element.setProperty(Property.StyleVisibility, "hidden"); if (this.flags_.get(BIT_HIDE_WITH_OFFSETS)) { element.setProperty(Property.StylePosition, "absolute"); @@ -1679,7 +1684,7 @@ void updateDom(final DomElement element, boolean all) { } } element.callJavaScript( - "Wt4_10_0.$('" + this.getId() + "').classList.remove('Wt-hidden');"); + "Wt4_10_1.$('" + this.getId() + "').classList.remove('Wt-hidden');"); element.setProperty(Property.StyleVisibility, "visible"); } } @@ -1694,7 +1699,7 @@ void updateDom(final DomElement element, boolean all) { app.loadJavaScript(THIS_JS, wtjs2()); if (!this.flags_.get(BIT_HIDE_WITH_VISIBILITY)) { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_10_0") + ss.append("Wt4_10_1") .append(".animateDisplay(") .append(app.getJavaScriptClass()) .append(",'") @@ -1716,7 +1721,7 @@ void updateDom(final DomElement element, boolean all) { } } else { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_10_0") + ss.append("Wt4_10_1") .append(".animateVisible('") .append(this.getId()) .append("',") @@ -1783,13 +1788,13 @@ void updateDom(final DomElement element, boolean all) { if (!app.isJavaScriptLoaded(SCROLL_JS) && this.isScrollVisibilityEnabled()) { app.loadJavaScript(SCROLL_JS, wtjs3()); StringBuilder ss = new StringBuilder(); - ss.append("if (!Wt4_10_0.scrollVisibility) {Wt4_10_0.scrollVisibility = new "); - ss.append("Wt4_10_0.ScrollVisibility(").append(app.getJavaScriptClass() + "); }"); + ss.append("if (!Wt4_10_1.scrollVisibility) {Wt4_10_1.scrollVisibility = new "); + ss.append("Wt4_10_1.ScrollVisibility(").append(app.getJavaScriptClass() + "); }"); element.callJavaScript(ss.toString()); } if (this.isScrollVisibilityEnabled()) { StringBuilder ss = new StringBuilder(); - ss.append("Wt4_10_0.scrollVisibility.add({"); + ss.append("Wt4_10_1.scrollVisibility.add({"); ss.append("el:").append(this.getJsRef()).append(','); ss.append("margin:").append(this.getScrollVisibilityMargin()).append(','); ss.append("visible:").append(this.isScrollVisible()); @@ -1799,7 +1804,7 @@ void updateDom(final DomElement element, boolean all) { } else { if (this.flags_.get(BIT_SCROLL_VISIBILITY_LOADED)) { element.callJavaScript( - "Wt4_10_0.scrollVisibility.remove(" + jsStringLiteral(this.getId()) + ");"); + "Wt4_10_1.scrollVisibility.remove(" + jsStringLiteral(this.getId()) + ");"); this.flags_.clear(BIT_SCROLL_VISIBILITY_LOADED); } } @@ -1863,7 +1868,7 @@ String renderRemoveJs(boolean recursive) { final StringBuilder result = new StringBuilder(); if (this.isRendered() && this.isScrollVisibilityEnabled()) { result - .append("Wt4_10_0.scrollVisibility.remove(") + .append("Wt4_10_1.scrollVisibility.remove(") .append(jsStringLiteral(this.getId())) .append(");"); this.flags_.set(BIT_SCROLL_VISIBILITY_CHANGED); @@ -1877,7 +1882,7 @@ String renderRemoveJs(boolean recursive) { if ((result.length() == 0)) { result.append("_").append(this.getId()); } else { - result.append("Wt4_10_0.remove('").append(this.getId()).append("');"); + result.append("Wt4_10_1.remove('").append(this.getId()).append("');"); } } return result.toString(); diff --git a/src/eu/webtoolkit/jwt/WWidget.java b/src/eu/webtoolkit/jwt/WWidget.java index cf6f53b83..de56e13ab 100644 --- a/src/eu/webtoolkit/jwt/WWidget.java +++ b/src/eu/webtoolkit/jwt/WWidget.java @@ -428,11 +428,11 @@ public void positionAt(WWidget widget, Orientation orientation) { } String side = orientation == Orientation.Horizontal ? ".Horizontal" : ".Vertical"; this.doJavaScript( - "Wt4_10_0.positionAtWidget('" + "Wt4_10_1.positionAtWidget('" + this.getId() + "','" + widget.getId() - + "',Wt4_10_0" + + "',Wt4_10_1" + side + ");"); } @@ -583,7 +583,7 @@ public final void setMargin(int pixels) { * *

    * - *

    Note: Currently you can only set this before initial rendering. + *

    Note: Currently you can only set this before initial rendering. * * @see WWidget#setHidden(boolean hidden, WAnimation animation) */ @@ -944,7 +944,7 @@ public void refresh() {} * @see WWidget#isRendered() */ public String getJsRef() { - return "Wt4_10_0.$('" + this.getId() + "')"; + return "Wt4_10_1.$('" + this.getId() + "')"; } /** * Sets an attribute value. @@ -1165,14 +1165,14 @@ public void stopAcceptDrops(final String mimeType) { * *

    Note: An id must start with a letter ([A-Za-z]), followed by one or more letters, * digits ([0-9]), hyphens ("-"), underscores ("_"), colons (":"), - * and periods ("."). + * and periods ("."). * *

    Warning: We recommend that you leave the id of a widget unchanged. JWt uses the id * to identify widgets in the JavaScript it generates, and this can often leads to bugs. If you do * change the id, only change the id right after widget construction. However, usually * there's a more preferable alternative, like setting the object name ({@link * WObject#setObjectName(String name) WObject#setObjectName()}), or adding style classes ({@link - * WWidget#addStyleClass(String styleClass, boolean force) addStyleClass()}). + * WWidget#addStyleClass(String styleClass, boolean force) addStyleClass()}). * * @see WObject#getId() */ diff --git a/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java b/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java index 7d49757eb..165b95f26 100644 --- a/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java +++ b/src/eu/webtoolkit/jwt/WWidgetCanvasPainter.java @@ -64,7 +64,7 @@ public void createContents(DomElement result, WPaintDevice device) { WApplication app = WApplication.getInstance(); { StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_10_0.WPaintedWidget(") + ss.append("new Wt4_10_1.WPaintedWidget(") .append(app.getJavaScriptClass()) .append(",") .append(this.widget_.getJsRef()) @@ -74,7 +74,7 @@ public void createContents(DomElement result, WPaintDevice device) { String updateAreasJs = ""; if (hasJsObjects) { StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_10_0.WJavaScriptObjectStorage(") + ss.append("new Wt4_10_1.WJavaScriptObjectStorage(") .append(app.getJavaScriptClass()) .append(",") .append(this.widget_.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java b/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java index 8d6e3a6a2..28954458b 100644 --- a/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java +++ b/src/eu/webtoolkit/jwt/WWidgetVectorPainter.java @@ -54,7 +54,7 @@ public void updateContents(final List result, WPaintDevice device) { if (this.widget_.repaintFlags_.contains(PaintFlag.Update)) { DomElement painter = DomElement.updateGiven( - "Wt4_10_0.getElement('p" + this.widget_.getId() + "').firstChild", + "Wt4_10_1.getElement('p" + this.widget_.getId() + "').firstChild", DomElementType.DIV); painter.setProperty(Property.AddedInnerHTML, vectorDevice.getRendered()); WApplication app = WApplication.getInstance(); diff --git a/src/eu/webtoolkit/jwt/WebRenderer.java b/src/eu/webtoolkit/jwt/WebRenderer.java index d1e433bfe..dd5309290 100644 --- a/src/eu/webtoolkit/jwt/WebRenderer.java +++ b/src/eu/webtoolkit/jwt/WebRenderer.java @@ -506,7 +506,7 @@ private void serveMainscript(final WebResponse response) throws IOException { "SHOW_ERROR", conf.getErrorReporting() == Configuration.ErrorReporting.ErrorMessage); script.setCondition("UGLY_INTERNAL_PATHS", this.session_.isUseUglyInternalPaths()); script.setCondition("DYNAMIC_JS", false); - script.setVar("WT_CLASS", "Wt4_10_0"); + script.setVar("WT_CLASS", "Wt4_10_1"); script.setVar("APP_CLASS", app.getJavaScriptClass()); script.setCondition("STRICTLY_SERIALIZED_EVENTS", conf.serializedEvents()); script.setCondition("WEB_SOCKETS", conf.webSockets()); @@ -567,18 +567,18 @@ private void serveMainscript(final WebResponse response) throws IOException { boolean enabledAjax = app.enableAjax_; if (app.enableAjax_) { this.collectedJS1_ - .append("var form = Wt4_10_0.getElement('Wt-form'); if (form) {") + .append("var form = Wt4_10_1.getElement('Wt-form'); if (form) {") .append(this.beforeLoadJS_.toString()); this.beforeLoadJS_.setLength(0); this.collectedJS1_ .append("var domRoot=") .append(app.domRoot_.getJsRef()) .append(';') - .append("Wt4_10_0.progressed(domRoot);"); + .append("Wt4_10_1.progressed(domRoot);"); int librariesLoaded = this.loadScriptLibraries(this.collectedJS1_, app); app.streamBeforeLoadJavaScript(this.collectedJS1_, false); this.collectedJS2_ - .append("Wt4_10_0.resolveRelativeAnchors();") + .append("Wt4_10_1.resolveRelativeAnchors();") .append("domRoot.style.visibility = 'visible';") .append(app.getJavaScriptClass()) .append("._p_.doAutoJavaScript();"); @@ -631,7 +631,7 @@ private void serveMainscript(final WebResponse response) throws IOException { .append("}, 400);") .append("else "); } - out.append("Wt4_10_0.ready(function() { ") + out.append("Wt4_10_1.ready(function() { ") .append(app.getJavaScriptClass()) .append("._p_.load(true);});\n"); } @@ -893,7 +893,7 @@ private void serveMainAjax(final StringBuilder out) { if (widgetset) { String historyE = app.getEnvironment().getParameter("Wt-history"); if (historyE != null) { - out.append("Wt4_10_0") + out.append("Wt4_10_1") .append(".history.initialize('") .append(historyE.charAt(0)) .append("-field', '") @@ -911,7 +911,7 @@ private void serveMainAjax(final StringBuilder out) { out.append("};\n"); } this.renderSetServerPush(out); - out.append("Wt4_10_0.ready(function() { ") + out.append("Wt4_10_1.ready(function() { ") .append(app.getJavaScriptClass()) .append("._p_.load(") .append(!widgetset) @@ -1109,7 +1109,7 @@ private void collectJavaScriptUpdate(final StringBuilder out) { private void loadStyleSheet( final StringBuilder out, WApplication app, final WLinkedCssStyleSheet sheet) { - out.append("Wt4_10_0") + out.append("Wt4_10_1") .append(".addStyleSheet('") .append(sheet.getLink().resolveUrl(app)) .append("', '") @@ -1128,7 +1128,7 @@ private void loadStyleSheets(final StringBuilder out, WApplication app) { private void removeStyleSheets(final StringBuilder out, WApplication app) { for (int i = (int) app.styleSheetsToRemove_.size() - 1; i > -1; --i) { - out.append("Wt4_10_0") + out.append("Wt4_10_1") .append(".removeStyleSheet('") .append(app.styleSheetsToRemove_.get(i).getLink().resolveUrl(app)) .append("');\n "); diff --git a/src/eu/webtoolkit/jwt/WebSession.java b/src/eu/webtoolkit/jwt/WebSession.java index d9a23c9b8..c589f6d3e 100644 --- a/src/eu/webtoolkit/jwt/WebSession.java +++ b/src/eu/webtoolkit/jwt/WebSession.java @@ -1198,7 +1198,11 @@ public boolean isHaveLock() { return this.session_.getMutex().isHeldByCurrentThread(); } - public void unlock() {} + public void unlock() { + if (this.isHaveLock()) { + this.session_.getMutex().unlock(); + } + } public void flushResponse() { if (this.response_ != null) { @@ -1700,7 +1704,7 @@ public void setLoaded() { this.setState(WebSession.State.Loaded, this.controller_.getConfiguration().getSessionTimeout()); if (wasSuspended) { if (this.env_.hasAjax() && this.controller_.getConfiguration().reloadIsNewSession()) { - this.app_.doJavaScript("Wt4_10_0.history.removeSessionId()"); + this.app_.doJavaScript("Wt4_10_1.history.removeSessionId()"); this.sessionIdInUrl_ = false; } this.app_.unsuspended().trigger(); @@ -2096,7 +2100,7 @@ private void notifySignal(final WEvent e) throws IOException { String hashE = request.getParameter(se + "_"); if (hashE != null) { this.changeInternalPath(hashE, handler.getResponse()); - this.app_.doJavaScript("Wt4_10_0.scrollHistory();"); + this.app_.doJavaScript("Wt4_10_1.scrollHistory();"); } else { this.changeInternalPath("", handler.getResponse()); } diff --git a/src/eu/webtoolkit/jwt/auth/AuthModel.java b/src/eu/webtoolkit/jwt/auth/AuthModel.java index 7dcc3a2b9..86233fdc0 100644 --- a/src/eu/webtoolkit/jwt/auth/AuthModel.java +++ b/src/eu/webtoolkit/jwt/auth/AuthModel.java @@ -195,7 +195,7 @@ public void configureThrottling(WInteractWidget button) { app.loadJavaScript("js/AuthModel.js", wtjs1()); button.setJavaScriptMember( " AuthThrottle", - "new Wt4_10_0.AuthThrottle(Wt4_10_0," + "new Wt4_10_1.AuthThrottle(Wt4_10_1," + button.getJsRef() + "," + WString.toWString(WString.tr("Wt.Auth.throttle-retry")).getJsStringLiteral() diff --git a/src/eu/webtoolkit/jwt/auth/AuthService.java b/src/eu/webtoolkit/jwt/auth/AuthService.java index 8f8bb868b..23dbf72d5 100644 --- a/src/eu/webtoolkit/jwt/auth/AuthService.java +++ b/src/eu/webtoolkit/jwt/auth/AuthService.java @@ -539,7 +539,7 @@ public void lostPassword(final String emailAddress, final AbstractUserDatabase u *

    Note: Since JWt 4.3.0, the behavior of this function changed. The lost password * token is no longer removed by {@link AuthService#processEmailToken(String token, * AbstractUserDatabase users) processEmailToken()}. Instead, it is now removed in {@link - * User#setPassword(PasswordHash password) User#setPassword()}. + * User#setPassword(PasswordHash password) User#setPassword()}. * * @see AuthService#verifyEmailAddress(User user, String address) * @see AuthService#lostPassword(String emailAddress, AbstractUserDatabase users) diff --git a/src/eu/webtoolkit/jwt/auth/OAuthProcess.java b/src/eu/webtoolkit/jwt/auth/OAuthProcess.java index 0afc10fed..d207af751 100644 --- a/src/eu/webtoolkit/jwt/auth/OAuthProcess.java +++ b/src/eu/webtoolkit/jwt/auth/OAuthProcess.java @@ -137,7 +137,7 @@ public void connectStartAuthenticate(final AbstractEventSignal s) { && this.service_.isPopupEnabled()) { StringBuilder js = new StringBuilder(); js.append("function(object, event) {") - .append("Wt4_10_0.PopupWindow(Wt4_10_0") + .append("Wt4_10_1.PopupWindow(Wt4_10_1") .append(",") .append(WWebWidget.jsStringLiteral(this.getAuthorizeUrl())) .append(", ") diff --git a/src/eu/webtoolkit/jwt/auth/OidcService.java b/src/eu/webtoolkit/jwt/auth/OidcService.java index c825f48ae..af94f5e0b 100644 --- a/src/eu/webtoolkit/jwt/auth/OidcService.java +++ b/src/eu/webtoolkit/jwt/auth/OidcService.java @@ -228,7 +228,7 @@ public ClientSecretMethod getClientSecretMethod() { * *

    * - *

    Note: The returned process will be an instance of {@link OidcService} + *

    Note: The returned process will be an instance of {@link OidcService} * * @see OidcService#getAuthenticationScope() */ diff --git a/src/eu/webtoolkit/jwt/auth/RegistrationModel.java b/src/eu/webtoolkit/jwt/auth/RegistrationModel.java index 2c9b3b962..dca983da5 100644 --- a/src/eu/webtoolkit/jwt/auth/RegistrationModel.java +++ b/src/eu/webtoolkit/jwt/auth/RegistrationModel.java @@ -516,9 +516,9 @@ public static void validatePasswordsMatchJS( + info2.getJsRef() + ",o1=" + password.getJsRef() - + ";if (!o1.classList.contains('Wt-invalid')) {if (o.value == o1.value) {o.classList.remove('Wt-invalid');Wt4_10_0.setHtml(i," + + ";if (!o1.classList.contains('Wt-invalid')) {if (o.value == o1.value) {o.classList.remove('Wt-invalid');Wt4_10_1.setHtml(i," + WString.toWString(WString.tr("Wt.Auth.valid")).getJsStringLiteral() - + ");} else {o.classList.remove('Wt-valid');Wt4_10_0.setHtml(i," + + ");} else {o.classList.remove('Wt-valid');Wt4_10_1.setHtml(i," + WString.toWString(WString.tr("Wt.Auth.repeat-password-info")).getJsStringLiteral() + ");}}}"); } diff --git a/src/eu/webtoolkit/jwt/chart/CurveLabel.java b/src/eu/webtoolkit/jwt/chart/CurveLabel.java index 219fe4474..640f59d2b 100644 --- a/src/eu/webtoolkit/jwt/chart/CurveLabel.java +++ b/src/eu/webtoolkit/jwt/chart/CurveLabel.java @@ -102,7 +102,7 @@ public void setPoint(final Object x, final Object y) { * WCartesianChart#mapToDevice(Object xValue, Object yValue, Axis axis, int xSegment, int * ySegment) WCartesianChart#mapToDevice()} uses, depending on the scale of the axis. {@link * CurveLabel#getX() getX()} and {@link CurveLabel#getY() getY()} will perform no conversion, so - * they may be safer to use. + * they may be safer to use. * * @see CurveLabel#setPoint(WPointF point) */ diff --git a/src/eu/webtoolkit/jwt/chart/WAbstractChart.java b/src/eu/webtoolkit/jwt/chart/WAbstractChart.java index 577123233..9a7402e39 100644 --- a/src/eu/webtoolkit/jwt/chart/WAbstractChart.java +++ b/src/eu/webtoolkit/jwt/chart/WAbstractChart.java @@ -64,7 +64,7 @@ public void remove() { *

    * *

    Note: Setting a new model on a {@link eu.webtoolkit.jwt.chart.WCartesianChart} - * causes the {@link WCartesianChart#XSeriesColumn()} and all series to be cleared + * causes the {@link WCartesianChart#XSeriesColumn()} and all series to be cleared * * @see WAbstractChart#getModel() */ @@ -81,7 +81,7 @@ public void setModel(final WAbstractItemModel model) { *

    * *

    Note: Setting a new model on a {@link eu.webtoolkit.jwt.chart.WCartesianChart} - * causes the {@link WCartesianChart#XSeriesColumn()} and all series to be cleared + * causes the {@link WCartesianChart#XSeriesColumn()} and all series to be cleared * * @see WAbstractChart#getModel() */ diff --git a/src/eu/webtoolkit/jwt/chart/WAbstractChartImplementation.java b/src/eu/webtoolkit/jwt/chart/WAbstractChartImplementation.java index 2fdde9d65..32b9ffaf3 100644 --- a/src/eu/webtoolkit/jwt/chart/WAbstractChartImplementation.java +++ b/src/eu/webtoolkit/jwt/chart/WAbstractChartImplementation.java @@ -34,13 +34,24 @@ static class RenderRange { public int numberOfCategories(Axis axis); - public int numberOfCategories(); + public default int numberOfCategories() { + return numberOfCategories(Axis.X); + } public WString categoryLabel(int u, Axis axis); + public default WString categoryLabel(int u) { + return categoryLabel(u, Axis.X); + } + public WAbstractChartImplementation.RenderRange computeRenderRange( Axis axis, int xAxis, int yAxis, AxisScale scale); + public default WAbstractChartImplementation.RenderRange computeRenderRange( + Axis axis, int xAxis, int yAxis) { + return computeRenderRange(axis, xAxis, yAxis, AxisScale.Linear); + } + public boolean isOnDemandLoadingEnabled(); public void update(); diff --git a/src/eu/webtoolkit/jwt/chart/WAbstractChartModel.java b/src/eu/webtoolkit/jwt/chart/WAbstractChartModel.java index b32224947..55627c09b 100644 --- a/src/eu/webtoolkit/jwt/chart/WAbstractChartModel.java +++ b/src/eu/webtoolkit/jwt/chart/WAbstractChartModel.java @@ -77,12 +77,12 @@ public WString getToolTip(int row, int column) { *

    * *

    Note: An XHTML text tooltip will be forced to be deferred. Non-deferred XHTML - * tooltips are not supported. + * tooltips are not supported. * *

    Note: When not using deferred tooltips, the HTML <area> tag will be used. If * there are many tooltips and the chart is interactive this may cause client-side performance * issues. If deferred tooltips are used, this will cause some load on the server, as it - * calculates server-side what marker or bar the user is hovering over. + * calculates server-side what marker or bar the user is hovering over. * *

    Note: If the chart is interactive, and tooltips are not deferred, they will be * scaled according to the first Y axis, and thus multiple Y axes will not be supported in diff --git a/src/eu/webtoolkit/jwt/chart/WAxis.java b/src/eu/webtoolkit/jwt/chart/WAxis.java index 4b75ca10e..99bdf34d4 100644 --- a/src/eu/webtoolkit/jwt/chart/WAxis.java +++ b/src/eu/webtoolkit/jwt/chart/WAxis.java @@ -1249,7 +1249,7 @@ public double getMinZoom() { *

    * *

    Note: If the pan position has been changed on the client side, this may not - * reflect the actual pan position. + * reflect the actual pan position. * * @deprecated Use {@link WAxis#setZoomRange(double minimum, double maximum) setZoomRange()} * instead. @@ -1352,13 +1352,15 @@ public TickDirection getTickDirection() { * Soft clipping enabled (slower).

    * * - * This is the default for {@link eu.webtoolkit.jwt.chart.WCartesianChart}. The tick for 0 is visible, and the 0 is shown completely. The tick for 01/01/86 is not visible, so its label is not shown.
    + * This is the default for {@link eu.webtoolkit.jwt.chart.WCartesianChart}. The tick for 0 is visible, and the 0 is shown completely. The tick for 01/01/86 is not visible, so its label is not shown. + *
    * *

    * Soft clipping disabled (faster).

    *
    * - * The tick of the 0 is visible, but the 0 is shown partially. Also, the tick of 01/01/86 is not visible, but the label is partially shown. + * The tick of the 0 is visible, but the 0 is shown partially. Also, the tick of 01/01/86 is not visible, but the label is partially shown. + * * */ public void setSoftLabelClipping(boolean enabled) { diff --git a/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java b/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java index 5eaf100d0..0237f251f 100644 --- a/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java +++ b/src/eu/webtoolkit/jwt/chart/WAxisSliderWidget.java @@ -635,7 +635,7 @@ protected void paintEvent(WPaintDevice paintDevice) { if (this.getMethod() == RenderMethod.HtmlCanvas) { WApplication app = WApplication.getInstance(); StringBuilder ss = new StringBuilder(); - ss.append("new Wt4_10_0.WAxisSliderWidget(") + ss.append("new Wt4_10_1.WAxisSliderWidget(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) diff --git a/src/eu/webtoolkit/jwt/chart/WCartesian3DChart.java b/src/eu/webtoolkit/jwt/chart/WCartesian3DChart.java index 493260948..716a0b4d5 100644 --- a/src/eu/webtoolkit/jwt/chart/WCartesian3DChart.java +++ b/src/eu/webtoolkit/jwt/chart/WCartesian3DChart.java @@ -878,8 +878,8 @@ public void setLegendLocation(Side side, AlignmentFlag alignment) { *

    This configures the font, border and background for the legend. * *

    The default font is a 10pt sans serif font (the same as the default axis label font), the - * default border is {@link PenStyle#None} and the default background is - * {@link BrushStyle#None}. + * default border is PenStyle::None and the default background is + * BrushStyle::None. * *

    * diff --git a/src/eu/webtoolkit/jwt/chart/WCartesianChart.java b/src/eu/webtoolkit/jwt/chart/WCartesianChart.java index 2cd63a36d..73e294224 100644 --- a/src/eu/webtoolkit/jwt/chart/WCartesianChart.java +++ b/src/eu/webtoolkit/jwt/chart/WCartesianChart.java @@ -88,7 +88,7 @@ * *

    Note: Client side interaction is only available if the chart is drawn on an HTML * canvas. This is the default rendering method on modern browsers, see {@link - * WPaintedWidget#setPreferredMethod(RenderMethod method) WPaintedWidget#setPreferredMethod()} + * WPaintedWidget#setPreferredMethod(RenderMethod method) WPaintedWidget#setPreferredMethod()} * *

    Note: Some features are currently not supported in interactive mode: * @@ -568,7 +568,7 @@ public WAxis getYAxis(int i) { * *

    * - *

    Note: This transfers ownership of the given {@link WAxis} to this chart. + *

    Note: This transfers ownership of the given {@link WAxis} to this chart. * *

    Note: Precondition: waxis is not null */ @@ -593,7 +593,7 @@ public int addXAxis(WAxis waxis) { * *

    * - *

    Note: This transfers ownership of the given {@link WAxis} to this chart. + *

    Note: This transfers ownership of the given {@link WAxis} to this chart. * *

    Note: Precondition: waxis is not null */ @@ -813,8 +813,8 @@ public void setLegendLocation(LegendLocation location, Side side, AlignmentFlag *

    This configures the font, border and background for the legend. * *

    The default font is a 10pt sans serif font (the same as the default axis label font), the - * default border is {@link PenStyle#None} and the default background is - * {@link BrushStyle#None}. + * default border is PenStyle::None and the default background is + * BrushStyle::None. * *

    * @@ -1760,7 +1760,7 @@ public void setBorderPen(final WPen pen) { /** * Returns the pen used to draw the border around the chart area. * - *

    Defaults to {@link PenStyle#None}. + *

    Defaults to PenStyle::None. * *

    * @@ -2024,7 +2024,7 @@ public int getCrosshairYAxis() { *

    * *

    Note: The follow curve functionality requires that the X axis values of the data - * series are monotonically increasing or decreasing. + * series are monotonically increasing or decreasing. * * @deprecated Use {@link WCartesianChart#setFollowCurve(WDataSeries series) setFollowCurve()} * instead @@ -2297,13 +2297,13 @@ public boolean isCurveManipulationEnabled() { * *

    Note: On-demand loading requires that the X axis data for all data series is * sorted in ascending order. This feature is optimized for equidistant X axis data, but - * that's not a requirement. + * that's not a requirement. * *

    Note: If no minimum or maximum are set on the Y axis (or axes), then the chart * will still have to scan all data of its data series to automatically determine the minimum and * maximum Y axis values. If this performance hit is undesirable and the Y axis range is known or * guaranteed to be within a certain range, make sure to {@link WAxis#setRange(double minimum, - * double maximum) set a range} on the Y axis (or axes). + * double maximum) set a range} on the Y axis (or axes). * * @see WCartesianChart#isOnDemandLoadingEnabled() */ @@ -3079,7 +3079,7 @@ protected void paintEvent(WPaintDevice paintDevice) { int selectedCurve = this.selectedSeries_ != null ? this.getSeriesIndexOf(this.selectedSeries_) : -1; int followCurve = this.followCurve_ != null ? this.getSeriesIndexOf(this.followCurve_) : -1; - ss.append("new Wt4_10_0.WCartesianChart(") + ss.append("new Wt4_10_1.WCartesianChart(") .append(app.getJavaScriptClass()) .append(",") .append(this.getJsRef()) @@ -5864,8 +5864,8 @@ private void defineJavaScript() { if (app != null && (this.isInteractive() || this.hasDeferredToolTips_)) { app.loadJavaScript("js/ChartCommon.js", wtjs2()); app.doJavaScript( - "if (!Wt4_10_0.chartCommon) {Wt4_10_0.chartCommon = new " - + "Wt4_10_0.ChartCommon(" + "if (!Wt4_10_1.chartCommon) {Wt4_10_1.chartCommon = new " + + "Wt4_10_1.ChartCommon(" + app.getJavaScriptClass() + "); }", false); diff --git a/src/eu/webtoolkit/jwt/chart/WChart2DImplementation.java b/src/eu/webtoolkit/jwt/chart/WChart2DImplementation.java index 69d37eafd..8a3e14c67 100644 --- a/src/eu/webtoolkit/jwt/chart/WChart2DImplementation.java +++ b/src/eu/webtoolkit/jwt/chart/WChart2DImplementation.java @@ -46,10 +46,6 @@ public int numberOfCategories(Axis axis) { } } - public final int numberOfCategories() { - return numberOfCategories(Axis.X); - } - public WString categoryLabel(int u, Axis axis) { if (this.chart_.XSeriesColumn() != -1) { if (u < this.chart_.getModel().getRowCount()) { @@ -62,10 +58,6 @@ public WString categoryLabel(int u, Axis axis) { } } - public final WString categoryLabel(int u) { - return categoryLabel(u, Axis.X); - } - public WAbstractChartImplementation.RenderRange computeRenderRange( Axis axis, int xAxis, int yAxis, AxisScale scale) { ExtremesIterator iterator = new ExtremesIterator(axis, xAxis, yAxis, scale); diff --git a/src/eu/webtoolkit/jwt/chart/WChart3DImplementation.java b/src/eu/webtoolkit/jwt/chart/WChart3DImplementation.java index de2812e71..7d1e52877 100644 --- a/src/eu/webtoolkit/jwt/chart/WChart3DImplementation.java +++ b/src/eu/webtoolkit/jwt/chart/WChart3DImplementation.java @@ -66,10 +66,6 @@ public int numberOfCategories(Axis axis) { } } - public final int numberOfCategories() { - return numberOfCategories(Axis.X); - } - public WString categoryLabel(int u, Axis axis) { if (this.chart_.getDataSeries().size() == 0) { return new WString(String.valueOf(u)); @@ -149,11 +145,6 @@ public WAbstractChartImplementation.RenderRange computeRenderRange( } } - public final WAbstractChartImplementation.RenderRange computeRenderRange( - Axis axis, int xAxis, int yAxis) { - return computeRenderRange(axis, xAxis, yAxis, AxisScale.Linear); - } - public boolean isOnDemandLoadingEnabled() { return false; } diff --git a/src/eu/webtoolkit/jwt/chart/WDataSeries.java b/src/eu/webtoolkit/jwt/chart/WDataSeries.java index 9f02536ff..9aba3b2ef 100644 --- a/src/eu/webtoolkit/jwt/chart/WDataSeries.java +++ b/src/eu/webtoolkit/jwt/chart/WDataSeries.java @@ -891,7 +891,7 @@ public final WPointF mapToDevice(final Object xValue, final Object yValue) { * *

    * - *

    Note: This is only supported for axes with linear scale. + *

    Note: This is only supported for axes with linear scale. * * @see WDataSeries#setScale(double scale) * @see WCartesianChart#setCurveManipulationEnabled(boolean enabled) @@ -924,7 +924,7 @@ public double getOffset() { * *

    * - *

    Note: This is only supported for axes with linear scale. + *

    Note: This is only supported for axes with linear scale. * * @see WDataSeries#setOffset(double offset) * @see WCartesianChart#setCurveManipulationEnabled(boolean enabled) @@ -954,7 +954,7 @@ public double getScale() { *

    * *

    Note: Individual models per data series are only supported for {@link - * ChartType#Scatter} type charts. + * ChartType#Scatter} type charts. * * @see WAbstractChart#setModel(WAbstractItemModel model) */ diff --git a/src/eu/webtoolkit/jwt/chart/WPieChart.java b/src/eu/webtoolkit/jwt/chart/WPieChart.java index 4c8f17181..efcece9ec 100644 --- a/src/eu/webtoolkit/jwt/chart/WPieChart.java +++ b/src/eu/webtoolkit/jwt/chart/WPieChart.java @@ -49,6 +49,8 @@ * *

    Example of a pie chart

    * + *

    + * * @see eu.webtoolkit.jwt.chart.WCartesianChart */ public class WPieChart extends WAbstractChart { diff --git a/src/eu/webtoolkit/jwt/chart/WStandardPalette.java b/src/eu/webtoolkit/jwt/chart/WStandardPalette.java index d98d9e6f6..64f694864 100644 --- a/src/eu/webtoolkit/jwt/chart/WStandardPalette.java +++ b/src/eu/webtoolkit/jwt/chart/WStandardPalette.java @@ -32,15 +32,51 @@ *

    * * - * - * - * - * - * - * - * - * - * + * + * + * + * + * + * + * + * + * *
    Neutral Bold Muted GrayScale
    Gmail blue Mozilla red Ruby on Rails red Gray #1
    Shiny silver Flock blue Mozilla blue Gray #2
    Interactive action yellow RSS orange Etsy vermillion Gray #3
    Qoop mint Techcrunch green Digg blue Gray #4
    Digg blue Flickr pink 43 Things gold Gray #5
    Shadows grey Newsvine green Writely olive Gray #6
    Magnolia Mag.nolia Magnolia Mag.nolia Last.fm crimson Gray #7
    RSS orange Rollyo red Basecamp green Gray #8
    Neutral + * Bold + * Muted + * GrayScale + *
    Gmail blue + * Mozilla red + * Ruby on Rails red + * Gray #1 + *
    Shiny silver + * Flock blue + * Mozilla blue + * Gray #2 + *
    Interactive action yellow + * RSS orange + * Etsy vermillion + * Gray #3 + *
    Qoop mint + * Techcrunch green + * Digg blue + * Gray #4 + *
    Digg blue + * Flickr pink + * 43 Things gold + * Gray #5 + *
    Shadows grey + * Newsvine green + * Writely olive + * Gray #6 + *
    Magnolia Mag.nolia + * Magnolia Mag.nolia + * Last.fm crimson + * Gray #7 + *
    RSS orange + * Rollyo red + * Basecamp green + * Gray #8 + *
    * *

    The border pen is in all cases a gray pen of 0 width, while the stroke pen is a line of width diff --git a/src/eu/webtoolkit/jwt/utils/LocaleUtils.java b/src/eu/webtoolkit/jwt/utils/LocaleUtils.java index 5399e4c6b..5d2caf44f 100644 --- a/src/eu/webtoolkit/jwt/utils/LocaleUtils.java +++ b/src/eu/webtoolkit/jwt/utils/LocaleUtils.java @@ -23,6 +23,10 @@ public static String getDateFormat(Locale locale) { return "yyyy-MM-dd"; } + public static String getDateTimeFormat(Locale locale) { + return "yyyy-MM-dd HH:mm:ss"; + } + public static double toDouble(Locale locale, String value) { value = value.trim(); ParsePosition pos = new ParsePosition(0); diff --git a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/mixins.less b/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/mixins.less deleted file mode 100644 index 5def7cff5..000000000 --- a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/mixins.less +++ /dev/null @@ -1,681 +0,0 @@ -// -// Mixins -// -------------------------------------------------- - - -// UTILITY MIXINS -// -------------------------------------------------- - -// Clearfix -// -------- -// For clearing floats like a boss h5bp.com/q -.clearfix { - *zoom: 1; - &:before, - &:after { - display: table; - content: ""; - // Fixes Opera/contenteditable bug: - // http://nicolasgallagher.com/micro-clearfix-hack/#comment-36952 - line-height: 0; - } - &:after { - clear: both; - } -} - -// Webkit-style focus -// ------------------ -.tab-focus() { - // Default - outline: thin dotted #333; - // Webkit - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -// Center-align a block level element -// ---------------------------------- -.center-block() { - display: block; - margin-left: auto; - margin-right: auto; -} - -// IE7 inline-block -// ---------------- -.ie7-inline-block() { - *display: inline; /* IE7 inline-block hack */ - *zoom: 1; -} - -// IE7 likes to collapse whitespace on either side of the inline-block elements. -// Ems because we're attempting to match the width of a space character. Left -// version is for form buttons, which typically come after other elements, and -// right version is for icons, which come before. Applying both is ok, but it will -// mean that space between those elements will be .6em (~2 space characters) in IE7, -// instead of the 1 space in other browsers. -.ie7-restore-left-whitespace() { - *margin-left: .3em; - - &:first-child { - *margin-left: 0; - } -} - -.ie7-restore-right-whitespace() { - *margin-right: .3em; -} - -// Sizing shortcuts -// ------------------------- -.size(@height, @width) { - width: @width; - height: @height; -} -.square(@size) { - .size(@size, @size); -} - -// Placeholder text -// ------------------------- -.placeholder(@color: @placeholderText) { - &:-moz-placeholder { - color: @color; - } - &:-ms-input-placeholder { - color: @color; - } - &::-webkit-input-placeholder { - color: @color; - } -} - -// Text overflow -// ------------------------- -// Requires inline-block or block for proper styling -.text-overflow() { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -// CSS image replacement -// ------------------------- -// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 -.hide-text { - font: 0/0 a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} - - -// FONTS -// -------------------------------------------------- - -#font { - #family { - .serif() { - font-family: @serifFontFamily; - } - .sans-serif() { - font-family: @sansFontFamily; - } - .monospace() { - font-family: @monoFontFamily; - } - } - .shorthand(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { - font-size: @size; - font-weight: @weight; - line-height: @lineHeight; - } - .serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { - #font > #family > .serif; - #font > .shorthand(@size, @weight, @lineHeight); - } - .sans-serif(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { - #font > #family > .sans-serif; - #font > .shorthand(@size, @weight, @lineHeight); - } - .monospace(@size: @baseFontSize, @weight: normal, @lineHeight: @baseLineHeight) { - #font > #family > .monospace; - #font > .shorthand(@size, @weight, @lineHeight); - } -} - - -// FORMS -// -------------------------------------------------- - -// Block level inputs -.input-block-level { - display: block; - width: 100%; - min-height: 30px; // Make inputs at least the height of their button counterpart - .box-sizing(border-box); // Makes inputs behave like true block-level elements -} - - - -// Mixin for form field states -.formFieldState(@textColor: #555, @borderColor: #ccc, @backgroundColor: #f5f5f5) { - // Set the text color - > label, - .help-block, - .help-inline { - color: @textColor; - } - // Style inputs accordingly - .checkbox, - .radio, - input, - select, - textarea { - color: @textColor; - } - input, - select, - textarea { - border-color: @borderColor; - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work - &:focus { - border-color: darken(@borderColor, 10%); - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@borderColor, 20%)); - } - } - // Give a small background color for input-prepend/-append - .input-prepend .add-on, - .input-append .add-on { - color: @textColor; - background-color: @backgroundColor; - border-color: @textColor; - } -} - - - -// CSS3 PROPERTIES -// -------------------------------------------------- - -// Border Radius -.border-radius(@radius) { - -webkit-border-radius: @radius; - -moz-border-radius: @radius; - border-radius: @radius; -} - -// Single Corner Border Radius -.border-top-left-radius(@radius) { - -webkit-border-top-left-radius: @radius; - -moz-border-radius-topleft: @radius; - border-top-left-radius: @radius; -} -.border-top-right-radius(@radius) { - -webkit-border-top-right-radius: @radius; - -moz-border-radius-topright: @radius; - border-top-right-radius: @radius; -} -.border-bottom-right-radius(@radius) { - -webkit-border-bottom-right-radius: @radius; - -moz-border-radius-bottomright: @radius; - border-bottom-right-radius: @radius; -} -.border-bottom-left-radius(@radius) { - -webkit-border-bottom-left-radius: @radius; - -moz-border-radius-bottomleft: @radius; - border-bottom-left-radius: @radius; -} - -// Single Side Border Radius -.border-top-radius(@radius) { - .border-top-right-radius(@radius); - .border-top-left-radius(@radius); -} -.border-right-radius(@radius) { - .border-top-right-radius(@radius); - .border-bottom-right-radius(@radius); -} -.border-bottom-radius(@radius) { - .border-bottom-right-radius(@radius); - .border-bottom-left-radius(@radius); -} -.border-left-radius(@radius) { - .border-top-left-radius(@radius); - .border-bottom-left-radius(@radius); -} - -// Drop shadows -.box-shadow(@shadowA, @shadowB:X, ...){ - // Multiple shadow solution from http://toekneestuck.com/blog/2012/05/15/less-css-arguments-variable/ - @props: ~`"@{arguments}".replace(/[\[\]]|\,\sX/g, '')`; - -webkit-box-shadow: @props; - -moz-box-shadow: @props; - box-shadow: @props; -} - -// Transitions -.transition(@transition) { - -webkit-transition: @transition; - -moz-transition: @transition; - -o-transition: @transition; - transition: @transition; -} -.transition-delay(@transition-delay) { - -webkit-transition-delay: @transition-delay; - -moz-transition-delay: @transition-delay; - -o-transition-delay: @transition-delay; - transition-delay: @transition-delay; -} - -// Transformations -.rotate(@degrees) { - -webkit-transform: rotate(@degrees); - -moz-transform: rotate(@degrees); - -ms-transform: rotate(@degrees); - -o-transform: rotate(@degrees); - transform: rotate(@degrees); -} -.scale(@ratio) { - -webkit-transform: scale(@ratio); - -moz-transform: scale(@ratio); - -ms-transform: scale(@ratio); - -o-transform: scale(@ratio); - transform: scale(@ratio); -} -.translate(@x, @y) { - -webkit-transform: translate(@x, @y); - -moz-transform: translate(@x, @y); - -ms-transform: translate(@x, @y); - -o-transform: translate(@x, @y); - transform: translate(@x, @y); -} -.skew(@x, @y) { - -webkit-transform: skew(@x, @y); - -moz-transform: skew(@x, @y); - -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twitter/bootstrap/issues/4885 - -o-transform: skew(@x, @y); - transform: skew(@x, @y); -} -.translate3d(@x, @y, @z) { - -webkit-transform: translate3d(@x, @y, @z); - -moz-transform: translate3d(@x, @y, @z); - -o-transform: translate3d(@x, @y, @z); - transform: translate3d(@x, @y, @z); -} - -// Backface visibility -// Prevent browsers from flickering when using CSS 3D transforms. -// Default value is `visible`, but can be changed to `hidden -// See git pull https://github.com/dannykeane/bootstrap.git backface-visibility for examples -.backface-visibility(@visibility){ - -webkit-backface-visibility: @visibility; - -moz-backface-visibility: @visibility; - backface-visibility: @visibility; -} - -// Background clipping -// Heads up: FF 3.6 and under need "padding" instead of "padding-box" -.background-clip(@clip) { - -webkit-background-clip: @clip; - -moz-background-clip: @clip; - background-clip: @clip; -} - -// Background sizing -.background-size(@size){ - -webkit-background-size: @size; - -moz-background-size: @size; - -o-background-size: @size; - background-size: @size; -} - - -// Box sizing -.box-sizing(@boxmodel) { - -webkit-box-sizing: @boxmodel; - -moz-box-sizing: @boxmodel; - box-sizing: @boxmodel; -} - -// User select -// For selecting text on the page -.user-select(@select) { - -webkit-user-select: @select; - -moz-user-select: @select; - -ms-user-select: @select; - -o-user-select: @select; - user-select: @select; -} - -// Resize anything -.resizable(@direction) { - resize: @direction; // Options: horizontal, vertical, both - overflow: auto; // Safari fix -} - -// CSS3 Content Columns -.content-columns(@columnCount, @columnGap: @gridGutterWidth) { - -webkit-column-count: @columnCount; - -moz-column-count: @columnCount; - column-count: @columnCount; - -webkit-column-gap: @columnGap; - -moz-column-gap: @columnGap; - column-gap: @columnGap; -} - -// Optional hyphenation -.hyphens(@mode: auto) { - word-wrap: break-word; - -webkit-hyphens: @mode; - -moz-hyphens: @mode; - -ms-hyphens: @mode; - -o-hyphens: @mode; - hyphens: @mode; -} - -// Opacity -.opacity(@opacity) { - opacity: @opacity / 100; - filter: ~"alpha(opacity=@{opacity})"; -} - - - -// BACKGROUNDS -// -------------------------------------------------- - -// Add an alphatransparency value to any background or border color (via Elyse Holladay) -#translucent { - .background(@color: @white, @alpha: 1) { - background-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha); - } - .border(@color: @white, @alpha: 1) { - border-color: hsla(hue(@color), saturation(@color), lightness(@color), @alpha); - .background-clip(padding-box); - } -} - -// Gradient Bar Colors for buttons and alerts -.gradientBar(@primaryColor, @secondaryColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { - color: @textColor; - text-shadow: @textShadow; - #gradient > .vertical(@primaryColor, @secondaryColor); - border-color: @secondaryColor @secondaryColor darken(@secondaryColor, 15%); - border-color: rgba(0,0,0,.1) rgba(0,0,0,.1) fadein(rgba(0,0,0,.1), 15%); -} - -// Gradients -#gradient { - .horizontal(@startColor: #555, @endColor: #333) { - background-color: @endColor; - background-image: -moz-linear-gradient(left, @startColor, @endColor); // FF 3.6+ - background-image: -webkit-gradient(linear, 0 0, 100% 0, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(left, @startColor, @endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(left, @startColor, @endColor); // Opera 11.10 - background-image: linear-gradient(to right, @startColor, @endColor); // Standard, IE10 - background-repeat: repeat-x; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@startColor),argb(@endColor))); // IE9 and down - } - .vertical(@startColor: #555, @endColor: #333) { - background-color: mix(@startColor, @endColor, 60%); - background-image: -moz-linear-gradient(top, @startColor, @endColor); // FF 3.6+ - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), to(@endColor)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(top, @startColor, @endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(top, @startColor, @endColor); // Opera 11.10 - background-image: linear-gradient(to bottom, @startColor, @endColor); // Standard, IE10 - background-repeat: repeat-x; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down - } - .directional(@startColor: #555, @endColor: #333, @deg: 45deg) { - background-color: @endColor; - background-repeat: repeat-x; - background-image: -moz-linear-gradient(@deg, @startColor, @endColor); // FF 3.6+ - background-image: -webkit-linear-gradient(@deg, @startColor, @endColor); // Safari 5.1+, Chrome 10+ - background-image: -o-linear-gradient(@deg, @startColor, @endColor); // Opera 11.10 - background-image: linear-gradient(@deg, @startColor, @endColor); // Standard, IE10 - } - .vertical-three-colors(@startColor: #00b3ee, @midColor: #7a43b6, @colorStop: 50%, @endColor: #c3325f) { - background-color: mix(@midColor, @endColor, 80%); - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@startColor), color-stop(@colorStop, @midColor), to(@endColor)); - background-image: -webkit-linear-gradient(@startColor, @midColor @colorStop, @endColor); - background-image: -moz-linear-gradient(top, @startColor, @midColor @colorStop, @endColor); - background-image: -o-linear-gradient(@startColor, @midColor @colorStop, @endColor); - background-image: linear-gradient(@startColor, @midColor @colorStop, @endColor); - background-repeat: no-repeat; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@startColor),argb(@endColor))); // IE9 and down, gets no color-stop at all for proper fallback - } - .radial(@innerColor: #555, @outerColor: #333) { - background-color: @outerColor; - background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@innerColor), to(@outerColor)); - background-image: -webkit-radial-gradient(circle, @innerColor, @outerColor); - background-image: -moz-radial-gradient(circle, @innerColor, @outerColor); - background-image: -o-radial-gradient(circle, @innerColor, @outerColor); - background-repeat: no-repeat; - } - .striped(@color: #555, @angle: 45deg) { - background-color: @color; - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, rgba(255,255,255,.15)), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, rgba(255,255,255,.15)), color-stop(.75, rgba(255,255,255,.15)), color-stop(.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: -o-linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - background-image: linear-gradient(@angle, rgba(255,255,255,.15) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.15) 50%, rgba(255,255,255,.15) 75%, transparent 75%, transparent); - } -} -// Reset filters for IE -.reset-filter() { - filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); -} - - - -// COMPONENT MIXINS -// -------------------------------------------------- - -// Horizontal dividers -// ------------------------- -// Dividers (basically an hr) within dropdowns and nav lists -.nav-divider(@top: #e5e5e5, @bottom: @white) { - // IE7 needs a set width since we gave a height. Restricting just - // to IE7 to keep the 1px left/right space in other browsers. - // It is unclear where IE is getting the extra space that we need - // to negative-margin away, but so it goes. - *width: 100%; - height: 1px; - margin: ((@baseLineHeight / 2) - 1) 1px; // 8px 1px - *margin: -5px 0 5px; - overflow: hidden; - background-color: @top; - border-bottom: 1px solid @bottom; -} - -// Button backgrounds -// ------------------ -.buttonBackground(@startColor, @endColor, @textColor: #fff, @textShadow: 0 -1px 0 rgba(0,0,0,.25)) { - // gradientBar will set the background to a pleasing blend of these, to support IE<=9 - .gradientBar(@startColor, @endColor, @textColor, @textShadow); - *background-color: @endColor; /* Darken IE7 buttons by default so they stand out more given they won't have borders */ - .reset-filter(); - - // in these cases the gradient won't cover the background, so we override - &:hover, &:active, &.active, &.disabled, &[disabled] { - color: @textColor; - background-color: @endColor; - *background-color: darken(@endColor, 5%); - } - - // IE 7 + 8 can't handle box-shadow to show active, so we darken a bit ourselves - &:active, - &.active { - background-color: darken(@endColor, 10%) e("\9"); - } -} - -// Navbar vertical align -// ------------------------- -// Vertically center elements in the navbar. -// Example: an element has a height of 30px, so write out `.navbarVerticalAlign(30px);` to calculate the appropriate top margin. -.navbarVerticalAlign(@elementHeight) { - margin-top: (@navbarHeight - @elementHeight) / 2; -} - - - -// Grid System -// ----------- - -// Centered container element -.container-fixed() { - margin-right: auto; - margin-left: auto; - .clearfix(); -} - -// Table columns -.tableColumns(@columnSpan: 1) { - float: none; // undo default grid column styles - width: ((@gridColumnWidth) * @columnSpan) + (@gridGutterWidth * (@columnSpan - 1)) - 16; // 16 is total padding on left and right of table cells - margin-left: 0; // undo default grid column styles -} - -// Make a Grid -// Use .makeRow and .makeColumn to assign semantic layouts grid system behavior -.makeRow() { - margin-left: @gridGutterWidth * -1; - .clearfix(); -} -.makeColumn(@columns: 1, @offset: 0) { - float: left; - margin-left: (@gridColumnWidth * @offset) + (@gridGutterWidth * (@offset - 1)) + (@gridGutterWidth * 2); - width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); -} - -// The Grid -#grid { - - .core (@gridColumnWidth, @gridGutterWidth) { - - .spanX (@index) when (@index > 0) { - (~".span@{index}") { .span(@index); } - .spanX(@index - 1); - } - .spanX (0) {} - - .offsetX (@index) when (@index > 0) { - (~".offset@{index}") { .offset(@index); } - .offsetX(@index - 1); - } - .offsetX (0) {} - - .offset (@columns) { - margin-left: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns + 1)); - } - - .span (@columns) { - width: (@gridColumnWidth * @columns) + (@gridGutterWidth * (@columns - 1)); - } - - .row { - margin-left: @gridGutterWidth * -1; - .clearfix(); - } - - [class*="span"] { - float: left; - min-height: 1px; // prevent collapsing columns - margin-left: @gridGutterWidth; - } - - // Set the container width, and override it for fixed navbars in media queries - .container, - .navbar-static-top .container, - .navbar-fixed-top .container, - .navbar-fixed-bottom .container { .span(@gridColumns); } - - // generate .spanX and .offsetX - .spanX (@gridColumns); - .offsetX (@gridColumns); - - } - - .fluid (@fluidGridColumnWidth, @fluidGridGutterWidth) { - - .spanX (@index) when (@index > 0) { - (~".span@{index}") { .span(@index); } - .spanX(@index - 1); - } - .spanX (0) {} - - .offsetX (@index) when (@index > 0) { - (~'.offset@{index}') { .offset(@index); } - (~'.offset@{index}:first-child') { .offsetFirstChild(@index); } - .offsetX(@index - 1); - } - .offsetX (0) {} - - .offset (@columns) { - margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth*2); - *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + (@fluidGridGutterWidth*2) - (.5 / @gridRowWidth * 100 * 1%); - } - - .offsetFirstChild (@columns) { - margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) + (@fluidGridGutterWidth); - *margin-left: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%) + @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); - } - - .span (@columns) { - width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)); - *width: (@fluidGridColumnWidth * @columns) + (@fluidGridGutterWidth * (@columns - 1)) - (.5 / @gridRowWidth * 100 * 1%); - } - - .row-fluid { - width: 100%; - .clearfix(); - [class*="span"] { - .input-block-level(); - float: left; - margin-left: @fluidGridGutterWidth; - *margin-left: @fluidGridGutterWidth - (.5 / @gridRowWidth * 100 * 1%); - } - [class*="span"]:first-child { - margin-left: 0; - } - - // generate .spanX and .offsetX - .spanX (@gridColumns); - .offsetX (@gridColumns); - } - - } - - .input(@gridColumnWidth, @gridGutterWidth) { - - .spanX (@index) when (@index > 0) { - (~"input.span@{index}, textarea.span@{index}, .uneditable-input.span@{index}") { .span(@index); } - .spanX(@index - 1); - } - .spanX (0) {} - - .span(@columns) { - width: ((@gridColumnWidth) * @columns) + (@gridGutterWidth * (@columns - 1)) - 14; - } - - input, - textarea, - .uneditable-input { - margin-left: 0; // override margin-left from core grid system - } - - // Space grid-sized controls properly if multiple per line - .controls-row [class*="span"] + [class*="span"] { - margin-left: @gridGutterWidth; - } - - // generate .spanX - .spanX (@gridColumns); - - } - -} diff --git a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/recompile.sh b/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/recompile.sh deleted file mode 100755 index a724ef253..000000000 --- a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/recompile.sh +++ /dev/null @@ -1 +0,0 @@ -/usr/local/lib/node_modules/recess/node_modules/less/bin/lessc --compile wt.less > wt.css diff --git a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/variables.less b/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/variables.less deleted file mode 100644 index 3fb5274c3..000000000 --- a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/2/variables.less +++ /dev/null @@ -1,301 +0,0 @@ -// -// Variables -// -------------------------------------------------- - - -// Global values -// -------------------------------------------------- - - -// Grays -// ------------------------- -@black: #000; -@grayDarker: #222; -@grayDark: #333; -@gray: #555; -@grayLight: #999; -@grayLighter: #eee; -@white: #fff; - - -// Accent colors -// ------------------------- -@blue: #049cdb; -@blueDark: #0064cd; -@green: #46a546; -@red: #9d261d; -@yellow: #ffc40d; -@orange: #f89406; -@pink: #c3325f; -@purple: #7a43b6; - - -// Scaffolding -// ------------------------- -@bodyBackground: @white; -@textColor: @grayDark; - - -// Links -// ------------------------- -@linkColor: #08c; -@linkColorHover: darken(@linkColor, 15%); - - -// Typography -// ------------------------- -@sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; -@serifFontFamily: Georgia, "Times New Roman", Times, serif; -@monoFontFamily: Monaco, Menlo, Consolas, "Courier New", monospace; - -@baseFontSize: 14px; -@baseFontFamily: @sansFontFamily; -@baseLineHeight: 20px; -@altFontFamily: @serifFontFamily; - -@headingsFontFamily: inherit; // empty to use BS default, @baseFontFamily -@headingsFontWeight: bold; // instead of browser default, bold -@headingsColor: inherit; // empty to use BS default, @textColor - - -// Component sizing -// ------------------------- -// Based on 14px font-size and 20px line-height - -@fontSizeLarge: @baseFontSize * 1.25; // ~18px -@fontSizeSmall: @baseFontSize * 0.85; // ~12px -@fontSizeMini: @baseFontSize * 0.75; // ~11px - -@paddingLarge: 11px 19px; // 44px -@paddingSmall: 2px 10px; // 26px -@paddingMini: 1px 6px; // 24px - -@baseBorderRadius: 4px; -@borderRadiusLarge: 6px; -@borderRadiusSmall: 3px; - - -// Tables -// ------------------------- -@tableBackground: transparent; // overall background-color -@tableBackgroundAccent: #f9f9f9; // for striping -@tableBackgroundHover: #f5f5f5; // for hover -@tableBorder: #ddd; // table and cell border - -// Buttons -// ------------------------- -@btnBackground: @white; -@btnBackgroundHighlight: darken(@white, 10%); -@btnBorder: #bbb; - -@btnPrimaryBackground: @linkColor; -@btnPrimaryBackgroundHighlight: spin(@btnPrimaryBackground, 20%); - -@btnInfoBackground: #5bc0de; -@btnInfoBackgroundHighlight: #2f96b4; - -@btnSuccessBackground: #62c462; -@btnSuccessBackgroundHighlight: #51a351; - -@btnWarningBackground: lighten(@orange, 15%); -@btnWarningBackgroundHighlight: @orange; - -@btnDangerBackground: #ee5f5b; -@btnDangerBackgroundHighlight: #bd362f; - -@btnInverseBackground: #444; -@btnInverseBackgroundHighlight: @grayDarker; - - -// Forms -// ------------------------- -@inputBackground: @white; -@inputBorder: #ccc; -@inputBorderRadius: @baseBorderRadius; -@inputDisabledBackground: @grayLighter; -@formActionsBackground: #f5f5f5; -@inputHeight: @baseLineHeight + 10px; // base line-height + 8px vertical padding + 2px top/bottom border - - -// Dropdowns -// ------------------------- -@dropdownBackground: @white; -@dropdownBorder: rgba(0,0,0,.2); -@dropdownDividerTop: #e5e5e5; -@dropdownDividerBottom: @white; - -@dropdownLinkColor: @grayDark; -@dropdownLinkColorHover: @white; -@dropdownLinkColorActive: @dropdownLinkColor; - -@dropdownLinkBackgroundActive: @linkColor; -@dropdownLinkBackgroundHover: @dropdownLinkBackgroundActive; - - - -// COMPONENT VARIABLES -// -------------------------------------------------- - - -// Z-index master list -// ------------------------- -// Used for a bird's eye view of components dependent on the z-axis -// Try to avoid customizing these :) -@zindexDropdown: 1000; -@zindexPopover: 1010; -@zindexTooltip: 1030; -@zindexFixedNavbar: 1030; -@zindexModalBackdrop: 1040; -@zindexModal: 1050; - - -// Sprite icons path -// ------------------------- -@iconSpritePath: "../img/glyphicons-halflings.png"; -@iconWhiteSpritePath: "../img/glyphicons-halflings-white.png"; - - -// Input placeholder text color -// ------------------------- -@placeholderText: @grayLight; - - -// Hr border color -// ------------------------- -@hrBorder: @grayLighter; - - -// Horizontal forms & lists -// ------------------------- -@horizontalComponentOffset: 180px; - - -// Wells -// ------------------------- -@wellBackground: #f5f5f5; - - -// Navbar -// ------------------------- -@navbarCollapseWidth: 979px; -@navbarCollapseDesktopWidth: @navbarCollapseWidth + 1; - -@navbarHeight: 40px; -@navbarBackgroundHighlight: #ffffff; -@navbarBackground: darken(@navbarBackgroundHighlight, 5%); -@navbarBorder: darken(@navbarBackground, 12%); - -@navbarText: #777; -@navbarLinkColor: #777; -@navbarLinkColorHover: @grayDark; -@navbarLinkColorActive: @gray; -@navbarLinkBackgroundHover: transparent; -@navbarLinkBackgroundActive: darken(@navbarBackground, 5%); - -@navbarBrandColor: @navbarLinkColor; - -// Inverted navbar -@navbarInverseBackground: #111111; -@navbarInverseBackgroundHighlight: #222222; -@navbarInverseBorder: #252525; - -@navbarInverseText: @grayLight; -@navbarInverseLinkColor: @grayLight; -@navbarInverseLinkColorHover: @white; -@navbarInverseLinkColorActive: @navbarInverseLinkColorHover; -@navbarInverseLinkBackgroundHover: transparent; -@navbarInverseLinkBackgroundActive: @navbarInverseBackground; - -@navbarInverseSearchBackground: lighten(@navbarInverseBackground, 25%); -@navbarInverseSearchBackgroundFocus: @white; -@navbarInverseSearchBorder: @navbarInverseBackground; -@navbarInverseSearchPlaceholderColor: #ccc; - -@navbarInverseBrandColor: @navbarInverseLinkColor; - - -// Pagination -// ------------------------- -@paginationBackground: #fff; -@paginationBorder: #ddd; -@paginationActiveBackground: #f5f5f5; - - -// Hero unit -// ------------------------- -@heroUnitBackground: @grayLighter; -@heroUnitHeadingColor: inherit; -@heroUnitLeadColor: inherit; - - -// Form states and alerts -// ------------------------- -@warningText: #c09853; -@warningBackground: #fcf8e3; -@warningBorder: darken(spin(@warningBackground, -10), 3%); - -@errorText: #b94a48; -@errorBackground: #f2dede; -@errorBorder: darken(spin(@errorBackground, -10), 3%); - -@successText: #468847; -@successBackground: #dff0d8; -@successBorder: darken(spin(@successBackground, -10), 5%); - -@infoText: #3a87ad; -@infoBackground: #d9edf7; -@infoBorder: darken(spin(@infoBackground, -10), 7%); - - -// Tooltips and popovers -// ------------------------- -@tooltipColor: #fff; -@tooltipBackground: #000; -@tooltipArrowWidth: 5px; -@tooltipArrowColor: @tooltipBackground; - -@popoverBackground: #fff; -@popoverArrowWidth: 10px; -@popoverArrowColor: #fff; -@popoverTitleBackground: darken(@popoverBackground, 3%); - -// Special enhancement for popovers -@popoverArrowOuterWidth: @popoverArrowWidth + 1; -@popoverArrowOuterColor: rgba(0,0,0,.25); - - - -// GRID -// -------------------------------------------------- - - -// Default 940px grid -// ------------------------- -@gridColumns: 12; -@gridColumnWidth: 60px; -@gridGutterWidth: 20px; -@gridRowWidth: (@gridColumns * @gridColumnWidth) + (@gridGutterWidth * (@gridColumns - 1)); - -// 1200px min -@gridColumnWidth1200: 70px; -@gridGutterWidth1200: 30px; -@gridRowWidth1200: (@gridColumns * @gridColumnWidth1200) + (@gridGutterWidth1200 * (@gridColumns - 1)); - -// 768px-979px -@gridColumnWidth768: 42px; -@gridGutterWidth768: 20px; -@gridRowWidth768: (@gridColumns * @gridColumnWidth768) + (@gridGutterWidth768 * (@gridColumns - 1)); - - -// Fluid grid -// ------------------------- -@fluidGridColumnWidth: percentage(@gridColumnWidth/@gridRowWidth); -@fluidGridGutterWidth: percentage(@gridGutterWidth/@gridRowWidth); - -// 1200px min -@fluidGridColumnWidth1200: percentage(@gridColumnWidth1200/@gridRowWidth1200); -@fluidGridGutterWidth1200: percentage(@gridGutterWidth1200/@gridRowWidth1200); - -// 768px-979px -@fluidGridColumnWidth768: percentage(@gridColumnWidth768/@gridRowWidth768); -@fluidGridGutterWidth768: percentage(@gridGutterWidth768/@gridRowWidth768); diff --git a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/3/mixins.less b/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/3/mixins.less deleted file mode 100644 index a1a9e9965..000000000 --- a/src/eu/webtoolkit/jwt/wt-resources/themes/bootstrap/3/mixins.less +++ /dev/null @@ -1,860 +0,0 @@ -// -// Mixins -// -------------------------------------------------- - - -// Utilities -// ------------------------- - -// Clearfix -// Source: http://nicolasgallagher.com/micro-clearfix-hack/ -// -// For modern browsers -// 1. The space content is one way to avoid an Opera bug when the -// contenteditable attribute is included anywhere else in the document. -// Otherwise it causes space to appear at the top and bottom of elements -// that are clearfixed. -// 2. The use of `table` rather than `block` is only necessary if using -// `:before` to contain the top-margins of child elements. -.clearfix() { - &:before, - &:after { - content: " "; /* 1 */ - display: table; /* 2 */ - } - &:after { - clear: both; - } -} - -// WebKit-style focus -.tab-focus() { - // Default - outline: thin dotted #333; - // WebKit - outline: 5px auto -webkit-focus-ring-color; - outline-offset: -2px; -} - -// Center-align a block level element -.center-block() { - display: block; - margin-left: auto; - margin-right: auto; -} - -// Sizing shortcuts -/* -.size(@width; @height) { - width: @width; - height: @height; -} -.square(@size) { - .size(@size; @size); -} -*/ - -// Placeholder text -.placeholder(@color: @input-color-placeholder) { - &:-moz-placeholder { color: @color; } // Firefox 4-18 - &::-moz-placeholder { color: @color; } // Firefox 19+ - &:-ms-input-placeholder { color: @color; } // Internet Explorer 10+ - &::-webkit-input-placeholder { color: @color; } // Safari and Chrome -} - -// Text overflow -// Requires inline-block or block for proper styling -.text-overflow() { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -// CSS image replacement -// -// Heads up! v3 launched with with only `.hide-text()`, but per our pattern for -// mixins being reused as classes with the same name, this doesn't hold up. As -// of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. Note -// that we cannot chain the mixins together in Less, so they are repeated. -// -// Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 - -// Deprecated as of v3.0.1 (will be removed in v4) -.hide-text() { - font: ~"0/0" a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} -// New mixin to use as of v3.0.1 -.text-hide() { - font: ~"0/0" a; - color: transparent; - text-shadow: none; - background-color: transparent; - border: 0; -} - - - -// CSS3 PROPERTIES -// -------------------------------------------------- - -// Single side border-radius -.border-top-radius(@radius) { - border-top-right-radius: @radius; - border-top-left-radius: @radius; -} -.border-right-radius(@radius) { - border-bottom-right-radius: @radius; - border-top-right-radius: @radius; -} -.border-bottom-radius(@radius) { - border-bottom-right-radius: @radius; - border-bottom-left-radius: @radius; -} -.border-left-radius(@radius) { - border-bottom-left-radius: @radius; - border-top-left-radius: @radius; -} - -// Drop shadows -.box-shadow(@shadow) { - -webkit-box-shadow: @shadow; // iOS <4.3 & Android <4.1 - box-shadow: @shadow; -} - -// Transitions -.transition(@transition) { - -webkit-transition: @transition; - transition: @transition; -} -.transition-property(@transition-property) { - -webkit-transition-property: @transition-property; - transition-property: @transition-property; -} -.transition-delay(@transition-delay) { - -webkit-transition-delay: @transition-delay; - transition-delay: @transition-delay; -} -.transition-duration(@transition-duration) { - -webkit-transition-duration: @transition-duration; - transition-duration: @transition-duration; -} -.transition-transform(@transition) { - -webkit-transition: -webkit-transform @transition; - -moz-transition: -moz-transform @transition; - -o-transition: -o-transform @transition; - transition: transform @transition; -} - -// Transformations -.rotate(@degrees) { - -webkit-transform: rotate(@degrees); - -ms-transform: rotate(@degrees); // IE9+ - transform: rotate(@degrees); -} -.scale(@ratio) { - -webkit-transform: scale(@ratio); - -ms-transform: scale(@ratio); // IE9+ - transform: scale(@ratio); -} -.translate(@x; @y) { - -webkit-transform: translate(@x, @y); - -ms-transform: translate(@x, @y); // IE9+ - transform: translate(@x, @y); -} -.skew(@x; @y) { - -webkit-transform: skew(@x, @y); - -ms-transform: skewX(@x) skewY(@y); // See https://github.com/twbs/bootstrap/issues/4885; IE9+ - transform: skew(@x, @y); -} -.translate3d(@x; @y; @z) { - -webkit-transform: translate3d(@x, @y, @z); - transform: translate3d(@x, @y, @z); -} - -.rotateX(@degrees) { - -webkit-transform: rotateX(@degrees); - -ms-transform: rotateX(@degrees); // IE9+ - transform: rotateX(@degrees); -} -.rotateY(@degrees) { - -webkit-transform: rotateY(@degrees); - -ms-transform: rotateY(@degrees); // IE9+ - transform: rotateY(@degrees); -} -.perspective(@perspective) { - -webkit-perspective: @perspective; - -moz-perspective: @perspective; - perspective: @perspective; -} -.perspective-origin(@perspective) { - -webkit-perspective-origin: @perspective; - -moz-perspective-origin: @perspective; - perspective-origin: @perspective; -} -.transform-origin(@origin) { - -webkit-transform-origin: @origin; - -moz-transform-origin: @origin; - transform-origin: @origin; -} - -// Animations -.animation(@animation) { - -webkit-animation: @animation; - animation: @animation; -} - -// Backface visibility -// Prevent browsers from flickering when using CSS 3D transforms. -// Default value is `visible`, but can be changed to `hidden` -.backface-visibility(@visibility){ - -webkit-backface-visibility: @visibility; - -moz-backface-visibility: @visibility; - backface-visibility: @visibility; -} - -// Box sizing -.box-sizing(@boxmodel) { - -webkit-box-sizing: @boxmodel; - -moz-box-sizing: @boxmodel; - box-sizing: @boxmodel; -} - -// User select -// For selecting text on the page -.user-select(@select) { - -webkit-user-select: @select; - -moz-user-select: @select; - -ms-user-select: @select; // IE10+ - -o-user-select: @select; - user-select: @select; -} - -// Resize anything -.resizable(@direction) { - resize: @direction; // Options: horizontal, vertical, both - overflow: auto; // Safari fix -} - -// CSS3 Content Columns -.content-columns(@column-count; @column-gap: @grid-gutter-width) { - -webkit-column-count: @column-count; - -moz-column-count: @column-count; - column-count: @column-count; - -webkit-column-gap: @column-gap; - -moz-column-gap: @column-gap; - column-gap: @column-gap; -} - -// Optional hyphenation -.hyphens(@mode: auto) { - word-wrap: break-word; - -webkit-hyphens: @mode; - -moz-hyphens: @mode; - -ms-hyphens: @mode; // IE10+ - -o-hyphens: @mode; - hyphens: @mode; -} - -// Opacity -.opacity(@opacity) { - opacity: @opacity; - // IE8 filter - @opacity-ie: (@opacity * 100); - filter: ~"alpha(opacity=@{opacity-ie})"; -} - - - -// GRADIENTS -// -------------------------------------------------- - -#gradient { - - // Horizontal gradient, from left to right - // - // Creates two color stops, start and end, by specifying a color and position for each color stop. - // Color stops are not available in IE9 and below. - .horizontal(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { - background-image: -webkit-gradient(linear, @start-percent top, @end-percent top, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(left, color-stop(@start-color @start-percent), color-stop(@end-color @end-percent)); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient(left, @start-color @start-percent, @end-color @end-percent); // FF 3.6+ - background-image: linear-gradient(to right, @start-color @start-percent, @end-color @end-percent); // Standard, IE10 - background-repeat: repeat-x; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down - } - - // Vertical gradient, from top to bottom - // - // Creates two color stops, start and end, by specifying a color and position for each color stop. - // Color stops are not available in IE9 and below. - .vertical(@start-color: #555; @end-color: #333; @start-percent: 0%; @end-percent: 100%) { - background-image: -webkit-gradient(linear, left @start-percent, left @end-percent, from(@start-color), to(@end-color)); // Safari 4+, Chrome 2+ - background-image: -webkit-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient(top, @start-color @start-percent, @end-color @end-percent); // FF 3.6+ - background-image: linear-gradient(to bottom, @start-color @start-percent, @end-color @end-percent); // Standard, IE10 - background-repeat: repeat-x; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down - } - - .directional(@start-color: #555; @end-color: #333; @deg: 45deg) { - background-repeat: repeat-x; - background-image: -webkit-linear-gradient(@deg, @start-color, @end-color); // Safari 5.1+, Chrome 10+ - background-image: -moz-linear-gradient(@deg, @start-color, @end-color); // FF 3.6+ - background-image: linear-gradient(@deg, @start-color, @end-color); // Standard, IE10 - } - .horizontal-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { - background-image: -webkit-gradient(left, linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color)); - background-image: -webkit-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); - background-image: -moz-linear-gradient(left, @start-color, @mid-color @color-stop, @end-color); - background-image: linear-gradient(to right, @start-color, @mid-color @color-stop, @end-color); - background-repeat: no-repeat; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=1)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback - } - .vertical-three-colors(@start-color: #00b3ee; @mid-color: #7a43b6; @color-stop: 50%; @end-color: #c3325f) { - background-image: -webkit-gradient(linear, 0 0, 0 100%, from(@start-color), color-stop(@color-stop, @mid-color), to(@end-color)); - background-image: -webkit-linear-gradient(@start-color, @mid-color @color-stop, @end-color); - background-image: -moz-linear-gradient(top, @start-color, @mid-color @color-stop, @end-color); - background-image: linear-gradient(@start-color, @mid-color @color-stop, @end-color); - background-repeat: no-repeat; - filter: e(%("progid:DXImageTransform.Microsoft.gradient(startColorstr='%d', endColorstr='%d', GradientType=0)",argb(@start-color),argb(@end-color))); // IE9 and down, gets no color-stop at all for proper fallback - } - .radial(@inner-color: #555; @outer-color: #333) { - background-image: -webkit-gradient(radial, center center, 0, center center, 460, from(@inner-color), to(@outer-color)); - background-image: -webkit-radial-gradient(circle, @inner-color, @outer-color); - background-image: -moz-radial-gradient(circle, @inner-color, @outer-color); - background-image: radial-gradient(circle, @inner-color, @outer-color); - background-repeat: no-repeat; - } - .striped(@color: rgba(255,255,255,.15); @angle: 45deg) { - background-image: -webkit-gradient(linear, 0 100%, 100% 0, color-stop(.25, @color), color-stop(.25, transparent), color-stop(.5, transparent), color-stop(.5, @color), color-stop(.75, @color), color-stop(.75, transparent), to(transparent)); - background-image: -webkit-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); - background-image: -moz-linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); - background-image: linear-gradient(@angle, @color 25%, transparent 25%, transparent 50%, @color 50%, @color 75%, transparent 75%, transparent); - } -} - -// Reset filters for IE -// -// When you need to remove a gradient background, do not forget to use this to reset -// the IE filter for IE9 and below. -.reset-filter() { - filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); -} - - - -// Retina images -// -// Short retina mixin for setting background-image and -size - -.img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { - background-image: url("@{file-1x}"); - - @media - only screen and (-webkit-min-device-pixel-ratio: 2), - only screen and ( min--moz-device-pixel-ratio: 2), - only screen and ( -o-min-device-pixel-ratio: 2/1), - only screen and ( min-device-pixel-ratio: 2), - only screen and ( min-resolution: 192dpi), - only screen and ( min-resolution: 2dppx) { - background-image: url("@{file-2x}"); - background-size: @width-1x @height-1x; - } -} - - -// Responsive image -// -// Keep images from scaling beyond the width of their parents. - -.img-responsive(@display: block;) { - display: @display; - max-width: 100%; // Part 1: Set a maximum relative to the parent - height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching -} - - -// COMPONENT MIXINS -// -------------------------------------------------- - -// Horizontal dividers -// ------------------------- -// Dividers (basically an hr) within dropdowns and nav lists -.nav-divider(@color: #e5e5e5) { - height: 1px; - margin: ((@line-height-computed / 2) - 1) 0; - overflow: hidden; - background-color: @color; -} - -// Panels -// ------------------------- -.panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border;) { - border-color: @border; - - & > .panel-heading { - color: @heading-text-color; - background-color: @heading-bg-color; - border-color: @heading-border; - - + .panel-collapse .panel-body { - border-top-color: @border; - } - & > .dropdown .caret { - border-color: @heading-text-color transparent; - } - } - & > .panel-footer { - + .panel-collapse .panel-body { - border-bottom-color: @border; - } - } -} - -// Alerts -// ------------------------- -.alert-variant(@background; @border; @text-color) { - background-color: @background; - border-color: @border; - color: @text-color; - - hr { - border-top-color: darken(@border, 5%); - } - .alert-link { - color: darken(@text-color, 10%); - } -} - -// Tables -// ------------------------- -.table-row-variant(@state; @background; @border) { - // Exact selectors below required to override `.table-striped` and prevent - // inheritance to nested tables. - .table > thead > tr, - .table > tbody > tr, - .table > tfoot > tr { - > td.@{state}, - > th.@{state}, - &.@{state} > td, - &.@{state} > th { - background-color: @background; - } - } - - // Hover states for `.table-hover` - // Note: this is not available for cells or rows within `thead` or `tfoot`. - .table-hover > tbody > tr { - > td.@{state}:hover, - > th.@{state}:hover, - &.@{state}:hover > td, - &.@{state}:hover > th { - background-color: darken(@background, 5%); - } - } -} - -// Button variants -// ------------------------- -// Easily pump out default styles, as well as :hover, :focus, :active, -// and disabled options for all buttons -.button-variant(@color; @background; @border) { - color: @color; - background-color: @background; - border-color: @border; - - &:hover, - &:focus, - &:active, - &.active, - .open .dropdown-toggle& { - color: @color; - background-color: darken(@background, 8%); - border-color: darken(@border, 12%); - } - &:active, - &.active, - .open .dropdown-toggle& { - background-image: none; - } - &.disabled, - &[disabled], - fieldset[disabled] & { - &, - &:hover, - &:focus, - &:active, - &.active { - background-color: @background; - border-color: @border; - } - } -} - -// Button sizes -// ------------------------- -.button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { - padding: @padding-vertical @padding-horizontal; - font-size: @font-size; - line-height: @line-height; - border-radius: @border-radius; -} - -// Pagination -// ------------------------- -.pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { - > li { - > a, - > span { - padding: @padding-vertical @padding-horizontal; - font-size: @font-size; - } - &:first-child { - > a, - > span { - .border-left-radius(@border-radius); - } - } - &:last-child { - > a, - > span { - .border-right-radius(@border-radius); - } - } - } -} - -// Labels -// ------------------------- -.label-variant(@color) { - background-color: @color; - &[href] { - &:hover, - &:focus { - background-color: darken(@color, 10%); - } - } -} - -// Navbar vertical align -// ------------------------- -// Vertically center elements in the navbar. -// Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. -.navbar-vertical-align(@element-height) { - margin-top: ((@navbar-height - @element-height) / 2); - margin-bottom: ((@navbar-height - @element-height) / 2); -} - -// Progress bars -// ------------------------- -.progress-bar-variant(@color) { - background-color: @color; - .progress-striped & { - #gradient > .striped(); - } -} - -// Responsive utilities -// ------------------------- -// More easily include all the states for responsive-utilities.less. -.responsive-visibility() { - display: block !important; - tr& { display: table-row !important; } - th&, - td& { display: table-cell !important; } -} - -.responsive-invisibility() { - &, - tr&, - th&, - td& { display: none !important; } -} - - -// Grid System -// ----------- - -// Centered container element -.container-fixed() { - margin-right: auto; - margin-left: auto; - padding-left: (@grid-gutter-width / 2); - padding-right: (@grid-gutter-width / 2); - .clearfix(); -} - -// Creates a wrapper for a series of columns -.make-row(@gutter: @grid-gutter-width) { - margin-left: (@gutter / -2); - margin-right: (@gutter / -2); - .clearfix(); -} - -// Generate the extra small columns -.make-xs-column(@columns; @gutter: @grid-gutter-width) { - position: relative; - float: left; - width: percentage((@columns / @grid-columns)); - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: (@gutter / 2); - padding-right: (@gutter / 2); -} - -// Generate the small columns -.make-sm-column(@columns; @gutter: @grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: (@gutter / 2); - padding-right: (@gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: @screen-sm-min) { - float: left; - width: percentage((@columns / @grid-columns)); - } -} - -// Generate the small column offsets -.make-sm-column-offset(@columns) { - @media (min-width: @screen-sm-min) { - margin-left: percentage((@columns / @grid-columns)); - } -} -.make-sm-column-push(@columns) { - @media (min-width: @screen-sm-min) { - left: percentage((@columns / @grid-columns)); - } -} -.make-sm-column-pull(@columns) { - @media (min-width: @screen-sm-min) { - right: percentage((@columns / @grid-columns)); - } -} - -// Generate the medium columns -.make-md-column(@columns; @gutter: @grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: (@gutter / 2); - padding-right: (@gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: @screen-md-min) { - float: left; - width: percentage((@columns / @grid-columns)); - } -} - -// Generate the medium column offsets -.make-md-column-offset(@columns) { - @media (min-width: @screen-md-min) { - margin-left: percentage((@columns / @grid-columns)); - } -} -.make-md-column-push(@columns) { - @media (min-width: @screen-md) { - left: percentage((@columns / @grid-columns)); - } -} -.make-md-column-pull(@columns) { - @media (min-width: @screen-md-min) { - right: percentage((@columns / @grid-columns)); - } -} - -// Generate the large columns -.make-lg-column(@columns; @gutter: @grid-gutter-width) { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: (@gutter / 2); - padding-right: (@gutter / 2); - - // Calculate width based on number of columns available - @media (min-width: @screen-lg-min) { - float: left; - width: percentage((@columns / @grid-columns)); - } -} - -// Generate the large column offsets -.make-lg-column-offset(@columns) { - @media (min-width: @screen-lg-min) { - margin-left: percentage((@columns / @grid-columns)); - } -} -.make-lg-column-push(@columns) { - @media (min-width: @screen-lg-min) { - left: percentage((@columns / @grid-columns)); - } -} -.make-lg-column-pull(@columns) { - @media (min-width: @screen-lg-min) { - right: percentage((@columns / @grid-columns)); - } -} - - -// Framework grid generation -// -// Used only by Bootstrap to generate the correct number of grid classes given -// any value of `@grid-columns`. - -.make-grid-columns() { - // Common styles for all sizes of grid columns, widths 1-12 - .col(@index) when (@index = 1) { // initial - @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; - .col(@index + 1, @item); - } - .col(@index, @list) when (@index =< @grid-columns) { // general; "=<" isn't a typo - @item: ~".col-xs-@{index}, .col-sm-@{index}, .col-md-@{index}, .col-lg-@{index}"; - .col(@index + 1, ~"@{list}, @{item}"); - } - .col(@index, @list) when (@index > @grid-columns) { // terminal - @{list} { - position: relative; - // Prevent columns from collapsing when empty - min-height: 1px; - // Inner gutter via padding - padding-left: (@grid-gutter-width / 2); - padding-right: (@grid-gutter-width / 2); - } - } - .col(1); // kickstart it -} - -.make-grid-columns-float(@class) { - .col(@index) when (@index = 1) { // initial - @item: ~".col-@{class}-@{index}"; - .col(@index + 1, @item); - } - .col(@index, @list) when (@index < @grid-columns) { // general - @item: ~".col-@{class}-@{index}"; - .col(@index + 1, ~"@{list}, @{item}"); - } - .col(@index, @list) when (@index = @grid-columns) { // terminal - @{list} { - float: left; - } - } - .col(1); // kickstart it -} - -.calc-grid(@index, @class, @type) when (@type = width) and (@index > 0) { - .col-@{class}-@{index} { - width: percentage((@index / @grid-columns)); - } -} -.calc-grid(@index, @class, @type) when (@type = push) { - .col-@{class}-push-@{index} { - left: percentage((@index / @grid-columns)); - } -} -.calc-grid(@index, @class, @type) when (@type = pull) { - .col-@{class}-pull-@{index} { - right: percentage((@index / @grid-columns)); - } -} -.calc-grid(@index, @class, @type) when (@type = offset) { - .col-@{class}-offset-@{index} { - margin-left: percentage((@index / @grid-columns)); - } -} - -// Basic looping in LESS -.make-grid(@index, @class, @type) when (@index >= 0) { - .calc-grid(@index, @class, @type); - // next iteration - .make-grid(@index - 1, @class, @type); -} - - -// Form validation states -// -// Used in forms.less to generate the form validation CSS for warnings, errors, -// and successes. - -.form-control-validation(@text-color: #555; @border-color: #ccc; @background-color: #f5f5f5) { - // Color the label and help text - .help-block, - .control-label, - .radio, - .checkbox, - .radio-inline, - .checkbox-inline { - color: @text-color; - } - // Set the border and box shadow on specific inputs to match - .form-control { - border-color: @border-color; - .box-shadow(inset 0 1px 1px rgba(0,0,0,.075)); // Redeclare so transitions work - &:focus { - border-color: darken(@border-color, 10%); - @shadow: inset 0 1px 1px rgba(0,0,0,.075), 0 0 6px lighten(@border-color, 20%); - .box-shadow(@shadow); - } - } - // Set validation states also for addons - .input-group-addon { - color: @text-color; - border-color: @border-color; - background-color: @background-color; - } -} - -// Form control focus state -// -// Generate a customized focus state and for any input with the specified color, -// which defaults to the `@input-focus-border` variable. -// -// We highly encourage you to not customize the default value, but instead use -// this to tweak colors on an as-needed basis. This aesthetic change is based on -// WebKit's default styles, but applicable to a wider range of browsers. Its -// usability and accessibility should be taken into account with any change. -// -// Example usage: change the default blue border and shadow to white for better -// contrast against a dark gray background. - -.form-control-focus(@color: @input-border-focus) { - @color-rgba: rgba(red(@color), green(@color), blue(@color), .6); - &:focus { - border-color: @color; - outline: 0; - .box-shadow(~"inset 0 1px 1px rgba(0,0,0,.075), 0 0 8px @{color-rgba}"); - } -} - -// Form control sizing -// -// Relative text size, padding, and border-radii changes for form controls. For -// horizontal sizing, wrap controls in the predefined grid classes. `