diff options
author | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-05-12 15:34:44 +0300 |
---|---|---|
committer | Jonatan Kronqvist <jonatan@vaadin.com> | 2014-05-12 15:36:15 +0300 |
commit | 78542b45fbff419a59912830e23461110fbbf067 (patch) | |
tree | 79a33b379ef882e41a466bec1c40460f1b8f8a24 | |
parent | 7af883e7e74bc2193bcc0ddeff9ec47c945f7b16 (diff) | |
parent | 77a08ca0f910fb00f97015a751d5f8414c2985eb (diff) | |
download | vaadin-framework-78542b45fbff419a59912830e23461110fbbf067.tar.gz vaadin-framework-78542b45fbff419a59912830e23461110fbbf067.zip |
Merge branch 'master' into 7.2
* 77a08ca - (origin/master, origin/HEAD, master) Add missing @sinces to JavaDoc
* 82033e8 - Support long in state again (#13692)
* 2b60bbb - Fix SelectedItemIcon rendering on IE (#13731)
* ee16285 - Support passing multiple versions
* 45226d5 - Mention dnd on IE touch devices in known issues (#13612)
* deeb645 - Added link to ticket for the Firefox reconnect issue (#13612)
* e975af7 - List authors in release notes (#13612)
* 20f5633 - Make SuperDevMode work again (#13682)
* e8f0fe7 - Show badges in release notes (#13612)
* 466883b - Convert test to TB4 to be compatible with Tomcat proxy test
* cd20de5 - Make touch actions disabled on some CSS classes (#13368)
* aab62be - Update sass-compiler to 0.9.2 (#13651)
* 43c1a36 - Update the release-notes (#13612)
* 35c174c - Re-apply old change which was excluded from master
* 67dd382 - Ignore PointerEvents in VDragAndDropManager (#13720)
* 5a4c888 - Rename base on API review (#13557)
* 4bd8314 - Remove ComponentLocator which conflicts with package name (#13729)
* 0970487 - Update ErrorIndicator test from TB2 to TB4
* 1cf11f8 - Resize PopupView's overlay on content resize (#13666)
* 2ecdf7e - Fix table focusing when scrolled from the server (#10522)
Change-Id: Ic0242d141705cce189c900ee12650a757e894512
39 files changed, 988 insertions, 343 deletions
diff --git a/WebContent/VAADIN/themes/base/dragwrapper/dragwrapper.scss b/WebContent/VAADIN/themes/base/dragwrapper/dragwrapper.scss index e66f02e207..86000abd7c 100644 --- a/WebContent/VAADIN/themes/base/dragwrapper/dragwrapper.scss +++ b/WebContent/VAADIN/themes/base/dragwrapper/dragwrapper.scss @@ -6,6 +6,8 @@ -webkit-border-radius: 4px; border-radius: 4px; position: relative; + -ms-touch-action: none; + touch-action: none; } [draggable=true] { -khtml-user-drag: element; diff --git a/WebContent/VAADIN/themes/base/slider/slider.scss b/WebContent/VAADIN/themes/base/slider/slider.scss index 9ef94d9d9e..60047bc6db 100644 --- a/WebContent/VAADIN/themes/base/slider/slider.scss +++ b/WebContent/VAADIN/themes/base/slider/slider.scss @@ -10,7 +10,6 @@ background: #eee; border-left: 1px solid #ddd; border-right: 1px solid #eee; - } .#{$primaryStyleName}-handle { background: #aaa; @@ -18,6 +17,8 @@ height: 12px; margin-top: -5px; font-size: 0; + -ms-touch-action: none; + touch-action: none; } .#{$primaryStyleName}-vertical { diff --git a/WebContent/VAADIN/themes/base/splitpanel/splitpanel.scss b/WebContent/VAADIN/themes/base/splitpanel/splitpanel.scss index bae740257f..968894d92d 100644 --- a/WebContent/VAADIN/themes/base/splitpanel/splitpanel.scss +++ b/WebContent/VAADIN/themes/base/splitpanel/splitpanel.scss @@ -15,6 +15,8 @@ background: #ddd; cursor: e-resize; cursor: col-resize; + -ms-touch-action: none; + touch-action: none } .v-disabled .#{$primaryStyleName}-hsplitter div { cursor: default; @@ -27,6 +29,8 @@ background: #ddd; cursor: s-resize; cursor: row-resize; + -ms-touch-action: none; + touch-action: none; } .v-disabled .#{$primaryStyleName}-vsplitter div { cursor: default; diff --git a/WebContent/css/styles.css b/WebContent/css/styles.css index 9a5ddc74c1..9bd03ae8bc 100644 --- a/WebContent/css/styles.css +++ b/WebContent/css/styles.css @@ -439,3 +439,37 @@ img { margin: 0em 2em .8em 2em; float: right; } + +span.fv { + padding: 2px 10px; + margin-right: 5px; + color: rgb(71,174,67); + font-weight: bold; +} +td.fv { + background-color: rgb(206,247,205); + text-align: center; + border-radius: 3px; + font-size: 12px; + line-height: 1; + font-weight: bold; +} +td.bfp { + text-align: center; + color: rgb(37,114,146); + border-radius: 3px; + + padding: 2px 10px; + margin-right: 5px; + background-color: rgb(216,245,255); + font-size: 12px; + line-height: 1; + font-weight: bold; +} +.ticket { + text-align: right; + padding-left: 5px; +} +.pad { + padding-left: 5px; +}
\ No newline at end of file diff --git a/WebContent/release-notes.html b/WebContent/release-notes.html index 7de723629f..847bade7cd 100644 --- a/WebContent/release-notes.html +++ b/WebContent/release-notes.html @@ -41,7 +41,6 @@ <ul> <li><a href="#overview">Overview of Vaadin @version@ Release</a></li> - <li><a href="#security-fixes">Security fixes</a></li> <li><a href="#changelog">Change log for Vaadin @version@</a></li> <li><a href="#enhancements">Enhancements in Vaadin @@ -64,73 +63,35 @@ @version-minor@</a></li> <li><a href="#supportedversions">Supported technologies</a></li> + <li><a href="#authors">Authors</a></li> <li><a href="#vaadinontheweb">Vaadin on the Web</a></li> </ul> <h2 id="overview">Overview of Vaadin @version@ Release</h2> <p> - Vaadin @version@ is a maintenance release that includes a - number of important bug fixes, as listed in the <a + Vaadin @version@ is a minor release that includes a + number of new features and bug fixes, as listed in the <a + href="#enhancements">list of enhancements</a> and <a href="#changelog">change log</a> below. </p> - <p> - For a list of enhancements in the last feature release, see - <a href="#enhancements">Enhancements in Vaadin - @version-minor@</a> and the <a - href="http://vaadin.com/download/release/@version-minor@/@version-minor@.0/release-notes.html">Release - Notes for Vaadin @version-minor@.0</a>. - </p> - <!-- ================================================================ --> - <h3 id="security-fixes">Security fixes in Vaadin Framework 7.1.11</h3> - - <p> - Vaadin 7.1.11 fixes two security issues discovered during internal review. - </p> - <p><b>Escaping of OptionGroup item icon URLs</b></p> - <p> - The issue affects OptionGroup with item icons. Proper escaping of the - src-attribute on the client side was not ensured when using icons for - OptionGroup items. This could potentially, in certain situations, allow - a malicious user to inject content, such as javascript, in order to - perform a cross-site scripting (XSS) attack. - </p> - <p> - In order for an application to be vulnerable, user provided input must - be used to form a URL used to display an icon for an OptionGroup item, - when showing that Option Group to other users.<br/> - The vulnerability has been classified as moderate, due to it's limited - application. - </p> - <p><b>Escaping of URLs in Util.getAbsoluteUrl()</b></p> - <p> - The client side Util.getAbsoluteUrl() did not ensure proper escaping - of the given URL. This could potentially, in certain situations, allow - a malicious user to inject content, such as javascript, in order to - perform a cross-site scripting (XSS) attack. - </p> - <p> - The method is used internally by the framework in such a manner that it - is unlikely this attack vector can be utilized in practice. However, - third party components, or future use of the method, could make an - attack viable.<br/> - The vulnerability has been classified as moderate, due to it's limited - application. - </p> - <h3 id="changelog">Change log for Vaadin @version@</h3> <p>This release includes the following closed issues:</p> - <ul>@release-notes-tickets@ - </ul> - + <table> + @release-notes-tickets@ + <tr><td> </td><td></td></tr> + <tr><td class="fv"><span class="vote">Vote</span></td><td colspan="2" class="pad">Enhancements <a href=" https://vaadin.com/support">Vaadin support</a> users have voted for</td></tr> + <tr><td class="bfp"><span class="bfp">Priority</span></td><td colspan="2" class="pad">Defects <a href=" https://vaadin.com/support">Vaadin support</a> users have prioritized</td></tr> + </table> + <br/> <p> You can also view the <a href="http://dev.vaadin.com/query?status=closed&resolution=fixed&milestone=Vaadin+@version@&order=id">list - of the closed issues</a> at the Vaadin developer's site. . + of the closed issues</a> at the Vaadin developer's site. </p> <h2 id="enhancements">Enhancements in Vaadin @@ -160,28 +121,6 @@ <li>Responsive layouts</li> </ul> - <p>Tools have been updated for Vaadin @version-minor@ with - the following changes:</p> - - <ul> - <li>Maven - <ul> - <li>Theme compilation support using <tt>vaadin:update-theme</tt> - and <tt>vaadin:compile-theme</tt></li> - </ul> - </li> - <li>Eclipse - <ul> - <li>Theme compilation support using the - provided button</li> - <li>New projects are by default generated using - Servlet 3.0 API</li> - <li>Additional GWT compiler parameters can be - specified</li> - </ul> - </li> - </ul> - <p> For enchancements introduced in Vaadin 7, see the <a href="http://vaadin.com/download/release/7.0/7.0.0/release-notes.html">Release @@ -198,9 +137,7 @@ from the Android SDK. They are 99% compatible.</li> <li>StringToNumberConverter has been removed in favor of more specific converters such as StringToBigDecimalConverter.</li> - <li>(internal) Atmosphere has been updated from version 1.x to 2.x. These - are not 100% compatible.</li> - <li>(internal) There is no longer support for "multiple variable bursts" + <li>There is no longer support for "multiple variable bursts" in the UIDL communication.</li> </ul> <h3 id="behavioraltering">Behavior altering changes</h3> @@ -222,12 +159,14 @@ <h3 id="knownissues">Known issues</h3> <ul> - <li>Not all features are implemented for devices using pointer events.</li> - <li>Push reconnecting does not work in all situations when</li> - <ul> - <li>using Firefox and streaming</li> - <li>using IE8-11 and long-polling</li> - </ul> + <li>Reconnecting a dropped push connection sometimes fails when using + Firefox and streaming or long polling. + (<a href="http://dev.vaadin.com/ticket/13578">#13578</a>) + </li> + <li>Drag'n'drop in a Table doesn't work on touch devices running + Internet Explorer (Windows Phone, Surface) + (<a href="http://dev.vaadin.com/ticket/13737">#13737</a>) + </li> </ul> <h3 id="limitations">Limitations</h3> @@ -241,17 +180,13 @@ href="http://dev.vaadin.com/ticket/11493">#11493</a>) </li> <li>HTTP session can not be invalidated while using - push (<a href="http://dev.vaadin.com/ticket/11721">#11721</a>) + push over websockets on Tomcat 7 (<a href="http://dev.vaadin.com/ticket/11721">#11721</a>) </li> - <li>Cookies are not available while using push (<a + <li>Cookies are not available while using websockets (<a href="http://dev.vaadin.com/ticket/11808">#11808</a>) </li> - <li>Not all proxies are compatible with websockets. If - you are using push with an incompatible proxy you might - have to force the transport mode to streaming. Some - proxies have problems with streaming also - you need to - ensure that the proxy does not buffer responses for HTTP - streaming to work.</li> + <li>Not all proxies are compatible with websockets or streaming. + Use long polling to avoid these problems.</li> </ul> <h2 id="vaadin">Vaadin Installation</h2> @@ -278,8 +213,7 @@ <li>If using Eclipse, use the Vaadin Plugin for Eclipse, which automatically downloads the Vaadin - libraries. To use this prerelease version, the plugin - should be installed from the experimental update site (<tt>http://vaadin.com/eclipse/experimental</tt>). + libraries. </li> </ul> @@ -416,30 +350,7 @@ directory of the web application that uses validation. </p> - <h2 id="upgrading">Upgrading to Vaadin @version-minor@</h2> - - <h3>Upgrading the Eclipse Plugin</h3> - - <p> - Vaadin 7 requires that you use a compatible version of the - Vaadin Plugin for Eclipse. The stable version of the plugin - is available from the - <tt>http://vaadin.com/eclipse</tt> - update site. Please see the <a - href="https://vaadin.com/book/vaadin7/-/page/getting-started.eclipse.html#getting-started.eclipse.update">section - about updating the plugin</a> in the Book of Vaadin and the - <a href="http://vaadin.com/eclipse">installation - instructions at the download site</a> for more details. - </p> - - <p> - You can also use the <i>experimental</i> Vaadin Plugin for - Eclipse. Its update site is - <tt>http://vaadin.com/eclipse/experimental</tt> - . - </p> - - <h3>General Upgrading Instructions</h3> + <h2 id="upgrading">Upgrading from Vaadin 7.1 to Vaadin @version-minor@</h2> <p>When upgrading from an earlier Vaadin version, you must: </p> @@ -449,11 +360,8 @@ version. Binary compatibility is only guaranteed for maintenance releases of Vaadin.</li> - <li>Recompile any add-ons you have created using the - new Vaadin</li> - <li>Unless using the precompiled widget set, recompile - your widget set using the new Vaadin version</li> + your widget set using the new Vaadin version.</li> </ul> <p>Remember also to refresh the project in your IDE to @@ -492,12 +400,9 @@ the contents of the <tt>vaadin-client-compiled</tt> and <tt>vaadin-themes</tt> must be extracted to the <tt>ROOT/html/VAADIN</tt> directory in the Liferay installation. If your portal uses custom - widgets, install the latest version of <a - href="http://vaadin.com/directory#addon/vaadin-control-panel-for-liferay">Vaadin - Control Panel for Liferay</a> for easy widget set - compilation - when it is available - the add-on is not - compatible with Vaadin @version@ at the time of this Vaadin - release. <!-- TODO: Remove note when done --></t> + widgets, you can use <a + href="http://vaadin.com/directory#addon/liferay-control-panel-plugin-for-vaadin:vaadin"> + Liferay Control Panel for Vaadin</a> for easy widget set compilation.</t> </p> <h2 id="gae"> @@ -623,11 +528,11 @@ </p> <p> - Vaadin supports the following <b>desktop browsers</b>: + Vaadin @version@ supports the following <b>desktop browsers</b>: </p> <ul> - <li>Mozilla Firefox 18-28</li> + <li>Mozilla Firefox 18-29</li> <li>Mozilla Firefox 17 ESR, 24 ESR</li> <li>Internet Explorer 8-11</li> <li>Safari 6-7</li> @@ -643,6 +548,7 @@ <ul> <li>iOS 5-7</li> <li>Android 2.3-4</li> + <li>Windows Phone 8</li> </ul> <p>Vaadin SQL Container supports the following databases:</p> @@ -654,6 +560,11 @@ <li>PostgreSQL</li> </ul> + <h2 id="authors">Authors</h2> + Vaadin @version@ was created by: + <ul> + @release-notes-authors@ + </ul> <h2 id="vaadinontheweb">Vaadin on the Web</h2> <ul> @@ -674,9 +585,10 @@ <li><a href="http://vaadin.com/directory">vaadin.com/directory - Add-ons for Vaadin</a></li> - <li><a href="http://vaadin.com/pro-account">vaadin.com/pro-account - - Commercial support and tools for Vaadin - development </a></li> + <li><a href="http://vaadin.com/pro-tools">vaadin.com/pro-tools + - Commercial tools for Vaadin development</a></li> + <li><a href="http://vaadin.com/support">vaadin.com/support + - Commercial support for Vaadin development </a></li> <li><a href="http://vaadin.com/services">vaadin.com/services - Expert services for Vaadin</a></li> <li><a href="http://vaadin.com/company">vaadin.com/company diff --git a/build.properties b/build.properties index 074d723897..043407b85d 100644 --- a/build.properties +++ b/build.properties @@ -5,5 +5,5 @@ vaadin.vendor=Vaadin Ltd vaadin.url=http://vaadin.com vaadin.java.version=1.6 vaadin.version=0.0.0.unversioned-development-build -vaadin.sass.version=0.9.0 +vaadin.sass.version=0.9.2 commons-io.version=2.4 diff --git a/buildhelpers/build.xml b/buildhelpers/build.xml index 28eb55e6e8..159435811f 100644 --- a/buildhelpers/build.xml +++ b/buildhelpers/build.xml @@ -44,6 +44,15 @@ </antcall> </target> + <target name="fetch-release-notes-authors"> + <copy file="src/com/vaadin/buildhelpers/authormap.properties" tofile="result/classes/com/vaadin/buildhelpers/authormap.properties" /> + <antcall target="common.exec-buildhelper"> + <param name="main.class" value="com.vaadin.buildhelpers.FetchReleaseNotesAuthors" /> + <param name="output" value="${output}" /> + </antcall> + <delete file="result/classes/com/vaadin/buildhelpers/authormap.properties" /> + </target> + <target name="test" depends="checkstyle"> <!--<antcall target="common.test.run" /> --> <echo>WHAT? No JUnit tests for ${module.name}!</echo> diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java new file mode 100644 index 0000000000..cd85ca6a3f --- /dev/null +++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesAuthors.java @@ -0,0 +1,101 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.buildhelpers; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Properties; + +public class FetchReleaseNotesAuthors { + private static final String template = "<li class=\"author\">@author@</li>"; + + public static void main(String[] args) throws IOException, + InterruptedException { + Properties authorMap = new Properties(); + + String authorsFilename = FetchReleaseNotesAuthors.class.getPackage() + .getName().replace(".", "/") + + "/authormap.properties"; + InputStream s = FetchReleaseNotesAuthors.class.getClassLoader() + .getResourceAsStream(authorsFilename); + if (s == null) { + System.err.println("Author mapping file " + authorsFilename + + " not found!"); + } + authorMap.load(s); + + String version = System.getProperty("vaadin.version"); + String previousVersion = getPreviousVersion(version); + // System.out.println("Using previous version: " + previousVersion); + // List all commits which are in this version but not in + // "previousVersion" + String cmd = "git log --pretty=%an HEAD ^origin/" + previousVersion; + Process p = Runtime.getRuntime().exec(cmd); + p.waitFor(); + if (p.exitValue() != 0) { + System.err.println("Exit code: " + p.exitValue()); + } + BufferedReader b = new BufferedReader(new InputStreamReader( + p.getInputStream())); + String line = ""; + + List<String> authors = new ArrayList<String>(); + while ((line = b.readLine()) != null) { + String author = line; + if (authorMap.containsKey(author)) { + author = authorMap.getProperty(author); + } + if (author != null && !author.equals("") + && !authors.contains(author)) { + authors.add(author); + } + } + Collections.sort(authors); + for (String author : authors) { + System.out.println(template.replace("@author@", author)); + } + } + + private static String getPreviousVersion(String version) { + String[] versionNumbers = version.split("\\."); + if (versionNumbers.length > 4 || versionNumbers.length < 3) { + throw new IllegalArgumentException("Cannot parse version: " + + version); + } + int major = Integer.parseInt(versionNumbers[0]); + int minor = Integer.parseInt(versionNumbers[1]); + int maintenance = Integer.parseInt(versionNumbers[2]); + // String qualifier = versionNumbers[3]; + + if (minor == 0) { + // Major release, can't know what the previous minor was + throw new IllegalArgumentException( + "Can't know what previous minor version was"); + } + if (maintenance == 0) { + // Minor release, use last minor + return major + "." + (minor - 1); + } else { + // Maintenance, use last maintenance + return major + "." + minor + "." + (maintenance - 1); + } + } +} diff --git a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java index 4ca17443dc..028880b2e1 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -17,6 +17,7 @@ package com.vaadin.buildhelpers; import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; import java.net.URL; import java.net.URLConnection; import java.util.List; @@ -24,16 +25,33 @@ import java.util.List; import org.apache.commons.io.IOUtils; public class FetchReleaseNotesTickets { - private static final String queryURL = "http://dev.vaadin.com/query?status=closed&milestone=Vaadin+@version@&resolution=fixed&format=tab&order=id"; - private static final String ticketTemplate = " <li><a href=\"http://dev.vaadin.com/ticket/@ticket@\">#@ticket@</a>: @description@</li>"; + private static final String queryURL = "http://dev.vaadin.com/query?status=closed&@milestone@&resolution=fixed&col=id&col=summary&col=owner&col=type&col=priority&col=component&col=version&col=bfptime&col=fv&format=tab&order=id"; + private static final String ticketTemplate = "<tr>" + + "@badge@" // + + "<td class=\"ticket\"><a href=\"http://dev.vaadin.com/ticket/@ticket@\">#@ticket@</a></td>" // + + "<td>@description@</td>" // + + "</tr>"; // public static void main(String[] args) throws IOException { - String version = System.getProperty("vaadin.version"); - if (version == null || version.equals("")) { + String versions = System.getProperty("vaadin.version"); + if (versions == null || versions.equals("")) { usage(); } + String milestone = ""; + for (String version : versions.split(" ")) { + if (!milestone.equals("")) { + milestone += "&"; + } + milestone += "milestone=Vaadin+" + version; + } + + printMilestone(milestone); + } - URL url = new URL(queryURL.replace("@version@", version)); + private static void printMilestone(String milestone) + throws MalformedURLException, IOException { + + URL url = new URL(queryURL.replace("@milestone@", milestone)); URLConnection connection = url.openConnection(); InputStream urlStream = connection.getInputStream(); @@ -52,8 +70,16 @@ public class FetchReleaseNotesTickets { summary = summary.substring(1, summary.length() - 1); summary = summary.replace("\"\"", "\""); } + String badge = "<td></td>"; + if (fields.length >= 8 && !fields[7].equals("")) { + badge = "<td class=\"bfp\"><span class=\"bfp\">Priority</span></td>"; + } else if (fields.length >= 9 && fields[8].equalsIgnoreCase("true")) { + badge = "<td class=\"fv\"><span class=\"fv\">Vote</span></td>"; + } + System.out.println(ticketTemplate.replace("@ticket@", fields[0]) - .replace("@description@", summary)); + .replace("@description@", summary) + .replace("@badge@", badge)); } urlStream.close(); } diff --git a/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties b/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties new file mode 100644 index 0000000000..15b8ad2cba --- /dev/null +++ b/buildhelpers/src/com/vaadin/buildhelpers/authormap.properties @@ -0,0 +1,6 @@ +denisanisimov=Denis Anisimov +joheriks=Johannes Eriksson +michaelvogt=Michael Vogt +tapio=Tapio Aali +Build\ Agent= +mtzukanov=Michael Tzukanov
\ No newline at end of file diff --git a/client-compiler/ivy.xml b/client-compiler/ivy.xml index 8c45597214..156a8d3ace 100644 --- a/client-compiler/ivy.xml +++ b/client-compiler/ivy.xml @@ -45,10 +45,11 @@ <dependency org="ant" name="ant-launcher" rev="1.6.5" conf="build,ide -> default" /> - <dependency org="org.eclipse.jetty" name="jetty-server" + <dependency org="org.eclipse.jetty" name="jetty-distribution" rev="8.1.12.v20130726" conf="build,ide -> default"> <exclude org="org.eclipse.jetty.orbit"></exclude> </dependency> + <dependency org="org.eclipse.jetty" name="jetty-util" rev="8.1.12.v20130726" conf="build,ide -> default" /> @@ -56,8 +57,8 @@ rev="1.1" conf="build,ide -> default" /> <dependency org="commons-codec" name="commons-codec" rev="1.8" conf="build,ide -> default" /> - <dependency org="commons-io" name="commons-io" rev="${commons-io.version}" - conf="build,ide -> default" /> + <dependency org="commons-io" name="commons-io" + rev="${commons-io.version}" conf="build,ide -> default" /> <dependency org="org.apache.commons" name="commons-lang3" rev="3.1" conf="build,ide -> default" /> <dependency org="org.apache.james" name="apache-mime4j" diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java index 75225c52dc..cc1841ec05 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -189,6 +189,8 @@ public class ConnectorBundleLoaderFactory extends Generator { if (isNative) { outdent(); println("}-*/;"); + // To support fields of type long (#13692) + println("@com.google.gwt.core.client.UnsafeNativeLong"); println("private native void %s(%s) /*-{", newMethod, args); } else { println("%s();", newMethod); @@ -313,6 +315,8 @@ public class ConnectorBundleLoaderFactory extends Generator { // Separate method for loading native JS stuff (e.g. callbacks) String loadNativeJsMethodName = "loadNativeJs"; + // To support fields of type long (#13692) + w.println("@com.google.gwt.core.client.UnsafeNativeLong"); w.println("private native void %s(%s store) /*-{", loadNativeJsMethodName, TypeDataStore.class.getName()); w.indent(); diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java index a31dafe05c..6c242dfd74 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java @@ -45,17 +45,25 @@ public class FieldProperty extends Property { @Override public void writeSetterBody(TreeLogger logger, SourceWriter w, String beanVariable, String valueVariable) { + // Don't try to unbox Longs in javascript, as it's not supported. + // (#13692) + boolean shouldUnbox = !"long".equals(field.getType() + .getSimpleSourceName()); w.println("%s.@%s::%s = %s;", beanVariable, getBeanType() - .getQualifiedSourceName(), getName(), unboxValue(valueVariable)); + .getQualifiedSourceName(), getName(), + shouldUnbox ? unboxValue(valueVariable) : valueVariable); } @Override public void writeGetterBody(TreeLogger logger, SourceWriter w, String beanVariable) { + // Longs are not unboxed, as it's not supported. (#13692) + boolean shouldBox = !"long".equals(field.getType() + .getSimpleSourceName()); String value = String.format("%s.@%s::%s", beanVariable, getBeanType() .getQualifiedSourceName(), getName()); w.print("return "); - w.print(boxValue(value)); + w.print(shouldBox ? boxValue(value) : value); w.println(";"); } diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java deleted file mode 100644 index db280bbe40..0000000000 --- a/client/src/com/vaadin/client/ComponentLocator.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2000-2014 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.client; - -/** - * ComponentLocator provides methods for generating a String locator for a given - * DOM element and for locating a DOM element using a String locator. - * - * @since 5.4 - * @deprecated Moved to com.vaadin.client.componentlocator.ComponentLocator - */ -public class ComponentLocator extends - com.vaadin.client.componentlocator.ComponentLocator { - /** - * Construct a ComponentLocator for the given ApplicationConnection. - * - * @param client - * ApplicationConnection instance for the application. - */ - public ComponentLocator(ApplicationConnection client) { - super(client); - } -} diff --git a/client/src/com/vaadin/client/SuperDevMode.java b/client/src/com/vaadin/client/SuperDevMode.java index c8efee357b..f1020b3d25 100644 --- a/client/src/com/vaadin/client/SuperDevMode.java +++ b/client/src/com/vaadin/client/SuperDevMode.java @@ -246,10 +246,9 @@ public class SuperDevMode { // in super dev mode, as a result of the recompile, the enabled // check will fail... if (!isSuperDevModeEnabledInModule()) { - showError("SuperDevMode is not enabled for this module/widgetset.<br/>" - + "Ensure that your module definition (.gwt.xml) contains <br/>" - + "<add-linker name="xsiframe"/><br/>" - + "<set-configuration-property name="devModeRedirectEnabled" value="true" /><br/>"); + showError("SuperDevMode is disabled for this module/widgetset.<br/>" + + "Ensure that your module definition (.gwt.xml) does not contain <br/>" + + "<set-configuration-property name="devModeRedirectEnabled" value="false" /><br/>"); return false; } return SuperDevMode.recompileIfNeeded(superDevModeParameter); diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java index 78c6b3146b..ccf070698b 100644 --- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java @@ -277,6 +277,7 @@ public abstract class AbstractComponentConnector extends AbstractConnector /** * Updates the DOM size of this connector's {@link #getWidget() widget}. * + * @since 7.1.15 * @param newWidth * The new width as a CSS string. Cannot be null. * @param newHeight diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index 2d080ecf3b..94adc1c4b5 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -1416,6 +1416,10 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, panel.remove(selectedItemIcon); } selectedItemIcon = new IconWidget(client.getIcon(iconUri)); + // Older IE versions don't scale icon correctly if DOM + // contains height and width attributes. + selectedItemIcon.getElement().removeAttribute("height"); + selectedItemIcon.getElement().removeAttribute("width"); selectedItemIcon.addDomHandler(new LoadHandler() { @Override public void onLoad(LoadEvent event) { diff --git a/client/src/com/vaadin/client/ui/VNotification.java b/client/src/com/vaadin/client/ui/VNotification.java index b40149c054..7097b428d0 100644 --- a/client/src/com/vaadin/client/ui/VNotification.java +++ b/client/src/com/vaadin/client/ui/VNotification.java @@ -38,9 +38,9 @@ import com.vaadin.client.UIDL; import com.vaadin.client.Util; import com.vaadin.client.ui.aria.AriaHelper; import com.vaadin.shared.Position; +import com.vaadin.shared.ui.ui.NotificationRole; import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.shared.ui.ui.UIState.NotificationTypeConfiguration; -import com.vaadin.shared.ui.ui.NotificationRole; public class VNotification extends VOverlay { @@ -183,11 +183,13 @@ public class VNotification extends VOverlay { } private boolean hasPostfix(NotificationTypeConfiguration styleSetup) { - return styleSetup != null && styleSetup.postfix != null && !styleSetup.postfix.isEmpty(); + return styleSetup != null && styleSetup.postfix != null + && !styleSetup.postfix.isEmpty(); } private boolean hasPrefix(NotificationTypeConfiguration styleSetup) { - return styleSetup != null && styleSetup.prefix != null && !styleSetup.prefix.isEmpty(); + return styleSetup != null && styleSetup.prefix != null + && !styleSetup.prefix.isEmpty(); } public void show(String html, Position position, String style) { @@ -214,8 +216,12 @@ public class VNotification extends VOverlay { } private NotificationTypeConfiguration getUiState(String style) { - return getApplicationConnection() - .getUIConnector().getState().notificationConfigurations + if (getApplicationConnection() == null + || getApplicationConnection().getUIConnector() == null) { + return null; + } + + return getApplicationConnection().getUIConnector().getState().notificationConfigurations .get(style); } diff --git a/client/src/com/vaadin/client/ui/VPopupView.java b/client/src/com/vaadin/client/ui/VPopupView.java index 34d1729177..2b680eb3c4 100644 --- a/client/src/com/vaadin/client/ui/VPopupView.java +++ b/client/src/com/vaadin/client/ui/VPopupView.java @@ -43,6 +43,7 @@ import com.vaadin.client.ComponentConnector; import com.vaadin.client.Util; import com.vaadin.client.VCaptionWrapper; import com.vaadin.client.VConsole; +import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.ShortcutActionHandler.ShortcutActionHandlerOwner; import com.vaadin.client.ui.popupview.VisibilityChangeEvent; import com.vaadin.client.ui.popupview.VisibilityChangeHandler; @@ -192,7 +193,8 @@ public class VPopupView extends HTML implements Iterable<Widget> { * (other than it being a VOverlay) is to be considered private and * potentially subject to change. */ - public class CustomPopup extends VOverlay { + public class CustomPopup extends VOverlay implements + StateChangeEvent.StateChangeHandler { private ComponentConnector popupComponentConnector = null; @@ -332,7 +334,9 @@ public class VPopupView extends HTML implements Iterable<Widget> { @Override public boolean remove(Widget w) { - + if (popupComponentConnector != null) { + popupComponentConnector.removeStateChangeHandler(this); + } popupComponentConnector = null; popupComponentWidget = null; captionWrapper = null; @@ -343,10 +347,15 @@ public class VPopupView extends HTML implements Iterable<Widget> { public void setPopupConnector(ComponentConnector newPopupComponent) { if (newPopupComponent != popupComponentConnector) { + if (popupComponentConnector != null) { + popupComponentConnector.removeStateChangeHandler(this); + } Widget newWidget = newPopupComponent.getWidget(); setWidget(newWidget); popupComponentWidget = newWidget; popupComponentConnector = newPopupComponent; + popupComponentConnector.addStateChangeHandler("height", this); + popupComponentConnector.addStateChangeHandler("width", this); } } @@ -360,6 +369,11 @@ public class VPopupView extends HTML implements Iterable<Widget> { return super.getContainerElement(); } + @Override + public void onStateChanged(StateChangeEvent stateChangeEvent) { + positionOrSizeUpdated(); + } + }// class CustomPopup public HandlerRegistration addVisibilityChangeHandler( diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index 180d0d771b..4a7fc1de0a 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1081,19 +1081,18 @@ public class VScrollTable extends FlowPanel implements HasWidgets, selected = true; keyboardSelectionOverRowFetchInProgress = true; } + if (selected) { + if (focusedRow == null + || !selectedRowKeys.contains(focusedRow + .getKey())) { + // The focus is no longer on a selected row, + // move focus to first selected row + setRowFocus(row); + } + } if (selected != row.isSelected()) { row.toggleSelection(); - if (selected) { - if (focusedRow == null - || !selectedRowKeys.contains(focusedRow - .getKey())) { - // The focus is no longer on a selected row, - // move focus to first selected row - setRowFocus(row); - } - } - if (!isSingleSelectMode() && !selected) { // Update selection range in case a row is // unselected from the middle of a range - #8076 @@ -1101,6 +1100,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } } } + } } unSyncedselectionsBeforeRowFetch = null; @@ -5301,17 +5301,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ public boolean isInViewPort() { int absoluteTop = getAbsoluteTop(); - int scrollPosition = scrollBodyPanel.getAbsoluteTop() - + scrollBodyPanel.getScrollPosition(); - if (absoluteTop < scrollPosition) { - return false; - } - int maxVisible = scrollPosition - + scrollBodyPanel.getOffsetHeight() - getOffsetHeight(); - if (absoluteTop > maxVisible) { - return false; - } - return true; + int absoluteBottom = absoluteTop + getOffsetHeight(); + int viewPortTop = scrollBodyPanel.getAbsoluteTop(); + int viewPortBottom = viewPortTop + + scrollBodyPanel.getOffsetHeight(); + return absoluteBottom > viewPortTop + && absoluteTop < viewPortBottom; } /** diff --git a/client/src/com/vaadin/client/ui/VTextArea.java b/client/src/com/vaadin/client/ui/VTextArea.java index cc77306100..edcb207bf9 100644 --- a/client/src/com/vaadin/client/ui/VTextArea.java +++ b/client/src/com/vaadin/client/ui/VTextArea.java @@ -33,7 +33,7 @@ import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.vaadin.client.BrowserInfo; import com.vaadin.client.Util; -import com.vaadin.client.ui.dd.VDragCloneAware; +import com.vaadin.client.ui.dd.DragImageModifier; /** * This class represents a multiline textfield (textarea). @@ -44,7 +44,7 @@ import com.vaadin.client.ui.dd.VDragCloneAware; * @author Vaadin Ltd. * */ -public class VTextArea extends VTextField implements VDragCloneAware { +public class VTextArea extends VTextField implements DragImageModifier { public static final String CLASSNAME = "v-textarea"; private boolean wordwrap = true; @@ -321,7 +321,7 @@ public class VTextArea extends VTextField implements VDragCloneAware { } @Override - public void initDragImageCopy(Element element) { + public void modifyDragImage(Element element) { // Fix for #13557 - drag image doesn't show original text area text. // It happens because "value" property is not copied into the cloned // element diff --git a/client/src/com/vaadin/client/ui/dd/VDragCloneAware.java b/client/src/com/vaadin/client/ui/dd/DragImageModifier.java index 8c1b17daec..f08c082a70 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragCloneAware.java +++ b/client/src/com/vaadin/client/ui/dd/DragImageModifier.java @@ -18,14 +18,14 @@ package com.vaadin.client.ui.dd; import com.google.gwt.dom.client.Element; /** - * Widget could implement this interface if drag image requires additional - * initialization/configuration. Method {@link #initDragImageCopy(Element)} - * allows to change/correct drag image element when element is dragged via DnD. + * Interface implemented by widgets if the drag image used for drag'n'drop + * requires additional initialization/configuration. The method + * {@link #modifyDragImage(Element)} is called for each element in the automatically generated drag image. * * @since 7.2 * @author Vaadin Ltd */ -public interface VDragCloneAware { +public interface DragImageModifier { /** * This method is called for cloned <code>element</code> which corresponds @@ -35,5 +35,5 @@ public interface VDragCloneAware { * @param element * cloned element of drag image */ - void initDragImageCopy(Element element); + void modifyDragImage(Element element); } diff --git a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java index 6044ee01cc..4ee19328d6 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java +++ b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java @@ -374,11 +374,10 @@ public class VDragAndDropManager { int typeInt = event.getTypeInt(); if (typeInt == -1 && event.getNativeEvent().getType() - .contains("MSPointer")) { + .toLowerCase().contains("pointer")) { /* - * Ignore MSPointer events, until they are - * properly used (might improve usability on - * touch devices). + * Ignore PointerEvents since IE10 and IE11 send + * also MouseEvents for backwards compatibility. */ return; } @@ -734,7 +733,7 @@ public class VDragAndDropManager { return dragElement; } - public void attachDragElement() { + private void attachDragElement() { if (dragElement != null && dragElement.getParentElement() == null) { ApplicationConnection connection = getCurrentDragApplicationConnection(); Element dragImageParent; diff --git a/client/src/com/vaadin/client/ui/dd/VDragEvent.java b/client/src/com/vaadin/client/ui/dd/VDragEvent.java index dc234de46d..6291a38e42 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragEvent.java +++ b/client/src/com/vaadin/client/ui/dd/VDragEvent.java @@ -285,13 +285,13 @@ public class VDragEvent { * Do additional content sync between <code>original</code> element and its * <code>copy</code> if needed. * - * @since 7.3 + * @since 7.2 * @param original * original element * @param copy * copy of original element */ - protected void syncContent(Element original, Element copy) { + private void syncContent(Element original, Element copy) { for (int i = 0; i < original.getChildCount(); i++) { Node child = original.getChild(i); if (child instanceof Element) { @@ -303,8 +303,8 @@ public class VDragEvent { private void doSyncContent(Element original, Element copy) { EventListener eventListener = Event.getEventListener(original); - if (eventListener instanceof VDragCloneAware) { - ((VDragCloneAware) eventListener).initDragImageCopy(copy); + if (eventListener instanceof DragImageModifier) { + ((DragImageModifier) eventListener).modifyDragImage(copy); } } diff --git a/common.xml b/common.xml index 17537899de..6e28ab6a60 100644 --- a/common.xml +++ b/common.xml @@ -32,12 +32,14 @@ <property name="filtered.webcontent.dir" location="${vaadin.basedir}/result/filteredWebContent" /> <property name="release-notes-tickets-file" location="${vaadin.basedir}/result/release-notes-tickets.html" /> + <property name="release-notes-authors-file" location="${vaadin.basedir}/result/release-notes-authors.html" /> - <target name="filter.webcontent" unless="webcontent.filtered" depends="fetch-release-notes-tickets"> + <target name="filter.webcontent" unless="webcontent.filtered" depends="fetch-release-notes-tickets,fetch-release-notes-authors"> <property name="webcontent.filtered" value="true" /> <!-- Running without build.release-notes will cause an error, which is ignored --> <loadfile property="release-notes-tickets" srcFile="${release-notes-tickets-file}" failonerror="false" /> + <loadfile property="release-notes-authors" srcFile="${release-notes-authors-file}" failonerror="false" /> <delete dir="${filtered.webcontent.dir}" /> <copy todir="${filtered.webcontent.dir}"> @@ -68,16 +70,27 @@ <replacetokens begintoken="@" endtoken="@"> <token key="release-notes-tickets" value="${release-notes-tickets}" /> </replacetokens> + <replacetokens begintoken="@" endtoken="@"> + <token key="release-notes-authors" value="${release-notes-authors}" /> + </replacetokens> </filterchain> </copy> </target> - <target name="fetch-release-notes-tickets" unless="built.release-notes" if="build.release-notes"> + <target name="fetch-release-notes-tickets" unless="built.release-notes-tickets" if="build.release-notes"> <mkdir dir="${vaadin.basedir}/result" /> <subant buildpath="${vaadin.basedir}/buildhelpers" target="fetch-release-notes-tickets" antfile="build.xml" inheritall="true"> <property name="output" location="${release-notes-tickets-file}" /> </subant> - <property name="built.release-notes" value="1" /> + <property name="built.release-notes-tickets" value="1" /> + </target> + + <target name="fetch-release-notes-authors" unless="built.release-notes-authors" if="build.release-notes"> + <mkdir dir="${vaadin.basedir}/result" /> + <subant buildpath="${vaadin.basedir}/buildhelpers" target="fetch-release-notes-authors" antfile="build.xml" inheritall="true"> + <property name="output" location="${release-notes-authors-file}" /> + </subant> + <property name="built.release-notes-authors" value="1" /> </target> <fileset dir="${filtered.webcontent.dir}" id="common.files.for.all.jars"> diff --git a/uitest/ivy.xml b/uitest/ivy.xml index f54ea7270e..020543c53f 100644 --- a/uitest/ivy.xml +++ b/uitest/ivy.xml @@ -83,6 +83,8 @@ <dependency org="junit" name="junit" rev="4.11" conf="build,ide -> default" /> + <dependency org="org.hamcrest" name="hamcrest-all" rev="1.3" + conf="build,ide->default" /> <dependency org="com.jcraft" name="jsch" rev="0.1.50" conf="ide, build->default" /> <dependency org="commons-codec" name="commons-codec" diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html deleted file mode 100644 index 81da3b897e..0000000000 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.html +++ /dev/null @@ -1,82 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> -<head profile="http://selenium-ide.openqa.org/profiles/test-case"> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> -<link rel="selenium.base" href="" /> -<title>Required error tootlip</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">Required error tooltip</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.orderedlayout.ErrorIndicator?restartApplication</td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span</td> - <td>43,4</td> -</tr> - -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipVertivcalCaption</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-4']/span[2]</td> - <td>3,6</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipVertivcalRequiredIndicator</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-6']/span</td> - <td>38,11</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipHorizontalCaption</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>showTooltip</td> - <td>//div[@id='gwt-uid-6']/span[2]</td> - <td>3,4</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>tooltipHorizontalRequiredIndicator</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java new file mode 100644 index 0000000000..0367a77c7e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java @@ -0,0 +1,41 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.orderedlayout; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ErrorIndicatorTest extends MultiBrowserTest { + + @Test + public void verifyTooltips() { + String tooltipText; + openTestURL(); + + $(TextFieldElement.class).first().showTooltip(); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Vertical layout tooltip"); + + $(TextFieldElement.class).get(1).showTooltip(); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Horizontal layout tooltip"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java new file mode 100644 index 0000000000..cf3854ee69 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpen.java @@ -0,0 +1,73 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Component; +import com.vaadin.ui.PopupView; +import com.vaadin.ui.VerticalLayout; + +/** + * Resizing PopupView's popup component while it is visible should also resize + * the drop shadow of the overlay. + * + * @author Vaadin Ltd + */ +public class PopupViewResizeWhileOpen extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + PopupView pv = new PopupView(new PopupView.Content() { + @Override + public Component getPopupComponent() { + final VerticalLayout popupComponent = new VerticalLayout(); + popupComponent.setId("content-vl"); + popupComponent.setWidth("640px"); + popupComponent.setHeight("480px"); + + Button button = new Button("Change height!", + new Button.ClickListener() { + @Override + public void buttonClick(Button.ClickEvent event) { + popupComponent.setHeight("320px"); + } + }); + + popupComponent.addComponent(button); + return popupComponent; + } + + @Override + public String getMinimizedValueAsHTML() { + return "Click me!"; + } + }); + pv.setHideOnMouseOut(false); + addComponent(pv); + } + + @Override + protected String getTestDescription() { + return "Resize PopupView's content component while visible"; + } + + @Override + protected Integer getTicketNumber() { + return 13666; + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java new file mode 100644 index 0000000000..52ffc6b729 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java @@ -0,0 +1,70 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.popupview; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.is; +import static org.hamcrest.Matchers.lessThan; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Dimension; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.PopupViewElement; +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Resizing PopupView's popup component while it is visible should also resize + * the drop shadow of the overlay. + * + * @author Vaadin Ltd + */ +public class PopupViewResizeWhileOpenTest extends MultiBrowserTest { + + @Test + public void testCustomPopupSizeAfterResize() { + openTestURL(); + + // Open PopupView + $(PopupViewElement.class).first().click(); + + // Shadow element + WebElement shadow = findElement(By.className("v-shadow")); + WebElement vl = $(VerticalLayoutElement.class).id("content-vl"); + + // Sanity check + assertShadowSize(vl, shadow); + + // Resize + $(ButtonElement.class).first().click(); + assertShadowSize(vl, shadow); + } + + private void assertShadowSize(WebElement layout, WebElement shadow) { + Dimension shadowSize = shadow.getSize(); + Dimension layoutSize = layout.getSize(); + + assertThat(shadowSize.height, is(greaterThan(layoutSize.height))); + assertThat(shadowSize.height, is(lessThan(layoutSize.height + 10))); + assertThat(shadowSize.width, is(greaterThan(layoutSize.width))); + assertThat(shadowSize.width, is(lessThan(layoutSize.width + 10))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java new file mode 100644 index 0000000000..4c0bea77ac --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItem.java @@ -0,0 +1,84 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Table; + +/** + * Test to see if the correct row gets the focus when the row is selected from + * the serverside and forces the table to scroll down + * + * @author Vaadin Ltd + */ +public class FocusOnSelectedItem extends AbstractTestUI { + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + + final Table table = new Table(); + table.setSelectable(true); + table.setImmediate(true); + + table.addContainerProperty("Property", String.class, null); + + for (int i = 0; i < 200; i++) { + table.addItem(new String[] { "Item " + i }, "Item " + i); + } + addComponent(table); + + Button button = new Button("Select"); + button.addClickListener(new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.setValue("Item 198"); + table.setCurrentPageFirstItemId("Item 198"); + table.focus(); + } + }); + addComponent(button); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test whether the selected row retains focus."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 10522; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java new file mode 100644 index 0000000000..14a0718325 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/FocusOnSelectedItemTest.java @@ -0,0 +1,66 @@ +/* + * Copyright 2000-2013 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.components.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if the correct row gets the focus when the row is selected from + * the serverside and forces the table to scroll down + * + * @author Vaadin Ltd + */ +public class FocusOnSelectedItemTest extends MultiBrowserTest { + + @Test + public void selectAndScrollFocusesSelectedRow() { + openTestURL(); + + WebElement selectButton = $(ButtonElement.class).caption("Select") + .first(); + selectButton.click(); + WebElement supposedlyFocusedRow = null; + WebElement selectedRow = null; + WebElement focusedStyleRow = null; + + Assert.assertTrue("No row was selected", + isElementPresent(By.className("v-selected"))); + + selectedRow = getDriver().findElement(By.className("v-selected")); + + supposedlyFocusedRow = $(TableElement.class).first().getCell(198, 0); + + Assert.assertTrue("Incorrect row was selected", selectedRow + .getLocation().getY() == supposedlyFocusedRow.getLocation() + .getY()); + + Assert.assertTrue("No row had the focused style.", + isElementPresent(By.className("v-table-focus"))); + + focusedStyleRow = getDriver() + .findElement(By.className("v-table-focus")); + Assert.assertTrue("Incorrect row has the focused style.", selectedRow + .getLocation().getY() == focusedStyleRow.getLocation().getY()); + + } +} diff --git a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java index e2af31c21b..941e988c5c 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java @@ -18,7 +18,8 @@ package com.vaadin.tests.integration; import java.io.IOException; import org.junit.Test; -import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.TableElement; /** * Base class for servlet integration tests. Automatically prepends "/demo" to @@ -33,28 +34,10 @@ public abstract class AbstractServletIntegrationTest extends public void runTest() throws IOException, AssertionError { openTestURL(); compareScreen("initial"); - - WebElement cell = vaadinElement(getTableCell(getTable(), 0, 1)); - testBenchElement(cell).click(51, 13); - + $(TableElement.class).first().getCell(0, 1).click(); compareScreen("finland"); } - private String getTableCell(String tableLocator, int row, int col) { - return tableLocator - + "/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[" - + row + "]/domChild[" + col + "]/domChild[0]"; - } - - protected String getTable() { - return "/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]"; - } - - /* - * (non-Javadoc) - * - * @see com.vaadin.tests.tb3.AbstractTB3Test#getDeploymentPath() - */ @Override protected String getDeploymentPath() { return "/demo" + super.getDeploymentPath(); diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index 990b350c97..1c18fb1912 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -38,6 +38,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; +import com.vaadin.tests.widgetset.client.SerializerTestState; import com.vaadin.tests.widgetset.client.SimpleTestBean; import com.vaadin.tests.widgetset.server.SerializerTestExtension; @@ -58,44 +59,110 @@ public class SerializerTest extends AbstractTestUI { SerializerTestRpc rpc = testExtension .getRpcProxy(SerializerTestRpc.class); + SerializerTestState state = testExtension.getState(); + rpc.sendBeanSubclass(new SimpleTestBean() { @Override public int getValue() { return 42; } }); + state.simpleTestBean = new SimpleTestBean() { + @Override + public int getValue() { + return 42; + } + }; + rpc.sendBoolean(true, Boolean.FALSE, new boolean[] { true, true, false, true, false, false }); + state.booleanValue = true; + state.booleanObjectValue = Boolean.FALSE; + state.booleanArray = new boolean[] { true, true, false, true, false, + false }; + rpc.sendByte((byte) 5, Byte.valueOf((byte) -12), new byte[] { 3, 1, 2 }); + state.byteValue = (byte) 5; + state.byteObjectValue = Byte.valueOf((byte) -12); + state.byteArray = new byte[] { 3, 1, 2 }; + rpc.sendChar('\u222b', Character.valueOf('å'), "aBcD".toCharArray()); + state.charValue = '\u222b'; + state.charObjectValue = Character.valueOf('å'); + state.charArray = "aBcD".toCharArray(); + rpc.sendInt(Integer.MAX_VALUE, Integer.valueOf(0), new int[] { 5, 7 }); + state.intValue = Integer.MAX_VALUE; + state.intObjectValue = Integer.valueOf(0); + state.intArray = new int[] { 5, 7 }; + rpc.sendLong(577431841358l, Long.valueOf(0), new long[] { -57841235865l, 57 }); + state.longValue = 577431841358l; + state.longObjectValue = Long.valueOf(0); + state.longArray = new long[] { -57841235865l, 57 }; + rpc.sendFloat(3.14159f, Float.valueOf(Math.nextUp(1)), new float[] { 57, 0, -12 }); + state.floatValue = 3.14159f; + state.floatObjectValue = Float.valueOf(Math.nextUp(1)); + state.floatArray = new float[] { 57, 0, -12 }; + rpc.sendDouble(Math.PI, Double.valueOf(-Math.E), new double[] { Double.MAX_VALUE, Double.MIN_VALUE }); + state.doubleValue = Math.PI; + state.doubleValue = Double.valueOf(-Math.E); + state.doubleArray = new double[] { Double.MAX_VALUE, Double.MIN_VALUE }; + rpc.sendString("This is a tesing string ‡"); + state.string = "This is a tesing string ‡"; + rpc.sendConnector(this); + state.connector = this; + rpc.sendBean( new ComplexTestBean(new SimpleTestBean(0), new SimpleTestBean(1), Arrays.asList( new SimpleTestBean(3), new SimpleTestBean(4)), 5), new SimpleTestBean(6), new SimpleTestBean[] { new SimpleTestBean(7) }); + state.complexTestBean = new ComplexTestBean(new SimpleTestBean(0), + new SimpleTestBean(1), Arrays.asList(new SimpleTestBean(3), + new SimpleTestBean(4)), 5); + state.simpleTestBean = new SimpleTestBean(6); + state.simpleTestBeanArray = new SimpleTestBean[] { new SimpleTestBean(7) }; + rpc.sendNull("Not null", null); + state.nullString = null; + rpc.sendNestedArray(new int[][] { { 5 }, { 7 } }, new SimpleTestBean[][] { { new SimpleTestBean(4), new SimpleTestBean(2) } }); + state.nestedIntArray = new int[][] { { 5 }, { 7 } }; + state.nestedBeanArray = new SimpleTestBean[][] { { + new SimpleTestBean(4), new SimpleTestBean(2) } }; + rpc.sendList(Arrays.asList(5, 8, -234), Arrays.<Connector> asList(this, testExtension), Arrays.asList(new SimpleTestBean(234), new SimpleTestBean(-568))); + state.intList = Arrays.asList(5, 8, -234); + state.connectorList = Arrays.<Connector> asList(this, testExtension); + state.simpleTestBeanList = Arrays.asList(new SimpleTestBean(234), + new SimpleTestBean(-568)); + rpc.sendArrayList( Arrays.asList(new int[] { 1, 2 }, new int[] { 3, 4 }), Arrays.asList(new Integer[] { 5, 6 }, new Integer[] { 7, 8 }), Collections .singletonList(new SimpleTestBean[] { new SimpleTestBean( 7) })); + state.primitiveArrayList = Arrays.asList(new int[] { 1, 2 }, new int[] { + 3, 4 }); + state.objectArrayList = Arrays.asList(new Integer[] { 5, 6 }, + new Integer[] { 7, 8 }); + state.beanArrayList = Collections + .singletonList(new SimpleTestBean[] { new SimpleTestBean(7) }); + // Disabled because of #8861 // rpc.sendListArray( // new List[] { Arrays.asList(1, 2), Arrays.asList(3, 4) }, @@ -103,6 +170,11 @@ public class SerializerTest extends AbstractTestUI { rpc.sendSet(new HashSet<Integer>(Arrays.asList(4, 7, 12)), Collections .singleton((Connector) this), new HashSet<SimpleTestBean>( Arrays.asList(new SimpleTestBean(1), new SimpleTestBean(2)))); + state.intSet = new HashSet<Integer>(Arrays.asList(4, 7, 12)); + state.connectorSet = Collections.singleton((Connector) this); + + state.beanSet = new HashSet<SimpleTestBean>(Arrays.asList( + new SimpleTestBean(1), new SimpleTestBean(2))); rpc.sendMap(new HashMap<String, SimpleTestBean>() { { @@ -125,6 +197,31 @@ public class SerializerTest extends AbstractTestUI { put(new SimpleTestBean(-4), new SimpleTestBean(4)); } }); + state.stringMap = new HashMap<String, SimpleTestBean>() { + { + put("1", new SimpleTestBean(1)); + put("2", new SimpleTestBean(2)); + } + }; + state.connectorMap = new HashMap<Connector, SimpleTestBean>() { + { + put(testExtension, new SimpleTestBean(3)); + put(getUI(), new SimpleTestBean(4)); + } + }; + state.intMap = new HashMap<Integer, Connector>() { + { + put(5, testExtension); + put(10, getUI()); + } + }; + state.beanMap = new HashMap<SimpleTestBean, SimpleTestBean>() { + { + put(new SimpleTestBean(5), new SimpleTestBean(-5)); + put(new SimpleTestBean(-4), new SimpleTestBean(4)); + } + }; + rpc.sendWrappedGenerics(new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>() { { put(Collections.singleton(new SimpleTestBean(42)), @@ -136,13 +233,32 @@ public class SerializerTest extends AbstractTestUI { }); } }); + state.generics = new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>() { + { + put(Collections.singleton(new SimpleTestBean(42)), + new HashMap<Integer, List<SimpleTestBean>>() { + { + put(1, Arrays.asList(new SimpleTestBean(1), + new SimpleTestBean(3))); + } + }); + } + }; rpc.sendEnum(ContentMode.TEXT, new ContentMode[] { ContentMode.PREFORMATTED, ContentMode.XML }, Arrays.asList(ContentMode.HTML, ContentMode.RAW)); + state.contentMode = ContentMode.TEXT; + state.array = new ContentMode[] { ContentMode.PREFORMATTED, + ContentMode.XML }; + state.list = Arrays.asList(ContentMode.HTML, ContentMode.RAW); + rpc.sendDate(new Date(1)); rpc.sendDate(new Date(2013 - 1900, 5 - 1, 31, 11, 12, 13)); + state.date1 = new Date(1); + state.date2 = new Date(2013 - 1900, 5 - 1, 31, 11, 12, 13); + testExtension.registerRpc(new SerializerTestRpc() { @Override public void sendBoolean(boolean value, Boolean boxedValue, @@ -331,6 +447,12 @@ public class SerializerTest extends AbstractTestUI { log.log("sendDate: " + format.format(date)); } + @Override + public void log(String string) { + log.log(string); + + } + }); } diff --git a/uitest/src/com/vaadin/tests/util/TestUtils.java b/uitest/src/com/vaadin/tests/util/TestUtils.java index dcd28c3413..5c6315a23a 100644 --- a/uitest/src/com/vaadin/tests/util/TestUtils.java +++ b/uitest/src/com/vaadin/tests/util/TestUtils.java @@ -99,13 +99,22 @@ public class TestUtils { "YE", "ZAMBIA", "ZM", "ZIMBABWE", "ZW" }; /** - * Injects css into the current window. Can be used to keep tests css in - * source files. + * Crossbrowser hack to dynamically add css current window. Can be used to + * keep tests css in source files. * * @param cssString */ public static void injectCSS(UI w, String cssString) { - w.getPage().getStyles().add(cssString); + String script = "if ('\\v'=='v') /* ie only */ {\n" + + " document.createStyleSheet().cssText = '" + + cssString + + "';\n" + + " } else {var tag = document.createElement('style'); tag.type = 'text/css';" + + " document.getElementsByTagName('head')[0].appendChild(tag);tag[ (typeof " + + "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' " + + ": 'innerHTML'] = '" + cssString + "';}"; + + w.getPage().getJavaScript().execute(script); } public static void installPerformanceReporting(TextArea targetTextArea) { diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java index f1917aaeb9..0ef4b664ac 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java @@ -257,6 +257,11 @@ public class SerializerTestConnector extends AbstractExtensionConnector { public void sendDate(Date date) { rpc.sendDate(date); } + + @Override + public void log(String message) { + // Do nothing, used only in the other direction + } }); } @@ -271,13 +276,80 @@ public class SerializerTestConnector extends AbstractExtensionConnector { } @Override - public ComplexTestBean getState() { - return (ComplexTestBean) super.getState(); + public SerializerTestState getState() { + return (SerializerTestState) super.getState(); } @Override public void onStateChanged(StateChangeEvent stateChangeEvent) { - // TODO do something clever + rpc.log("state.booleanValue: " + getState().booleanValue); + rpc.log("state.booleanObjectValue: " + getState().booleanObjectValue); + rpc.log("state.booleanArray: " + getState().booleanArray); + + rpc.log("state.byteValue: " + getState().byteValue); + rpc.log("state.byteObjectValue: " + getState().byteObjectValue); + rpc.log("state.byteArray: " + getState().byteArray); + + rpc.log("state.charValue: " + getState().charValue); + rpc.log("state.charObjectValue: " + getState().charObjectValue); + rpc.log("state.charArray: " + String.valueOf(getState().charArray)); + + rpc.log("state.intValue: " + getState().intValue); + rpc.log("state.intObjectValue: " + getState().intObjectValue); + rpc.log("state.intArray: " + getState().intArray); + + rpc.log("state.longValue: " + getState().longValue); + rpc.log("state.longObjectValue: " + getState().longObjectValue); + rpc.log("state.longArray: " + getState().longArray); + + rpc.log("state.floatValue: " + getState().floatValue); + rpc.log("state.floatObjectValue: " + getState().floatObjectValue); + rpc.log("state.floatArray: " + getState().floatArray); + + rpc.log("state.doubleValue: " + getState().doubleValue); + rpc.log("state.doubleObjectValue: " + getState().doubleObjectValue); + rpc.log("state.doubleArray: " + getState().doubleArray); + + /* + * TODO public double doubleValue; public Double DoubleValue; public + * double[] doubleArray; ; + * + * public String string; + * + * public String nullString; + * + * public Connector connector; + * + * public ComplexTestBean complexTestBean; public SimpleTestBean + * simpleTestBean; public SimpleTestBean[] simpleTestBeanArray; public + * int[][] nestedIntArray; public SimpleTestBean[][] nestedBeanArray; + * + * public List<Integer> intList; public List<Connector> connectorList; + * public List<SimpleTestBean> simpleTestBeanList; + * + * public List<int[]> primitiveArrayList; public List<Integer[]> + * objectArrayList; public List<SimpleTestBean[]> beanArrayList; + * + * public List<Integer>[] objectListArray; public List<SimpleTestBean>[] + * beanListArray; + * + * public Set<Integer> intSet; public Set<Connector> connectorSet; + * public Set<SimpleTestBean> beanSet; + * + * public Map<String, SimpleTestBean> stringMap; public Map<Connector, + * SimpleTestBean> connectorMap; public Map<Integer, Connector> intMap; + * public Map<SimpleTestBean, SimpleTestBean> beanMap; + * + * public Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> + * generics; + * + * public ContentMode contentMode; public ContentMode[] array; public + * List<ContentMode> list; + * + * public SimpleTestBean bean; + * + * public Date date1; public Date date2; + */ } @Override diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java index 1c0784d8b4..6b4c4e7ac1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java @@ -81,4 +81,6 @@ public interface SerializerTestRpc extends ServerRpc, ClientRpc { public void sendBeanSubclass(SimpleTestBean bean); public void sendDate(Date date); + + public void log(String string); } diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java new file mode 100644 index 0000000000..d22165b2bb --- /dev/null +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestState.java @@ -0,0 +1,100 @@ +/* + * Copyright 2000-2014 Vaadin Ltd. + * + * Licensed under the Apache License; Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing; software + * distributed under the License is distributed on an "AS IS" BASIS; WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND; either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.tests.widgetset.client; + +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import com.vaadin.shared.AbstractComponentState; +import com.vaadin.shared.Connector; +import com.vaadin.shared.ui.label.ContentMode; + +public class SerializerTestState extends AbstractComponentState { + + public boolean booleanValue; + public Boolean booleanObjectValue; + public boolean[] booleanArray; + + public byte byteValue; + public Byte byteObjectValue; + public byte[] byteArray; + + public char charValue; + public Character charObjectValue; + public char[] charArray; + + public int intValue; + public Integer intObjectValue; + public int[] intArray; + + public long longValue; + public Long longObjectValue; + public long[] longArray; + + public float floatValue; + public Float floatObjectValue; + public float[] floatArray; + + public double doubleValue; + public Double doubleObjectValue; + public double[] doubleArray; + + public String string; + + public String nullString; + + public Connector connector; + + public ComplexTestBean complexTestBean; + public SimpleTestBean simpleTestBean; + public SimpleTestBean[] simpleTestBeanArray; + public int[][] nestedIntArray; + public SimpleTestBean[][] nestedBeanArray; + + public List<Integer> intList; + public List<Connector> connectorList; + public List<SimpleTestBean> simpleTestBeanList; + + public List<int[]> primitiveArrayList; + public List<Integer[]> objectArrayList; + public List<SimpleTestBean[]> beanArrayList; + + public List<Integer>[] objectListArray; + public List<SimpleTestBean>[] beanListArray; + + public Set<Integer> intSet; + public Set<Connector> connectorSet; + public Set<SimpleTestBean> beanSet; + + public Map<String, SimpleTestBean> stringMap; + public Map<Connector, SimpleTestBean> connectorMap; + public Map<Integer, Connector> intMap; + public Map<SimpleTestBean, SimpleTestBean> beanMap; + + public Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics; + + public ContentMode contentMode; + public ContentMode[] array; + public List<ContentMode> list; + + public SimpleTestBean bean; + + public Date date1; + public Date date2; + +} diff --git a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java index c42b8749c2..5fc5c19497 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java @@ -18,8 +18,8 @@ package com.vaadin.tests.widgetset.server; import com.vaadin.server.AbstractExtension; import com.vaadin.shared.communication.ClientRpc; -import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; +import com.vaadin.tests.widgetset.client.SerializerTestState; public class SerializerTestExtension extends AbstractExtension { @@ -29,8 +29,8 @@ public class SerializerTestExtension extends AbstractExtension { } @Override - public ComplexTestBean getState() { - return (ComplexTestBean) super.getState(); + public SerializerTestState getState() { + return (SerializerTestState) super.getState(); } public void registerRpc(SerializerTestRpc rpc) { |