diff options
author | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-03 12:58:56 +0300 |
---|---|---|
committer | Jouni Koivuviita <jouni@vaadin.com> | 2014-06-03 15:09:11 +0300 |
commit | ad452a36795b764aeea2b00e3ceed2bae75d7949 (patch) | |
tree | 9b522f8b93464520430d839ab1608fa372efe23a | |
parent | e65231e6028892bd6847777c5bad982b73278b14 (diff) | |
parent | 44eadeaa160152616152cd33f8181d7ab1fa3359 (diff) | |
download | vaadin-framework-ad452a36795b764aeea2b00e3ceed2bae75d7949.tar.gz vaadin-framework-ad452a36795b764aeea2b00e3ceed2bae75d7949.zip |
Merge branch 'master' into valo
Conflicts:
WebContent/release-notes.html
build.properties
client/src/com/vaadin/client/ApplicationConfiguration.java
Change-Id: I36f075a03350e45c8666832142d7368891af3e59
1748 files changed, 22002 insertions, 5242 deletions
diff --git a/.settings/org.eclipse.jdt.ui.prefs b/.settings/org.eclipse.jdt.ui.prefs index 4f3b6f7ed3..095a6ca1ed 100644 --- a/.settings/org.eclipse.jdt.ui.prefs +++ b/.settings/org.eclipse.jdt.ui.prefs @@ -3,7 +3,7 @@ editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true formatter_profile=_Vaadin Java Conventions 20110923 formatter_settings_version=12 org.eclipse.jdt.ui.javadoc=true -org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * \n * @since \n * @author Vaadin Ltd\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * @since\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * Copyright 2000-2013 Vaadin Ltd.\n * \n * Licensed under the Apache License, Version 2.0 (the "License"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http\://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> +org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\n * @return the ${bare_field_name}\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\n * @param ${param} the ${bare_field_name} to set\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\n * ${tags}\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\n * \n */</template><template autoinsert\="false" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\n * \n * @since \n * @author Vaadin Ltd\n * ${tags}\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\n * \n */</template><template autoinsert\="false" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\n * @since\n * ${tags}\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\n * ${see_to_overridden}\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\n * ${tags}\n * ${see_to_target}\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">/*\n * Copyright 2000-2014 Vaadin Ltd.\n * \n * Licensed under the Apache License, Version 2.0 (the "License"); you may not\n * use this file except in compliance with the License. You may obtain a copy of\n * the License at\n * \n * http\://www.apache.org/licenses/LICENSE-2.0\n * \n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations under\n * the License.\n */\n${package_declaration}\n\n${typecomment}\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates> sp_cleanup.add_default_serial_version_id=true sp_cleanup.add_generated_serial_version_id=false sp_cleanup.add_missing_annotations=true diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs index 9e3833bbc9..84f66c16b8 100644 --- a/.settings/org.eclipse.wst.validation.prefs +++ b/.settings/org.eclipse.wst.validation.prefs @@ -1,10 +1,10 @@ DELEGATES_PREFERENCE=delegateValidatorList USER_BUILD_PREFERENCE=enabledBuildValidatorList USER_MANUAL_PREFERENCE=enabledManualValidatorList -USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.401.v201209052200 +USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationtrueversion1.2.500.v201303130500 eclipse.preferences.version=1 override=true -suspend=false +suspend=true vals/org.eclipse.wst.html.core.HTMLValidator/global=TF01 vals/org.eclipse.wst.jsdt.web.core.JsBatchValidator/global=TF02 vf.version=3 @@ -1,3 +1,16 @@ +Vaadin +====== +*[Vaadin](https://vaadin.com) is a Java framework for building modern web applications that look great, perform well and make you and your users happy.* + +For instructions about _using_ Vaadin to develop applications, please refer to +https://vaadin.com/learn + +To contribute, first refer to https://vaadin.com/wiki/-/wiki/Main/Contributing+Code +for general instructions and requirements for contributing code to the Vaadin framework. + +Instructions on how to set up a working environment for developing the Vaadin +framework follow below. + Cloning the project repositories ====== @@ -6,7 +19,7 @@ Vaadin 7 consists of three separate repositories * https://github.com/vaadin/gwt.git * https://github.com/vaadin/gwt-tools.git -Start by cloning these repositories into the same folder: +Start by cloning these repositories **into the same folder**: <pre><code>git clone https://github.com/vaadin/vaadin.git git clone https://github.com/vaadin/gwt.git git clone https://github.com/vaadin/gwt-tools.git</code></pre> @@ -21,7 +34,7 @@ Assuming you have cloned the repositories as described in “Cloning the project Start Eclipse ------------- -Start Eclipse and use the root checkout folder (the one containing the *vaadin*, *gwt* and *gwt-tools* folders) as the workspace folder +Start Eclipse and **use the root checkout folder** (the one containing the *vaadin*, *gwt* and *gwt-tools* folders) **as the workspace folder** Install IvyDE --------- @@ -31,7 +44,7 @@ You'll need the Apache Ivy plug-in for Eclipse to build the project later on, in 1. Enter `http://www.apache.org/dist/ant/ivyde/updatesite` in the "Work with:" text field 1. Select and install all items -If you have installed IvyDE via the Eclipse Marketplace previously, make sure that you also have *Apache Ivy Ant Targets* installed, which is not included in that IvyDE installation: +If you have installed IvyDE via the Eclipse Marketplace previously, **make sure** that you also have *Apache Ivy Ant Tasks* installed, which is not included in that IvyDE installation: 1. Go to *Help* -> *Install New Software...* 1. Click the hyperlink in the "What is already installed?" sentence near the bottom right-hand corner @@ -51,7 +64,7 @@ Set up the Workspace and define required variables for projects 1. Go to *Java* -> *Build Path* -> *Classpath Variables* 1. Add two new variables 1. GWT_TOOLS referring to the gwt-tools folder containing the dependency jars - 1. JDK_HOME referring to your jdk installation directory + 1. JDK_HOME referring to your jdk installation directory ![GWT_TOOLS](http://f.cl.ly/items/1k2Z1n2v0p0y3l0X0D1G/ClasspathVars.png "Defining GWT_TOOLS") 1. Go to Java -> Compiler 1. Check that the compliance level has been set to 1.6 @@ -88,14 +101,14 @@ Note that the first compilation takes a while to finish as Ivy downloads depende Compiling the Default Widget Set and Themes -------- -Compile the default widget set by executing the default target in build/ide.xml in the vaadin project. +Compile the default widget set by executing the default target in build/ide.xml in the vaadin project. In Eclipse this is done by opening build/ide.xml, right clicking on it and choosing *Run As* -> *Ant Build*. ![CompileWidgetSet](http://cl.ly/image/1R43162b282e/build.png "Compiling the Widget Set") Running a UI test ------ -The *vaadin* project includes an embedded Jetty which is used for running the UI tests. -It is a standard Java application: *com.vaadin.launcher.DevelopmentServerLauncher*. +The *vaadin* project includes an embedded Jetty which is used for running the UI tests. +It is a standard Java application: *com.vaadin.launcher.DevelopmentServerLauncher*. Launch it in debug mode in Eclipse by right clicking on it and selecting *Debug As* -> *Java Application*. This launches a Jetty on port 8888 which allows you to run any UI class in the project by opening http://localhost:8888/run/<UI class name>?restartApplication in your browser, e.g. [http://localhost:8888/run/com.vaadin.tests.components.label.LabelModes?restartApplication](http://localhost:8888/run/com.vaadin.tests.components.label.LabelModes?restartApplication) (Add ?restartApplication to ensure). @@ -108,11 +121,11 @@ The JUnit tests for the projects can be run using Running this in the *gwt* directory will run the GWT JUnit tests. Running it in the *vaadin* directory will run the Vaadin JUnit tests. -Running the Vaadin TestBench tests currently requires access to a correctly configured TestBench 2 cluster, only available inside Vaadin. +Note that the included Vaadin TestBench (browser) tests currently requires access to a TestBench cluster, which is currently only available internally at Vaadin Ltd. Building a package ===== -The distribution files can be built in a few steps. First build the *gwt* project by running +The distribution files can be built in a few steps. First build the *gwt* project by running <pre><code>ant</code></pre> in the *gwt* directory. The elemental package needs to be built separately: <pre><code>ant elemental</code></pre> @@ -123,4 +136,3 @@ Move to the *vaadin* project directory and unpack the previously built gwt jars Then build the *vaadin* project by running <pre><code>ant</code></pre> in the *vaadin* directory. - 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/VAADIN/themes/base/treetable/treetable.scss b/WebContent/VAADIN/themes/base/treetable/treetable.scss index 934e66097c..e4d41eefa8 100644 --- a/WebContent/VAADIN/themes/base/treetable/treetable.scss +++ b/WebContent/VAADIN/themes/base/treetable/treetable.scss @@ -26,7 +26,6 @@ .#{$primaryStyleName} .v-table-row .v-table-cell-content, .#{$primaryStyleName} .v-table-row-odd .v-table-cell-content { - position: relative; z-index: 10; } diff --git a/WebContent/VAADIN/themes/tests-table/styles.css b/WebContent/VAADIN/themes/tests-table/styles.css new file mode 100644 index 0000000000..78193c0982 --- /dev/null +++ b/WebContent/VAADIN/themes/tests-table/styles.css @@ -0,0 +1,5 @@ +@import url(../reindeer/legacy-styles.css); + +.v-table-footer-container, .v-table-cell-wrapper { + text-align: center; +} diff --git a/WebContent/VAADIN/vaadinBootstrap.js b/WebContent/VAADIN/vaadinBootstrap.js index bab759b812..df46d8bc72 100644 --- a/WebContent/VAADIN/vaadinBootstrap.js +++ b/WebContent/VAADIN/vaadinBootstrap.js @@ -67,7 +67,7 @@ // "v-app-loading" we have only received the HTML // but not yet started the widget set // (UIConnector removes the v-app-loading div). - if (className && className.contains("v-app-loading")) { + if (className && className.indexOf("v-app-loading") != -1) { return false; } } @@ -108,29 +108,29 @@ // No special url defined, use the same URL that loaded this page (without the fragment) url = window.location.href.replace(/#.*/,''); } - url += ((/\?/).test(url) ? "&" : "?") + "v-browserDetails=1"; + // Timestamp to avoid caching + url += ((/\?/).test(url) ? "&" : "?") + "v-" + (new Date()).getTime(); + + var params = "v-browserDetails=1"; var rootId = getConfig("v-rootId"); if (rootId !== undefined) { - url += "&v-rootId=" + rootId; + params += "&v-rootId=" + rootId; } // Tell the UI what theme it is configured to use var theme = getConfig('theme'); if (theme !== undefined) { - url += '&theme=' + encodeURIComponent(theme); + params += '&theme=' + encodeURIComponent(theme); } - url += "&v-appId=" + appId; + params += "&v-appId=" + appId; var extraParams = getConfig('extraParams') if (extraParams !== undefined) { - url += extraParams; + params += extraParams; } - url += '&' + vaadin.getBrowserDetailsParameters(appId); - - // Timestamp to avoid caching - url += '&v-' + (new Date()).getTime(); + params += '&' + vaadin.getBrowserDetailsParameters(appId); var r; try { @@ -168,7 +168,9 @@ } } }; - r.send(null); + // send parameters as POST data + r.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); + r.send(params); log('sending request to ', url); }; @@ -229,18 +231,21 @@ loadTheme: loadTheme, registerWidgetset: function(widgetset, callback) { log("Widgetset registered", widgetset); - widgetsets[widgetset].callback = callback; - for(var i = 0; i < widgetsets[widgetset].pendingApps.length; i++) { - var appId = widgetsets[widgetset].pendingApps[i]; - log("Starting from register widgetset", appId); - callback(appId); + var ws = widgetsets[widgetset]; + if (ws && ws.pendingApps) { + ws.callback = callback; + for(var i = 0; i < ws.pendingApps.length; i++) { + var appId = ws.pendingApps[i]; + log("Starting from register widgetset", appId); + callback(appId); + } + ws.pendingApps = null; } - widgetsets[widgetset].pendingApps = null; }, getBrowserDetailsParameters: function(parentElementId) { // Screen height and width - var url = 'v-sh=' + window.screen.height; - url += '&v-sw=' + window.screen.width; + var params = 'v-sh=' + window.screen.height; + params += '&v-sw=' + window.screen.width; // Window height and width var cw = 0; @@ -254,12 +259,12 @@ cw = document.documentElement.clientWidth; ch = document.documentElement.clientHeight; } - url += '&v-cw=' + cw + '&v-ch=' + ch; + params += '&v-cw=' + cw + '&v-ch=' + ch; var d = new Date(); - url += '&v-curdate=' + d.getTime(); + params += '&v-curdate=' + d.getTime(); var tzo1 = d.getTimezoneOffset(); // current offset var dstDiff = 0; @@ -276,29 +281,29 @@ } // Time zone offset - url += '&v-tzo=' + tzo1; + params += '&v-tzo=' + tzo1; // DST difference - url += '&v-dstd=' + dstDiff; + params += '&v-dstd=' + dstDiff; // Raw time zone offset - url += '&v-rtzo=' + rtzo; + params += '&v-rtzo=' + rtzo; // DST in effect? - url += '&v-dston=' + (tzo1 != rtzo); + params += '&v-dston=' + (tzo1 != rtzo); var pe = document.getElementById(parentElementId); if (pe) { - url += '&v-vw=' + pe.offsetWidth; - url += '&v-vh=' + pe.offsetHeight; + params += '&v-vw=' + pe.offsetWidth; + params += '&v-vh=' + pe.offsetHeight; } // Location - url += '&v-loc=' + encodeURIComponent(location.href); + params += '&v-loc=' + encodeURIComponent(location.href); // Window name if (window.name) { - url += '&v-wn=' + encodeURIComponent(window.name); + params += '&v-wn=' + encodeURIComponent(window.name); } // Detect touch device support @@ -313,10 +318,10 @@ } if (supportsTouch) { - url += "&v-td=1"; + params += "&v-td=1"; } - return url; + return params; } }; 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 eeeea1071d..356675726e 100644 --- a/WebContent/release-notes.html +++ b/WebContent/release-notes.html @@ -41,11 +41,12 @@ <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 @version-minor@</a></li> + <li><a href="#knownissues">Known issues in + @version-minor@</a></li> <li><a href="#limitations">Limitations in @version-minor@</a></li> <li><a href="#vaadin">Vaadin Installation</a></li> @@ -64,67 +65,28 @@ <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 @@ -196,6 +158,18 @@ $v-app-background-color: hsl(200, 50%, 50%); <code>$ sass styles.scss styles.css</code></li> </ul> + <h3 id="knownissues">Known issues</h3> + <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> <ul> <li><p>It is currently not possible to specify <tt>font-size</tt> @@ -210,17 +184,13 @@ $v-app-background-color: hsl(200, 50%, 50%); 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> @@ -247,8 +217,7 @@ $v-app-background-color: hsl(200, 50%, 50%); <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> @@ -385,30 +354,7 @@ $v-app-background-color: hsl(200, 50%, 50%); 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> @@ -418,11 +364,8 @@ $v-app-background-color: hsl(200, 50%, 50%); 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 @@ -461,12 +404,9 @@ $v-app-background-color: hsl(200, 50%, 50%); 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"> @@ -584,6 +524,7 @@ $v-app-background-color: hsl(200, 50%, 50%); <li>Liferay Portal 5.2-6</li> <li>GateIn Portal 3</li> <li>eXo Platform 3</li> + <li>IBM WebSphere Portal 8</li> </ul> <p> @@ -591,16 +532,16 @@ $v-app-background-color: hsl(200, 50%, 50%); </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-24</li> - <li>Mozilla Firefox 17 ESR</li> - <li>Internet Explorer 8-10</li> - <li>Safari 6</li> - <li>Opera 12,16</li> - <li>Google Chrome 23-29</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> + <li>Opera 12, 16-20</li> + <li>Google Chrome 23-34</li> </ul> <p> @@ -611,6 +552,7 @@ $v-app-background-color: hsl(200, 50%, 50%); <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> @@ -642,9 +584,10 @@ $v-app-background-color: hsl(200, 50%, 50%); <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 374b1a8345..c041d3639c 100644 --- a/build.properties +++ b/build.properties @@ -1,9 +1,9 @@ javadoc.doctitle=<h1>Vaadin</h1> -javadoc.bottom=<i>Copyright © 2000-2011 Vaadin Ltd. All Rights Reserved.</i> +javadoc.bottom=<i>Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.</i> ivy.organisation=com.vaadin 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.4 -commons-io.version=2.4
\ No newline at end of file +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/CompileTheme.java b/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java index 06b941f522..0fa4a7e8ab 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/CompileTheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 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 fb7b672b21..028880b2e1 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/FetchReleaseNotesTickets.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/GeneratePackageExports.java b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java index 78ab0748ed..9dd51f8c6d 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/GeneratePackageExports.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java b/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java index 688af4b591..9e9b29c4a1 100644 --- a/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java +++ b/buildhelpers/src/com/vaadin/buildhelpers/ManifestWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -156,4 +156,4 @@ public class ManifestWriter { public byte[] getBytes() { return buffer.toString().getBytes(); } -}
\ No newline at end of file +} 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/checkstyle/header b/checkstyle/header index 511f77e5ba..a1063268ac 100644 --- a/checkstyle/header +++ b/checkstyle/header @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -12,4 +12,4 @@ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations under * the License. - */
\ No newline at end of file + */ diff --git a/checkstyle/vaadin-checkstyle.xml b/checkstyle/vaadin-checkstyle.xml index 1caf480582..9dfe1c9156 100644 --- a/checkstyle/vaadin-checkstyle.xml +++ b/checkstyle/vaadin-checkstyle.xml @@ -90,6 +90,8 @@ <module name="Header"> <property name="headerFile" value="${checkstyle.header.file}" /> <property name="fileExtensions" value="java" /> + <!-- ignore empty lines that may or may not have trailing white-space --> + <property name="ignoreLines" value="3, 7, 9"/> </module> <module name="TreeWalker"> diff --git a/client-compiled/build.xml b/client-compiled/build.xml index 448c9799cd..78757f5ceb 100644 --- a/client-compiled/build.xml +++ b/client-compiled/build.xml @@ -85,7 +85,8 @@ <arg value="-localWorkers" /> <arg value="${localWorkers}" /> <arg value="-strict" /> - <arg value="-XenableClosureCompiler" /> + <!-- Disabled for now as it breaks code, e.g. ButtonWithShortcutNotRendered --> + <!-- <arg value="-XenableClosureCompiler" />--> <arg line="${extraParams}" /> <arg value="${module}" /> diff --git a/client-compiler/ivy.xml b/client-compiler/ivy.xml index 8c45597214..0b87069f2c 100644 --- a/client-compiler/ivy.xml +++ b/client-compiler/ivy.xml @@ -45,10 +45,15 @@ <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-annotations" rev="8.1.12.v20130726" conf="build,ide -> default"> <exclude org="org.eclipse.jetty.orbit"></exclude> </dependency> + <dependency org="org.eclipse.jetty" name="jetty-servlets" + 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 +61,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/sass/linker/SassLinker.java b/client-compiler/src/com/vaadin/sass/linker/SassLinker.java index 3183f4bfe7..dda6733384 100644 --- a/client-compiler/src/com/vaadin/sass/linker/SassLinker.java +++ b/client-compiler/src/com/vaadin/sass/linker/SassLinker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java b/client-compiler/src/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java index ae7e117965..b7850e6370 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/AcceptCriteriaFactoryGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java index 9b00142534..cc1841ec05 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/ConnectorBundleLoaderFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/ArraySerializer.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java index 38d97e9751..6ffd6c5462 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ArraySerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java index c966f7f65e..856f67657f 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ClientRpcVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -29,6 +29,7 @@ public class ClientRpcVisitor extends TypeVisitor { @Override public void visitClientRpc(TreeLogger logger, JClassType type, ConnectorBundle bundle) throws UnableToCompleteException { + checkGenericType(logger, type); Set<? extends JClassType> hierarchy = type .getFlattenedSupertypeHierarchy(); for (JClassType subType : hierarchy) { @@ -47,6 +48,17 @@ public class ClientRpcVisitor extends TypeVisitor { } } + public static void checkGenericType(TreeLogger logger, JClassType type) + throws UnableToCompleteException { + if (type.isGenericType() != null) { + logger.log(Type.ERROR, + "Type " + type.getParameterizedQualifiedSourceName() + + "is parameterizied generic. RPC proxy " + + "for parameterizied types is not supported."); + throw new UnableToCompleteException(); + } + } + public static void checkReturnType(TreeLogger logger, JMethod method) throws UnableToCompleteException { if (!method.getReturnType().getQualifiedSourceName().equals("void")) { diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java index f762a484b7..8a4ca8f795 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java index 293a6ca613..ea3b097fa2 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorInitVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java index 00a19d2656..bb3dd4f61d 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/CustomSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java index cd6eebddd1..18e9652ed1 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/EnumSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 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 e9ff4587fb..6c242dfd74 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/FieldProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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-compiler/src/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java index 53b0022fd0..6afb172ea2 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/GeneratedSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java index 69445b3cc1..0509689850 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/JsonSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java index 1d9deef265..32aad92774 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/MethodProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java index ea3e639486..1c0da9d9e8 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/OnStateChangeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/Property.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/Property.java index 381af23b42..f07b1c29fd 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/Property.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/Property.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java index 651596c9cf..6ad0d2fd98 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ServerRpcVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -28,6 +28,7 @@ public class ServerRpcVisitor extends TypeVisitor { @Override public void visitServerRpc(TreeLogger logger, JClassType type, ConnectorBundle bundle) throws UnableToCompleteException { + ClientRpcVisitor.checkGenericType(logger, type); bundle.setNeedsProxySupport(type); Set<? extends JClassType> superTypes = type diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java index f58d1c5d40..046c5c4611 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/StateInitVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java index aae610cdcd..028e4cc44d 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/TypeVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java index bac7f5a0f7..e3fee8d9ee 100644 --- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java +++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/WidgetInitVisitor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client-compiler/src/com/vaadin/tools/WidgetsetCompiler.java b/client-compiler/src/com/vaadin/tools/WidgetsetCompiler.java index e57468c675..7c06e9d7af 100755 --- a/client-compiler/src/com/vaadin/tools/WidgetsetCompiler.java +++ b/client-compiler/src/com/vaadin/tools/WidgetsetCompiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/Vaadin.gwt.xml b/client/src/com/vaadin/Vaadin.gwt.xml index d4eb454e86..711729f64f 100644 --- a/client/src/com/vaadin/Vaadin.gwt.xml +++ b/client/src/com/vaadin/Vaadin.gwt.xml @@ -1,4 +1,3 @@ - <module> <!-- This GWT module inherits all Vaadin client side functionality modules. This is the module you want to inherit in your client side project to be @@ -64,4 +63,38 @@ <!-- Remove IE6/IE7 permutation as they are not supported --> <set-property name="user.agent" value="ie8,ie9,ie10,gecko1_8,safari,opera" /> + <!-- Pointer event support --> + <define-property name="modernie" values="none,yes" /> + <property-provider name="modernie"><![CDATA[ + { + var ua = $wnd.navigator.userAgent; + if (ua.indexOf('IE') == -1 && ua.indexOf('Trident') != -1) { return 'yes'; } + return 'none'; + } + ]]></property-provider> + + <set-property name="modernie" value="none"> + <none> + <when-property-is name="user.agent" value="gecko1_8" /> + </none> + </set-property> + + <!-- Fall through to this rule when the browser doesn't support pointer + event --> + <replace-with class="com.vaadin.client.event.PointerEventSupportImpl"> + <when-type-is class="com.vaadin.client.event.PointerEventSupportImpl" /> + </replace-with> + + <replace-with + class="com.vaadin.client.event.PointerEventSupportImplModernIE"> + <when-type-is class="com.vaadin.client.event.PointerEventSupportImpl" /> + <none> + <when-property-is value="none" name="modernie" /> + </none> + </replace-with> + + <replace-with class="com.vaadin.client.event.PointerEventSupportImplIE10"> + <when-type-is class="com.vaadin.client.event.PointerEventSupportImpl" /> + <when-property-is value="ie10" name="user.agent" /> + </replace-with> </module> diff --git a/client/src/com/vaadin/client/ApplicationConfiguration.java b/client/src/com/vaadin/client/ApplicationConfiguration.java index 16cdc759fa..c7ef9586c5 100644 --- a/client/src/com/vaadin/client/ApplicationConfiguration.java +++ b/client/src/com/vaadin/client/ApplicationConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -45,6 +45,7 @@ import com.vaadin.client.debug.internal.Section; import com.vaadin.client.debug.internal.TestBenchSection; import com.vaadin.client.debug.internal.VDebugWindow; import com.vaadin.client.debug.internal.theme.DebugWindowStyles; +import com.vaadin.client.event.PointerEventSupport; import com.vaadin.client.metadata.BundleLoadCallback; import com.vaadin.client.metadata.ConnectorBundleLoader; import com.vaadin.client.metadata.NoDataException; @@ -223,6 +224,7 @@ public class ApplicationConfiguration implements EntryPoint { private boolean browserDetailsSent = false; private boolean widgetsetVersionSent = false; + private static boolean moduleLoaded = false; static// TODO consider to make this hashmap per application LinkedList<Command> callbacks = new LinkedList<Command>(); @@ -597,6 +599,13 @@ public class ApplicationConfiguration implements EntryPoint { @Override public void onModuleLoad() { + + // Don't run twice if the module has been inherited several times. + if (moduleLoaded) { + return; + } + moduleLoaded = true; + Profiler.initialize(); Profiler.enter("ApplicationConfiguration.onModuleLoad"); @@ -612,6 +621,9 @@ public class ApplicationConfiguration implements EntryPoint { enableIEPromptFix(); } + // Register pointer events (must be done before any events are used) + PointerEventSupport.init(); + // Prepare the debugging window if (isDebugMode()) { /* diff --git a/client/src/com/vaadin/client/ApplicationConnection.java b/client/src/com/vaadin/client/ApplicationConnection.java index 5d614439bb..694fc71060 100644 --- a/client/src/com/vaadin/client/ApplicationConnection.java +++ b/client/src/com/vaadin/client/ApplicationConnection.java @@ -1,6 +1,6 @@ -/* - * Copyright 2000-2013 Vaadin Ltd. - * +/* + * 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 @@ -43,6 +43,7 @@ import com.google.gwt.event.shared.EventBus; import com.google.gwt.event.shared.EventHandler; import com.google.gwt.event.shared.GwtEvent; import com.google.gwt.event.shared.HandlerRegistration; +import com.google.gwt.event.shared.HasHandlers; import com.google.gwt.event.shared.SimpleEventBus; import com.google.gwt.http.client.Request; import com.google.gwt.http.client.RequestBuilder; @@ -120,7 +121,7 @@ import com.vaadin.shared.ui.ui.UIState.PushConfigurationState; * * Entry point classes (widgetsets) define <code>onModuleLoad()</code>. */ -public class ApplicationConnection { +public class ApplicationConnection implements HasHandlers { /** * Helper used to return two values when updating the connector hierarchy. @@ -342,6 +343,42 @@ public class ApplicationConnection { } + /** + * Event triggered when a XHR request has finished with the status code of + * the response. + * + * Useful for handlers observing network failures like online/off-line + * monitors. + */ + public static class ConnectionStatusEvent extends + GwtEvent<ConnectionStatusEvent.ConnectionStatusHandler> { + private int status; + + public static interface ConnectionStatusHandler extends EventHandler { + public void onConnectionStatusChange(ConnectionStatusEvent event); + } + + public ConnectionStatusEvent(int status) { + this.status = status; + } + + public int getStatus() { + return status; + } + + public final static Type<ConnectionStatusHandler> TYPE = new Type<ConnectionStatusHandler>(); + + @Override + public Type<ConnectionStatusHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(ConnectionStatusHandler handler) { + handler.onConnectionStatusChange(this); + } + } + public static class ResponseHandlingStartedEvent extends ApplicationConnectionEvent { @@ -836,6 +873,8 @@ public class ApplicationConnection { - requestStartTime.getTime()) + "ms"); int statusCode = response.getStatusCode(); + // Notify network observers about response status + fireEvent(new ConnectionStatusEvent(statusCode)); switch (statusCode) { case 0: @@ -933,6 +972,7 @@ public class ApplicationConnection { } catch (RequestException e) { VConsole.error(e); endRequest(); + fireEvent(new ConnectionStatusEvent(0)); } } } @@ -1084,10 +1124,13 @@ public class ApplicationConnection { handleWhenCSSLoaded(jsonText, json); } }).schedule(50); - VConsole.log("Assuming CSS loading is not complete, " - + "postponing render phase. " - + "(.v-loading-indicator height == 0)"); - cssWaits++; + + // Show this message just once + if (cssWaits++ == 0) { + VConsole.log("Assuming CSS loading is not complete, " + + "postponing render phase. " + + "(.v-loading-indicator height == 0)"); + } } else { cssLoaded = true; handleReceivedJSONMessage(new Date(), jsonText, json); @@ -3465,6 +3508,11 @@ public class ApplicationConnection { return eventBus.addHandler(type, handler); } + @Override + public void fireEvent(GwtEvent<?> event) { + eventBus.fireEvent(event); + } + /** * Calls {@link ComponentConnector#flush()} on the active connector. Does * nothing if there is no active (focused) connector. @@ -3559,4 +3607,10 @@ public class ApplicationConnection { return Logger.getLogger(ApplicationConnection.class.getName()); } + /** + * Returns the hearbeat instance. + */ + public Heartbeat getHeartbeat() { + return heartbeat; + } } diff --git a/client/src/com/vaadin/client/BrowserInfo.java b/client/src/com/vaadin/client/BrowserInfo.java index 78c5c1f59f..e8b8d8309a 100644 --- a/client/src/com/vaadin/client/BrowserInfo.java +++ b/client/src/com/vaadin/client/BrowserInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/CSSRule.java b/client/src/com/vaadin/client/CSSRule.java index 63a136175b..a1ddce6d0a 100644 --- a/client/src/com/vaadin/client/CSSRule.java +++ b/client/src/com/vaadin/client/CSSRule.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ComponentConnector.java b/client/src/com/vaadin/client/ComponentConnector.java index f923a9dade..d0c943d553 100644 --- a/client/src/com/vaadin/client/ComponentConnector.java +++ b/client/src/com/vaadin/client/ComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ComponentDetail.java b/client/src/com/vaadin/client/ComponentDetail.java index 58b72b3d95..9e5e2a82a8 100644 --- a/client/src/com/vaadin/client/ComponentDetail.java +++ b/client/src/com/vaadin/client/ComponentDetail.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ComponentDetailMap.java b/client/src/com/vaadin/client/ComponentDetailMap.java index 94eba721b1..c99ebd2738 100644 --- a/client/src/com/vaadin/client/ComponentDetailMap.java +++ b/client/src/com/vaadin/client/ComponentDetailMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ComponentLocator.java b/client/src/com/vaadin/client/ComponentLocator.java deleted file mode 100644 index f30528c0c0..0000000000 --- a/client/src/com/vaadin/client/ComponentLocator.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.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/ComputedStyle.java b/client/src/com/vaadin/client/ComputedStyle.java index db8ed037bf..e806e9e197 100644 --- a/client/src/com/vaadin/client/ComputedStyle.java +++ b/client/src/com/vaadin/client/ComputedStyle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ConnectorHierarchyChangeEvent.java b/client/src/com/vaadin/client/ConnectorHierarchyChangeEvent.java index 2896386933..55494af0d4 100644 --- a/client/src/com/vaadin/client/ConnectorHierarchyChangeEvent.java +++ b/client/src/com/vaadin/client/ConnectorHierarchyChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -103,4 +103,4 @@ public class ConnectorHierarchyChangeEvent extends return TYPE; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ConnectorMap.java b/client/src/com/vaadin/client/ConnectorMap.java index c2f1eda21d..1211eb2684 100644 --- a/client/src/com/vaadin/client/ConnectorMap.java +++ b/client/src/com/vaadin/client/ConnectorMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ContainerResizedListener.java b/client/src/com/vaadin/client/ContainerResizedListener.java index 602e57abc0..702542f0ac 100644 --- a/client/src/com/vaadin/client/ContainerResizedListener.java +++ b/client/src/com/vaadin/client/ContainerResizedListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/DateTimeService.java b/client/src/com/vaadin/client/DateTimeService.java index 2388bd38fb..bf57261c72 100644 --- a/client/src/com/vaadin/client/DateTimeService.java +++ b/client/src/com/vaadin/client/DateTimeService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/DirectionalManagedLayout.java b/client/src/com/vaadin/client/DirectionalManagedLayout.java index 887593acf3..eab9811082 100644 --- a/client/src/com/vaadin/client/DirectionalManagedLayout.java +++ b/client/src/com/vaadin/client/DirectionalManagedLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,4 +21,4 @@ public interface DirectionalManagedLayout extends ManagedLayout { public void layoutVertically(); public void layoutHorizontally(); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/EventHelper.java b/client/src/com/vaadin/client/EventHelper.java index ef1326b52c..a1cb75527d 100644 --- a/client/src/com/vaadin/client/EventHelper.java +++ b/client/src/com/vaadin/client/EventHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/FastStringMap.java b/client/src/com/vaadin/client/FastStringMap.java index 5b15b1263a..ba3d07025b 100644 --- a/client/src/com/vaadin/client/FastStringMap.java +++ b/client/src/com/vaadin/client/FastStringMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/FastStringSet.java b/client/src/com/vaadin/client/FastStringSet.java index a36aa9bfef..756bd374dc 100644 --- a/client/src/com/vaadin/client/FastStringSet.java +++ b/client/src/com/vaadin/client/FastStringSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -98,4 +98,4 @@ public final class FastStringSet extends JavaScriptObject { } } }-*/; -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/Focusable.java b/client/src/com/vaadin/client/Focusable.java index 3204b6c6a8..05b32a7b05 100644 --- a/client/src/com/vaadin/client/Focusable.java +++ b/client/src/com/vaadin/client/Focusable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/HasComponentsConnector.java b/client/src/com/vaadin/client/HasComponentsConnector.java index ebc6dbcd2a..3d8df3b8cd 100644 --- a/client/src/com/vaadin/client/HasComponentsConnector.java +++ b/client/src/com/vaadin/client/HasComponentsConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/JavaScriptConnectorHelper.java b/client/src/com/vaadin/client/JavaScriptConnectorHelper.java index 52d2eeb6dc..c4b36d6453 100644 --- a/client/src/com/vaadin/client/JavaScriptConnectorHelper.java +++ b/client/src/com/vaadin/client/JavaScriptConnectorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/JavaScriptExtension.java b/client/src/com/vaadin/client/JavaScriptExtension.java index 73fc1e3c57..9c60d38a5a 100644 --- a/client/src/com/vaadin/client/JavaScriptExtension.java +++ b/client/src/com/vaadin/client/JavaScriptExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/JsArrayObject.java b/client/src/com/vaadin/client/JsArrayObject.java index 5b45650684..b6dcf3789d 100644 --- a/client/src/com/vaadin/client/JsArrayObject.java +++ b/client/src/com/vaadin/client/JsArrayObject.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java index fbf540273f..bf79009f4c 100644 --- a/client/src/com/vaadin/client/LayoutManager.java +++ b/client/src/com/vaadin/client/LayoutManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,6 +20,7 @@ import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.util.logging.Logger; import com.google.gwt.core.client.Duration; import com.google.gwt.core.client.JsArrayString; @@ -827,6 +828,12 @@ public class LayoutManager { /** * Marks that a ManagedLayout should be layouted in the next layout phase * even if none of the elements managed by the layout have been resized. + * <p> + * This method should not be invoked during a layout phase since it only + * controls what will happen in the beginning of the next phase. If you want + * to explicitly cause some layout to be considered in an ongoing layout + * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted @@ -840,14 +847,25 @@ public class LayoutManager { * Marks that a ManagedLayout should be layouted horizontally in the next * layout phase even if none of the elements managed by the layout have been * resized horizontally. - * + * <p> * For SimpleManagedLayout which is always layouted in both directions, this * has the same effect as {@link #setNeedsLayout(ManagedLayout)}. + * <p> + * This method should not be invoked during a layout phase since it only + * controls what will happen in the beginning of the next phase. If you want + * to explicitly cause some layout to be considered in an ongoing layout + * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted */ public final void setNeedsHorizontalLayout(ManagedLayout layout) { + if (isLayoutRunning()) { + getLogger() + .warning( + "setNeedsHorizontalLayout should not be run while a layout phase is in progress."); + } needsHorizontalLayout.add(layout.getConnectorId()); } @@ -855,14 +873,25 @@ public class LayoutManager { * Marks that a ManagedLayout should be layouted vertically in the next * layout phase even if none of the elements managed by the layout have been * resized vertically. - * + * <p> * For SimpleManagedLayout which is always layouted in both directions, this * has the same effect as {@link #setNeedsLayout(ManagedLayout)}. + * <p> + * This method should not be invoked during a layout phase since it only + * controls what will happen in the beginning of the next phase. If you want + * to explicitly cause some layout to be considered in an ongoing layout + * phase, you should use {@link #setNeedsMeasure(ComponentConnector)} + * instead. * * @param layout * the managed layout that should be layouted */ public final void setNeedsVerticalLayout(ManagedLayout layout) { + if (isLayoutRunning()) { + getLogger() + .warning( + "setNeedsVerticalLayout should not be run while a layout phase is in progress."); + } needsVerticalLayout.add(layout.getConnectorId()); } @@ -1609,4 +1638,8 @@ public class LayoutManager { protected void cleanMeasuredSizes() { } + private static Logger getLogger() { + return Logger.getLogger(LayoutManager.class.getName()); + } + } diff --git a/client/src/com/vaadin/client/LayoutManagerIE8.java b/client/src/com/vaadin/client/LayoutManagerIE8.java index 97e3059a22..941ac589b2 100644 --- a/client/src/com/vaadin/client/LayoutManagerIE8.java +++ b/client/src/com/vaadin/client/LayoutManagerIE8.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/LocaleNotLoadedException.java b/client/src/com/vaadin/client/LocaleNotLoadedException.java index 9761750084..6f59e786e4 100644 --- a/client/src/com/vaadin/client/LocaleNotLoadedException.java +++ b/client/src/com/vaadin/client/LocaleNotLoadedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/LocaleService.java b/client/src/com/vaadin/client/LocaleService.java index 69345d7174..dcd1c9ea4e 100644 --- a/client/src/com/vaadin/client/LocaleService.java +++ b/client/src/com/vaadin/client/LocaleService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/MeasuredSize.java b/client/src/com/vaadin/client/MeasuredSize.java index bc6ef789d0..2531ff9389 100644 --- a/client/src/com/vaadin/client/MeasuredSize.java +++ b/client/src/com/vaadin/client/MeasuredSize.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -289,4 +289,4 @@ public class MeasuredSize { return sizes1[0] != sizes2[0] || sizes1[2] != sizes2[2]; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/MouseEventDetailsBuilder.java b/client/src/com/vaadin/client/MouseEventDetailsBuilder.java index 85418d6807..313fe682fd 100644 --- a/client/src/com/vaadin/client/MouseEventDetailsBuilder.java +++ b/client/src/com/vaadin/client/MouseEventDetailsBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/Paintable.java b/client/src/com/vaadin/client/Paintable.java index 543f71783b..34f2d0714f 100644 --- a/client/src/com/vaadin/client/Paintable.java +++ b/client/src/com/vaadin/client/Paintable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/Profiler.java b/client/src/com/vaadin/client/Profiler.java index cfce59b08b..2174e00de1 100644 --- a/client/src/com/vaadin/client/Profiler.java +++ b/client/src/com/vaadin/client/Profiler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/RenderInformation.java b/client/src/com/vaadin/client/RenderInformation.java index 4d856e90ee..8fd3fc7e0b 100644 --- a/client/src/com/vaadin/client/RenderInformation.java +++ b/client/src/com/vaadin/client/RenderInformation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/RenderSpace.java b/client/src/com/vaadin/client/RenderSpace.java index d58932f3b9..5a7440b682 100644 --- a/client/src/com/vaadin/client/RenderSpace.java +++ b/client/src/com/vaadin/client/RenderSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ResourceLoader.java b/client/src/com/vaadin/client/ResourceLoader.java index 3d8eb739b1..67b878001e 100644 --- a/client/src/com/vaadin/client/ResourceLoader.java +++ b/client/src/com/vaadin/client/ResourceLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ServerConnector.java b/client/src/com/vaadin/client/ServerConnector.java index 676d5626d1..4eaa7bc086 100644 --- a/client/src/com/vaadin/client/ServerConnector.java +++ b/client/src/com/vaadin/client/ServerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/SimpleTree.java b/client/src/com/vaadin/client/SimpleTree.java index 39e76a6d75..3c63f54d5f 100644 --- a/client/src/com/vaadin/client/SimpleTree.java +++ b/client/src/com/vaadin/client/SimpleTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/StyleConstants.java b/client/src/com/vaadin/client/StyleConstants.java index d54c72c38b..c4588587d4 100644 --- a/client/src/com/vaadin/client/StyleConstants.java +++ b/client/src/com/vaadin/client/StyleConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/SuperDevMode.java b/client/src/com/vaadin/client/SuperDevMode.java index a6e5d9b1ec..f1020b3d25 100644 --- a/client/src/com/vaadin/client/SuperDevMode.java +++ b/client/src/com/vaadin/client/SuperDevMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/TooltipInfo.java b/client/src/com/vaadin/client/TooltipInfo.java index 961a6e3a67..67d2ad37c2 100644 --- a/client/src/com/vaadin/client/TooltipInfo.java +++ b/client/src/com/vaadin/client/TooltipInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/UIDL.java b/client/src/com/vaadin/client/UIDL.java index 732fcc33d4..2c2a5de308 100644 --- a/client/src/com/vaadin/client/UIDL.java +++ b/client/src/com/vaadin/client/UIDL.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/Util.java b/client/src/com/vaadin/client/Util.java index 730f844985..e031b37422 100644 --- a/client/src/com/vaadin/client/Util.java +++ b/client/src/com/vaadin/client/Util.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -33,6 +33,7 @@ import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.NodeList; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Touch; import com.google.gwt.user.client.Command; import com.google.gwt.user.client.DOM; @@ -212,10 +213,10 @@ public class Util { if (widthGuess < 1) { widthGuess = 1; } - DOM.setStyleAttribute(element, "width", widthGuess + "px"); + element.getStyle().setWidth(widthGuess, Unit.PX); int padding = element.getOffsetWidth() - widthGuess; - DOM.setStyleAttribute(element, "width", originalWidth); + element.getStyle().setProperty("width", originalWidth); return padding; } @@ -228,10 +229,10 @@ public class Util { if (widthGuess < 1) { widthGuess = 1; } - DOM.setStyleAttribute(element, "height", widthGuess + "px"); + element.getStyle().setHeight(widthGuess, Unit.PX); int padding = element.getOffsetHeight() - widthGuess; - DOM.setStyleAttribute(element, "height", originalHeight); + element.getStyle().setProperty("height", originalHeight); return padding; } @@ -323,11 +324,11 @@ public class Util { } private static void setWidth(Widget widget, String width) { - DOM.setStyleAttribute(widget.getElement(), "width", width); + widget.getElement().getStyle().setProperty("width", width); } private static void setHeight(Widget widget, String height) { - DOM.setStyleAttribute(widget.getElement(), "height", height); + widget.getElement().getStyle().setProperty("height", height); } public static int setWidthExcludingPaddingAndBorder(Widget widget, @@ -356,7 +357,7 @@ public class Util { widthGuess = 0; } - DOM.setStyleAttribute(element, "width", widthGuess + "px"); + element.getStyle().setWidth(widthGuess, Unit.PX); int captionOffsetWidth = DOM.getElementPropertyInt(element, "offsetWidth"); @@ -372,7 +373,7 @@ public class Util { // Cannot set negative width even if we would want to w = 0; } - DOM.setStyleAttribute(element, "width", w + "px"); + element.getStyle().setWidth(w, Unit.PX); } @@ -389,7 +390,7 @@ public class Util { heightGuess = 0; } - DOM.setStyleAttribute(element, "height", heightGuess + "px"); + element.getStyle().setHeight(heightGuess, Unit.PX); int captionOffsetHeight = DOM.getElementPropertyInt(element, "offsetHeight"); @@ -405,7 +406,7 @@ public class Util { // Cannot set negative height even if we would want to h = 0; } - DOM.setStyleAttribute(element, "height", h + "px"); + element.getStyle().setHeight(h, Unit.PX); } @@ -424,9 +425,9 @@ public class Util { public static void setFloat(Element element, String value) { if (BrowserInfo.get().isIE()) { - DOM.setStyleAttribute(element, "styleFloat", value); + element.getStyle().setProperty("styleFloat", value); } else { - DOM.setStyleAttribute(element, "cssFloat", value); + element.getStyle().setProperty("cssFloat", value); } } diff --git a/client/src/com/vaadin/client/VCaption.java b/client/src/com/vaadin/client/VCaption.java index 1b98a0fa78..becc89ce1d 100644 --- a/client/src/com/vaadin/client/VCaption.java +++ b/client/src/com/vaadin/client/VCaption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,6 +18,7 @@ package com.vaadin.client; import com.google.gwt.aria.client.Roles; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.ui.HTML; @@ -585,19 +586,19 @@ public class VCaption extends HTML { } public void setAlignment(String alignment) { - DOM.setStyleAttribute(getElement(), "textAlign", alignment); + getElement().getStyle().setProperty("textAlign", alignment); } public void setMaxWidth(int maxWidth) { this.maxWidth = maxWidth; - DOM.setStyleAttribute(getElement(), "width", maxWidth + "px"); + getElement().getStyle().setWidth(maxWidth, Unit.PX); if (icon != null) { - DOM.setStyleAttribute(icon.getElement(), "width", ""); + icon.getElement().getStyle().clearWidth(); } if (captionText != null) { - DOM.setStyleAttribute(captionText, "width", ""); + captionText.getStyle().clearWidth(); } int requiredWidth = getRequiredWidth(); @@ -628,8 +629,8 @@ public class VCaption extends HTML { if (availableWidth > iconRequiredWidth) { availableWidth -= iconRequiredWidth; } else { - DOM.setStyleAttribute(icon.getElement(), "width", - availableWidth + "px"); + icon.getElement().getStyle() + .setWidth(availableWidth, Unit.PX); availableWidth = 0; } } @@ -639,8 +640,7 @@ public class VCaption extends HTML { availableWidth -= captionWidth; } else { - DOM.setStyleAttribute(captionText, "width", availableWidth - + "px"); + captionText.getStyle().setWidth(availableWidth, Unit.PX); availableWidth = 0; } diff --git a/client/src/com/vaadin/client/VCaptionWrapper.java b/client/src/com/vaadin/client/VCaptionWrapper.java index 789e75d9a1..382126f409 100644 --- a/client/src/com/vaadin/client/VCaptionWrapper.java +++ b/client/src/com/vaadin/client/VCaptionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/VConsole.java b/client/src/com/vaadin/client/VConsole.java index 32eb206a70..c01711c5b3 100644 --- a/client/src/com/vaadin/client/VConsole.java +++ b/client/src/com/vaadin/client/VConsole.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/VErrorMessage.java b/client/src/com/vaadin/client/VErrorMessage.java index 77b3970aba..271c7b1be8 100644 --- a/client/src/com/vaadin/client/VErrorMessage.java +++ b/client/src/com/vaadin/client/VErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/VLoadingIndicator.java b/client/src/com/vaadin/client/VLoadingIndicator.java index 3a6f8e08bb..e873005d3a 100644 --- a/client/src/com/vaadin/client/VLoadingIndicator.java +++ b/client/src/com/vaadin/client/VLoadingIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/VSchedulerImpl.java b/client/src/com/vaadin/client/VSchedulerImpl.java index baeb61c574..2c0657eb59 100644 --- a/client/src/com/vaadin/client/VSchedulerImpl.java +++ b/client/src/com/vaadin/client/VSchedulerImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/VTooltip.java b/client/src/com/vaadin/client/VTooltip.java index 9badd0ca1c..487f577ae3 100644 --- a/client/src/com/vaadin/client/VTooltip.java +++ b/client/src/com/vaadin/client/VTooltip.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,6 +19,7 @@ import com.google.gwt.aria.client.LiveValue; import com.google.gwt.aria.client.RelevantValue; import com.google.gwt.aria.client.Roles; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; @@ -51,6 +52,8 @@ public class VTooltip extends VWindowOverlay { VErrorMessage em = new VErrorMessage(); Element description = DOM.createDiv(); + private TooltipInfo currentTooltipInfo = new TooltipInfo(" "); + private boolean closing = false; private boolean opening = false; @@ -101,30 +104,37 @@ public class VTooltip extends VWindowOverlay { */ public void showAssistive(TooltipInfo info) { updatePosition(null, true); - show(info); + setTooltipText(info); + showTooltip(); } - /** - * Show a popup containing the information in the "info" tooltip - * - * @param info - */ - private void show(TooltipInfo info) { - boolean hasContent = false; + private void setTooltipText(TooltipInfo info) { if (info.getErrorMessage() != null) { em.setVisible(true); em.updateMessage(info.getErrorMessage()); - hasContent = true; } else { em.setVisible(false); } if (info.getTitle() != null && !"".equals(info.getTitle())) { - DOM.setInnerHTML(description, info.getTitle()); - DOM.setStyleAttribute(description, "display", ""); - hasContent = true; + description.setInnerHTML(info.getTitle()); + description.getStyle().clearDisplay(); } else { - DOM.setInnerHTML(description, ""); - DOM.setStyleAttribute(description, "display", "none"); + description.setInnerHTML(""); + description.getStyle().setDisplay(Display.NONE); + } + currentTooltipInfo = info; + } + + /** + * Show a popup containing the currentTooltipInfo + * + */ + private void showTooltip() { + boolean hasContent = false; + if (currentTooltipInfo.getErrorMessage() != null + || (currentTooltipInfo.getTitle() != null && !"" + .equals(currentTooltipInfo.getTitle()))) { + hasContent = true; } if (hasContent) { // Issue #8454: With IE7 the tooltips size is calculated based on @@ -163,7 +173,6 @@ public class VTooltip extends VWindowOverlay { y = Window.getScrollTop(); } } - setPopupPosition(x, y); sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT); } @@ -173,18 +182,14 @@ public class VTooltip extends VWindowOverlay { } } - private void showTooltip() { - - // Close current tooltip - if (isShowing()) { - closeNow(); - } - - // Schedule timer for showing the tooltip according to if it was - // recently closed or not. - int timeout = justClosed ? getQuickOpenDelay() : getOpenDelay(); - showTimer.schedule(timeout); - opening = true; + /** + * For assistive tooltips to work correctly we must have the tooltip visible + * and attached to the DOM well in advance. + * + * @return + */ + public boolean isActuallyVisible() { + return super.isShowing() && getPopupLeft() > 0 && getPopupTop() > 0; } private void closeNow() { @@ -196,11 +201,8 @@ public class VTooltip extends VWindowOverlay { private Timer showTimer = new Timer() { @Override public void run() { - TooltipInfo info = tooltipEventHandler.getTooltipInfo(); - if (null != info) { - show(info); - } opening = false; + showTooltip(); } }; @@ -208,7 +210,7 @@ public class VTooltip extends VWindowOverlay { @Override public void run() { closeNow(); - justClosedTimer.schedule(2000); + justClosedTimer.schedule(getQuickOpenTimeout()); justClosed = true; } }; @@ -234,8 +236,6 @@ public class VTooltip extends VWindowOverlay { } closeTimer.schedule(getCloseTimeout()); closing = true; - justClosed = true; - justClosedTimer.schedule(getQuickOpenTimeout()); } @Override @@ -251,13 +251,16 @@ public class VTooltip extends VWindowOverlay { private int tooltipEventMouseY; public void updatePosition(Event event, boolean isFocused) { - if (isFocused) { - tooltipEventMouseX = -1000; - tooltipEventMouseY = -1000; - } else { - tooltipEventMouseX = DOM.eventGetClientX(event); - tooltipEventMouseY = DOM.eventGetClientY(event); - } + tooltipEventMouseX = getEventX(event, isFocused); + tooltipEventMouseY = getEventY(event, isFocused); + } + + private int getEventX(Event event, boolean isFocused) { + return isFocused ? -5000 : DOM.eventGetClientX(event); + } + + private int getEventY(Event event, boolean isFocused) { + return isFocused ? -5000 : DOM.eventGetClientY(event); } @Override @@ -283,10 +286,7 @@ public class VTooltip extends VWindowOverlay { closeNow(); } - TooltipInfo info = tooltipEventHandler.getTooltipInfo(); - if (null != info) { - show(info); - } + showTooltip(); opening = false; } @@ -304,27 +304,13 @@ public class VTooltip extends VWindowOverlay { private boolean handledByFocus; /** - * Current tooltip active - */ - private TooltipInfo currentTooltipInfo = null; - - /** - * Get current active tooltip information - * - * @return Current active tooltip information or null - */ - public TooltipInfo getTooltipInfo() { - return currentTooltipInfo; - } - - /** - * Locate connector and it's tooltip for given element + * Locate the tooltip for given element * * @param element * Element used in search - * @return true if connector and tooltip found + * @return TooltipInfo if connector and tooltip found, null if not */ - private boolean resolveConnector(Element element) { + private TooltipInfo getTooltipFor(Element element) { ApplicationConnection ac = getApplicationConnection(); ComponentConnector connector = Util.getConnectorForElement(ac, @@ -352,11 +338,11 @@ public class VTooltip extends VWindowOverlay { assert connector.hasTooltip() : "getTooltipInfo for " + Util.getConnectorString(connector) + " returned a tooltip even though hasTooltip claims there are no tooltips for the connector."; - currentTooltipInfo = info; - return true; + return info; + } - return false; + return null; } /** @@ -367,7 +353,6 @@ public class VTooltip extends VWindowOverlay { */ private void handleHideEvent() { hideTooltip(); - currentTooltipInfo = null; } @Override @@ -417,26 +402,38 @@ public class VTooltip extends VWindowOverlay { return; } - boolean connectorAndTooltipFound = resolveConnector(element); - if (!connectorAndTooltipFound) { - if (isShowing()) { + TooltipInfo info = getTooltipFor(element); + if (info == null) { + if (isActuallyVisible()) { handleHideEvent(); - } else { - currentTooltipInfo = null; } } else { + setTooltipText(info); updatePosition(event, isFocused); - - if (isShowing() && !isFocused) { - replaceCurrentTooltip(); - } else { + if (isActuallyVisible() && !isFocused) { showTooltip(); + } else { + if (isActuallyVisible()) { + closeNow(); + } + // Schedule timer for showing the tooltip according to if it + // was + // recently closed or not. + int timeout = justClosed ? getQuickOpenDelay() + : getOpenDelay(); + if (timeout == 0) { + showTooltip(); + } else { + showTimer.schedule(timeout); + opening = true; + } } } handledByFocus = isFocused; currentElement = element; } + } private final TooltipEventHandler tooltipEventHandler = new TooltipEventHandler(); diff --git a/client/src/com/vaadin/client/VUIDLBrowser.java b/client/src/com/vaadin/client/VUIDLBrowser.java index ee64a5b7b0..4b4fd2f389 100644 --- a/client/src/com/vaadin/client/VUIDLBrowser.java +++ b/client/src/com/vaadin/client/VUIDLBrowser.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ValueMap.java b/client/src/com/vaadin/client/ValueMap.java index 4141eaa9d6..172fd84a84 100644 --- a/client/src/com/vaadin/client/ValueMap.java +++ b/client/src/com/vaadin/client/ValueMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -118,4 +118,4 @@ public final class ValueMap extends JavaScriptObject { return this[name]; }-*/; -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/WidgetInstantiator.java b/client/src/com/vaadin/client/WidgetInstantiator.java index 81ff68a03b..727db967ef 100644 --- a/client/src/com/vaadin/client/WidgetInstantiator.java +++ b/client/src/com/vaadin/client/WidgetInstantiator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/WidgetLoader.java b/client/src/com/vaadin/client/WidgetLoader.java index 6095768fea..4cc1cd1d5f 100644 --- a/client/src/com/vaadin/client/WidgetLoader.java +++ b/client/src/com/vaadin/client/WidgetLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/WidgetMap.java b/client/src/com/vaadin/client/WidgetMap.java index 67965cc111..ec053eb511 100644 --- a/client/src/com/vaadin/client/WidgetMap.java +++ b/client/src/com/vaadin/client/WidgetMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/WidgetSet.java b/client/src/com/vaadin/client/WidgetSet.java index 34e18a5e4e..eff98a146a 100644 --- a/client/src/com/vaadin/client/WidgetSet.java +++ b/client/src/com/vaadin/client/WidgetSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/annotations/OnStateChange.java b/client/src/com/vaadin/client/annotations/OnStateChange.java index 8223507b7f..d15e32f493 100644 --- a/client/src/com/vaadin/client/annotations/OnStateChange.java +++ b/client/src/com/vaadin/client/annotations/OnStateChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/AbstractServerConnectorEvent.java b/client/src/com/vaadin/client/communication/AbstractServerConnectorEvent.java index 67b4d25f49..9f99a451e1 100644 --- a/client/src/com/vaadin/client/communication/AbstractServerConnectorEvent.java +++ b/client/src/com/vaadin/client/communication/AbstractServerConnectorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java index f0e3eb5b48..48e17cde05 100644 --- a/client/src/com/vaadin/client/communication/AtmospherePushConnection.java +++ b/client/src/com/vaadin/client/communication/AtmospherePushConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -340,7 +340,7 @@ public class AtmospherePushConnection implements PushConnection { } protected void onClose(AtmosphereResponse response) { - VConsole.log("Push connection closed, awaiting reconnection"); + VConsole.log("Push connection closed"); state = State.CONNECT_PENDING; } diff --git a/client/src/com/vaadin/client/communication/Date_Serializer.java b/client/src/com/vaadin/client/communication/Date_Serializer.java index c6eb7af188..15ef3869aa 100644 --- a/client/src/com/vaadin/client/communication/Date_Serializer.java +++ b/client/src/com/vaadin/client/communication/Date_Serializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/DiffJSONSerializer.java b/client/src/com/vaadin/client/communication/DiffJSONSerializer.java index ffb71d9595..59575604a1 100644 --- a/client/src/com/vaadin/client/communication/DiffJSONSerializer.java +++ b/client/src/com/vaadin/client/communication/DiffJSONSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java b/client/src/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java index 902480418d..deb5900b89 100644 --- a/client/src/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java +++ b/client/src/com/vaadin/client/communication/HasJavaScriptConnectorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/Heartbeat.java b/client/src/com/vaadin/client/communication/Heartbeat.java index 4b80827127..1ff0825f0e 100644 --- a/client/src/com/vaadin/client/communication/Heartbeat.java +++ b/client/src/com/vaadin/client/communication/Heartbeat.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -25,6 +25,7 @@ import com.google.gwt.http.client.Response; import com.google.gwt.user.client.Timer; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.ApplicationConnection.ApplicationStoppedEvent; +import com.vaadin.client.ApplicationConnection.ConnectionStatusEvent; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.ui.ui.UIConstants; @@ -36,7 +37,6 @@ import com.vaadin.shared.ui.ui.UIConstants; */ public class Heartbeat { - private int interval = -1; private Timer timer = new Timer() { @Override public void run() { @@ -45,6 +45,8 @@ public class Heartbeat { }; private ApplicationConnection connection; + private String uri; + private int interval = -1; private static Logger getLogger() { return Logger.getLogger(Heartbeat.class.getName()); @@ -56,11 +58,16 @@ public class Heartbeat { * @param connection * the connection */ - public void init(ApplicationConnection connection) { - this.connection = connection; - interval = connection.getConfiguration().getHeartbeatInterval(); - setInterval(interval); - schedule(); + public void init(ApplicationConnection applicationConnection) { + connection = applicationConnection; + + setInterval(connection.getConfiguration().getHeartbeatInterval()); + + uri = ApplicationConnection.addGetParameters(connection + .translateVaadinUri(ApplicationConstants.APP_PROTOCOL_PREFIX + + ApplicationConstants.HEARTBEAT_PATH + '/'), + UIConstants.UI_ID_PARAMETER + "=" + + connection.getConfiguration().getUIId()); connection.addHandler( ApplicationConnection.ApplicationStoppedEvent.TYPE, @@ -70,22 +77,15 @@ public class Heartbeat { public void onApplicationStopped( ApplicationStoppedEvent event) { setInterval(-1); - schedule(); } }); - } /** * Sends a heartbeat to the server */ public void send() { - final String uri = ApplicationConnection.addGetParameters( - getConnection().translateVaadinUri( - ApplicationConstants.APP_PROTOCOL_PREFIX - + ApplicationConstants.HEARTBEAT_PATH + '/'), - UIConstants.UI_ID_PARAMETER + "=" - + getConnection().getConfiguration().getUIId()); + timer.cancel(); final RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, uri); @@ -94,24 +94,41 @@ public class Heartbeat { @Override public void onResponseReceived(Request request, Response response) { int status = response.getStatusCode(); + + // Notify network observers about response status + connection.fireEvent(new ConnectionStatusEvent(status)); + if (status == Response.SC_OK) { - // TODO Permit retry in some error situations getLogger().fine("Heartbeat response OK"); - schedule(); + } else if (status == 0) { + getLogger().warning( + "Failed sending heartbeat, server is unreachable, retrying in " + + interval + "secs."); + } else if (status >= 500) { + getLogger().warning( + "Failed sending heartbeat, see server logs, retrying in " + + interval + "secs."); } else if (status == Response.SC_GONE) { - // FIXME This should really do something else like send an - // event - getConnection().showSessionExpiredError(null); + connection.showSessionExpiredError(null); + // If session is expired break the loop + return; } else { getLogger().warning( "Failed sending heartbeat to server. Error code: " + status); } + + // Don't break the loop + schedule(); } @Override public void onError(Request request, Throwable exception) { - getLogger().severe("Exception sending heartbeat: " + exception); + getLogger().severe("Exception sending heartbeat: " + exception.getMessage()); + // Notify network observers about response status + connection.fireEvent(new ConnectionStatusEvent(0)); + // Don't break the loop + schedule(); } }; @@ -134,38 +151,38 @@ public class Heartbeat { } /** - * sets the interval at which heartbeat requests are sent - * - * @param interval - * the new interval - */ - public void setInterval(int interval) { - this.interval = interval; - } - - /** * Updates the schedule of the heartbeat to match the set interval. A * negative interval disables the heartbeat. */ public void schedule() { - if (getInterval() > 0) { + if (interval > 0) { getLogger() .fine("Scheduling heartbeat in " + interval + " seconds"); timer.schedule(interval * 1000); } else { - if (timer != null) { - getLogger().fine("Disabling heartbeat"); - timer.cancel(); - } + getLogger().fine("Disabling heartbeat"); + timer.cancel(); } - } /** * @return the application connection */ + @Deprecated protected ApplicationConnection getConnection() { return connection; } + /** + * Changes the heartbeatInterval in runtime and applies it. + * + * @param heartbeatInterval + * new interval in seconds. + */ + public void setInterval(int heartbeatInterval) { + getLogger().info( + "Setting hearbeat interval to " + heartbeatInterval + "sec."); + interval = heartbeatInterval; + schedule(); + } } diff --git a/client/src/com/vaadin/client/communication/JSONSerializer.java b/client/src/com/vaadin/client/communication/JSONSerializer.java index a4e78e503c..3327baf842 100644 --- a/client/src/com/vaadin/client/communication/JSONSerializer.java +++ b/client/src/com/vaadin/client/communication/JSONSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/JavaScriptMethodInvocation.java b/client/src/com/vaadin/client/communication/JavaScriptMethodInvocation.java index b9743ee536..43366902e2 100644 --- a/client/src/com/vaadin/client/communication/JavaScriptMethodInvocation.java +++ b/client/src/com/vaadin/client/communication/JavaScriptMethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/JsonDecoder.java b/client/src/com/vaadin/client/communication/JsonDecoder.java index e1ee1fd7b7..37c113bb2f 100644 --- a/client/src/com/vaadin/client/communication/JsonDecoder.java +++ b/client/src/com/vaadin/client/communication/JsonDecoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/JsonEncoder.java b/client/src/com/vaadin/client/communication/JsonEncoder.java index 49cd613a2c..6783e802ec 100644 --- a/client/src/com/vaadin/client/communication/JsonEncoder.java +++ b/client/src/com/vaadin/client/communication/JsonEncoder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/PushConnection.java b/client/src/com/vaadin/client/communication/PushConnection.java index ba79af9d2c..3bdb18ff1b 100644 --- a/client/src/com/vaadin/client/communication/PushConnection.java +++ b/client/src/com/vaadin/client/communication/PushConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -102,4 +102,4 @@ public interface PushConnection { */ public String getTransportType(); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/communication/RpcManager.java b/client/src/com/vaadin/client/communication/RpcManager.java index 852f854541..7b706fca2d 100644 --- a/client/src/com/vaadin/client/communication/RpcManager.java +++ b/client/src/com/vaadin/client/communication/RpcManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/RpcProxy.java b/client/src/com/vaadin/client/communication/RpcProxy.java index 1ad8a5eae0..31b5c92707 100644 --- a/client/src/com/vaadin/client/communication/RpcProxy.java +++ b/client/src/com/vaadin/client/communication/RpcProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/StateChangeEvent.java b/client/src/com/vaadin/client/communication/StateChangeEvent.java index e8fd95e818..6bda41cef2 100644 --- a/client/src/com/vaadin/client/communication/StateChangeEvent.java +++ b/client/src/com/vaadin/client/communication/StateChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/communication/URLReference_Serializer.java b/client/src/com/vaadin/client/communication/URLReference_Serializer.java index 64ce1184a8..586dd626f0 100644 --- a/client/src/com/vaadin/client/communication/URLReference_Serializer.java +++ b/client/src/com/vaadin/client/communication/URLReference_Serializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/ComponentLocator.java b/client/src/com/vaadin/client/componentlocator/ComponentLocator.java index f0b76766a7..c1ddc02aae 100644 --- a/client/src/com/vaadin/client/componentlocator/ComponentLocator.java +++ b/client/src/com/vaadin/client/componentlocator/ComponentLocator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java b/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java index 232433273f..5df9854038 100644 --- a/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java +++ b/client/src/com/vaadin/client/componentlocator/LegacyLocatorStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/LocatorStrategy.java b/client/src/com/vaadin/client/componentlocator/LocatorStrategy.java index 6b3103c677..6eb732bf46 100644 --- a/client/src/com/vaadin/client/componentlocator/LocatorStrategy.java +++ b/client/src/com/vaadin/client/componentlocator/LocatorStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/LocatorUtil.java b/client/src/com/vaadin/client/componentlocator/LocatorUtil.java index 04624920a9..1d1c06587b 100644 --- a/client/src/com/vaadin/client/componentlocator/LocatorUtil.java +++ b/client/src/com/vaadin/client/componentlocator/LocatorUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/SelectorPredicate.java b/client/src/com/vaadin/client/componentlocator/SelectorPredicate.java index 32b33005ed..31f6cc9b05 100644 --- a/client/src/com/vaadin/client/componentlocator/SelectorPredicate.java +++ b/client/src/com/vaadin/client/componentlocator/SelectorPredicate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java b/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java index e7e752ef34..6075d1bf48 100644 --- a/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java +++ b/client/src/com/vaadin/client/componentlocator/VaadinFinderLocatorStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java b/client/src/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java index 7561bc2c03..1238d88345 100644 --- a/client/src/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java +++ b/client/src/com/vaadin/client/debug/internal/AnalyzeLayoutsPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java b/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java index fc7b55497e..0b49fa7aaf 100644 --- a/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java +++ b/client/src/com/vaadin/client/debug/internal/ConnectorInfoPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/DebugButton.java b/client/src/com/vaadin/client/debug/internal/DebugButton.java index a49a392fbe..f797197afb 100644 --- a/client/src/com/vaadin/client/debug/internal/DebugButton.java +++ b/client/src/com/vaadin/client/debug/internal/DebugButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java index 0e4c57494b..f4fbe12c0d 100644 --- a/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java +++ b/client/src/com/vaadin/client/debug/internal/ErrorNotificationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -83,4 +83,4 @@ public class ErrorNotificationHandler extends Handler { public void flush() { // Nothing todo } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/debug/internal/HierarchyPanel.java b/client/src/com/vaadin/client/debug/internal/HierarchyPanel.java index 755f076b7a..c5c134fc31 100644 --- a/client/src/com/vaadin/client/debug/internal/HierarchyPanel.java +++ b/client/src/com/vaadin/client/debug/internal/HierarchyPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/HierarchySection.java b/client/src/com/vaadin/client/debug/internal/HierarchySection.java index 1647a61256..1eacf286e8 100644 --- a/client/src/com/vaadin/client/debug/internal/HierarchySection.java +++ b/client/src/com/vaadin/client/debug/internal/HierarchySection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/Highlight.java b/client/src/com/vaadin/client/debug/internal/Highlight.java index 262313b9b3..e91f4abcbb 100644 --- a/client/src/com/vaadin/client/debug/internal/Highlight.java +++ b/client/src/com/vaadin/client/debug/internal/Highlight.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/Icon.java b/client/src/com/vaadin/client/debug/internal/Icon.java index 70bac11175..d05eca2f6f 100644 --- a/client/src/com/vaadin/client/debug/internal/Icon.java +++ b/client/src/com/vaadin/client/debug/internal/Icon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/InfoSection.java b/client/src/com/vaadin/client/debug/internal/InfoSection.java index 38d7290fde..23b77a94db 100644 --- a/client/src/com/vaadin/client/debug/internal/InfoSection.java +++ b/client/src/com/vaadin/client/debug/internal/InfoSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/LogSection.java b/client/src/com/vaadin/client/debug/internal/LogSection.java index f792ec95be..30abb4fff9 100644 --- a/client/src/com/vaadin/client/debug/internal/LogSection.java +++ b/client/src/com/vaadin/client/debug/internal/LogSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -358,4 +358,4 @@ public class LogSection implements Section { addRow(Level.FINE, "UIDL: " + uidl.toSource()); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/debug/internal/NetworkSection.java b/client/src/com/vaadin/client/debug/internal/NetworkSection.java index a1cb8138ef..5b0579238f 100644 --- a/client/src/com/vaadin/client/debug/internal/NetworkSection.java +++ b/client/src/com/vaadin/client/debug/internal/NetworkSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java b/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java index a8d8aad888..0db8ad91a4 100644 --- a/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java +++ b/client/src/com/vaadin/client/debug/internal/OptimizedWidgetsetPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java index 4a2a3a1c38..c4fea5cf71 100644 --- a/client/src/com/vaadin/client/debug/internal/ProfilerSection.java +++ b/client/src/com/vaadin/client/debug/internal/ProfilerSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/Section.java b/client/src/com/vaadin/client/debug/internal/Section.java index c6b8af55e8..876b9bbc27 100644 --- a/client/src/com/vaadin/client/debug/internal/Section.java +++ b/client/src/com/vaadin/client/debug/internal/Section.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -73,4 +73,4 @@ public interface Section { public void meta(ApplicationConnection ac, ValueMap meta); public void uidl(ApplicationConnection ac, ValueMap uidl); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/debug/internal/SelectConnectorListener.java b/client/src/com/vaadin/client/debug/internal/SelectConnectorListener.java index ec3a36c7c4..c3652c78e8 100644 --- a/client/src/com/vaadin/client/debug/internal/SelectConnectorListener.java +++ b/client/src/com/vaadin/client/debug/internal/SelectConnectorListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,4 +35,4 @@ public interface SelectConnectorListener { */ public void select(ServerConnector connector, Element element); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/debug/internal/SelectorPath.java b/client/src/com/vaadin/client/debug/internal/SelectorPath.java index 56b48b2447..5627bf0250 100644 --- a/client/src/com/vaadin/client/debug/internal/SelectorPath.java +++ b/client/src/com/vaadin/client/debug/internal/SelectorPath.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -265,4 +265,4 @@ public class SelectorPath { } return name; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/debug/internal/TestBenchSection.java b/client/src/com/vaadin/client/debug/internal/TestBenchSection.java index d35c575568..355565f706 100644 --- a/client/src/com/vaadin/client/debug/internal/TestBenchSection.java +++ b/client/src/com/vaadin/client/debug/internal/TestBenchSection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/VDebugWindow.java b/client/src/com/vaadin/client/debug/internal/VDebugWindow.java index 5e146ffda8..3393d7371b 100644 --- a/client/src/com/vaadin/client/debug/internal/VDebugWindow.java +++ b/client/src/com/vaadin/client/debug/internal/VDebugWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java b/client/src/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java index 0afc46d0f3..249b24a938 100644 --- a/client/src/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java +++ b/client/src/com/vaadin/client/debug/internal/theme/DebugWindowStyles.java @@ -1,3 +1,18 @@ +/* + * 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.debug.internal.theme; import com.google.gwt.resources.client.ClientBundle; diff --git a/client/src/com/vaadin/client/event/PointerCancelEvent.java b/client/src/com/vaadin/client/event/PointerCancelEvent.java new file mode 100644 index 0000000000..906a07b120 --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerCancelEvent.java @@ -0,0 +1,62 @@ +/* + * 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.event; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native PointerCancelEvent. + * + * @since 7.2 + */ +public class PointerCancelEvent extends PointerEvent<PointerCancelHandler> { + + /** + * Event type for PointerCancelEvent. Represents the meta-data associated + * with this event. + */ + private static final Type<PointerCancelHandler> TYPE = new Type<PointerCancelHandler>( + EventType.PointerCancel.getNativeEventName(), + new PointerCancelEvent()); + + /** + * Gets the event type associated with pointer cancel events. + * + * @return the handler type + */ + public static Type<PointerCancelHandler> getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer up events. + */ + protected PointerCancelEvent() { + } + + @Override + public final Type<PointerCancelHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(PointerCancelHandler handler) { + handler.onPointerCancel(this); + } + +} diff --git a/client/src/com/vaadin/client/event/PointerCancelHandler.java b/client/src/com/vaadin/client/event/PointerCancelHandler.java new file mode 100644 index 0000000000..fa2210b73c --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerCancelHandler.java @@ -0,0 +1,34 @@ +/* + * 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.event; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link PointerCancelEvent} events. + * + * @since 7.2 + */ +public interface PointerCancelHandler extends EventHandler { + + /** + * Called when PointerCancelEvent is fired. + * + * @param event + * the {@link PointerCancelEvent} that was fired + */ + void onPointerCancel(PointerCancelEvent event); +} diff --git a/client/src/com/vaadin/client/event/PointerDownEvent.java b/client/src/com/vaadin/client/event/PointerDownEvent.java new file mode 100644 index 0000000000..eeae9891f2 --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerDownEvent.java @@ -0,0 +1,61 @@ +/* + * 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.event; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native PointerDownEvent. + * + * @since 7.2 + */ +public class PointerDownEvent extends PointerEvent<PointerDownHandler> { + + /** + * Event type for PointerDownEvent. Represents the meta-data associated with + * this event. + */ + private static final Type<PointerDownHandler> TYPE = new Type<PointerDownHandler>( + EventType.PointerDown.getNativeEventName(), new PointerDownEvent()); + + /** + * Gets the event type associated with PointerDownEvent events. + * + * @return the handler type + */ + public static Type<PointerDownHandler> getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected PointerDownEvent() { + } + + @Override + public final Type<PointerDownHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(PointerDownHandler handler) { + handler.onPointerDown(this); + } + +} diff --git a/client/src/com/vaadin/client/event/PointerDownHandler.java b/client/src/com/vaadin/client/event/PointerDownHandler.java new file mode 100644 index 0000000000..dfd9a358eb --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerDownHandler.java @@ -0,0 +1,34 @@ +/* + * 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.event; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link PointerDownEvent} events. + * + * @since 7.2 + */ +public interface PointerDownHandler extends EventHandler { + + /** + * Called when PointerDownEvent is fired. + * + * @param event + * the {@link PointerDownEvent} that was fired + */ + void onPointerDown(PointerDownEvent event); +} diff --git a/client/src/com/vaadin/client/event/PointerEvent.java b/client/src/com/vaadin/client/event/PointerEvent.java new file mode 100644 index 0000000000..71e73f945c --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerEvent.java @@ -0,0 +1,173 @@ +/* + * 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.event; + +import com.google.gwt.dom.client.NativeEvent; +import com.google.gwt.event.dom.client.MouseEvent; +import com.google.gwt.event.shared.EventHandler; + +/** + * Abstract class representing Pointer events. + * + * @param <H> + * handler type + * + * @since 7.2 + */ +public abstract class PointerEvent<H extends EventHandler> extends + MouseEvent<H> { + + enum EventType { + PointerDown, PointerMove, PointerOut, PointerOver, PointerUp, PointerCancel; + + String getNativeEventName() { + return PointerEventSupport.getNativeEventName(this); + } + } + + public static final String TYPE_UNKNOWN = ""; + public static final String TYPE_TOUCH = "touch"; + public static final String TYPE_PEN = "pen"; + public static final String TYPE_MOUSE = "mouse"; + + /** + * Gets a unique identifier for the pointer that caused this event. The + * identifiers of previously active but retired pointers may be recycled. + * + * @return unique pointer id + */ + public final int getPointerId() { + return getPointerId(getNativeEvent()); + } + + /** + * Gets the width of the contact geometry of the pointer in CSS pixels. + * + * @return width in CSS pixels + */ + public final int getWidth() { + return getWidth(getNativeEvent()); + } + + /** + * Gets the height of the contact geometry of the pointer in CSS pixels. + * + * @return height in CSS pixels. + */ + public final int getHeight() { + return getHeight(getNativeEvent()); + } + + /** + * Gets the pressure of the pointer input as a value in the range of [0, 1] + * where 0 and 1 represent the minimum and maximum, respectively. + * + * @return input pressure as a value between 0 and 1 + */ + public final double getPressure() { + return getPressure(getNativeEvent()); + } + + /** + * Gets the angle between the Y-Z plane and the plane containing both the + * transducer and the Y axis. A positive tilt is to the right. + * + * @return the tilt along the X axis as degrees in the range of [-90, 90], + * or 0 if the device does not support tilt + */ + public final double getTiltX() { + return getTiltX(getNativeEvent()); + } + + /** + * Gets the angle between the X-Z plane and the plane containing both the + * transducer and the X axis. A positive tilt is towards the user. + * + * @return the tilt along the Y axis as degrees in the range of [-90, 90], + * or 0 if the device does not support tilt + */ + public final double getTiltY() { + return getTiltY(getNativeEvent()); + } + + /** + * Gets the type of the pointer device that caused this event. + * + * @see PointerEvent#TYPE_UNKNOWN + * @see PointerEvent#TYPE_TOUCH + * @see PointerEvent#TYPE_PEN + * @see PointerEvent#TYPE_MOUSE + * + * @return a String indicating the type of the pointer device + */ + public final String getPointerType() { + return getPointerType(getNativeEvent()); + } + + /** + * Indicates whether the pointer is the primary pointer of this type. + * + * @return true if the pointer is the primary pointer, otherwise false + */ + public final boolean isPrimary() { + return isPrimary(getNativeEvent()); + } + + private static native final int getPointerId(NativeEvent e) + /*-{ + return e.pointerId; + }-*/; + + private static native final int getWidth(NativeEvent e) + /*-{ + return e.width; + }-*/; + + private static native final int getHeight(NativeEvent e) + /*-{ + return e.height; + }-*/; + + private static native final double getPressure(NativeEvent e) + /*-{ + return e.pressure; + }-*/; + + private static native final double getTiltX(NativeEvent e) + /*-{ + return e.tiltX; + }-*/; + + private static native final double getTiltY(NativeEvent e) + /*-{ + return e.tiltY; + }-*/; + + private static native final String getPointerType(NativeEvent e) + /*-{ + var pointerType = e.pointerType; + if (typeof pointerType === "number") { + pointerType = [ , , "touch", "pen", "mouse" ][pointerType]; + } + return pointerType || ""; + }-*/; + + private static native final boolean isPrimary(NativeEvent e) + /*-{ + return e.isPrimary; + }-*/; + +} diff --git a/client/src/com/vaadin/client/event/PointerEventSupport.java b/client/src/com/vaadin/client/event/PointerEventSupport.java new file mode 100644 index 0000000000..99d73745c5 --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerEventSupport.java @@ -0,0 +1,55 @@ +/* + * 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.event; + +import com.google.gwt.core.client.GWT; +import com.vaadin.client.event.PointerEvent.EventType; + +/** + * Main class for pointer event support. Contains functionality for determining + * if pointer events are available or not. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PointerEventSupport { + + private static final PointerEventSupportImpl impl = GWT + .create(PointerEventSupportImpl.class); + + private PointerEventSupport() { + } + + public static void init() { + impl.init(); + } + + /** + * @return true if pointer events are supported by the browser, false + * otherwise + */ + public static boolean isSupported() { + return impl.isSupported(); + } + + /** + * @param eventType + * @return the native event name of the given event + */ + public static String getNativeEventName(EventType eventType) { + return impl.getNativeEventName(eventType); + } +} diff --git a/client/src/com/vaadin/client/event/PointerEventSupportImpl.java b/client/src/com/vaadin/client/event/PointerEventSupportImpl.java new file mode 100644 index 0000000000..7605104ade --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerEventSupportImpl.java @@ -0,0 +1,51 @@ +/* + * 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.event; + +import com.vaadin.client.event.PointerEvent.EventType; + +/** + * Main pointer event support implementation class. Made for browser without + * pointer event support. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PointerEventSupportImpl { + + /** + * @return true if the pointer events are supported, false otherwise + */ + protected boolean isSupported() { + return false; + } + + /** + * @param events + * @return the native event name of the given event + */ + public String getNativeEventName(EventType eventName) { + return eventName.toString().toLowerCase(); + } + + /** + * Initializes event support + */ + protected void init() { + + } + +} diff --git a/client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java b/client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java new file mode 100644 index 0000000000..1de2f9722f --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerEventSupportImplIE10.java @@ -0,0 +1,34 @@ +/* + * 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.event; + +import com.vaadin.client.event.PointerEvent.EventType; + +/** + * Pointer event support class for IE 10 ("ms" prefixed pointer events) + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PointerEventSupportImplIE10 extends + PointerEventSupportImplModernIE { + + @Override + public String getNativeEventName(EventType eventName) { + return "MS" + eventName; + } + +} diff --git a/client/src/com/vaadin/client/event/PointerEventSupportImplModernIE.java b/client/src/com/vaadin/client/event/PointerEventSupportImplModernIE.java new file mode 100644 index 0000000000..851c600bcb --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerEventSupportImplModernIE.java @@ -0,0 +1,72 @@ +/* + * 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.event; + +import com.google.gwt.core.client.JavaScriptObject; +import com.google.gwt.user.client.impl.DOMImplStandard; +import com.vaadin.client.event.PointerEvent.EventType; + +/** + * Pointer event support class for IE 11+ (unprefixed pointer events) + * + * @since 7.2 + * @author Vaadin Ltd + */ + +public class PointerEventSupportImplModernIE extends PointerEventSupportImpl { + + protected static boolean inited = false; + + @Override + protected boolean isSupported() { + return true; + } + + @Override + protected void init() { + if (!inited) { + JavaScriptObject eventDispatcherMapExtensions = JavaScriptObject + .createObject(); + JavaScriptObject captureEventDispatcherMapExtensions = JavaScriptObject + .createObject(); + for (EventType e : EventType.values()) { + addEventDispatcher(e.getNativeEventName(), + eventDispatcherMapExtensions); + getPointerEventCaptureDispatchers(e.getNativeEventName(), + captureEventDispatcherMapExtensions); + } + DOMImplStandard + .addBitlessEventDispatchers(eventDispatcherMapExtensions); + DOMImplStandard + .addCaptureEventDispatchers(captureEventDispatcherMapExtensions); + + inited = true; + } + } + + private static native void addEventDispatcher(String eventName, + JavaScriptObject jso) + /*-{ + jso[eventName] = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchEvent(*); + }-*/; + + private static native void getPointerEventCaptureDispatchers( + String eventName, JavaScriptObject jso) + /*-{ + jso[eventName] = @com.google.gwt.user.client.impl.DOMImplStandard::dispatchCapturedMouseEvent(*); + }-*/; + +} diff --git a/client/src/com/vaadin/client/event/PointerMoveEvent.java b/client/src/com/vaadin/client/event/PointerMoveEvent.java new file mode 100644 index 0000000000..6a4a81e17d --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerMoveEvent.java @@ -0,0 +1,61 @@ +/* + * 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.event; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native PointerMoveEvent event. + * + * @since 7.2 + */ +public class PointerMoveEvent extends PointerEvent<PointerMoveHandler> { + + /** + * Event type for PointerMoveEvent. Represents the meta-data associated with + * this event. + */ + private static final Type<PointerMoveHandler> TYPE = new Type<PointerMoveHandler>( + EventType.PointerMove.getNativeEventName(), new PointerMoveEvent()); + + /** + * Gets the event type associated with PointerMoveEvent. + * + * @return the handler type + */ + public static Type<PointerMoveHandler> getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected PointerMoveEvent() { + } + + @Override + public final Type<PointerMoveHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(PointerMoveHandler handler) { + handler.onPointerMove(this); + } + +} diff --git a/client/src/com/vaadin/client/event/PointerMoveHandler.java b/client/src/com/vaadin/client/event/PointerMoveHandler.java new file mode 100644 index 0000000000..ad6a93da8d --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerMoveHandler.java @@ -0,0 +1,34 @@ +/* + * 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.event; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link PointerMoveEvent} events. + * + * @since 7.2 + */ +public interface PointerMoveHandler extends EventHandler { + + /** + * Called when PointerMoveEvent is fired. + * + * @param event + * the {@link PointerMoveEvent} that was fired + */ + void onPointerMove(PointerMoveEvent event); +} diff --git a/client/src/com/vaadin/client/event/PointerUpEvent.java b/client/src/com/vaadin/client/event/PointerUpEvent.java new file mode 100644 index 0000000000..005902d7f7 --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerUpEvent.java @@ -0,0 +1,61 @@ +/* + * 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.event; + +import com.google.gwt.event.dom.client.DomEvent; + +/** + * Represents a native PointerUpEvent. + * + * @since 7.2 + */ +public class PointerUpEvent extends PointerEvent<PointerUpHandler> { + + /** + * Event type for PointerUpEvent. Represents the meta-data associated with + * this event. + */ + private static final Type<PointerUpHandler> TYPE = new Type<PointerUpHandler>( + EventType.PointerUp.getNativeEventName(), new PointerUpEvent()); + + /** + * Gets the event type associated with PointerUpEvent. + * + * @return the handler type + */ + public static Type<PointerUpHandler> getType() { + return TYPE; + } + + /** + * Protected constructor, use + * {@link DomEvent#fireNativeEvent(com.google.gwt.dom.client.NativeEvent, com.google.gwt.event.shared.HasHandlers)} + * to fire pointer down events. + */ + protected PointerUpEvent() { + } + + @Override + public final Type<PointerUpHandler> getAssociatedType() { + return TYPE; + } + + @Override + protected void dispatch(PointerUpHandler handler) { + handler.onPointerUp(this); + } + +} diff --git a/client/src/com/vaadin/client/event/PointerUpHandler.java b/client/src/com/vaadin/client/event/PointerUpHandler.java new file mode 100644 index 0000000000..587b249634 --- /dev/null +++ b/client/src/com/vaadin/client/event/PointerUpHandler.java @@ -0,0 +1,34 @@ +/* + * 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.event; + +import com.google.gwt.event.shared.EventHandler; + +/** + * Handler interface for {@link PointerUpEvent} events. + * + * @since 7.2 + */ +public interface PointerUpHandler extends EventHandler { + + /** + * Called when PointerUpEvent is fired. + * + * @param event + * the {@link PointerUpEvent} that was fired + */ + void onPointerUp(PointerUpEvent event); +} diff --git a/client/src/com/vaadin/client/extensions/AbstractExtensionConnector.java b/client/src/com/vaadin/client/extensions/AbstractExtensionConnector.java index 4aa1ec0e65..79eaa2f8b9 100644 --- a/client/src/com/vaadin/client/extensions/AbstractExtensionConnector.java +++ b/client/src/com/vaadin/client/extensions/AbstractExtensionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java b/client/src/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java index a4e9b41a52..58457c1b7b 100644 --- a/client/src/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java +++ b/client/src/com/vaadin/client/extensions/BrowserWindowOpenerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/extensions/FileDownloaderConnector.java b/client/src/com/vaadin/client/extensions/FileDownloaderConnector.java index 981d6be982..66fc30575b 100644 --- a/client/src/com/vaadin/client/extensions/FileDownloaderConnector.java +++ b/client/src/com/vaadin/client/extensions/FileDownloaderConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/extensions/ResponsiveConnector.java b/client/src/com/vaadin/client/extensions/ResponsiveConnector.java index 500e4a0916..1392a1a49a 100644 --- a/client/src/com/vaadin/client/extensions/ResponsiveConnector.java +++ b/client/src/com/vaadin/client/extensions/ResponsiveConnector.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -100,13 +100,13 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements * @return The selectors in a comma delimited string. */ protected String constructSelectorsForTarget() { - String primaryStyle = this.target.getState().primaryStyleName; + String primaryStyle = target.getState().primaryStyleName; StringBuilder selectors = new StringBuilder(); selectors.append(".").append(primaryStyle); - if (this.target.getState().styles != null - && this.target.getState().styles.size() > 0) { - for (String style : this.target.getState().styles) { + if (target.getState().styles != null + && target.getState().styles.size() > 0) { + for (String style : target.getState().styles) { selectors.append(",.").append(style); selectors.append(",.").append(primaryStyle).append(".") .append(style); @@ -118,8 +118,8 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements } // Allow the ID to be used as the selector as well for ranges - if (this.target.getState().id != null) { - selectors.append(",#").append(this.target.getState().id); + if (target.getState().id != null) { + selectors.append(",#").append(target.getState().id); } return selectors.toString(); } @@ -128,7 +128,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements public void onUnregister() { super.onUnregister(); LayoutManager.get(getConnection()).removeElementResizeListener( - this.target.getWidget().getElement(), this); + target.getWidget().getElement(), this); } /** @@ -314,7 +314,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements int height = event.getLayoutManager() .getOuterHeight(event.getElement()); - com.google.gwt.user.client.Element element = this.target.getWidget() + com.google.gwt.user.client.Element element = target.getWidget() .getElement(); boolean forceRedraw = false; @@ -323,7 +323,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements event.getElement()); if (!"".equals(currentWidthRanges)) { - this.target.getWidget().getElement() + target.getWidget().getElement() .setAttribute("width-range", currentWidthRanges); forceRedraw = true; } else { @@ -335,7 +335,7 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements event.getElement()); if (!"".equals(currentHeightRanges)) { - this.target.getWidget().getElement() + target.getWidget().getElement() .setAttribute("height-range", currentHeightRanges); forceRedraw = true; } else { @@ -383,15 +383,15 @@ public class ResponsiveConnector extends AbstractExtensionConnector implements var min = parseInt(bp[1]); var max = parseInt(bp[2]); - if(min && max) { + if(!isNaN(min) && !isNaN(max)) { if(min <= size && size <= max) { ranges += " " + bp[1] + "-" + bp[2]; } - } else if (min) { + } else if (!isNaN(min)) { if(min <= size) { ranges += " " + bp[1] + "-"; } - } else if (max) { + } else if (!isNaN(max)) { if (size <= max) { ranges += " -" + bp[2]; } diff --git a/client/src/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java b/client/src/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java index 8e6ad25407..f76f5058c5 100644 --- a/client/src/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java +++ b/client/src/com/vaadin/client/extensions/javascriptmanager/JavaScriptManagerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java b/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java index 6be89c9cc9..9b7f611281 100644 --- a/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java +++ b/client/src/com/vaadin/client/metadata/AsyncBundleLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/BundleLoadCallback.java b/client/src/com/vaadin/client/metadata/BundleLoadCallback.java index 66a58aed72..399ac87d4e 100644 --- a/client/src/com/vaadin/client/metadata/BundleLoadCallback.java +++ b/client/src/com/vaadin/client/metadata/BundleLoadCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java b/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java index 8148010b54..7d2078061e 100644 --- a/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java +++ b/client/src/com/vaadin/client/metadata/ConnectorBundleLoader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/InvokationHandler.java b/client/src/com/vaadin/client/metadata/InvokationHandler.java index 4d1a3caa94..4faf0a1484 100644 --- a/client/src/com/vaadin/client/metadata/InvokationHandler.java +++ b/client/src/com/vaadin/client/metadata/InvokationHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/Invoker.java b/client/src/com/vaadin/client/metadata/Invoker.java index 3639b4a1e7..6e263829c0 100644 --- a/client/src/com/vaadin/client/metadata/Invoker.java +++ b/client/src/com/vaadin/client/metadata/Invoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/JsniInvoker.java b/client/src/com/vaadin/client/metadata/JsniInvoker.java index 4692a18cfe..d6a60c89f3 100644 --- a/client/src/com/vaadin/client/metadata/JsniInvoker.java +++ b/client/src/com/vaadin/client/metadata/JsniInvoker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/Method.java b/client/src/com/vaadin/client/metadata/Method.java index 390574cdf8..d6b474fabc 100644 --- a/client/src/com/vaadin/client/metadata/Method.java +++ b/client/src/com/vaadin/client/metadata/Method.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/NoDataException.java b/client/src/com/vaadin/client/metadata/NoDataException.java index 921b0a5b4e..45ea67d017 100644 --- a/client/src/com/vaadin/client/metadata/NoDataException.java +++ b/client/src/com/vaadin/client/metadata/NoDataException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/OnStateChangeMethod.java b/client/src/com/vaadin/client/metadata/OnStateChangeMethod.java index 2ba06fd4eb..47749fcd52 100644 --- a/client/src/com/vaadin/client/metadata/OnStateChangeMethod.java +++ b/client/src/com/vaadin/client/metadata/OnStateChangeMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/Property.java b/client/src/com/vaadin/client/metadata/Property.java index 72ed7fec41..f421a5525b 100644 --- a/client/src/com/vaadin/client/metadata/Property.java +++ b/client/src/com/vaadin/client/metadata/Property.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/ProxyHandler.java b/client/src/com/vaadin/client/metadata/ProxyHandler.java index 3057a7c287..6fba8a8155 100644 --- a/client/src/com/vaadin/client/metadata/ProxyHandler.java +++ b/client/src/com/vaadin/client/metadata/ProxyHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/Type.java b/client/src/com/vaadin/client/metadata/Type.java index c09dffa638..cc185dff96 100644 --- a/client/src/com/vaadin/client/metadata/Type.java +++ b/client/src/com/vaadin/client/metadata/Type.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/TypeData.java b/client/src/com/vaadin/client/metadata/TypeData.java index 08f653f371..9addc4ffb2 100644 --- a/client/src/com/vaadin/client/metadata/TypeData.java +++ b/client/src/com/vaadin/client/metadata/TypeData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/metadata/TypeDataStore.java b/client/src/com/vaadin/client/metadata/TypeDataStore.java index bc6610a6ff..7aa952d0f2 100644 --- a/client/src/com/vaadin/client/metadata/TypeDataStore.java +++ b/client/src/com/vaadin/client/metadata/TypeDataStore.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractClickEventHandler.java b/client/src/com/vaadin/client/ui/AbstractClickEventHandler.java index 32c10fac49..c08656c4d9 100644 --- a/client/src/com/vaadin/client/ui/AbstractClickEventHandler.java +++ b/client/src/com/vaadin/client/ui/AbstractClickEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -242,4 +242,4 @@ public abstract class AbstractClickEventHandler implements MouseDownHandler, return connector.getWidget().getElement(); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java index f6c26cda05..ccf070698b 100644 --- a/client/src/com/vaadin/client/ui/AbstractComponentConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -217,11 +217,24 @@ public abstract class AbstractComponentConnector extends AbstractConnector } + /** + * Updates the component size based on the shared state, invoking the + * {@link LayoutManager layout manager} if necessary. + */ protected void updateComponentSize() { updateComponentSize(getState().width == null ? "" : getState().width, getState().height == null ? "" : getState().height); } + /** + * Updates the component size, invoking the {@link LayoutManager layout + * manager} if necessary. + * + * @param newWidth + * The new width as a CSS string. Cannot be null. + * @param newHeight + * The new height as a CSS string. Cannot be null. + */ protected void updateComponentSize(String newWidth, String newHeight) { Profiler.enter("AbstractComponentConnector.updateComponentSize"); @@ -255,13 +268,26 @@ public abstract class AbstractComponentConnector extends AbstractConnector Profiler.leave("AbstractComponentConnector.updateComponentSize update styleNames"); Profiler.enter("AbstractComponentConnector.updateComponentSize update DOM"); - widget.setHeight(newHeight); - widget.setWidth(newWidth); + updateWidgetSize(newWidth, newHeight); Profiler.leave("AbstractComponentConnector.updateComponentSize update DOM"); Profiler.leave("AbstractComponentConnector.updateComponentSize"); } + /** + * 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 + * The new height as a CSS string. Cannot be null. + */ + protected void updateWidgetSize(String newWidth, String newHeight) { + getWidget().setWidth(newWidth); + getWidget().setHeight(newHeight); + } + @Override public boolean isRelativeHeight() { return ComponentStateUtil.isRelativeHeight(getState()); diff --git a/client/src/com/vaadin/client/ui/AbstractComponentContainerConnector.java b/client/src/com/vaadin/client/ui/AbstractComponentContainerConnector.java index e1b4e720f9..f808fb194c 100644 --- a/client/src/com/vaadin/client/ui/AbstractComponentContainerConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractComponentContainerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractConnector.java b/client/src/com/vaadin/client/ui/AbstractConnector.java index bd499ac4bc..a2e0d9cd54 100644 --- a/client/src/com/vaadin/client/ui/AbstractConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractFieldConnector.java b/client/src/com/vaadin/client/ui/AbstractFieldConnector.java index b435c28b92..a3c3779eb6 100644 --- a/client/src/com/vaadin/client/ui/AbstractFieldConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractHasComponentsConnector.java b/client/src/com/vaadin/client/ui/AbstractHasComponentsConnector.java index d833f076e4..27210de10d 100644 --- a/client/src/com/vaadin/client/ui/AbstractHasComponentsConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractHasComponentsConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractLayoutConnector.java b/client/src/com/vaadin/client/ui/AbstractLayoutConnector.java index 4939d824a9..6e1dde3863 100644 --- a/client/src/com/vaadin/client/ui/AbstractLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java b/client/src/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java index 07fec98189..954803b64c 100644 --- a/client/src/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java +++ b/client/src/com/vaadin/client/ui/AbstractSingleComponentContainerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/Action.java b/client/src/com/vaadin/client/ui/Action.java index 84399f7611..d7593740d6 100644 --- a/client/src/com/vaadin/client/ui/Action.java +++ b/client/src/com/vaadin/client/ui/Action.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/ActionOwner.java b/client/src/com/vaadin/client/ui/ActionOwner.java index 0d95072714..73c3675438 100644 --- a/client/src/com/vaadin/client/ui/ActionOwner.java +++ b/client/src/com/vaadin/client/ui/ActionOwner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/CalendarEntry.java b/client/src/com/vaadin/client/ui/CalendarEntry.java index 196739694a..8050f0aab1 100644 --- a/client/src/com/vaadin/client/ui/CalendarEntry.java +++ b/client/src/com/vaadin/client/ui/CalendarEntry.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -137,4 +137,4 @@ public class CalendarEntry { return s; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/ClickEventHandler.java b/client/src/com/vaadin/client/ui/ClickEventHandler.java index 668b2aa131..7947e0560c 100644 --- a/client/src/com/vaadin/client/ui/ClickEventHandler.java +++ b/client/src/com/vaadin/client/ui/ClickEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -59,4 +59,4 @@ public abstract class ClickEventHandler extends AbstractClickEventHandler { protected abstract void fireClick(NativeEvent event, MouseEventDetails mouseDetails); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/Field.java b/client/src/com/vaadin/client/ui/Field.java index 987d3e1c3f..99bfe107b3 100644 --- a/client/src/com/vaadin/client/ui/Field.java +++ b/client/src/com/vaadin/client/ui/Field.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/FocusElementPanel.java b/client/src/com/vaadin/client/ui/FocusElementPanel.java index dd5544f016..d0ddca0935 100644 --- a/client/src/com/vaadin/client/ui/FocusElementPanel.java +++ b/client/src/com/vaadin/client/ui/FocusElementPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/FocusUtil.java b/client/src/com/vaadin/client/ui/FocusUtil.java index 8de3f767bd..4750b89173 100644 --- a/client/src/com/vaadin/client/ui/FocusUtil.java +++ b/client/src/com/vaadin/client/ui/FocusUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/FocusableFlexTable.java b/client/src/com/vaadin/client/ui/FocusableFlexTable.java index ff453061c4..8deec2babb 100644 --- a/client/src/com/vaadin/client/ui/FocusableFlexTable.java +++ b/client/src/com/vaadin/client/ui/FocusableFlexTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/FocusableFlowPanel.java b/client/src/com/vaadin/client/ui/FocusableFlowPanel.java index 931b345698..77a26361ef 100644 --- a/client/src/com/vaadin/client/ui/FocusableFlowPanel.java +++ b/client/src/com/vaadin/client/ui/FocusableFlowPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -114,4 +114,4 @@ public class FocusableFlowPanel extends FlowPanel implements HasFocusHandlers, public void focus() { setFocus(true); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java index d01ffc00ff..475c8f8074 100644 --- a/client/src/com/vaadin/client/ui/FocusableScrollPanel.java +++ b/client/src/com/vaadin/client/ui/FocusableScrollPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/FontIcon.java b/client/src/com/vaadin/client/ui/FontIcon.java index 04640fab06..74d094a0f2 100644 --- a/client/src/com/vaadin/client/ui/FontIcon.java +++ b/client/src/com/vaadin/client/ui/FontIcon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/Icon.java b/client/src/com/vaadin/client/ui/Icon.java index 219692161e..277fc2dd5d 100644 --- a/client/src/com/vaadin/client/ui/Icon.java +++ b/client/src/com/vaadin/client/ui/Icon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/ImageIcon.java b/client/src/com/vaadin/client/ui/ImageIcon.java index 787b0175aa..7174c73637 100644 --- a/client/src/com/vaadin/client/ui/ImageIcon.java +++ b/client/src/com/vaadin/client/ui/ImageIcon.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/JavaScriptComponentConnector.java b/client/src/com/vaadin/client/ui/JavaScriptComponentConnector.java index 3131b757ba..a3a03b597b 100644 --- a/client/src/com/vaadin/client/ui/JavaScriptComponentConnector.java +++ b/client/src/com/vaadin/client/ui/JavaScriptComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/JavaScriptWidget.java b/client/src/com/vaadin/client/ui/JavaScriptWidget.java index 211d652f1e..da9192dace 100644 --- a/client/src/com/vaadin/client/ui/JavaScriptWidget.java +++ b/client/src/com/vaadin/client/ui/JavaScriptWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/LayoutClickEventHandler.java b/client/src/com/vaadin/client/ui/LayoutClickEventHandler.java index af398a1e07..6eccb9cb3b 100644 --- a/client/src/com/vaadin/client/ui/LayoutClickEventHandler.java +++ b/client/src/com/vaadin/client/ui/LayoutClickEventHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/LegacyConnector.java b/client/src/com/vaadin/client/ui/LegacyConnector.java index 8916e9bf4a..35a82cff53 100644 --- a/client/src/com/vaadin/client/ui/LegacyConnector.java +++ b/client/src/com/vaadin/client/ui/LegacyConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/ManagedLayout.java b/client/src/com/vaadin/client/ui/ManagedLayout.java index 0a92c59768..e7266d99b5 100644 --- a/client/src/com/vaadin/client/ui/ManagedLayout.java +++ b/client/src/com/vaadin/client/ui/ManagedLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/MediaBaseConnector.java b/client/src/com/vaadin/client/ui/MediaBaseConnector.java index 8614977be1..cebb2e3836 100644 --- a/client/src/com/vaadin/client/ui/MediaBaseConnector.java +++ b/client/src/com/vaadin/client/ui/MediaBaseConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/PostLayoutListener.java b/client/src/com/vaadin/client/ui/PostLayoutListener.java index 3da2358b0c..bbeb6f1255 100644 --- a/client/src/com/vaadin/client/ui/PostLayoutListener.java +++ b/client/src/com/vaadin/client/ui/PostLayoutListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/ShortcutActionHandler.java b/client/src/com/vaadin/client/ui/ShortcutActionHandler.java index 1ed044ffda..9e9279267d 100644 --- a/client/src/com/vaadin/client/ui/ShortcutActionHandler.java +++ b/client/src/com/vaadin/client/ui/ShortcutActionHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/SimpleFocusablePanel.java b/client/src/com/vaadin/client/ui/SimpleFocusablePanel.java index 2678a6168e..f938b2e74f 100644 --- a/client/src/com/vaadin/client/ui/SimpleFocusablePanel.java +++ b/client/src/com/vaadin/client/ui/SimpleFocusablePanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/SimpleManagedLayout.java b/client/src/com/vaadin/client/ui/SimpleManagedLayout.java index 300248810c..e61e2799c4 100644 --- a/client/src/com/vaadin/client/ui/SimpleManagedLayout.java +++ b/client/src/com/vaadin/client/ui/SimpleManagedLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/SubPartAware.java b/client/src/com/vaadin/client/ui/SubPartAware.java index fea8c2dc4a..a064b8a8a8 100644 --- a/client/src/com/vaadin/client/ui/SubPartAware.java +++ b/client/src/com/vaadin/client/ui/SubPartAware.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/TouchScrollDelegate.java b/client/src/com/vaadin/client/ui/TouchScrollDelegate.java index 9d7e435339..f53b32b4e1 100644 --- a/client/src/com/vaadin/client/ui/TouchScrollDelegate.java +++ b/client/src/com/vaadin/client/ui/TouchScrollDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/TreeAction.java b/client/src/com/vaadin/client/ui/TreeAction.java index 8ff7caa0d4..f190ab62d2 100644 --- a/client/src/com/vaadin/client/ui/TreeAction.java +++ b/client/src/com/vaadin/client/ui/TreeAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/UnknownComponentConnector.java b/client/src/com/vaadin/client/ui/UnknownComponentConnector.java index b9b0388d9a..50ded0aeba 100644 --- a/client/src/com/vaadin/client/ui/UnknownComponentConnector.java +++ b/client/src/com/vaadin/client/ui/UnknownComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VAbsoluteLayout.java b/client/src/com/vaadin/client/ui/VAbsoluteLayout.java index bbec8b9e6c..44230288a7 100644 --- a/client/src/com/vaadin/client/ui/VAbsoluteLayout.java +++ b/client/src/com/vaadin/client/ui/VAbsoluteLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java b/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java index a2de144ad2..269db23366 100644 --- a/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java +++ b/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,8 @@ import java.util.List; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.Style; +import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.TouchCancelEvent; import com.google.gwt.event.dom.client.TouchCancelHandler; import com.google.gwt.event.dom.client.TouchEndEvent; @@ -181,16 +183,16 @@ public class VAbstractSplitPanel extends ComplexPanel { protected void constructDom() { DOM.appendChild(splitter, DOM.createDiv()); // for styling DOM.appendChild(getElement(), wrapper); - DOM.setStyleAttribute(wrapper, "position", "relative"); - DOM.setStyleAttribute(wrapper, "width", "100%"); - DOM.setStyleAttribute(wrapper, "height", "100%"); + wrapper.getStyle().setPosition(Position.RELATIVE); + wrapper.getStyle().setWidth(100, Unit.PCT); + wrapper.getStyle().setHeight(100, Unit.PCT); DOM.appendChild(wrapper, firstContainer); DOM.appendChild(wrapper, splitter); DOM.appendChild(wrapper, secondContainer); - DOM.setStyleAttribute(splitter, "position", "absolute"); - DOM.setStyleAttribute(secondContainer, "position", "absolute"); + splitter.getStyle().setPosition(Position.ABSOLUTE); + secondContainer.getStyle().setPosition(Position.ABSOLUTE); setStylenames(); } @@ -198,16 +200,16 @@ public class VAbstractSplitPanel extends ComplexPanel { private void setOrientation(Orientation orientation) { this.orientation = orientation; if (orientation == Orientation.HORIZONTAL) { - DOM.setStyleAttribute(splitter, "height", "100%"); - DOM.setStyleAttribute(splitter, "top", "0"); - DOM.setStyleAttribute(firstContainer, "height", "100%"); - DOM.setStyleAttribute(secondContainer, "top", "0"); - DOM.setStyleAttribute(secondContainer, "height", "100%"); + splitter.getStyle().setHeight(100, Unit.PCT); + splitter.getStyle().setTop(0, Unit.PX); + firstContainer.getStyle().setHeight(100, Unit.PCT); + secondContainer.getStyle().setTop(0, Unit.PX); + secondContainer.getStyle().setHeight(100, Unit.PCT); } else { - DOM.setStyleAttribute(splitter, "width", "100%"); - DOM.setStyleAttribute(splitter, "left", "0"); - DOM.setStyleAttribute(firstContainer, "width", "100%"); - DOM.setStyleAttribute(secondContainer, "width", "100%"); + splitter.getStyle().setWidth(100, Unit.PCT); + splitter.getStyle().setLeft(0, Unit.PX); + firstContainer.getStyle().setWidth(100, Unit.PCT); + secondContainer.getStyle().setWidth(100, Unit.PCT); } } @@ -237,11 +239,11 @@ public class VAbstractSplitPanel extends ComplexPanel { public void setPositionReversed(boolean reversed) { if (positionReversed != reversed) { if (orientation == Orientation.HORIZONTAL) { - DOM.setStyleAttribute(splitter, "right", ""); - DOM.setStyleAttribute(splitter, "left", ""); + splitter.getStyle().clearRight(); + splitter.getStyle().clearLeft(); } else if (orientation == Orientation.VERTICAL) { - DOM.setStyleAttribute(splitter, "top", ""); - DOM.setStyleAttribute(splitter, "bottom", ""); + splitter.getStyle().clearTop(); + splitter.getStyle().clearBottom(); } positionReversed = reversed; @@ -411,15 +413,14 @@ public class VAbstractSplitPanel extends ComplexPanel { return; } - DOM.setStyleAttribute(firstContainer, "width", pixelPosition + "px"); + firstContainer.getStyle().setWidth(pixelPosition, Unit.PX); int secondContainerWidth = (wholeSize - pixelPosition - getSplitterSize()); if (secondContainerWidth < 0) { secondContainerWidth = 0; } - DOM.setStyleAttribute(secondContainer, "width", - secondContainerWidth + "px"); - DOM.setStyleAttribute(secondContainer, "left", - (pixelPosition + getSplitterSize()) + "px"); + secondContainer.getStyle().setWidth(secondContainerWidth, Unit.PX); + secondContainer.getStyle().setLeft( + pixelPosition + getSplitterSize(), Unit.PX); LayoutManager layoutManager = LayoutManager.get(client); ConnectorMap connectorMap = ConnectorMap.get(client); @@ -460,16 +461,15 @@ public class VAbstractSplitPanel extends ComplexPanel { return; } - DOM.setStyleAttribute(firstContainer, "height", pixelPosition - + "px"); + firstContainer.getStyle().setHeight(pixelPosition, Unit.PX); int secondContainerHeight = (wholeSize - pixelPosition - getSplitterSize()); if (secondContainerHeight < 0) { secondContainerHeight = 0; } - DOM.setStyleAttribute(secondContainer, "height", - secondContainerHeight + "px"); - DOM.setStyleAttribute(secondContainer, "top", - (pixelPosition + getSplitterSize()) + "px"); + secondContainer.getStyle() + .setHeight(secondContainerHeight, Unit.PX); + secondContainer.getStyle().setTop( + pixelPosition + getSplitterSize(), Unit.PX); layoutManager = LayoutManager.get(client); connectorMap = ConnectorMap.get(client); @@ -716,13 +716,12 @@ public class VAbstractSplitPanel extends ComplexPanel { } if (draggingCurtain == null) { draggingCurtain = DOM.createDiv(); - DOM.setStyleAttribute(draggingCurtain, "position", "absolute"); - DOM.setStyleAttribute(draggingCurtain, "top", "0px"); - DOM.setStyleAttribute(draggingCurtain, "left", "0px"); - DOM.setStyleAttribute(draggingCurtain, "width", "100%"); - DOM.setStyleAttribute(draggingCurtain, "height", "100%"); - DOM.setStyleAttribute(draggingCurtain, "zIndex", "" - + VOverlay.Z_INDEX); + draggingCurtain.getStyle().setPosition(Position.ABSOLUTE); + draggingCurtain.getStyle().setTop(0, Unit.PX); + draggingCurtain.getStyle().setLeft(0, Unit.PX); + draggingCurtain.getStyle().setWidth(100, Unit.PCT); + draggingCurtain.getStyle().setHeight(100, Unit.PCT); + draggingCurtain.getStyle().setZIndex(VOverlay.Z_INDEX); DOM.appendChild(wrapper, draggingCurtain); } diff --git a/client/src/com/vaadin/client/ui/VAccordion.java b/client/src/com/vaadin/client/ui/VAccordion.java index d348e6863b..3e89958a98 100644 --- a/client/src/com/vaadin/client/ui/VAccordion.java +++ b/client/src/com/vaadin/client/ui/VAccordion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,6 +20,8 @@ import java.util.Iterator; import java.util.Set; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.DOM; @@ -160,12 +162,11 @@ public class VAccordion extends VTabsheetBase { public void setHeight(int height) { if (height == -1) { super.setHeight(""); - DOM.setStyleAttribute(content, "height", "0px"); + content.getStyle().setHeight(0, Unit.PX); } else { super.setHeight((height + getCaptionHeight()) + "px"); - DOM.setStyleAttribute(content, "height", height + "px"); - DOM.setStyleAttribute(content, "top", getCaptionHeight() + "px"); - + content.getStyle().setHeight(height, Unit.PX); + content.getStyle().setTop(getCaptionHeight(), Unit.PX); } } @@ -286,20 +287,20 @@ public class VAccordion extends VTabsheetBase { public void open() { open = true; - DOM.setStyleAttribute(content, "top", getCaptionHeight() + "px"); - DOM.setStyleAttribute(content, "left", "0px"); - DOM.setStyleAttribute(content, "visibility", ""); + content.getStyle().setTop(getCaptionHeight(), Unit.PX); + content.getStyle().setLeft(0, Unit.PX); + content.getStyle().clearVisibility(); addStyleDependentName("open"); } public void hide() { - DOM.setStyleAttribute(content, "visibility", "hidden"); + content.getStyle().setVisibility(Visibility.HIDDEN); } public void close() { - DOM.setStyleAttribute(content, "visibility", "hidden"); - DOM.setStyleAttribute(content, "top", "-100000px"); - DOM.setStyleAttribute(content, "left", "-100000px"); + content.getStyle().setVisibility(Visibility.HIDDEN); + content.getStyle().setTop(-100000, Unit.PX); + content.getStyle().setLeft(-100000, Unit.PX); removeStyleDependentName("open"); setHeight(-1); setWidth(""); diff --git a/client/src/com/vaadin/client/ui/VAudio.java b/client/src/com/vaadin/client/ui/VAudio.java index 647391840e..109e4d65b0 100644 --- a/client/src/com/vaadin/client/ui/VAudio.java +++ b/client/src/com/vaadin/client/ui/VAudio.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VBrowserFrame.java b/client/src/com/vaadin/client/ui/VBrowserFrame.java index 4e13921582..2c4011e87d 100644 --- a/client/src/com/vaadin/client/ui/VBrowserFrame.java +++ b/client/src/com/vaadin/client/ui/VBrowserFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VButton.java b/client/src/com/vaadin/client/ui/VButton.java index 98df258f57..7dfb5c7c86 100644 --- a/client/src/com/vaadin/client/ui/VButton.java +++ b/client/src/com/vaadin/client/ui/VButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VCalendar.java b/client/src/com/vaadin/client/ui/VCalendar.java index 965d2a148e..f0f1bc89ca 100644 --- a/client/src/com/vaadin/client/ui/VCalendar.java +++ b/client/src/com/vaadin/client/ui/VCalendar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VCalendarPanel.java b/client/src/com/vaadin/client/ui/VCalendarPanel.java index 74462e501d..d8c96917d8 100644 --- a/client/src/com/vaadin/client/ui/VCalendarPanel.java +++ b/client/src/com/vaadin/client/ui/VCalendarPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,7 @@ import java.util.Iterator; import com.google.gwt.aria.client.Roles; import com.google.gwt.aria.client.SelectedValue; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Node; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; @@ -138,6 +139,10 @@ public class VCalendarPanel extends FocusableFlexTable implements */ @Override public void onClick(ClickEvent event) { + if (!isEnabled() || isReadonly()) { + return; + } + Date newDate = ((Day) event.getSource()).getDate(); if (!isDateInsideRange(newDate, Resolution.DAY)) { return; @@ -174,10 +179,6 @@ public class VCalendarPanel extends FocusableFlexTable implements private Date value; - private boolean enabled = true; - - private boolean readonly = false; - private DateTimeService dateTimeService; private boolean showISOWeekNumbers; @@ -349,11 +350,11 @@ public class VCalendarPanel extends FocusableFlexTable implements } private boolean isReadonly() { - return readonly; + return parent.isReadonly(); } private boolean isEnabled() { - return enabled; + return parent.isEnabled(); } @Override @@ -1498,11 +1499,12 @@ public class VCalendarPanel extends FocusableFlexTable implements */ @Override public void onMouseDown(MouseDownEvent event) { - // Allow user to click-n-hold for fast-forward or fast-rewind. + // Click-n-hold the left mouse button for fast-forward or fast-rewind. // Timer is first used for a 500ms delay after mousedown. After that has // elapsed, another timer is triggered to go off every 150ms. Both // timers are cancelled on mouseup or mouseout. - if (event.getSource() instanceof VEventButton) { + if (event.getNativeButton() == NativeEvent.BUTTON_LEFT + && event.getSource() instanceof VEventButton) { final VEventButton sender = (VEventButton) event.getSource(); processClickEvent(sender); mouseTimer = new Timer() { diff --git a/client/src/com/vaadin/client/ui/VCheckBox.java b/client/src/com/vaadin/client/ui/VCheckBox.java index 59058caf81..887dba262a 100644 --- a/client/src/com/vaadin/client/ui/VCheckBox.java +++ b/client/src/com/vaadin/client/ui/VCheckBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VColorPicker.java b/client/src/com/vaadin/client/ui/VColorPicker.java index f4124d7351..b55c125418 100644 --- a/client/src/com/vaadin/client/ui/VColorPicker.java +++ b/client/src/com/vaadin/client/ui/VColorPicker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,7 +17,6 @@ package com.vaadin.client.ui; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.HTML; /** @@ -80,8 +79,7 @@ public class VColorPicker extends VButton implements ClickHandler { } // Set the color - DOM.setStyleAttribute(colorIcon.getElement(), "background", color); - + colorIcon.getElement().getStyle().setProperty("background", color); } } diff --git a/client/src/com/vaadin/client/ui/VColorPickerArea.java b/client/src/com/vaadin/client/ui/VColorPickerArea.java index 81f2c8fcc7..e581cf3448 100644 --- a/client/src/com/vaadin/client/ui/VColorPickerArea.java +++ b/client/src/com/vaadin/client/ui/VColorPickerArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -166,7 +166,7 @@ public class VColorPickerArea extends Widget implements ClickHandler, HasHTML, public void refreshColor() { if (color != null) { // Set the color - DOM.setStyleAttribute(area.getElement(), "background", color); + area.getElement().getStyle().setProperty("background", color); } } diff --git a/client/src/com/vaadin/client/ui/VContextMenu.java b/client/src/com/vaadin/client/ui/VContextMenu.java index 7aa4035f10..038ee27dad 100644 --- a/client/src/com/vaadin/client/ui/VContextMenu.java +++ b/client/src/com/vaadin/client/ui/VContextMenu.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VCssLayout.java b/client/src/com/vaadin/client/ui/VCssLayout.java index e4fac6acb3..d7d9eefef9 100644 --- a/client/src/com/vaadin/client/ui/VCssLayout.java +++ b/client/src/com/vaadin/client/ui/VCssLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VCustomComponent.java b/client/src/com/vaadin/client/ui/VCustomComponent.java index 3bd6f06541..6aa21b08d2 100644 --- a/client/src/com/vaadin/client/ui/VCustomComponent.java +++ b/client/src/com/vaadin/client/ui/VCustomComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VCustomLayout.java b/client/src/com/vaadin/client/ui/VCustomLayout.java index 7f5e4d4028..f9caceb668 100644 --- a/client/src/com/vaadin/client/ui/VCustomLayout.java +++ b/client/src/com/vaadin/client/ui/VCustomLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VDateField.java b/client/src/com/vaadin/client/ui/VDateField.java index cd9052dc73..b4084847dd 100644 --- a/client/src/com/vaadin/client/ui/VDateField.java +++ b/client/src/com/vaadin/client/ui/VDateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VDateFieldCalendar.java b/client/src/com/vaadin/client/ui/VDateFieldCalendar.java index ee67e32c7d..759ebef102 100644 --- a/client/src/com/vaadin/client/ui/VDateFieldCalendar.java +++ b/client/src/com/vaadin/client/ui/VDateFieldCalendar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java index 237d2b55c2..4010ffd542 100644 --- a/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java +++ b/client/src/com/vaadin/client/ui/VDragAndDropWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VDragAndDropWrapperIE.java b/client/src/com/vaadin/client/ui/VDragAndDropWrapperIE.java index d434a4adb1..b32b36d13b 100644 --- a/client/src/com/vaadin/client/ui/VDragAndDropWrapperIE.java +++ b/client/src/com/vaadin/client/ui/VDragAndDropWrapperIE.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VEmbedded.java b/client/src/com/vaadin/client/ui/VEmbedded.java index d38d74f394..acf814471a 100644 --- a/client/src/com/vaadin/client/ui/VEmbedded.java +++ b/client/src/com/vaadin/client/ui/VEmbedded.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VFilterSelect.java b/client/src/com/vaadin/client/ui/VFilterSelect.java index e0ced98394..5ffa580371 100644 --- a/client/src/com/vaadin/client/ui/VFilterSelect.java +++ b/client/src/com/vaadin/client/ui/VFilterSelect.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2013 Vaadin Ltd. - * + * 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 @@ -80,7 +80,7 @@ import com.vaadin.shared.ui.combobox.FilteringMode; /** * Client side implementation of the Select component. - * + * * TODO needs major refactoring (to be extensible etc) */ @SuppressWarnings("deprecation") @@ -100,7 +100,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Constructor - * + * * @param uidl * The UIDL recieved from the server */ @@ -149,7 +149,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the option key which represents the item on the server side. - * + * * @return The key of the item */ public String getOptionKey() { @@ -158,7 +158,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the URI of the icon. Used when constructing the displayed option. - * + * * @return */ public String getIconUri() { @@ -252,7 +252,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Shows the popup where the user can see the filtered options - * + * * @param currentSuggestions * The filtered suggestions * @param currentPage @@ -275,6 +275,12 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * correctly. This issue manifests when a Combobox is placed in * another popupView which also needs to calculate the absoluteTop() * to position itself. #9768 + * + * After deferring the showSuggestions method, a problem with + * navigating in the combo box occurs. Because of that the method + * navigateItemAfterPageChange in ComboBoxConnector class, which + * navigates to the exact item after page was changed also was + * marked as deferred. #11333 */ final SuggestionPopup popup = this; Scheduler.get().scheduleDeferred(new ScheduledCommand() { @@ -332,7 +338,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Should the next page button be visible to the user? - * + * * @param active */ private void setNextButtonActive(boolean active) { @@ -352,7 +358,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Should the previous page button be visible to the user - * + * * @param active */ private void setPrevButtonActive(boolean active) { @@ -439,7 +445,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * because otherwise the waiting flag will be reset in * the first response and the second response will be * ignored, causing an empty popup... - * + * * As long as the scrolling delay is suitable * double/triple clicks will work by scrolling two or * three pages at a time and this should not be a @@ -453,7 +459,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, public void scrollUp() { debug("VFS.SP.LPS: scrollUp()"); - if (currentPage + pagesToScroll > 0) { + if (pageLength > 0 && currentPage + pagesToScroll > 0) { pagesToScroll--; cancel(); schedule(200); @@ -462,8 +468,9 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, public void scrollDown() { debug("VFS.SP.LPS: scrollDown()"); - if (totalMatches > (currentPage + pagesToScroll + 1) - * pageLength) { + if (pageLength > 0 + && totalMatches > (currentPage + pagesToScroll + 1) + * pageLength) { pagesToScroll++; cancel(); schedule(200); @@ -473,7 +480,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -510,7 +517,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * amount of items are visible at a time and a scrollbar or buttons are * visible to change page. If paging is turned of then all options are * rendered into the popup menu. - * + * * @param paging * Should the paging be turned on? */ @@ -533,7 +540,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.PopupPanel$PositionCallback#setPosition * (int, int) @@ -615,7 +622,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Was the popup just closed? - * + * * @return true if popup was just closed */ public boolean isJustClosed() { @@ -626,7 +633,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.logical.shared.CloseHandler#onClose(com.google * .gwt.event.logical.shared.CloseEvent) @@ -644,7 +651,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Updates style names in suggestion popup to help theme building. - * + * * @param uidl * UIDL for the whole combo box * @param componentState @@ -724,7 +731,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the suggestions rendered in the menu - * + * * @param suggestions * The suggestions to be rendered in the menu */ @@ -919,7 +926,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * TextBox variant used as input element for filter selects, which prevents * selecting text when disabled. - * + * * @since 7.1.5 */ public class FilterSelectTextBox extends TextBox { @@ -971,7 +978,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Widget#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -1144,7 +1151,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.user.client.ui.Composite#onBrowserEvent(com.google.gwt * .user.client.Event) @@ -1171,7 +1178,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * It is invoked during the Constructor and should only be overridden if a * custom TextBox shall be used. The overriding method cannot use any * instance variables. - * + * * @since 7.1.5 * @return TextBox instance used by this VFilterSelect */ @@ -1184,7 +1191,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * instance. It is invoked during the Constructor and should only be * overridden if a custom SuggestionPopup shall be used. The overriding * method cannot use any instance variables. - * + * * @since 7.1.5 * @return SuggestionPopup instance used by this VFilterSelect */ @@ -1212,12 +1219,12 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Does the Select have more pages? - * + * * @return true if a next page exists, else false if the current page is the * last page */ public boolean hasNextPage() { - if (totalMatches > (currentPage + 1) * pageLength) { + if (pageLength > 0 && totalMatches > (currentPage + 1) * pageLength) { return true; } else { return false; @@ -1227,7 +1234,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at a certain page. Uses the text box input as a * filter - * + * * @param page * The page which items are to be filtered */ @@ -1237,7 +1244,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at certain page using the given filter - * + * * @param page * The page to filter * @param filter @@ -1249,7 +1256,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Filters the options at certain page using the given filter - * + * * @param page * The page to filter * @param filter @@ -1314,7 +1321,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the text in the text box. - * + * * @param text * the text to set in the text box */ @@ -1343,7 +1350,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * shown in the text box if nothing has been entered. * <p> * For internal use only. May be removed or replaced in the future. - * + * * @param text * The text the text box should contain. */ @@ -1358,7 +1365,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a suggestion is selected - * + * * @param suggestion * The suggestion that just got selected. */ @@ -1398,7 +1405,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Sets the icon URI of the selected item. The icon is shown on the left * side of the item caption text. Set the URI to null to remove the icon. - * + * * @param iconUri * The URI of the icon */ @@ -1415,6 +1422,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) { @@ -1452,8 +1463,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, int iconHeight = Util.getRequiredHeight(selectedItemIcon); int marginTop = (availableHeight - iconHeight) / 2; - DOM.setStyleAttribute(selectedItemIcon.getElement(), "marginTop", - marginTop + "px"); + selectedItemIcon.getElement().getStyle() + .setMarginTop(marginTop, Unit.PX); } private static Set<Integer> navigationKeyCodes = new HashSet<Integer>(); @@ -1467,7 +1478,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.KeyDownHandler#onKeyDown(com.google.gwt * .event.dom.client.KeyDownEvent) @@ -1520,7 +1531,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key is pressed in the text box - * + * * @param event * The KeyDownEvent */ @@ -1565,7 +1576,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key was pressed in the suggestion popup. - * + * * @param event * The KeyDownEvent of the key */ @@ -1647,7 +1658,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Triggered when a key was depressed - * + * * @param event * The KeyUpEvent of the key depressed */ @@ -1790,7 +1801,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.FocusHandler#onFocus(com.google.gwt.event * .dom.client.FocusEvent) @@ -1834,7 +1845,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see * com.google.gwt.event.dom.client.BlurHandler#onBlur(com.google.gwt.event * .dom.client.BlurEvent) @@ -1874,6 +1885,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, // much of the TAB handling takes place here if (tabPressedWhenPopupOpen) { tabPressedWhenPopupOpen = false; + waitingForFilteringResponse = false; suggestionPopup.menu.doSelectedItemAction(); suggestionPopup.hide(); } else if ((!suggestionPopup.isAttached() && waitingForFilteringResponse) @@ -1898,7 +1910,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /* * (non-Javadoc) - * + * * @see com.vaadin.client.Focusable#focus() */ @@ -1919,6 +1931,20 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * For internal use only. May be removed or replaced in the future. */ public void updateRootWidth() { + updateRootWidth(false); + } + + /** + * Calculates the width of the select if the select has undefined width. + * Should be called when the width changes or when the icon changes. + * <p> + * For internal use only. May be removed or replaced in the future. + * + * @param forceUpdate + * a flag that forces a recalculation even if one would not + * normally be done + */ + public void updateRootWidth(boolean forceUpdate) { ComponentConnector paintable = ConnectorMap.get(client).getConnector( this); if (paintable.isUndefinedWidth()) { @@ -1931,7 +1957,8 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, * wide. */ int w = Util.getRequiredWidth(this); - if ((!initDone || currentPage + 1 < 0) + + if (forceUpdate || (!initDone || currentPage + 1 < 0) && suggestionPopupMinWidth > w) { /* * We want to compensate for the paddings just to preserve the @@ -1967,7 +1994,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Get the width of the select in pixels where the text area and icon has * been included. - * + * * @return The width in pixels */ private int getMainWidth() { @@ -1984,7 +2011,7 @@ public class VFilterSelect extends Composite implements Field, KeyDownHandler, /** * Handles special behavior of the mouse down event - * + * * @param event */ private void handleMouseDownEvent(Event event) { diff --git a/client/src/com/vaadin/client/ui/VFlash.java b/client/src/com/vaadin/client/ui/VFlash.java index 73c99e52b4..cf15f89cb4 100644 --- a/client/src/com/vaadin/client/ui/VFlash.java +++ b/client/src/com/vaadin/client/ui/VFlash.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VForm.java b/client/src/com/vaadin/client/ui/VForm.java index 94379a5611..ca38ea070b 100644 --- a/client/src/com/vaadin/client/ui/VForm.java +++ b/client/src/com/vaadin/client/ui/VForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VFormLayout.java b/client/src/com/vaadin/client/ui/VFormLayout.java index 9ce6f4b992..64a7c5e579 100644 --- a/client/src/com/vaadin/client/ui/VFormLayout.java +++ b/client/src/com/vaadin/client/ui/VFormLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,7 @@ import java.util.List; import com.google.gwt.aria.client.Roles; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.DOM; @@ -53,8 +54,8 @@ public class VFormLayout extends SimplePanel { public VFormLayout() { super(); - setStyleName(StyleConstants.UI_LAYOUT); - addStyleName(CLASSNAME); + setStyleName(CLASSNAME); + addStyleName(StyleConstants.UI_LAYOUT); table = new VFormLayoutTable(); setWidget(table); } @@ -331,10 +332,10 @@ public class VFormLayout extends SimplePanel { if (BrowserInfo.get().isIE()) { if (isEmpty) { setHeight("0px"); - DOM.setStyleAttribute(getElement(), "overflow", "hidden"); + getElement().getStyle().setOverflow(Overflow.HIDDEN); } else { setHeight(""); - DOM.setStyleAttribute(getElement(), "overflow", ""); + getElement().getStyle().clearOverflow(); } } diff --git a/client/src/com/vaadin/client/ui/VGridLayout.java b/client/src/com/vaadin/client/ui/VGridLayout.java index 07dba1f9b3..1c42243621 100644 --- a/client/src/com/vaadin/client/ui/VGridLayout.java +++ b/client/src/com/vaadin/client/ui/VGridLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VHorizontalLayout.java b/client/src/com/vaadin/client/ui/VHorizontalLayout.java index e3d8369c8b..b890aefe3d 100644 --- a/client/src/com/vaadin/client/ui/VHorizontalLayout.java +++ b/client/src/com/vaadin/client/ui/VHorizontalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VImage.java b/client/src/com/vaadin/client/ui/VImage.java index 92d4b83507..2742182179 100644 --- a/client/src/com/vaadin/client/ui/VImage.java +++ b/client/src/com/vaadin/client/ui/VImage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VLabel.java b/client/src/com/vaadin/client/ui/VLabel.java index 35f47d540a..0f996fa6b9 100644 --- a/client/src/com/vaadin/client/ui/VLabel.java +++ b/client/src/com/vaadin/client/ui/VLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VLazyExecutor.java b/client/src/com/vaadin/client/ui/VLazyExecutor.java index 9b8f253f9d..dfa4f574c6 100644 --- a/client/src/com/vaadin/client/ui/VLazyExecutor.java +++ b/client/src/com/vaadin/client/ui/VLazyExecutor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VLink.java b/client/src/com/vaadin/client/ui/VLink.java index b528e770d4..baad9bd955 100644 --- a/client/src/com/vaadin/client/ui/VLink.java +++ b/client/src/com/vaadin/client/ui/VLink.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VListSelect.java b/client/src/com/vaadin/client/ui/VListSelect.java index c0892f4370..b6f4f0c722 100644 --- a/client/src/com/vaadin/client/ui/VListSelect.java +++ b/client/src/com/vaadin/client/ui/VListSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -151,4 +151,4 @@ public class VListSelect extends VOptionGroupBase { public void focus() { select.setFocus(true); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/VMediaBase.java b/client/src/com/vaadin/client/ui/VMediaBase.java index eadc8258c6..53d7cef02d 100644 --- a/client/src/com/vaadin/client/ui/VMediaBase.java +++ b/client/src/com/vaadin/client/ui/VMediaBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VMenuBar.java b/client/src/com/vaadin/client/ui/VMenuBar.java index a2715fd786..f17ffbefed 100644 --- a/client/src/com/vaadin/client/ui/VMenuBar.java +++ b/client/src/com/vaadin/client/ui/VMenuBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VNativeButton.java b/client/src/com/vaadin/client/ui/VNativeButton.java index d38e4c3374..93d8d958d6 100644 --- a/client/src/com/vaadin/client/ui/VNativeButton.java +++ b/client/src/com/vaadin/client/ui/VNativeButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VNativeSelect.java b/client/src/com/vaadin/client/ui/VNativeSelect.java index 04cc9e6624..8156732f6f 100644 --- a/client/src/com/vaadin/client/ui/VNativeSelect.java +++ b/client/src/com/vaadin/client/ui/VNativeSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VNotification.java b/client/src/com/vaadin/client/ui/VNotification.java index 3aa3fa847d..93dc26f8be 100644 --- a/client/src/com/vaadin/client/ui/VNotification.java +++ b/client/src/com/vaadin/client/ui/VNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,6 +24,7 @@ import java.util.Iterator; import com.google.gwt.aria.client.Roles; import com.google.gwt.core.client.GWT; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.Event; @@ -38,9 +39,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.NotificationConfigurationBean; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.shared.ui.ui.NotificationRole; import com.vaadin.shared.ui.ui.UIConstants; +import com.vaadin.shared.ui.ui.UIState.NotificationTypeConfiguration; public class VNotification extends VOverlay { @@ -90,7 +91,7 @@ public class VNotification extends VOverlay { public VNotification() { setStyleName(STYLENAME); sinkEvents(Event.ONCLICK); - DOM.setStyleAttribute(getElement(), "zIndex", "" + Z_INDEX_BASE); + getElement().getStyle().setZIndex(Z_INDEX_BASE); } /** @@ -161,20 +162,20 @@ public class VNotification extends VOverlay { } public void show(Widget widget, Position position, String style) { - NotificationConfigurationBean styleSetup = getUiState(style); + NotificationTypeConfiguration styleSetup = getUiState(style); setWaiAriaRole(styleSetup); FlowPanel panel = new FlowPanel(); - if (styleSetup.hasAssistivePrefix()) { - panel.add(new Label(styleSetup.getAssistivePrefix())); + if (hasPrefix(styleSetup)) { + panel.add(new Label(styleSetup.prefix)); AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), true); } panel.add(widget); - if (styleSetup.hasAssistivePostfix()) { - panel.add(new Label(styleSetup.getAssistivePostfix())); + if (hasPostfix(styleSetup)) { + panel.add(new Label(styleSetup.postfix)); AriaHelper.setVisibleForAssistiveDevicesOnly(panel.getElement(), true); } @@ -182,8 +183,18 @@ public class VNotification extends VOverlay { show(position, style); } + private boolean hasPostfix(NotificationTypeConfiguration styleSetup) { + return styleSetup != null && styleSetup.postfix != null + && !styleSetup.postfix.isEmpty(); + } + + private boolean hasPrefix(NotificationTypeConfiguration styleSetup) { + return styleSetup != null && styleSetup.prefix != null + && !styleSetup.prefix.isEmpty(); + } + public void show(String html, Position position, String style) { - NotificationConfigurationBean styleSetup = getUiState(style); + NotificationTypeConfiguration styleSetup = getUiState(style); String assistiveDeviceOnlyStyle = AriaHelper.ASSISTIVE_DEVICE_ONLY_STYLE; setWaiAriaRole(styleSetup); @@ -191,32 +202,35 @@ public class VNotification extends VOverlay { String type = ""; String usage = ""; - if (styleSetup != null && styleSetup.hasAssistivePrefix()) { + if (hasPrefix(styleSetup)) { type = "<span class='" + assistiveDeviceOnlyStyle + "'>" - + styleSetup.getAssistivePrefix() + "</span>"; + + styleSetup.prefix + "</span>"; } - if (styleSetup != null && styleSetup.hasAssistivePostfix()) { + if (hasPostfix(styleSetup)) { usage = "<span class='" + assistiveDeviceOnlyStyle + "'>" - + styleSetup.getAssistivePostfix() + "</span>"; + + styleSetup.postfix + "</span>"; } setWidget(new HTML(type + html + usage)); show(position, style); } - private NotificationConfigurationBean getUiState(String style) { - NotificationConfigurationBean styleSetup = getApplicationConnection() - .getUIConnector().getState().notificationConfiguration.setup + private NotificationTypeConfiguration getUiState(String style) { + if (getApplicationConnection() == null + || getApplicationConnection().getUIConnector() == null) { + return null; + } + + return getApplicationConnection().getUIConnector().getState().notificationConfigurations .get(style); - return styleSetup; } - private void setWaiAriaRole(NotificationConfigurationBean styleSetup) { + private void setWaiAriaRole(NotificationTypeConfiguration styleSetup) { Roles.getAlertRole().set(getElement()); - if (styleSetup != null && styleSetup.getAssistiveRole() != null) { - if (Role.STATUS == styleSetup.getAssistiveRole()) { + if (styleSetup != null && styleSetup.notificationRole != null) { + if (NotificationRole.STATUS == styleSetup.notificationRole) { Roles.getStatusRole().set(getElement()); } } @@ -290,49 +304,52 @@ public class VNotification extends VOverlay { public void setPosition(com.vaadin.shared.Position position) { final Element el = getElement(); - DOM.setStyleAttribute(el, "top", ""); - DOM.setStyleAttribute(el, "left", ""); - DOM.setStyleAttribute(el, "bottom", ""); - DOM.setStyleAttribute(el, "right", ""); + el.getStyle().clearTop(); + el.getStyle().clearLeft(); + el.getStyle().clearBottom(); + el.getStyle().clearRight(); switch (position) { case TOP_LEFT: - DOM.setStyleAttribute(el, "top", "0px"); - DOM.setStyleAttribute(el, "left", "0px"); + el.getStyle().setTop(0, Unit.PX); + el.getStyle().setLeft(0, Unit.PX); break; case TOP_RIGHT: - DOM.setStyleAttribute(el, "top", "0px"); - DOM.setStyleAttribute(el, "right", "0px"); + el.getStyle().setTop(0, Unit.PX); + el.getStyle().setRight(0, Unit.PX); break; case MIDDLE_LEFT: center(); - DOM.setStyleAttribute(el, "left", "0px"); + el.getStyle().setLeft(0, Unit.PX); break; case MIDDLE_RIGHT: center(); - DOM.setStyleAttribute(el, "left", ""); - DOM.setStyleAttribute(el, "right", "0px"); + el.getStyle().clearLeft(); + el.getStyle().setRight(0, Unit.PX); break; case BOTTOM_RIGHT: - DOM.setStyleAttribute(el, "position", "absolute"); - DOM.setStyleAttribute(el, "bottom", "0px"); - DOM.setStyleAttribute(el, "right", "0px"); + // Avoiding strings would be ugly since another Position is imported + // TODO this is most likely redundant + el.getStyle().setProperty("position", "absolute"); + + el.getStyle().setBottom(0, Unit.PX); + el.getStyle().setRight(0, Unit.PX); break; case BOTTOM_LEFT: - DOM.setStyleAttribute(el, "bottom", "0px"); - DOM.setStyleAttribute(el, "left", "0px"); + el.getStyle().setBottom(0, Unit.PX); + el.getStyle().setLeft(0, Unit.PX); break; case TOP_CENTER: center(); - DOM.setStyleAttribute(el, "top", "0px"); + el.getStyle().setTop(0, Unit.PX); break; case BOTTOM_CENTER: center(); - DOM.setStyleAttribute(el, "top", ""); - DOM.setStyleAttribute(el, "bottom", "0px"); + el.getStyle().clearTop(); + el.getStyle().setBottom(0, Unit.PX); break; case ASSISTIVE: - DOM.setStyleAttribute(el, "top", "-2000px"); - DOM.setStyleAttribute(el, "left", "-2000px"); + el.getStyle().setTop(-2000, Unit.PX); + el.getStyle().setLeft(-2000, Unit.PX); break; default: case MIDDLE_CENTER: @@ -356,10 +373,10 @@ public class VNotification extends VOverlay { } private void setOpacity(Element el, int opacity) { - DOM.setStyleAttribute(el, "opacity", "" + (opacity / 100.0)); + el.getStyle().setOpacity(opacity / 100.0); if (BrowserInfo.get().isIE()) { - DOM.setStyleAttribute(el, "filter", "Alpha(opacity=" + opacity - + ")"); + el.getStyle().setProperty("filter", + "Alpha(opacity=" + opacity + ")"); } } diff --git a/client/src/com/vaadin/client/ui/VOptionGroup.java b/client/src/com/vaadin/client/ui/VOptionGroup.java index 3e4b357be3..34227831b9 100644 --- a/client/src/com/vaadin/client/ui/VOptionGroup.java +++ b/client/src/com/vaadin/client/ui/VOptionGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -57,7 +57,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, private final Map<CheckBox, String> optionsToKeys; - private final List<Boolean> optionsEnabled; + private final Map<CheckBox, Boolean> optionsEnabled; /** For internal use only. May be removed or replaced in the future. */ public boolean sendFocusEvents = false; @@ -94,7 +94,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, super(CLASSNAME); panel = (Panel) optionsContainer; optionsToKeys = new HashMap<CheckBox, String>(); - optionsEnabled = new ArrayList<Boolean>(); + optionsEnabled = new HashMap<CheckBox, Boolean>(); wasMultiselect = isMultiselect(); } @@ -176,7 +176,7 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, .getBooleanAttribute(OptionGroupConstants.ATTRIBUTE_OPTION_DISABLED); boolean enabled = optionEnabled && !isReadonly() && isEnabled(); op.setEnabled(enabled); - optionsEnabled.add(optionEnabled); + optionsEnabled.put(op, optionEnabled); setStyleName(op.getElement(), ApplicationConnection.DISABLED_CLASSNAME, @@ -239,19 +239,26 @@ public class VOptionGroup extends VOptionGroupBase implements FocusHandler, @Override protected void updateEnabledState() { - int i = 0; boolean optionGroupEnabled = isEnabled() && !isReadonly(); // sets options enabled according to the widget's enabled, // readonly and each options own enabled for (Widget w : panel) { if (w instanceof HasEnabled) { - ((HasEnabled) w).setEnabled(optionsEnabled.get(i) - && optionGroupEnabled); - setStyleName(w.getElement(), - ApplicationConnection.DISABLED_CLASSNAME, - !(optionsEnabled.get(i) && isEnabled())); + HasEnabled hasEnabled = (HasEnabled) w; + Boolean isOptionEnabled = optionsEnabled.get(w); + if (isOptionEnabled == null) { + hasEnabled.setEnabled(optionGroupEnabled); + setStyleName(w.getElement(), + ApplicationConnection.DISABLED_CLASSNAME, + !isEnabled()); + } else { + hasEnabled + .setEnabled(isOptionEnabled && optionGroupEnabled); + setStyleName(w.getElement(), + ApplicationConnection.DISABLED_CLASSNAME, + !(isOptionEnabled && isEnabled())); + } } - i++; } } diff --git a/client/src/com/vaadin/client/ui/VOptionGroupBase.java b/client/src/com/vaadin/client/ui/VOptionGroupBase.java index cc691130ad..ce75043d89 100644 --- a/client/src/com/vaadin/client/ui/VOptionGroupBase.java +++ b/client/src/com/vaadin/client/ui/VOptionGroupBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VOverlay.java b/client/src/com/vaadin/client/ui/VOverlay.java index f053b9bb8f..aca016a90f 100644 --- a/client/src/com/vaadin/client/ui/VOverlay.java +++ b/client/src/com/vaadin/client/ui/VOverlay.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,6 +23,7 @@ import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.IFrameElement; import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.BorderStyle; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.event.logical.shared.CloseEvent; @@ -265,7 +266,7 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { shadow = DOM.createDiv(); shadow.setClassName(CLASSNAME_SHADOW); shadow.setInnerHTML(SHADOW_HTML); - DOM.setStyleAttribute(shadow, "position", "absolute"); + shadow.getStyle().setPosition(Position.ABSOLUTE); addCloseHandler(this); } else { removeShadowIfPresent(); @@ -324,9 +325,9 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { * The new z-index */ protected void setZIndex(int zIndex) { - DOM.setStyleAttribute(getElement(), "zIndex", "" + zIndex); + getElement().getStyle().setZIndex(zIndex); if (isShadowEnabled()) { - DOM.setStyleAttribute(shadow, "zIndex", "" + zIndex); + shadow.getStyle().setZIndex(zIndex); } } @@ -581,8 +582,12 @@ public class VOverlay extends PopupPanel implements CloseHandler<PopupPanel> { } updatePositionAndSize(shadow, positionAndSize); - DOM.setStyleAttribute(shadow, "zIndex", zIndex); - DOM.setStyleAttribute(shadow, "display", progress < 0.9 ? "none" : ""); + shadow.getStyle().setProperty("zIndex", zIndex); + if (progress < 0.9) { + shadow.getStyle().setDisplay(Display.NONE); + } else { + shadow.getStyle().clearDisplay(); + } // Opera fix, part 2 (ticket #2704) if (BrowserInfo.get().isOpera()) { diff --git a/client/src/com/vaadin/client/ui/VPanel.java b/client/src/com/vaadin/client/ui/VPanel.java index 3b263d6dbb..946ff83180 100644 --- a/client/src/com/vaadin/client/ui/VPanel.java +++ b/client/src/com/vaadin/client/ui/VPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VPasswordField.java b/client/src/com/vaadin/client/ui/VPasswordField.java index ccc57ea532..dcbb60364c 100644 --- a/client/src/com/vaadin/client/ui/VPasswordField.java +++ b/client/src/com/vaadin/client/ui/VPasswordField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VPopupCalendar.java b/client/src/com/vaadin/client/ui/VPopupCalendar.java index e180239fc1..7dea959bb4 100644 --- a/client/src/com/vaadin/client/ui/VPopupCalendar.java +++ b/client/src/com/vaadin/client/ui/VPopupCalendar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -459,6 +459,7 @@ public class VPopupCalendar extends VTextualDate implements Field, public void setEnabled(boolean enabled) { super.setEnabled(enabled); + calendarToggle.setEnabled(enabled); Roles.getButtonRole().setAriaDisabledState(calendarToggle.getElement(), !enabled); } diff --git a/client/src/com/vaadin/client/ui/VPopupImpl.java b/client/src/com/vaadin/client/ui/VPopupImpl.java index 893b51d9b3..5da54b248c 100644 --- a/client/src/com/vaadin/client/ui/VPopupImpl.java +++ b/client/src/com/vaadin/client/ui/VPopupImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VPopupImplMozilla.java b/client/src/com/vaadin/client/ui/VPopupImplMozilla.java index 9b4cfe33cd..c9ede541ab 100644 --- a/client/src/com/vaadin/client/ui/VPopupImplMozilla.java +++ b/client/src/com/vaadin/client/ui/VPopupImplMozilla.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VPopupView.java b/client/src/com/vaadin/client/ui/VPopupView.java index 00e39532db..adf070f453 100644 --- a/client/src/com/vaadin/client/ui/VPopupView.java +++ b/client/src/com/vaadin/client/ui/VPopupView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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; @@ -102,7 +103,8 @@ public class VPopupView extends HTML implements Iterable<Widget> { } }); - popup.setAnimationEnabled(true); + // TODO: Enable animations once GWT fix has been merged + popup.setAnimationEnabled(false); popup.setAutoHideOnHistoryEventsEnabled(false); } @@ -192,7 +194,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 +335,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 +348,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 +370,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/VProgressBar.java b/client/src/com/vaadin/client/ui/VProgressBar.java index 3efbbbd8a6..8d23d0c36d 100644 --- a/client/src/com/vaadin/client/ui/VProgressBar.java +++ b/client/src/com/vaadin/client/ui/VProgressBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VProgressIndicator.java b/client/src/com/vaadin/client/ui/VProgressIndicator.java index c75113b5f4..f93fa37af6 100644 --- a/client/src/com/vaadin/client/ui/VProgressIndicator.java +++ b/client/src/com/vaadin/client/ui/VProgressIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VRichTextArea.java b/client/src/com/vaadin/client/ui/VRichTextArea.java index cb3cba3f1d..52e3782f32 100644 --- a/client/src/com/vaadin/client/ui/VRichTextArea.java +++ b/client/src/com/vaadin/client/ui/VRichTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,9 @@ import java.util.Map.Entry; import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.KeyDownEvent; import com.google.gwt.event.dom.client.KeyDownHandler; @@ -216,11 +219,11 @@ public class VRichTextArea extends Composite implements Field, KeyPressHandler, private void detectExtraSizes() { Element clone = Util.cloneNode(getElement(), false); DOM.setElementAttribute(clone, "id", ""); - DOM.setStyleAttribute(clone, "visibility", "hidden"); - DOM.setStyleAttribute(clone, "position", "absolute"); + clone.getStyle().setVisibility(Visibility.HIDDEN); + clone.getStyle().setPosition(Position.ABSOLUTE); // due FF3 bug set size to 10px and later subtract it from extra pixels - DOM.setStyleAttribute(clone, "width", "10px"); - DOM.setStyleAttribute(clone, "height", "10px"); + clone.getStyle().setWidth(10, Unit.PX); + clone.getStyle().setHeight(10, Unit.PX); DOM.appendChild(DOM.getParent(getElement()), clone); extraHorizontalPixels = DOM.getElementPropertyInt(clone, "offsetWidth") - 10; extraVerticalPixels = DOM.getElementPropertyInt(clone, "offsetHeight") - 10; diff --git a/client/src/com/vaadin/client/ui/VScrollTable.java b/client/src/com/vaadin/client/ui/VScrollTable.java index b2ba590d8e..d6eec66561 100644 --- a/client/src/com/vaadin/client/ui/VScrollTable.java +++ b/client/src/com/vaadin/client/ui/VScrollTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -38,6 +38,7 @@ import com.google.gwt.dom.client.Style; import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.dom.client.Style.TextAlign; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.dom.client.TableCellElement; @@ -1081,19 +1082,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 +1101,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } } } + } } unSyncedselectionsBeforeRowFetch = null; @@ -1132,6 +1133,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, // cell to accomodate for the size of the sort arrow. HeaderCell sortedHeader = tHead.getHeaderCell(sortColumn); if (sortedHeader != null) { + // Mark header as sorted now. Any earlier marking would lead to + // columns with wrong sizes + sortedHeader.setSorted(true); tHead.resizeCaptionContainer(sortedHeader); } // Also recalculate the width of the captionContainer element in the @@ -2301,7 +2305,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, /** For internal use only. May be removed or replaced in the future. */ public void hideScrollPositionAnnotation() { if (scrollPositionElement != null) { - DOM.setStyleAttribute(scrollPositionElement, "display", "none"); + scrollPositionElement.getStyle().setDisplay(Display.NONE); } } @@ -2658,11 +2662,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (width == -1) { // go to default mode, clip content if necessary - DOM.setStyleAttribute(captionContainer, "overflow", ""); + captionContainer.getStyle().clearOverflow(); } width = w; if (w == -1) { - DOM.setStyleAttribute(captionContainer, "width", ""); + captionContainer.getStyle().clearWidth(); setWidth(""); } else { tHead.resizeCaptionContainer(this); @@ -2699,7 +2703,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public void setUndefinedWidth() { definedWidth = false; - setWidth(-1, false); + if (!isResizing) { + setWidth(-1, false); + } } /** @@ -2831,7 +2837,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } floatingCopyOfHeaderCell.setClassName(sb.toString().trim()); // otherwise might wrap or be cut if narrow column - DOM.setStyleAttribute(floatingCopyOfHeaderCell, "width", "auto"); + floatingCopyOfHeaderCell.getStyle().setProperty("width", "auto"); updateFloatingCopysPosition(DOM.getAbsoluteLeft(td), DOM.getAbsoluteTop(td)); DOM.appendChild(VOverlay.getOverlayContainer(client), @@ -2841,10 +2847,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private void updateFloatingCopysPosition(int x, int y) { x -= DOM.getElementPropertyInt(floatingCopyOfHeaderCell, "offsetWidth") / 2; - DOM.setStyleAttribute(floatingCopyOfHeaderCell, "left", x + "px"); + floatingCopyOfHeaderCell.getStyle().setLeft(x, Unit.PX); if (y > 0) { - DOM.setStyleAttribute(floatingCopyOfHeaderCell, "top", (y + 7) - + "px"); + floatingCopyOfHeaderCell.getStyle().setTop(y + 7, Unit.PX); } } @@ -3231,8 +3236,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, table.setPropertyInt("cellSpacing", 0); } - DOM.setStyleAttribute(hTableWrapper, "overflow", "hidden"); - DOM.setStyleAttribute(columnSelector, "display", "none"); + hTableWrapper.getStyle().setOverflow(Overflow.HIDDEN); + columnSelector.getStyle().setDisplay(Display.NONE); DOM.appendChild(table, headerTableBody); DOM.appendChild(headerTableBody, tr); @@ -3344,11 +3349,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (col.hasAttribute("sortable")) { c.setSortable(true); - if (cid.equals(sortColumn)) { - c.setSorted(true); - } else { - c.setSorted(false); - } + c.setSorted(false); } else { c.setSortable(false); } @@ -3359,7 +3360,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, c.setAlign(ALIGN_LEFT); } - if (col.hasAttribute("width")) { + if (col.hasAttribute("width") && !c.isResizing) { // Make sure to accomodate for the sort indicator if // necessary. int width = col.getIntAttribute("width"); @@ -3791,7 +3792,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, setText(headerText); // ensure no clipping initially (problem on column additions) - DOM.setStyleAttribute(captionContainer, "overflow", "visible"); + captionContainer.getStyle().setOverflow(Overflow.VISIBLE); DOM.sinkEvents(captionContainer, Event.MOUSEEVENTS); @@ -3835,15 +3836,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, if (align != c) { switch (c) { case ALIGN_CENTER: - DOM.setStyleAttribute(captionContainer, "textAlign", - "center"); + captionContainer.getStyle().setTextAlign(TextAlign.CENTER); break; case ALIGN_RIGHT: - DOM.setStyleAttribute(captionContainer, "textAlign", - "right"); + captionContainer.getStyle().setTextAlign(TextAlign.RIGHT); break; default: - DOM.setStyleAttribute(captionContainer, "textAlign", ""); + captionContainer.getStyle().setTextAlign(TextAlign.LEFT); break; } } @@ -3881,11 +3880,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (width == -1) { // go to default mode, clip content if necessary - DOM.setStyleAttribute(captionContainer, "overflow", ""); + captionContainer.getStyle().clearOverflow(); } width = w; if (w == -1) { - DOM.setStyleAttribute(captionContainer, "width", ""); + captionContainer.getStyle().clearWidth(); setWidth(""); } else { /* @@ -4144,7 +4143,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, public TableFooter() { - DOM.setStyleAttribute(hTableWrapper, "overflow", "hidden"); + hTableWrapper.getStyle().setOverflow(Overflow.HIDDEN); DOM.appendChild(table, headerTableBody); DOM.appendChild(headerTableBody, tr); @@ -4271,7 +4270,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } if (col.hasAttribute("width")) { - if (scrollBody == null) { + if (scrollBody == null || isNewBody) { // Already updated by setColWidth called from // TableHeads.updateCellsFromUIDL in case of a server // side resize @@ -4369,15 +4368,14 @@ public class VScrollTable extends FlowPanel implements HasWidgets, * Disable browser measurement of the table width */ public void disableBrowserIntelligence() { - DOM.setStyleAttribute(hTableContainer, "width", WRAPPER_WIDTH - + "px"); + hTableContainer.getStyle().setWidth(WRAPPER_WIDTH, Unit.PX); } /** * Enable browser measurement of the table width */ public void enableBrowserIntelligence() { - DOM.setStyleAttribute(hTableContainer, "width", ""); + hTableContainer.getStyle().clearWidth(); } /** @@ -4880,8 +4878,8 @@ public class VScrollTable extends FlowPanel implements HasWidgets, */ private void setContainerHeight() { fixSpacers(); - DOM.setStyleAttribute(container, "height", - measureRowHeightOffset(totalRows) + "px"); + container.getStyle().setHeight(measureRowHeightOffset(totalRows), + Unit.PX); } private void fixSpacers() { @@ -5302,17 +5300,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; } /** @@ -5407,17 +5400,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } else { container.setInnerText(text); } - if (align != ALIGN_LEFT) { - switch (align) { - case ALIGN_CENTER: - container.getStyle().setProperty("textAlign", "center"); - break; - case ALIGN_RIGHT: - default: - container.getStyle().setProperty("textAlign", "right"); - break; - } - } + setAlign(align, container); setTooltip(td, description); td.appendChild(container); @@ -5455,6 +5438,21 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } + private void setAlign(char align, final Element container) { + switch (align) { + case ALIGN_CENTER: + container.getStyle().setProperty("textAlign", "center"); + break; + case ALIGN_LEFT: + container.getStyle().setProperty("textAlign", "left"); + break; + case ALIGN_RIGHT: + default: + container.getStyle().setProperty("textAlign", "right"); + break; + } + } + protected void initCellWithWidget(Widget w, char align, String style, boolean sorted, final TableCellElement td) { final Element container = DOM.createDiv(); @@ -5471,21 +5469,7 @@ public class VScrollTable extends FlowPanel implements HasWidgets, td.setClassName(className); container.setClassName(VScrollTable.this.getStylePrimaryName() + "-cell-wrapper"); - // TODO most components work with this, but not all (e.g. - // Select) - // Old comment: make widget cells respect align. - // text-align:center for IE, margin: auto for others - if (align != ALIGN_LEFT) { - switch (align) { - case ALIGN_CENTER: - container.getStyle().setProperty("textAlign", "center"); - break; - case ALIGN_RIGHT: - default: - container.getStyle().setProperty("textAlign", "right"); - break; - } - } + setAlign(align, container); td.appendChild(container); getElement().appendChild(td); // ensure widget not attached to another element (possible tBody @@ -6652,6 +6636,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, int checksum = 0; while (headCells.hasNext()) { hCell = (HeaderCell) headCells.next(); + if (hCell.isResizing) { + continue; + } if (!hCell.isDefinedWidth()) { int w = hCell.getNaturalColumnWidth(colIndex); int newSpace; @@ -6721,8 +6708,9 @@ public class VScrollTable extends FlowPanel implements HasWidgets, } int heightBefore = getOffsetHeight(); scrollBodyPanel.setHeight(bodyHeight + "px"); + if (heightBefore != getOffsetHeight()) { - Util.notifyParentOfSizeChange(VScrollTable.this, false); + Util.notifyParentOfSizeChange(VScrollTable.this, rendering); } } Scheduler.get().scheduleDeferred(new Command() { @@ -6830,14 +6818,13 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private int getContentAreaBorderHeight() { if (contentAreaBorderHeight < 0) { - DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", - "hidden"); + scrollBodyPanel.getElement().getStyle() + .setOverflow(Overflow.HIDDEN); int oh = scrollBodyPanel.getOffsetHeight(); int ch = scrollBodyPanel.getElement() .getPropertyInt("clientHeight"); contentAreaBorderHeight = oh - ch; - DOM.setStyleAttribute(scrollBodyPanel.getElement(), "overflow", - "auto"); + scrollBodyPanel.getElement().getStyle().setOverflow(Overflow.AUTO); } return contentAreaBorderHeight; } @@ -7101,7 +7088,11 @@ public class VScrollTable extends FlowPanel implements HasWidgets, dropDetails = new TableDDDetails(); Element elementOver = drag.getElementOver(); - VScrollTableRow row = Util.findWidget(elementOver, getRowClass()); + Class<? extends Widget> clazz = getRowClass(); + VScrollTableRow row = null; + if (clazz != null) { + row = Util.findWidget(elementOver, clazz); + } if (row != null) { dropDetails.overkey = row.rowKey; Element tr = row.getElement(); @@ -7127,7 +7118,12 @@ public class VScrollTable extends FlowPanel implements HasWidgets, private Class<? extends Widget> getRowClass() { // get the row type this way to make dd work in derived // implementations - return scrollBody.iterator().next().getClass(); + Iterator<Widget> iterator = scrollBody.iterator(); + if (iterator.hasNext()) { + return iterator.next().getClass(); + } else { + return null; + } } @Override diff --git a/client/src/com/vaadin/client/ui/VSlider.java b/client/src/com/vaadin/client/ui/VSlider.java index 7ac31fd85a..bc314e0314 100644 --- a/client/src/com/vaadin/client/ui/VSlider.java +++ b/client/src/com/vaadin/client/ui/VSlider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VSplitPanelHorizontal.java b/client/src/com/vaadin/client/ui/VSplitPanelHorizontal.java index b78fd3ce94..c6919d456b 100644 --- a/client/src/com/vaadin/client/ui/VSplitPanelHorizontal.java +++ b/client/src/com/vaadin/client/ui/VSplitPanelHorizontal.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VSplitPanelVertical.java b/client/src/com/vaadin/client/ui/VSplitPanelVertical.java index 3d9ef65eca..b008e5d3f0 100644 --- a/client/src/com/vaadin/client/ui/VSplitPanelVertical.java +++ b/client/src/com/vaadin/client/ui/VSplitPanelVertical.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VTabsheet.java b/client/src/com/vaadin/client/ui/VTabsheet.java index f2e4003e7f..3f2d90b721 100644 --- a/client/src/com/vaadin/client/ui/VTabsheet.java +++ b/client/src/com/vaadin/client/ui/VTabsheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,6 +27,9 @@ import com.google.gwt.core.client.Scheduler; import com.google.gwt.dom.client.DivElement; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style; +import com.google.gwt.dom.client.Style.Display; +import com.google.gwt.dom.client.Style.Overflow; +import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.dom.client.TableCellElement; import com.google.gwt.dom.client.TableElement; @@ -324,8 +327,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } private boolean update(TabState tabState) { - if (tabState.description != null - || tabState.componentError != null) { + if (tabState.description != null || tabState.componentError != null) { setTooltipInfo(new TooltipInfo(tabState.description, tabState.componentError)); } else { @@ -337,14 +339,11 @@ public class VTabsheet extends VTabsheetBase implements Focusable, String captionString = tabState.caption.isEmpty() ? null : tabState.caption; boolean ret = updateCaptionWithoutOwner(captionString, - !tabState.enabled, - hasAttribute(tabState.description), + !tabState.enabled, hasAttribute(tabState.description), hasAttribute(tabState.componentError), tab.getTabsheet().connector .getResourceUrl(ComponentConstants.ICON_RESOURCE - + tabState.key), - tabState.iconAltText - ); + + tabState.key), tabState.iconAltText); setClosable(tabState.closable); @@ -804,7 +803,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, addHandler(this, BlurEvent.getType()); // Tab scrolling - DOM.setStyleAttribute(getElement(), "overflow", "hidden"); + getElement().getStyle().setOverflow(Overflow.HIDDEN); tabs = DOM.createDiv(); DOM.setElementProperty(tabs, "className", TABS_CLASSNAME); Roles.getTablistRole().set(tabs); @@ -916,7 +915,6 @@ public class VTabsheet extends VTabsheetBase implements Focusable, DOM.setElementProperty(tabs, "className", tabsClass); DOM.setElementProperty(contentNode, "className", contentClass); DOM.setElementProperty(deco, "className", decoClass); - borderW = -1; } } else { tb.setStyleName(CLASSNAME + "-tabs"); @@ -993,10 +991,10 @@ public class VTabsheet extends VTabsheetBase implements Focusable, if (scrolledOutOfView(index)) { // Should not set tabs visible if they are scrolled out of view - tabState.visible = false; + tab.setVisible(false); + } else { + tab.setVisible(tabState.visible); } - // Set the current visibility of the tab (in the browser) - tab.setVisible(tabState.visible); /* * Force the width of the caption container so the content will not wrap @@ -1045,6 +1043,16 @@ public class VTabsheet extends VTabsheetBase implements Focusable, VTabsheet.this.removeStyleDependentName("loading"); } + /** + * Recalculates the sizes of tab captions, causing the tabs to be rendered + * the correct size. + */ + private void updateTabCaptionSizes() { + for (int tabIx = 0; tabIx < tb.getTabCount(); tabIx++) { + tb.getTab(tabIx).recalculateCaptionWidth(); + } + } + /** For internal use only. May be removed or replaced in the future. */ public void updateContentNodeHeight() { if (!isDynamicHeight()) { @@ -1056,14 +1064,18 @@ public class VTabsheet extends VTabsheetBase implements Focusable, } // Set proper values for content element - DOM.setStyleAttribute(contentNode, "height", contentHeight + "px"); + contentNode.getStyle().setHeight(contentHeight, Unit.PX); } else { - DOM.setStyleAttribute(contentNode, "height", ""); + contentNode.getStyle().clearHeight(); } } + /** + * Run internal layouting. + */ public void iLayout() { updateTabScroller(); + updateTabCaptionSizes(); } /** @@ -1104,7 +1116,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, */ private void updateTabScroller() { if (!isDynamicWidth()) { - DOM.setStyleAttribute(tabs, "width", "100%"); + tabs.getStyle().setWidth(100, Unit.PCT); } // Make sure scrollerIndex is valid @@ -1118,7 +1130,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, boolean scrolled = isScrolledTabs(); boolean clipped = isClippedTabs(); if (tb.getTabCount() > 0 && tb.isVisible() && (scrolled || clipped)) { - DOM.setStyleAttribute(scroller, "display", ""); + scroller.getStyle().clearDisplay(); DOM.setElementProperty(scrollerPrev, "className", SCROLLER_CLASSNAME + (scrolled ? "Prev" : "Prev-disabled")); DOM.setElementProperty(scrollerNext, "className", @@ -1131,7 +1143,7 @@ public class VTabsheet extends VTabsheetBase implements Focusable, : -1); } else { - DOM.setStyleAttribute(scroller, "display", "none"); + scroller.getStyle().setDisplay(Display.NONE); } if (BrowserInfo.get().isSafari()) { @@ -1195,14 +1207,9 @@ public class VTabsheet extends VTabsheetBase implements Focusable, return tabPanel.iterator(); } - private int borderW = -1; - /** For internal use only. May be removed or replaced in the future. */ public int getContentAreaBorderWidth() { - if (borderW < 0) { - borderW = Util.measureHorizontalBorder(contentNode); - } - return borderW; + return Util.measureHorizontalBorder(contentNode); } @Override diff --git a/client/src/com/vaadin/client/ui/VTabsheetBase.java b/client/src/com/vaadin/client/ui/VTabsheetBase.java index 6d9f78e87f..59f0bc565c 100644 --- a/client/src/com/vaadin/client/ui/VTabsheetBase.java +++ b/client/src/com/vaadin/client/ui/VTabsheetBase.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VTabsheetPanel.java b/client/src/com/vaadin/client/ui/VTabsheetPanel.java index 6bd63cdbd3..240f493907 100644 --- a/client/src/com/vaadin/client/ui/VTabsheetPanel.java +++ b/client/src/com/vaadin/client/ui/VTabsheetPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,6 +17,9 @@ package com.vaadin.client.ui; import com.google.gwt.dom.client.Element; +import com.google.gwt.dom.client.Style.Position; +import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.ComplexPanel; import com.google.gwt.user.client.ui.Widget; @@ -60,7 +63,7 @@ public class VTabsheetPanel extends ComplexPanel { private Element createContainerElement() { Element el = DOM.createDiv(); - DOM.setStyleAttribute(el, "position", "absolute"); + el.getStyle().setPosition(Position.ABSOLUTE); hide(el); touchScrollHandler.addElement(el); return el; @@ -136,15 +139,15 @@ public class VTabsheetPanel extends ComplexPanel { } private void hide(Element e) { - DOM.setStyleAttribute(e, "visibility", "hidden"); - DOM.setStyleAttribute(e, "top", "-100000px"); - DOM.setStyleAttribute(e, "left", "-100000px"); + e.getStyle().setVisibility(Visibility.HIDDEN); + e.getStyle().setTop(-100000, Unit.PX); + e.getStyle().setLeft(-100000, Unit.PX); } private void unHide(Element e) { - DOM.setStyleAttribute(e, "top", "0px"); - DOM.setStyleAttribute(e, "left", "0px"); - DOM.setStyleAttribute(e, "visibility", ""); + e.getStyle().setTop(0, Unit.PX); + e.getStyle().setLeft(0, Unit.PX); + e.getStyle().clearVisibility(); } public void fixVisibleTabSize(int width, int height, int minWidth) { diff --git a/client/src/com/vaadin/client/ui/VTextArea.java b/client/src/com/vaadin/client/ui/VTextArea.java index 2a697969df..bb48b29e61 100644 --- a/client/src/com/vaadin/client/ui/VTextArea.java +++ b/client/src/com/vaadin/client/ui/VTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,12 +17,15 @@ package com.vaadin.client.ui; import com.google.gwt.core.client.Scheduler; +import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Overflow; import com.google.gwt.dom.client.Style.WhiteSpace; import com.google.gwt.dom.client.TextAreaElement; import com.google.gwt.event.dom.client.ChangeEvent; import com.google.gwt.event.dom.client.ChangeHandler; +import com.google.gwt.event.dom.client.KeyCodes; import com.google.gwt.event.dom.client.KeyDownEvent; +import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.dom.client.KeyUpEvent; import com.google.gwt.event.dom.client.KeyUpHandler; import com.google.gwt.user.client.Command; @@ -30,6 +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.DragImageModifier; /** * This class represents a multiline textfield (textarea). @@ -40,15 +44,22 @@ import com.vaadin.client.Util; * @author Vaadin Ltd. * */ -public class VTextArea extends VTextField { +public class VTextArea extends VTextField implements DragImageModifier { + public static final String CLASSNAME = "v-textarea"; private boolean wordwrap = true; private MaxLengthHandler maxLengthHandler = new MaxLengthHandler(); private boolean browserSupportsMaxLengthAttribute = browserSupportsMaxLengthAttribute(); + private EnterDownHandler enterDownHandler = new EnterDownHandler(); public VTextArea() { super(DOM.createTextArea()); setStyleName(CLASSNAME); + + // KeyDownHandler is needed for correct text input on all + // browsers, not just those that don't support a max length attribute + addKeyDownHandler(enterDownHandler); + if (!browserSupportsMaxLengthAttribute) { addKeyUpHandler(maxLengthHandler); addChangeHandler(maxLengthHandler); @@ -247,6 +258,23 @@ public class VTextArea extends VTextField { } } + private class EnterDownHandler implements KeyDownHandler { + + @Override + public void onKeyDown(KeyDownEvent event) { + // Fix for #12424/13811 - if the key being pressed is enter, we stop + // propagation of the KeyDownEvents if there were no modifier keys + // also pressed. This prevents shortcuts that are bound to only the + // enter key from being processed but allows usage of e.g. + // shift-enter or ctrl-enter. + if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER + && !event.isAnyModifierKeyDown()) { + event.stopPropagation(); + } + } + + } + @Override public int getCursorPos() { // This is needed so that TextBoxImplIE6 is used to return the correct @@ -292,6 +320,17 @@ public class VTextArea extends VTextField { // Overridden to avoid submitting TextArea value on enter in IE. This is // another reason why widgets should inherit a common abstract // class instead of directly each other. + // This method is overridden only for IE and Firefox. } + @Override + 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 + String value = getElement().getPropertyString("value"); + if (value != null) { + element.setPropertyString("value", value); + } + } } diff --git a/client/src/com/vaadin/client/ui/VTextField.java b/client/src/com/vaadin/client/ui/VTextField.java index 98c8699405..c517f8fec0 100644 --- a/client/src/com/vaadin/client/ui/VTextField.java +++ b/client/src/com/vaadin/client/ui/VTextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VTextualDate.java b/client/src/com/vaadin/client/ui/VTextualDate.java index 44a3321f6f..b95f696030 100644 --- a/client/src/com/vaadin/client/ui/VTextualDate.java +++ b/client/src/com/vaadin/client/ui/VTextualDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -216,6 +216,12 @@ public class VTextualDate extends VDateField implements Field, ChangeHandler, } + @Override + public void setEnabled(boolean enabled) { + super.setEnabled(enabled); + text.setEnabled(enabled); + } + protected void setPrompting(boolean prompting) { this.prompting = prompting; if (prompting) { diff --git a/client/src/com/vaadin/client/ui/VTree.java b/client/src/com/vaadin/client/ui/VTree.java index 4979de6a47..b12053ea04 100644 --- a/client/src/com/vaadin/client/ui/VTree.java +++ b/client/src/com/vaadin/client/ui/VTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VTreeTable.java b/client/src/com/vaadin/client/ui/VTreeTable.java index 591aa6b0de..49d398246f 100644 --- a/client/src/com/vaadin/client/ui/VTreeTable.java +++ b/client/src/com/vaadin/client/ui/VTreeTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VTwinColSelect.java b/client/src/com/vaadin/client/ui/VTwinColSelect.java index 33f1afea31..3987460989 100644 --- a/client/src/com/vaadin/client/ui/VTwinColSelect.java +++ b/client/src/com/vaadin/client/ui/VTwinColSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,7 @@ import java.util.Iterator; import java.util.Set; import com.google.gwt.dom.client.Style.Overflow; +import com.google.gwt.dom.client.Style.Position; import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.DoubleClickEvent; import com.google.gwt.event.dom.client.DoubleClickHandler; @@ -32,7 +33,6 @@ import com.google.gwt.event.dom.client.KeyDownHandler; import com.google.gwt.event.dom.client.MouseDownEvent; import com.google.gwt.event.dom.client.MouseDownHandler; import com.google.gwt.event.shared.HandlerRegistration; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.FlowPanel; import com.google.gwt.user.client.ui.HTML; import com.google.gwt.user.client.ui.ListBox; @@ -393,7 +393,7 @@ public class VTwinColSelect extends VOptionGroupBase implements KeyDownHandler, /** For internal use only. May be removed or replaced in the future. */ public void setInternalWidths() { - DOM.setStyleAttribute(getElement(), "position", "relative"); + getElement().getStyle().setPosition(Position.RELATIVE); int bordersAndPaddings = Util.measureHorizontalPaddingAndBorder( buttons.getElement(), 0); diff --git a/client/src/com/vaadin/client/ui/VUI.java b/client/src/com/vaadin/client/ui/VUI.java index 590263a5ed..df24c3b1c7 100644 --- a/client/src/com/vaadin/client/ui/VUI.java +++ b/client/src/com/vaadin/client/ui/VUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VUnknownComponent.java b/client/src/com/vaadin/client/ui/VUnknownComponent.java index ea97110aaa..89907854de 100644 --- a/client/src/com/vaadin/client/ui/VUnknownComponent.java +++ b/client/src/com/vaadin/client/ui/VUnknownComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VUpload.java b/client/src/com/vaadin/client/ui/VUpload.java index bcb4265d50..92df9d9614 100644 --- a/client/src/com/vaadin/client/ui/VUpload.java +++ b/client/src/com/vaadin/client/ui/VUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VVerticalLayout.java b/client/src/com/vaadin/client/ui/VVerticalLayout.java index d82f35050d..00ef0fc719 100644 --- a/client/src/com/vaadin/client/ui/VVerticalLayout.java +++ b/client/src/com/vaadin/client/ui/VVerticalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VVideo.java b/client/src/com/vaadin/client/ui/VVideo.java index 376c832bed..023a7f9ee0 100644 --- a/client/src/com/vaadin/client/ui/VVideo.java +++ b/client/src/com/vaadin/client/ui/VVideo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/VWindow.java b/client/src/com/vaadin/client/ui/VWindow.java index 396fc76eb0..9b1f7a6f3c 100644 --- a/client/src/com/vaadin/client/ui/VWindow.java +++ b/client/src/com/vaadin/client/ui/VWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -31,8 +31,10 @@ import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Style; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.dom.client.Style.Position; import com.google.gwt.dom.client.Style.Unit; +import com.google.gwt.dom.client.Style.Visibility; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.FocusEvent; @@ -67,7 +69,7 @@ import com.vaadin.client.ui.window.WindowMoveHandler; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.ui.window.WindowMode; -import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.shared.ui.window.WindowRole; /** * "Sub window" component. @@ -328,7 +330,7 @@ public class VWindow extends VWindowOverlay implements protected void setZIndex(int zIndex) { super.setZIndex(zIndex); if (vaadinModality) { - DOM.setStyleAttribute(getModalityCurtain(), "zIndex", "" + zIndex); + getModalityCurtain().getStyle().setZIndex(zIndex); } } @@ -622,9 +624,9 @@ public class VWindow extends VWindowOverlay implements this.closable = closable; if (closable) { - DOM.setStyleAttribute(closeBox, "display", ""); + closeBox.getStyle().clearDisplay(); } else { - DOM.setStyleAttribute(closeBox, "display", "none"); + closeBox.getStyle().setDisplay(Display.NONE); } } @@ -725,8 +727,8 @@ public class VWindow extends VWindowOverlay implements } private void showModalityCurtain() { - DOM.setStyleAttribute(getModalityCurtain(), "zIndex", - "" + (windowOrder.indexOf(this) + Z_INDEX)); + getModalityCurtain().getStyle().setZIndex( + windowOrder.indexOf(this) + Z_INDEX); if (isShowing()) { getOverlayContainer().insertBefore(getModalityCurtain(), @@ -801,12 +803,12 @@ public class VWindow extends VWindowOverlay implements private Element createCurtain() { Element curtain = DOM.createDiv(); - DOM.setStyleAttribute(curtain, "position", "absolute"); - DOM.setStyleAttribute(curtain, "top", "0px"); - DOM.setStyleAttribute(curtain, "left", "0px"); - DOM.setStyleAttribute(curtain, "width", "100%"); - DOM.setStyleAttribute(curtain, "height", "100%"); - DOM.setStyleAttribute(curtain, "zIndex", "" + VOverlay.Z_INDEX); + curtain.getStyle().setPosition(Position.ABSOLUTE); + curtain.getStyle().setTop(0, Unit.PX); + curtain.getStyle().setLeft(0, Unit.PX); + curtain.getStyle().setWidth(100, Unit.PCT); + curtain.getStyle().setHeight(100, Unit.PCT); + curtain.getStyle().setZIndex(VOverlay.Z_INDEX); return curtain; } @@ -1041,7 +1043,7 @@ public class VWindow extends VWindowOverlay implements } showResizingCurtain(); if (BrowserInfo.get().isIE()) { - DOM.setStyleAttribute(resizeBox, "visibility", "hidden"); + resizeBox.getStyle().setVisibility(Visibility.HIDDEN); } resizing = true; startX = Util.getTouchOrMouseClientX(event); @@ -1059,7 +1061,7 @@ public class VWindow extends VWindowOverlay implements case Event.ONLOSECAPTURE: hideResizingCurtain(); if (BrowserInfo.get().isIE()) { - DOM.setStyleAttribute(resizeBox, "visibility", ""); + resizeBox.getStyle().clearVisibility(); } resizing = false; break; diff --git a/client/src/com/vaadin/client/ui/VWindowOverlay.java b/client/src/com/vaadin/client/ui/VWindowOverlay.java index 6558ab14fa..41a8276402 100644 --- a/client/src/com/vaadin/client/ui/VWindowOverlay.java +++ b/client/src/com/vaadin/client/ui/VWindowOverlay.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java b/client/src/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java index 6a6a1429f8..366775e9a2 100644 --- a/client/src/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/absolutelayout/AbsoluteLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/accordion/AccordionConnector.java b/client/src/com/vaadin/client/ui/accordion/AccordionConnector.java index ce843dc22f..c0caded759 100644 --- a/client/src/com/vaadin/client/ui/accordion/AccordionConnector.java +++ b/client/src/com/vaadin/client/ui/accordion/AccordionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -59,6 +59,7 @@ public class AccordionConnector extends TabsheetBaseConnector implements } else if (getWidget().getOpenStackItem() != null) { getWidget().close(getWidget().getOpenStackItem()); } + getLayoutManager().setNeedsVerticalLayout(this); } @Override diff --git a/client/src/com/vaadin/client/ui/aria/AriaHelper.java b/client/src/com/vaadin/client/ui/aria/AriaHelper.java index b1f51b85e9..bf93901a33 100644 --- a/client/src/com/vaadin/client/ui/aria/AriaHelper.java +++ b/client/src/com/vaadin/client/ui/aria/AriaHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/aria/HandlesAriaCaption.java b/client/src/com/vaadin/client/ui/aria/HandlesAriaCaption.java index e754f2d095..369edb7d69 100644 --- a/client/src/com/vaadin/client/ui/aria/HandlesAriaCaption.java +++ b/client/src/com/vaadin/client/ui/aria/HandlesAriaCaption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/aria/HandlesAriaInvalid.java b/client/src/com/vaadin/client/ui/aria/HandlesAriaInvalid.java index 05cb82b0d6..296e455dcd 100644 --- a/client/src/com/vaadin/client/ui/aria/HandlesAriaInvalid.java +++ b/client/src/com/vaadin/client/ui/aria/HandlesAriaInvalid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/aria/HandlesAriaRequired.java b/client/src/com/vaadin/client/ui/aria/HandlesAriaRequired.java index 9b18bfb4de..95ebd7fb9a 100644 --- a/client/src/com/vaadin/client/ui/aria/HandlesAriaRequired.java +++ b/client/src/com/vaadin/client/ui/aria/HandlesAriaRequired.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/audio/AudioConnector.java b/client/src/com/vaadin/client/ui/audio/AudioConnector.java index 5a90cab09d..f238ecc08c 100644 --- a/client/src/com/vaadin/client/ui/audio/AudioConnector.java +++ b/client/src/com/vaadin/client/ui/audio/AudioConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java b/client/src/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java index 736bdc25a7..8ff8a0b72d 100644 --- a/client/src/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java +++ b/client/src/com/vaadin/client/ui/browserframe/BrowserFrameConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/button/ButtonConnector.java b/client/src/com/vaadin/client/ui/button/ButtonConnector.java index 32a457c1f1..4220c3f5d1 100644 --- a/client/src/com/vaadin/client/ui/button/ButtonConnector.java +++ b/client/src/com/vaadin/client/ui/button/ButtonConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -66,8 +66,7 @@ public class ButtonConnector extends AbstractComponentConnector implements getWidget().errorIndicatorElement .setClassName("v-errorindicator"); } - getWidget().wrapper.insertBefore(getWidget().errorIndicatorElement, - getWidget().captionElement); + getWidget().wrapper.insertFirst(getWidget().errorIndicatorElement); } else if (getWidget().errorIndicatorElement != null) { getWidget().wrapper.removeChild(getWidget().errorIndicatorElement); diff --git a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java index 89f923d483..cbf63768a3 100644 --- a/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java +++ b/client/src/com/vaadin/client/ui/calendar/CalendarConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/VCalendarAction.java b/client/src/com/vaadin/client/ui/calendar/VCalendarAction.java index 2a529354e5..470ee3cf1a 100644 --- a/client/src/com/vaadin/client/ui/calendar/VCalendarAction.java +++ b/client/src/com/vaadin/client/ui/calendar/VCalendarAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java index ca176c08c1..44b82f166f 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarDay.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java index e2c06d41ea..d3a5e3f16e 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/CalendarEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -310,4 +310,4 @@ public class CalendarEvent { } return false; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java index c3fd2b54cf..ffa5f78071 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCell.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -829,4 +829,4 @@ public class DateCell extends FocusableComplexPanel implements .contextMenu(event, DateCell.this); } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java index 04e6bb7df6..82af89c794 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -114,4 +114,4 @@ public class DateCellContainer extends FlowPanel implements MouseDownHandler, } } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java index ae86833952..bbbd355a32 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellDayEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -642,4 +642,4 @@ public class DateCellDayEvent extends FocusableHTML implements public Object getTooltipKey() { return eventIndex; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java index 79276eab7b..f4ef22f4ca 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateCellGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -56,4 +56,4 @@ public class DateCellGroup { public void add(Integer index) { items.add(index); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DateUtil.java b/client/src/com/vaadin/client/ui/calendar/schedule/DateUtil.java index 84726327e2..165bbefefc 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DateUtil.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DateUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java index 58b5fafa7f..db3f47dfed 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/DayToolbar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java index 6b42caec10..cdad83744e 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableComplexPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java index b40f1c3652..1369392656 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableGrid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java index 31d810608a..0c6ddb3697 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/FocusableHTML.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java b/client/src/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java index 5827068840..d04ec39527 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/HasTooltipKey.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java b/client/src/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java index 928ff85f18..6fc2e430cd 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/MonthEventLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -161,4 +161,4 @@ public class MonthEventLabel extends HTML implements HasTooltipKey { public CalendarEvent getCalendarEvent() { return calendarEvent; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java b/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java index 3b1c774793..52a81d0eb9 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/MonthGrid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -212,4 +212,4 @@ public class MonthGrid extends FocusableGrid implements KeyDownHandler { return -1; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java index 00fc1ef3ea..8e83dc4e36 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayCell.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -698,4 +698,4 @@ public class SimpleDayCell extends FocusableFlowPanel implements public void removeEmphasisStyle() { removeStyleDependentName("dragemphasis"); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java index fc75136b93..3133341542 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleDayToolbar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -94,4 +94,4 @@ public class SimpleDayToolbar extends HorizontalPanel { } } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java index 59902811cd..fc79163d3e 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/SimpleWeekToolbar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -106,4 +106,4 @@ public class SimpleWeekToolbar extends FlexTable implements ClickHandler { wl.getYear() + "w" + wl.getWeek()); } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/WeekGrid.java b/client/src/com/vaadin/client/ui/calendar/schedule/WeekGrid.java index 450ea29549..d1d99e6cf2 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/WeekGrid.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/WeekGrid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java b/client/src/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java index e634735be7..07bcc1e887 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/WeekGridMinuteTimeRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -59,4 +59,4 @@ public class WeekGridMinuteTimeRange { && a.getEnd().compareTo(b.getStart()) > 0; return overlaps; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/WeekLabel.java b/client/src/com/vaadin/client/ui/calendar/schedule/WeekLabel.java index bde8675435..bb0cf5d1ea 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/WeekLabel.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/WeekLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,4 +48,4 @@ public class WeekLabel extends Label { public void setYear(int year) { this.year = year; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java b/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java index f7c5c0dac4..bd833e06a0 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java b/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java index a97d352e81..7d3dc9b89a 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/WeeklyLongEventsDateCell.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -64,4 +64,4 @@ public class WeeklyLongEventsDateCell extends HTML implements HasTooltipKey { } return null; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java index ab0c9f2e9a..92046f96ec 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java index 7c0c541ee3..9cab421200 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarMonthDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java index d19dcfedc4..853e4b724e 100644 --- a/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java +++ b/client/src/com/vaadin/client/ui/calendar/schedule/dd/CalendarWeekDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java index b40e96ff95..a72049aa90 100644 --- a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java +++ b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,6 +15,7 @@ */ package com.vaadin.client.ui.checkbox; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.event.dom.client.BlurEvent; import com.google.gwt.event.dom.client.BlurHandler; import com.google.gwt.event.dom.client.ClickEvent; @@ -30,7 +31,6 @@ import com.vaadin.client.VTooltip; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.Icon; -import com.vaadin.client.ui.ImageIcon; import com.vaadin.client.ui.VCheckBox; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.communication.FieldRpc.FocusAndBlurServerRpc; @@ -82,12 +82,11 @@ public class CheckBoxConnector extends AbstractFieldConnector implements DOM.sinkEvents(getWidget().errorIndicatorElement, VTooltip.TOOLTIP_EVENTS | Event.ONCLICK); } else { - DOM.setStyleAttribute(getWidget().errorIndicatorElement, - "display", ""); + getWidget().errorIndicatorElement.getStyle().clearDisplay(); } } else if (getWidget().errorIndicatorElement != null) { - DOM.setStyleAttribute(getWidget().errorIndicatorElement, "display", - "none"); + getWidget().errorIndicatorElement.getStyle().setDisplay( + Display.NONE); getWidget().setAriaInvalid(false); } diff --git a/client/src/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java b/client/src/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java index ba0575d8fe..ac168d1f9a 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java +++ b/client/src/com/vaadin/client/ui/colorpicker/AbstractColorPickerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java index 7377b0044b..2237920cb8 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java +++ b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerAreaConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java index 8bf2825d68..237241fe81 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java +++ b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java index b28831b860..223675f660 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java +++ b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGradientConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -82,4 +82,4 @@ public class ColorPickerGradientConnector extends AbstractComponentConnector getWidget().addMouseUpHandler(this); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java index 730981d2dd..dc3c3ca790 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java +++ b/client/src/com/vaadin/client/ui/colorpicker/ColorPickerGridConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java b/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java index 3a135e2381..70ced91da4 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java +++ b/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGradient.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java b/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java index 8c9c34d668..c407bdc5ef 100644 --- a/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java +++ b/client/src/com/vaadin/client/ui/colorpicker/VColorPickerGrid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index 8dec26cf90..c3cdb43703 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2013 Vaadin Ltd. - * + * 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 @@ -19,9 +19,12 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.vaadin.client.ApplicationConnection; import com.vaadin.client.Paintable; import com.vaadin.client.UIDL; +import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractFieldConnector; import com.vaadin.client.ui.SimpleManagedLayout; import com.vaadin.client.ui.VFilterSelect; @@ -41,6 +44,10 @@ public class ComboBoxConnector extends AbstractFieldConnector implements // update textbox text by a changed item caption. private boolean oldSuggestionTextMatchTheOldSelection; + // Need to recompute the width of the combobox when styles change, see + // #13444 + private boolean stylesChanged; + /* * (non-Javadoc) * @@ -121,6 +128,10 @@ public class ComboBoxConnector extends AbstractFieldConnector implements boolean suggestionsChanged = !getWidget().initDone || !newSuggestions.equals(getWidget().currentSuggestions); + // An ItemSetChangeEvent on server side clears the current suggestion + // popup. Popup needs to be repopulated with suggestions from UIDL. + boolean popupOpenAndCleared = false; + oldSuggestionTextMatchTheOldSelection = false; if (suggestionsChanged) { @@ -141,6 +152,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements * menu might not necessary exist in select at all anymore. */ getWidget().suggestionPopup.menu.clearItems(); + popupOpenAndCleared = getWidget().suggestionPopup.isAttached(); } @@ -159,9 +171,9 @@ public class ComboBoxConnector extends AbstractFieldConnector implements } } - if (getWidget().waitingForFilteringResponse - && getWidget().lastFilter.toLowerCase().equals( - uidl.getStringVariable("filter"))) { + if ((getWidget().waitingForFilteringResponse && getWidget().lastFilter + .toLowerCase().equals(uidl.getStringVariable("filter"))) + || popupOpenAndCleared) { getWidget().suggestionPopup.showSuggestions( getWidget().currentSuggestions, getWidget().currentPage, getWidget().totalMatches); @@ -169,28 +181,14 @@ public class ComboBoxConnector extends AbstractFieldConnector implements if (!getWidget().popupOpenerClicked && getWidget().selectPopupItemWhenResponseIsReceived != VFilterSelect.Select.NONE) { // we're paging w/ arrows - if (getWidget().selectPopupItemWhenResponseIsReceived == VFilterSelect.Select.LAST) { - getWidget().suggestionPopup.menu.selectLastItem(); - } else { - getWidget().suggestionPopup.menu.selectFirstItem(); - } - - // This is used for paging so we update the keyboard selection - // variable as well. - MenuItem activeMenuItem = getWidget().suggestionPopup.menu - .getSelectedItem(); - getWidget().suggestionPopup.menu - .setKeyboardSelectedItem(activeMenuItem); - - // Update text field to contain the correct text - getWidget().setTextboxText(activeMenuItem.getText()); - getWidget().tb.setSelectionRange( - getWidget().lastFilter.length(), - activeMenuItem.getText().length() - - getWidget().lastFilter.length()); - - getWidget().selectPopupItemWhenResponseIsReceived = VFilterSelect.Select.NONE; // reset + Scheduler.get().scheduleDeferred(new ScheduledCommand() { + @Override + public void execute() { + navigateItemAfterPageChange(); + } + }); } + if (getWidget().updateSelectionWhenReponseIsReceived) { getWidget().suggestionPopup.menu .doPostFilterSelectedItemAction(); @@ -202,8 +200,17 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().popupOpenerClicked = false; + /* + * if styles have changed or this is our first time we need to + * recalculate the root width. + */ if (!getWidget().initDone) { - getWidget().updateRootWidth(); + // no need to force update since we have no existing width + getWidget().updateRootWidth(false); + } else if (stylesChanged) { + // we have previously calculated a width, we must force an update + // due to changed styles + getWidget().updateRootWidth(true); } // Focus dependent style names are lost during the update, so we add @@ -212,9 +219,44 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().addStyleDependentName("focus"); } + // width has been recalculated above, clear style change flag + stylesChanged = false; + getWidget().initDone = true; } + /* + * This method navigates to the proper item in the combobox page. This + * should be executed after setSuggestions() method which is called from + * vFilterSelect.showSuggestions(). ShowSuggestions() method builds the page + * content. As far as setSuggestions() method is called as deferred, + * navigateItemAfterPageChange method should be also be called as deferred. + * #11333 + */ + private void navigateItemAfterPageChange() { + if (getWidget().selectPopupItemWhenResponseIsReceived == VFilterSelect.Select.LAST) { + getWidget().suggestionPopup.menu.selectLastItem(); + } else { + getWidget().suggestionPopup.menu.selectFirstItem(); + } + + // This is used for paging so we update the keyboard selection + // variable as well. + MenuItem activeMenuItem = getWidget().suggestionPopup.menu + .getSelectedItem(); + getWidget().suggestionPopup.menu + .setKeyboardSelectedItem(activeMenuItem); + + // Update text field to contain the correct text + getWidget().setTextboxText(activeMenuItem.getText()); + getWidget().tb.setSelectionRange( + getWidget().lastFilter.length(), + activeMenuItem.getText().length() + - getWidget().lastFilter.length()); + + getWidget().selectPopupItemWhenResponseIsReceived = VFilterSelect.Select.NONE; // reset + } + private void performSelection(String selectedKey) { // some item selected for (FilterSelectSuggestion suggestion : getWidget().currentSuggestions) { @@ -267,7 +309,9 @@ public class ComboBoxConnector extends AbstractFieldConnector implements // we have focus in field, prompting can't be set on, instead // just clear the input if the value has changed from something // else to null - if (getWidget().selectedOptionKey != null) { + if (getWidget().selectedOptionKey != null + || (getWidget().allowNewItem && !getWidget().tb + .getValue().isEmpty())) { getWidget().tb.setValue(""); } } @@ -300,4 +344,13 @@ public class ComboBoxConnector extends AbstractFieldConnector implements getWidget().enabled = widgetEnabled; getWidget().tb.setEnabled(widgetEnabled); } + + @Override + public void onStateChanged(StateChangeEvent event) { + super.onStateChanged(event); + if (event.hasPropertyChanged("styles")) { + stylesChanged = true; + } + } + } diff --git a/client/src/com/vaadin/client/ui/csslayout/CssLayoutConnector.java b/client/src/com/vaadin/client/ui/csslayout/CssLayoutConnector.java index 034fd79364..16c80cfa15 100644 --- a/client/src/com/vaadin/client/ui/csslayout/CssLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/csslayout/CssLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java b/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java index 90ed2feaa5..e981dc13fc 100644 --- a/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java +++ b/client/src/com/vaadin/client/ui/customcomponent/CustomComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/customfield/CustomFieldConnector.java b/client/src/com/vaadin/client/ui/customfield/CustomFieldConnector.java index c6e4b87b73..d18574d010 100644 --- a/client/src/com/vaadin/client/ui/customfield/CustomFieldConnector.java +++ b/client/src/com/vaadin/client/ui/customfield/CustomFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java index 029db18dab..a37ce9af38 100644 --- a/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/customlayout/CustomLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java index 3baae4f117..6d1c9316f6 100644 --- a/client/src/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/AbstractDateFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java index 2fb40b3cdb..6321e1c092 100644 --- a/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/InlineDateFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java index d2aadca99b..a349eb2993 100644 --- a/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/PopupDateFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -103,8 +103,6 @@ public class PopupDateFieldConnector extends TextualDateConnector { getWidget().calendar.renderCalendar(); } - getWidget().calendarToggle.setEnabled(getWidget().isEnabled()); - if (getWidget().getCurrentResolution().getCalendarField() <= Resolution.MONTH .getCalendarField()) { getWidget().calendar @@ -161,7 +159,6 @@ public class PopupDateFieldConnector extends TextualDateConnector { getWidget().setDescriptionForAssistiveDevices( getState().descriptionForAssistiveDevices); - getWidget().calendarToggle.setEnabled(true); } @Override diff --git a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java index 9357f9f946..8545c20d7d 100644 --- a/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java +++ b/client/src/com/vaadin/client/ui/datefield/TextualDateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/DDUtil.java b/client/src/com/vaadin/client/ui/dd/DDUtil.java index 96f681b54a..dfdafe1352 100644 --- a/client/src/com/vaadin/client/ui/dd/DDUtil.java +++ b/client/src/com/vaadin/client/ui/dd/DDUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/DragImageModifier.java b/client/src/com/vaadin/client/ui/dd/DragImageModifier.java new file mode 100644 index 0000000000..f08c082a70 --- /dev/null +++ b/client/src/com/vaadin/client/ui/dd/DragImageModifier.java @@ -0,0 +1,39 @@ +/* + * 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.ui.dd; + +import com.google.gwt.dom.client.Element; + +/** + * 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 DragImageModifier { + + /** + * This method is called for cloned <code>element</code> which corresponds + * to the widget element. One could modify/correct this <code>element</code> + * for drag image. + * + * @param element + * cloned element of drag image + */ + void modifyDragImage(Element element); +} diff --git a/client/src/com/vaadin/client/ui/dd/VAbstractDropHandler.java b/client/src/com/vaadin/client/ui/dd/VAbstractDropHandler.java index 44a97042c3..61708260a1 100644 --- a/client/src/com/vaadin/client/ui/dd/VAbstractDropHandler.java +++ b/client/src/com/vaadin/client/ui/dd/VAbstractDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VAcceptAll.java b/client/src/com/vaadin/client/ui/dd/VAcceptAll.java index 72ca7f5523..bb6170da45 100644 --- a/client/src/com/vaadin/client/ui/dd/VAcceptAll.java +++ b/client/src/com/vaadin/client/ui/dd/VAcceptAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -29,4 +29,4 @@ final public class VAcceptAll extends VAcceptCriterion { protected boolean accept(VDragEvent drag, UIDL configuration) { return true; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VAcceptCallback.java b/client/src/com/vaadin/client/ui/dd/VAcceptCallback.java index 70fc38d4cc..706abb0e05 100644 --- a/client/src/com/vaadin/client/ui/dd/VAcceptCallback.java +++ b/client/src/com/vaadin/client/ui/dd/VAcceptCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VAcceptCriteria.java b/client/src/com/vaadin/client/ui/dd/VAcceptCriteria.java index 7181a11f2a..4bf23cbe7f 100644 --- a/client/src/com/vaadin/client/ui/dd/VAcceptCriteria.java +++ b/client/src/com/vaadin/client/ui/dd/VAcceptCriteria.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VAcceptCriterion.java b/client/src/com/vaadin/client/ui/dd/VAcceptCriterion.java index db617b874a..5205b9182b 100644 --- a/client/src/com/vaadin/client/ui/dd/VAcceptCriterion.java +++ b/client/src/com/vaadin/client/ui/dd/VAcceptCriterion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java b/client/src/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java index 6b98f3f16d..1503b1f84d 100644 --- a/client/src/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java +++ b/client/src/com/vaadin/client/ui/dd/VAcceptCriterionFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VAnd.java b/client/src/com/vaadin/client/ui/dd/VAnd.java index 3ed90e04b0..ee4bc94f9e 100644 --- a/client/src/com/vaadin/client/ui/dd/VAnd.java +++ b/client/src/com/vaadin/client/ui/dd/VAnd.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -51,4 +51,4 @@ final public class VAnd extends VAcceptCriterion implements VAcceptCallback { b1 = true; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VContainsDataFlavor.java b/client/src/com/vaadin/client/ui/dd/VContainsDataFlavor.java index 929579b6e2..2ad375fd77 100644 --- a/client/src/com/vaadin/client/ui/dd/VContainsDataFlavor.java +++ b/client/src/com/vaadin/client/ui/dd/VContainsDataFlavor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -30,4 +30,4 @@ final public class VContainsDataFlavor extends VAcceptCriterion { String name = configuration.getStringAttribute("p"); return drag.getTransferable().getDataFlavors().contains(name); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java index f44fceb398..4ee19328d6 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java +++ b/client/src/com/vaadin/client/ui/dd/VDragAndDropManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -31,7 +31,6 @@ import com.google.gwt.user.client.Command; import com.google.gwt.user.client.Event; import com.google.gwt.user.client.Event.NativePreviewEvent; import com.google.gwt.user.client.Event.NativePreviewHandler; -import com.google.gwt.user.client.Timer; import com.google.gwt.user.client.ui.RootPanel; import com.google.gwt.user.client.ui.Widget; import com.vaadin.client.ApplicationConnection; @@ -340,10 +339,7 @@ public class VDragAndDropManager { .addNativePreviewHandler(defaultDragAndDropEventHandler); if (dragElement != null && dragElement.getParentElement() == null) { - // deferred attaching drag image is on going, we can - // hurry with it now - lazyAttachDragElement.cancel(); - lazyAttachDragElement.run(); + attachDragElement(); } } // just capture something to prevent text selection in IE @@ -365,17 +361,23 @@ public class VDragAndDropManager { deferredStartRegistration = Event .addNativePreviewHandler(new NativePreviewHandler() { + private int startX = Util + .getTouchOrMouseClientX(currentDrag + .getCurrentGwtEvent()); + private int startY = Util + .getTouchOrMouseClientY(currentDrag + .getCurrentGwtEvent()); + @Override public void onPreviewNativeEvent( NativePreviewEvent event) { 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; } @@ -417,13 +419,23 @@ public class VDragAndDropManager { } case Event.ONMOUSEMOVE: case Event.ONTOUCHMOVE: - if (deferredStartRegistration != null) { - deferredStartRegistration.removeHandler(); - deferredStartRegistration = null; + int currentX = Util + .getTouchOrMouseClientX(event + .getNativeEvent()); + int currentY = Util + .getTouchOrMouseClientY(event + .getNativeEvent()); + if (Math.abs(startX - currentX) > 3 + || Math.abs(startY - currentY) > 3) { + if (deferredStartRegistration != null) { + deferredStartRegistration + .removeHandler(); + deferredStartRegistration = null; + } + currentDrag.setCurrentGwtEvent(event + .getNativeEvent()); + startDrag.execute(); } - currentDrag.setCurrentGwtEvent(event - .getNativeEvent()); - startDrag.execute(); break; default: // on any other events, clean up the @@ -712,16 +724,7 @@ public class VDragAndDropManager { updateDragImagePosition(); if (isStarted) { - lazyAttachDragElement.run(); - } else { - /* - * To make our default dnd handler as compatible as possible, we - * need to defer the appearance of dragElement. Otherwise events - * that are derived from sequences of other events might not - * fire as domchanged will fire between them or mouse up might - * happen on dragElement. - */ - lazyAttachDragElement.schedule(300); + attachDragElement(); } } } @@ -730,24 +733,20 @@ public class VDragAndDropManager { return dragElement; } - private final Timer lazyAttachDragElement = new Timer() { - - @Override - public void run() { - if (dragElement != null && dragElement.getParentElement() == null) { - ApplicationConnection connection = getCurrentDragApplicationConnection(); - Element dragImageParent; - if (connection == null) { - VConsole.error("Could not determine ApplicationConnection for current drag operation. The drag image will likely look broken"); - dragImageParent = RootPanel.getBodyElement(); - } else { - dragImageParent = VOverlay.getOverlayContainer(connection); - } - dragImageParent.appendChild(dragElement); + private void attachDragElement() { + if (dragElement != null && dragElement.getParentElement() == null) { + ApplicationConnection connection = getCurrentDragApplicationConnection(); + Element dragImageParent; + if (connection == null) { + VConsole.error("Could not determine ApplicationConnection for current drag operation. The drag image will likely look broken"); + dragImageParent = RootPanel.getBodyElement(); + } else { + dragImageParent = VOverlay.getOverlayContainer(connection); } - + dragImageParent.appendChild(dragElement); } - }; + + } private Command deferredCommand; diff --git a/client/src/com/vaadin/client/ui/dd/VDragEvent.java b/client/src/com/vaadin/client/ui/dd/VDragEvent.java index 9b592cfcbd..6291a38e42 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragEvent.java +++ b/client/src/com/vaadin/client/ui/dd/VDragEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,11 +21,14 @@ import java.util.Map; import com.google.gwt.dom.client.Document; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; +import com.google.gwt.dom.client.Node; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.dom.client.TableElement; import com.google.gwt.dom.client.TableSectionElement; import com.google.gwt.event.dom.client.MouseOverEvent; import com.google.gwt.user.client.DOM; +import com.google.gwt.user.client.Event; +import com.google.gwt.user.client.EventListener; import com.vaadin.client.BrowserInfo; import com.vaadin.client.Util; @@ -241,6 +244,7 @@ public class VDragEvent { public void createDragImage(com.google.gwt.user.client.Element element, boolean alignImageToEvent) { Element cloneNode = (Element) element.cloneNode(true); + syncContent(element, cloneNode); if (BrowserInfo.get().isIE()) { if (cloneNode.getTagName().toLowerCase().equals("tr")) { TableElement table = Document.get().createTableElement(); @@ -277,4 +281,31 @@ public class VDragEvent { createDragImage(DOM.asOld(element), alignImageToEvent); } + /** + * Do additional content sync between <code>original</code> element and its + * <code>copy</code> if needed. + * + * @since 7.2 + * @param original + * original element + * @param copy + * copy of original element + */ + private void syncContent(Element original, Element copy) { + for (int i = 0; i < original.getChildCount(); i++) { + Node child = original.getChild(i); + if (child instanceof Element) { + syncContent((Element) child, (Element) copy.getChild(i)); + } + } + doSyncContent(original, copy); + } + + private void doSyncContent(Element original, Element copy) { + EventListener eventListener = Event.getEventListener(original); + if (eventListener instanceof DragImageModifier) { + ((DragImageModifier) eventListener).modifyDragImage(copy); + } + } + } diff --git a/client/src/com/vaadin/client/ui/dd/VDragEventServerCallback.java b/client/src/com/vaadin/client/ui/dd/VDragEventServerCallback.java index c1f89bd421..ba2d0f789b 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragEventServerCallback.java +++ b/client/src/com/vaadin/client/ui/dd/VDragEventServerCallback.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VDragSourceIs.java b/client/src/com/vaadin/client/ui/dd/VDragSourceIs.java index 8112a3cf28..8a8d1d7bb9 100644 --- a/client/src/com/vaadin/client/ui/dd/VDragSourceIs.java +++ b/client/src/com/vaadin/client/ui/dd/VDragSourceIs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -51,4 +51,4 @@ final public class VDragSourceIs extends VAcceptCriterion { } return false; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VDropHandler.java b/client/src/com/vaadin/client/ui/dd/VDropHandler.java index 18fd740c0d..96059883e7 100644 --- a/client/src/com/vaadin/client/ui/dd/VDropHandler.java +++ b/client/src/com/vaadin/client/ui/dd/VDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VHasDropHandler.java b/client/src/com/vaadin/client/ui/dd/VHasDropHandler.java index 40c3cd81e9..4d82c5c9cf 100644 --- a/client/src/com/vaadin/client/ui/dd/VHasDropHandler.java +++ b/client/src/com/vaadin/client/ui/dd/VHasDropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VHtml5DragEvent.java b/client/src/com/vaadin/client/ui/dd/VHtml5DragEvent.java index 3615db650f..68987e565f 100644 --- a/client/src/com/vaadin/client/ui/dd/VHtml5DragEvent.java +++ b/client/src/com/vaadin/client/ui/dd/VHtml5DragEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VHtml5File.java b/client/src/com/vaadin/client/ui/dd/VHtml5File.java index ef74439063..6022835343 100644 --- a/client/src/com/vaadin/client/ui/dd/VHtml5File.java +++ b/client/src/com/vaadin/client/ui/dd/VHtml5File.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VIsOverId.java b/client/src/com/vaadin/client/ui/dd/VIsOverId.java index 7e2f596a20..8e8abf1a97 100644 --- a/client/src/com/vaadin/client/ui/dd/VIsOverId.java +++ b/client/src/com/vaadin/client/ui/dd/VIsOverId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -51,4 +51,4 @@ final public class VIsOverId extends VAcceptCriterion { } return false; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VItemIdIs.java b/client/src/com/vaadin/client/ui/dd/VItemIdIs.java index b022f434f4..4bfc71ab14 100644 --- a/client/src/com/vaadin/client/ui/dd/VItemIdIs.java +++ b/client/src/com/vaadin/client/ui/dd/VItemIdIs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -47,4 +47,4 @@ final public class VItemIdIs extends VAcceptCriterion { } return false; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java b/client/src/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java index 190c7bc504..f67174c1c1 100644 --- a/client/src/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java +++ b/client/src/com/vaadin/client/ui/dd/VLazyInitItemIdentifiers.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -90,4 +90,4 @@ public class VLazyInitItemIdentifiers extends VAcceptCriterion { protected boolean accept(VDragEvent drag, UIDL configuration) { return false; // not used is this implementation } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VNot.java b/client/src/com/vaadin/client/ui/dd/VNot.java index 660a12a275..3e931f9580 100644 --- a/client/src/com/vaadin/client/ui/dd/VNot.java +++ b/client/src/com/vaadin/client/ui/dd/VNot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -73,4 +73,4 @@ final public class VNot extends VAcceptCriterion { protected boolean accept(VDragEvent drag, UIDL configuration) { return false; // not used } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VOr.java b/client/src/com/vaadin/client/ui/dd/VOr.java index d06337bf35..e189e22b45 100644 --- a/client/src/com/vaadin/client/ui/dd/VOr.java +++ b/client/src/com/vaadin/client/ui/dd/VOr.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -59,4 +59,4 @@ final public class VOr extends VAcceptCriterion implements VAcceptCallback { accepted = true; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VOverTreeNode.java b/client/src/com/vaadin/client/ui/dd/VOverTreeNode.java index 324406be98..c7c00a6bee 100644 --- a/client/src/com/vaadin/client/ui/dd/VOverTreeNode.java +++ b/client/src/com/vaadin/client/ui/dd/VOverTreeNode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -28,4 +28,4 @@ final public class VOverTreeNode extends VAcceptCriterion { "itemIdOverIsNode"); return containsKey != null && containsKey.booleanValue(); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VServerAccept.java b/client/src/com/vaadin/client/ui/dd/VServerAccept.java index 3f40d6455c..9ead6298b0 100644 --- a/client/src/com/vaadin/client/ui/dd/VServerAccept.java +++ b/client/src/com/vaadin/client/ui/dd/VServerAccept.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,4 +48,4 @@ final public class VServerAccept extends VAcceptCriterion { protected boolean accept(VDragEvent drag, UIDL configuration) { return false; // not used } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VSourceIsTarget.java b/client/src/com/vaadin/client/ui/dd/VSourceIsTarget.java index 6f4a3b0497..3e453b4105 100644 --- a/client/src/com/vaadin/client/ui/dd/VSourceIsTarget.java +++ b/client/src/com/vaadin/client/ui/dd/VSourceIsTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -34,4 +34,4 @@ final public class VSourceIsTarget extends VAcceptCriterion { return paintable == dragSource; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VTargetDetailIs.java b/client/src/com/vaadin/client/ui/dd/VTargetDetailIs.java index 8d062c8c67..9084d7df89 100644 --- a/client/src/com/vaadin/client/ui/dd/VTargetDetailIs.java +++ b/client/src/com/vaadin/client/ui/dd/VTargetDetailIs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,4 +48,4 @@ final public class VTargetDetailIs extends VAcceptCriterion { } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/dd/VTargetInSubtree.java b/client/src/com/vaadin/client/ui/dd/VTargetInSubtree.java index c3f56b410d..1641eb30f1 100644 --- a/client/src/com/vaadin/client/ui/dd/VTargetInSubtree.java +++ b/client/src/com/vaadin/client/ui/dd/VTargetInSubtree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/dd/VTransferable.java b/client/src/com/vaadin/client/ui/dd/VTransferable.java index 18f6369b92..b03dcbcb35 100644 --- a/client/src/com/vaadin/client/ui/dd/VTransferable.java +++ b/client/src/com/vaadin/client/ui/dd/VTransferable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java index f659e72e78..afb521b141 100644 --- a/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java +++ b/client/src/com/vaadin/client/ui/draganddropwrapper/DragAndDropWrapperConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java b/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java index c6e9e774ee..cd4c79ccc6 100644 --- a/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java +++ b/client/src/com/vaadin/client/ui/embedded/EmbeddedConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -236,4 +236,4 @@ public class EmbeddedConnector extends AbstractComponentConnector implements }; -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/flash/FlashConnector.java b/client/src/com/vaadin/client/ui/flash/FlashConnector.java index e12e1be64d..7d01f6f560 100644 --- a/client/src/com/vaadin/client/ui/flash/FlashConnector.java +++ b/client/src/com/vaadin/client/ui/flash/FlashConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/form/FormConnector.java b/client/src/com/vaadin/client/ui/form/FormConnector.java index f5256adbb2..25046f8b9a 100644 --- a/client/src/com/vaadin/client/ui/form/FormConnector.java +++ b/client/src/com/vaadin/client/ui/form/FormConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java b/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java index 8328e1f0a7..494a1a87ff 100644 --- a/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/formlayout/FormLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java b/client/src/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java index cc052fa6d5..67220e5c36 100644 --- a/client/src/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/gridlayout/GridLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -210,4 +210,18 @@ public class GridLayoutConnector extends AbstractComponentContainerConnector public void layoutHorizontally() { getWidget().updateWidth(); } + + @Override + protected void updateWidgetSize(String newWidth, String newHeight) { + // Prevent the element from momentarily shrinking to zero size + // when the size is set to undefined by a state change but before + // it is recomputed in the layout phase. This may affect scroll + // position in some cases; see #13386. + if (!isUndefinedHeight()) { + getWidget().setHeight(newHeight); + } + if (!isUndefinedWidth()) { + getWidget().setWidth(newWidth); + } + } } diff --git a/client/src/com/vaadin/client/ui/image/ImageConnector.java b/client/src/com/vaadin/client/ui/image/ImageConnector.java index d637f56bfd..e4ba4af070 100644 --- a/client/src/com/vaadin/client/ui/image/ImageConnector.java +++ b/client/src/com/vaadin/client/ui/image/ImageConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/label/LabelConnector.java b/client/src/com/vaadin/client/ui/label/LabelConnector.java index 6a04c91562..07defcc64d 100644 --- a/client/src/com/vaadin/client/ui/label/LabelConnector.java +++ b/client/src/com/vaadin/client/ui/label/LabelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java b/client/src/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java index de3626d846..b323fde1db 100644 --- a/client/src/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java +++ b/client/src/com/vaadin/client/ui/layout/ComponentConnectorLayoutSlot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/ElementResizeEvent.java b/client/src/com/vaadin/client/ui/layout/ElementResizeEvent.java index 9ad08510a0..a1f75baff4 100644 --- a/client/src/com/vaadin/client/ui/layout/ElementResizeEvent.java +++ b/client/src/com/vaadin/client/ui/layout/ElementResizeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/ElementResizeListener.java b/client/src/com/vaadin/client/ui/layout/ElementResizeListener.java index 8fa6ccc4cc..97ca34a8a4 100644 --- a/client/src/com/vaadin/client/ui/layout/ElementResizeListener.java +++ b/client/src/com/vaadin/client/ui/layout/ElementResizeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.client.ui.layout; public interface ElementResizeListener { public void onElementResize(ElementResizeEvent e); -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java index e148742b0b..ae866e3354 100644 --- a/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java +++ b/client/src/com/vaadin/client/ui/layout/LayoutDependencyTree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/Margins.java b/client/src/com/vaadin/client/ui/layout/Margins.java index cd0cbe79d0..75839c9ce8 100644 --- a/client/src/com/vaadin/client/ui/layout/Margins.java +++ b/client/src/com/vaadin/client/ui/layout/Margins.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/MayScrollChildren.java b/client/src/com/vaadin/client/ui/layout/MayScrollChildren.java index 0588b55303..2a0b821646 100644 --- a/client/src/com/vaadin/client/ui/layout/MayScrollChildren.java +++ b/client/src/com/vaadin/client/ui/layout/MayScrollChildren.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java b/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java index 5c8a627dea..50020e51fe 100644 --- a/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java +++ b/client/src/com/vaadin/client/ui/layout/VLayoutSlot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -299,4 +299,4 @@ public abstract class VLayoutSlot { public double getExpandRatio() { return expandRatio; } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/link/LinkConnector.java b/client/src/com/vaadin/client/ui/link/LinkConnector.java index c8bbc426e9..42c42cf06e 100644 --- a/client/src/com/vaadin/client/ui/link/LinkConnector.java +++ b/client/src/com/vaadin/client/ui/link/LinkConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,6 +16,7 @@ package com.vaadin.client.ui.link; +import com.google.gwt.dom.client.Style.Display; import com.google.gwt.user.client.DOM; import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; @@ -83,8 +84,8 @@ public class LinkConnector extends AbstractComponentConnector { DOM.insertChild(getWidget().getElement(), getWidget().errorIndicatorElement, 0); } else if (getWidget().errorIndicatorElement != null) { - DOM.setStyleAttribute(getWidget().errorIndicatorElement, "display", - "none"); + getWidget().errorIndicatorElement.getStyle().setDisplay( + Display.NONE); } if (getWidget().icon != null) { diff --git a/client/src/com/vaadin/client/ui/listselect/ListSelectConnector.java b/client/src/com/vaadin/client/ui/listselect/ListSelectConnector.java index 0b86b6c226..b867a3358c 100644 --- a/client/src/com/vaadin/client/ui/listselect/ListSelectConnector.java +++ b/client/src/com/vaadin/client/ui/listselect/ListSelectConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/menubar/MenuBar.java b/client/src/com/vaadin/client/ui/menubar/MenuBar.java index 6f0546601a..b00665e766 100644 --- a/client/src/com/vaadin/client/ui/menubar/MenuBar.java +++ b/client/src/com/vaadin/client/ui/menubar/MenuBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java b/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java index 4ead614275..20cabf9a36 100644 --- a/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java +++ b/client/src/com/vaadin/client/ui/menubar/MenuBarConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/menubar/MenuItem.java b/client/src/com/vaadin/client/ui/menubar/MenuItem.java index 9cad2e976f..bf2fbf8feb 100644 --- a/client/src/com/vaadin/client/ui/menubar/MenuItem.java +++ b/client/src/com/vaadin/client/ui/menubar/MenuItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java index e4e88899eb..6968f59574 100644 --- a/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java +++ b/client/src/com/vaadin/client/ui/nativebutton/NativeButtonConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java b/client/src/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java index 1799ba2958..46a8f37122 100644 --- a/client/src/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java +++ b/client/src/com/vaadin/client/ui/nativeselect/NativeSelectConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java index 86e857ac7f..a655635edc 100644 --- a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java +++ b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupBaseConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java index 9b8a38b952..f9bdf455f6 100644 --- a/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java +++ b/client/src/com/vaadin/client/ui/optiongroup/OptionGroupConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java index fbf94f0da3..0c09ae49c6 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/AbstractOrderedLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,6 +17,8 @@ package com.vaadin.client.ui.orderedlayout; import java.util.List; +import com.google.gwt.core.client.Scheduler; +import com.google.gwt.core.client.Scheduler.ScheduledCommand; import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.Style.Unit; import com.google.gwt.user.client.ui.Widget; @@ -203,6 +205,13 @@ public abstract class AbstractOrderedLayoutConnector extends private boolean hasChildrenWithRelativeHeight = false; /** + * Keep track of whether any child has relative width. Used to determine + * whether measurements are needed to make relative child widths work + * together with undefined container width. + */ + private boolean hasChildrenWithRelativeWidth = false; + + /** * Keep track of whether any child is middle aligned. Used to determine if * measurements are needed to make middle aligned children work. */ @@ -421,6 +430,8 @@ public abstract class AbstractOrderedLayoutConnector extends processedResponseId = lastResponseId; hasChildrenWithRelativeHeight = false; + hasChildrenWithRelativeWidth = false; + hasChildrenWithMiddleAlignment = false; needsExpand = getWidget().vertical ? !isUndefinedHeight() @@ -474,6 +485,9 @@ public abstract class AbstractOrderedLayoutConnector extends if (child.isRelativeHeight()) { hasChildrenWithRelativeHeight = true; } + if (child.isRelativeWidth()) { + hasChildrenWithRelativeWidth = true; + } } if (needsFixedHeight()) { @@ -493,7 +507,15 @@ public abstract class AbstractOrderedLayoutConnector extends updateLayoutHeight(); if (needsExpand()) { getWidget().updateExpandedSizes(); - getWidget().updateExpandCompensation(); + // updateExpandedSizes causes fixed size components to temporarily + // lose their size. updateExpandCompensation must be delayed until + // the browser has a chance to measure them. + Scheduler.get().scheduleFinally(new ScheduledCommand() { + @Override + public void execute() { + getWidget().updateExpandCompensation(); + } + }); } else { getWidget().clearExpand(); } @@ -565,7 +587,7 @@ public abstract class AbstractOrderedLayoutConnector extends if (slot.hasCaption()) { slot.setCaptionResizeListener(slotCaptionResizeListener); } - } else if ((child.isRelativeHeight() || child.isRelativeWidth()) + } else if ((hasChildrenWithRelativeHeight || hasChildrenWithRelativeWidth) && slot.hasCaption()) { /* * If the slot has caption, we need to listen for its size changes diff --git a/client/src/com/vaadin/client/ui/orderedlayout/CaptionPosition.java b/client/src/com/vaadin/client/ui/orderedlayout/CaptionPosition.java index 57f85b9e23..885dc1ecd7 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/CaptionPosition.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/CaptionPosition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,4 +21,4 @@ package com.vaadin.client.ui.orderedlayout; */ public enum CaptionPosition { TOP, RIGHT, BOTTOM, LEFT -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java index 87888bddae..2cd1acd78b 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/HorizontalLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java index 03038eefd3..b1d7dd2804 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/Slot.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/Slot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -766,4 +766,4 @@ public final class Slot extends SimplePanel { return hasRelativeWidth(); } } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java index 4a1dae9b95..4c74358753 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VAbstractOrderedLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -674,6 +674,7 @@ public class VAbstractOrderedLayout extends FlowPanel { } } } + Util.forceIE8Redraw(getElement()); } /** diff --git a/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java b/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java index 932327653a..33ff020e89 100644 --- a/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java +++ b/client/src/com/vaadin/client/ui/orderedlayout/VerticalLayoutConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/panel/PanelConnector.java b/client/src/com/vaadin/client/ui/panel/PanelConnector.java index f2e73bae80..11111df602 100644 --- a/client/src/com/vaadin/client/ui/panel/PanelConnector.java +++ b/client/src/com/vaadin/client/ui/panel/PanelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java b/client/src/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java index e8ed6c1113..61576fac04 100644 --- a/client/src/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java +++ b/client/src/com/vaadin/client/ui/passwordfield/PasswordFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java b/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java index 2f53280c99..bde5f6a051 100644 --- a/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java +++ b/client/src/com/vaadin/client/ui/popupview/PopupViewConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -97,11 +97,9 @@ public class PopupViewConnector extends AbstractHasComponentsConnector public void onConnectorHierarchyChange( ConnectorHierarchyChangeEvent connectorHierarchyChangeEvent) { // Render the popup if visible and show it. - if (!getChildren().isEmpty()) { + if (!getChildComponents().isEmpty()) { getWidget().preparePopup(getWidget().popup); - getWidget().popup - .setPopupConnector((ComponentConnector) getChildren() - .get(0)); + getWidget().popup.setPopupConnector(getChildComponents().get(0)); if (ComponentStateUtil.hasStyles(getState())) { final StringBuffer styleBuf = new StringBuffer(); final String primaryName = getWidget().popup diff --git a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java index a14cac3808..8db2d1cb85 100644 --- a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java +++ b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java index 545beddcc2..3c5e09d1fc 100644 --- a/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java +++ b/client/src/com/vaadin/client/ui/popupview/VisibilityChangeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java b/client/src/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java index 91f3da5323..3a83430f7a 100644 --- a/client/src/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java +++ b/client/src/com/vaadin/client/ui/progressindicator/ProgressBarConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -53,4 +53,4 @@ public class ProgressBarConnector extends AbstractFieldConnector { return (VProgressBar) super.getWidget(); } -}
\ No newline at end of file +} diff --git a/client/src/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java b/client/src/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java index 23b71868e0..36bb1dd6b2 100644 --- a/client/src/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java +++ b/client/src/com/vaadin/client/ui/progressindicator/ProgressIndicatorConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java b/client/src/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java index a19e931713..6b3bf84578 100644 --- a/client/src/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java +++ b/client/src/com/vaadin/client/ui/richtextarea/RichTextAreaConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java b/client/src/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java index dc7d456427..2e0554c499 100644 --- a/client/src/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java +++ b/client/src/com/vaadin/client/ui/richtextarea/VRichTextToolbar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/slider/SliderConnector.java b/client/src/com/vaadin/client/ui/slider/SliderConnector.java index b4eb9f14f7..1e5120ce76 100644 --- a/client/src/com/vaadin/client/ui/slider/SliderConnector.java +++ b/client/src/com/vaadin/client/ui/slider/SliderConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java index 45535de3de..ce8b3c8fea 100644 --- a/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java +++ b/client/src/com/vaadin/client/ui/splitpanel/AbstractSplitPanelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java index 9cc79db77f..75389b6cc4 100644 --- a/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java +++ b/client/src/com/vaadin/client/ui/splitpanel/HorizontalSplitPanelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java b/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java index 05e06b2609..e95f7143ba 100644 --- a/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java +++ b/client/src/com/vaadin/client/ui/splitpanel/VerticalSplitPanelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java index 610f2f8010..bea49e5f27 100644 --- a/client/src/com/vaadin/client/ui/table/TableConnector.java +++ b/client/src/com/vaadin/client/ui/table/TableConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -303,9 +303,13 @@ public class TableConnector extends AbstractHasComponentsConnector implements getWidget().tabIndex = getState().tabIndex; getWidget().setProperTabIndex(); - if (getWidget().initializedAndAttached) { - getWidget().resizeSortedColumnForSortIndicator(); - } + Scheduler.get().scheduleFinally(new ScheduledCommand() { + + @Override + public void execute() { + getWidget().resizeSortedColumnForSortIndicator(); + } + }); // Remember this to detect situations where overflow hack might be // needed during scrolling diff --git a/client/src/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java b/client/src/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java index 30c9e47c6e..9de415e74e 100644 --- a/client/src/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java +++ b/client/src/com/vaadin/client/ui/tabsheet/TabsheetBaseConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java index b472300c21..8c6afd1c4f 100644 --- a/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java +++ b/client/src/com/vaadin/client/ui/tabsheet/TabsheetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,7 +16,7 @@ package com.vaadin.client.ui.tabsheet; import com.google.gwt.dom.client.Element; -import com.google.gwt.user.client.DOM; +import com.google.gwt.dom.client.Style.Overflow; import com.vaadin.client.ComponentConnector; import com.vaadin.client.ConnectorHierarchyChangeEvent; import com.vaadin.client.TooltipInfo; @@ -77,11 +77,11 @@ public class TabsheetConnector extends TabsheetBaseConnector implements // tabs; push or not if (!isUndefinedWidth()) { - DOM.setStyleAttribute(getWidget().tabs, "overflow", "hidden"); + getWidget().tabs.getStyle().setOverflow(Overflow.HIDDEN); } else { getWidget().showAllTabs(); - DOM.setStyleAttribute(getWidget().tabs, "width", ""); - DOM.setStyleAttribute(getWidget().tabs, "overflow", "visible"); + getWidget().tabs.getStyle().clearWidth(); + getWidget().tabs.getStyle().setOverflow(Overflow.VISIBLE); getWidget().updateDynamicWidth(); } @@ -176,7 +176,11 @@ public class TabsheetConnector extends TabsheetBaseConnector implements * (Re-)render the content of the active tab. */ protected void renderContent() { - ComponentConnector contentConnector = getChildComponents().get(0); + ComponentConnector contentConnector = null; + if (!getChildComponents().isEmpty()) { + contentConnector = getChildComponents().get(0); + } + if (null != contentConnector) { getWidget().renderContent(contentConnector.getWidget()); } else { diff --git a/client/src/com/vaadin/client/ui/textarea/TextAreaConnector.java b/client/src/com/vaadin/client/ui/textarea/TextAreaConnector.java index 5cfc309e5b..e406ff5459 100644 --- a/client/src/com/vaadin/client/ui/textarea/TextAreaConnector.java +++ b/client/src/com/vaadin/client/ui/textarea/TextAreaConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java index e2ede121b6..42b045005f 100644 --- a/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java +++ b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/tree/TreeConnector.java b/client/src/com/vaadin/client/ui/tree/TreeConnector.java index 8b09c10ad3..c57430b3b4 100644 --- a/client/src/com/vaadin/client/ui/tree/TreeConnector.java +++ b/client/src/com/vaadin/client/ui/tree/TreeConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java index 4f62f0df89..5a42484b28 100644 --- a/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java +++ b/client/src/com/vaadin/client/ui/treetable/TreeTableConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,7 +48,12 @@ public class TreeTableConnector extends TableConnector { .getIntAttribute(TreeTableConstants.ATTRIBUTE_HIERARCHY_COLUMN_INDEX) : 0; int oldTotalRows = getWidget().getTotalRows(); + super.updateFromUIDL(uidl, client); + // super.updateFromUIDL set rendering to false, even though we continue + // rendering here. Set it back to true. + getWidget().rendering = true; + if (getWidget().collapseRequest) { if (getWidget().collapsedRowKey != null && getWidget().scrollBody != null) { @@ -105,6 +110,7 @@ public class TreeTableConnector extends TableConnector { getWidget() .handleNavigation(event.keycode, event.ctrl, event.shift); } + getWidget().rendering = false; } @Override diff --git a/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java b/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java index 72794d08f1..0994ac15c3 100644 --- a/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java +++ b/client/src/com/vaadin/client/ui/twincolselect/TwinColSelectConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/ui/UIConnector.java b/client/src/com/vaadin/client/ui/ui/UIConnector.java index 576f50d018..1d2a49cbd1 100644 --- a/client/src/com/vaadin/client/ui/ui/UIConnector.java +++ b/client/src/com/vaadin/client/ui/ui/UIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/upload/UploadConnector.java b/client/src/com/vaadin/client/ui/upload/UploadConnector.java index 03f1a2802c..87e97bc675 100644 --- a/client/src/com/vaadin/client/ui/upload/UploadConnector.java +++ b/client/src/com/vaadin/client/ui/upload/UploadConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java b/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java index 20c1368017..2c2e10594d 100644 --- a/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java +++ b/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java b/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java index 6a38c8986b..0c114e2ee7 100644 --- a/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java +++ b/client/src/com/vaadin/client/ui/upload/UploadIFrameOnloadStrategyIE.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/video/VideoConnector.java b/client/src/com/vaadin/client/ui/video/VideoConnector.java index 6098cf63d6..de53368d6a 100644 --- a/client/src/com/vaadin/client/ui/video/VideoConnector.java +++ b/client/src/com/vaadin/client/ui/video/VideoConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/window/WindowConnector.java b/client/src/com/vaadin/client/ui/window/WindowConnector.java index 07015e7fbe..5c8f5e2d2d 100644 --- a/client/src/com/vaadin/client/ui/window/WindowConnector.java +++ b/client/src/com/vaadin/client/ui/window/WindowConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,6 +15,8 @@ */ package com.vaadin.client.ui.window; +import java.util.logging.Logger; + import com.google.gwt.dom.client.Element; import com.google.gwt.dom.client.NativeEvent; import com.google.gwt.dom.client.Style; @@ -256,6 +258,12 @@ public class WindowConnector extends AbstractSingleComponentContainerConnector @Override public void postLayout() { VWindow window = getWidget(); + + if (!window.isAttached()) { + Logger.getLogger(WindowConnector.class.getName()).warning( + "Called postLayout to detached Window."); + return; + } if (window.centered && getState().windowMode != WindowMode.MAXIMIZED) { window.center(); } diff --git a/client/src/com/vaadin/client/ui/window/WindowMoveEvent.java b/client/src/com/vaadin/client/ui/window/WindowMoveEvent.java index 439a90e3a1..add7ee740f 100644 --- a/client/src/com/vaadin/client/ui/window/WindowMoveEvent.java +++ b/client/src/com/vaadin/client/ui/window/WindowMoveEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/client/src/com/vaadin/client/ui/window/WindowMoveHandler.java b/client/src/com/vaadin/client/ui/window/WindowMoveHandler.java index e30e1853fe..0ac348af68 100644 --- a/client/src/com/vaadin/client/ui/window/WindowMoveHandler.java +++ b/client/src/com/vaadin/client/ui/window/WindowMoveHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 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/eclipse/Development Mode (vaadin).launch b/eclipse/Development Mode (vaadin).launch index 483ce58233..e8a8ee09c1 100644 --- a/eclipse/Development Mode (vaadin).launch +++ b/eclipse/Development Mode (vaadin).launch @@ -27,7 +27,6 @@ <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=server%2Fivy.xml&amp;confs=ide&amp;ivySettingsPath=%24%7Bworkspace_loc%3Avaadin%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=" javaProject="vaadin" path="3" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=shared%2Fivy.xml&amp;confs=ide&amp;ivySettingsPath=%24%7Bworkspace_loc%3Avaadin%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=" javaProject="vaadin" path="3" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=client-compiler%2Fivy.xml&amp;confs=ide&amp;ivySettingsPath=%24%7Bworkspace_loc%3Avaadin%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=" javaProject="vaadin" path="3" type="4"/> "/> -<listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=theme-compiler%2Fivy.xml&amp;confs=ide&amp;ivySettingsPath=%24%7Bworkspace_loc%3Avaadin%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=" javaProject="vaadin" path="3" type="4"/> "/> <listEntry value="<?xml version="1.0" encoding="UTF-8" standalone="no"?> <runtimeClasspathEntry containerPath="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=vaadin&amp;ivyXmlPath=uitest%2Fivy.xml&amp;confs=ide&amp;ivySettingsPath=%24%7Bworkspace_loc%3Avaadin%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=" javaProject="vaadin" path="3" type="4"/> "/> </listAttribute> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> diff --git a/eclipse/Development Server (vaadin).launch b/eclipse/Development Server (vaadin).launch index 9505811c0b..197344cce0 100644 --- a/eclipse/Development Server (vaadin).launch +++ b/eclipse/Development Server (vaadin).launch @@ -14,6 +14,7 @@ </listAttribute> <booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="false"/> <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="com.vaadin.launcher.DevelopmentServerLauncher"/> +<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="--autoreload=build/classes --scaninterval=3"/> <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="vaadin"/> <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-ea"/> </launchConfiguration> diff --git a/eclipse/VaadinJavaConventions.xml b/eclipse/VaadinJavaConventions.xml index 34d96187d9..8d2c47ab90 100644 --- a/eclipse/VaadinJavaConventions.xml +++ b/eclipse/VaadinJavaConventions.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="12">
-<profile kind="CodeFormatterProfile" name="Vaadin Java Conventions 20110923" version="12">
+<profile kind="CodeFormatterProfile" name="Vaadin Java Conventions 20140408" version="12">
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
@@ -193,7 +193,7 @@ <setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
-<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="insert"/>
+<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="do not insert"/>
diff --git a/push/build.xml b/push/build.xml index c307ee621d..dfc8d03156 100644 --- a/push/build.xml +++ b/push/build.xml @@ -17,7 +17,7 @@ <!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java --> <property name="atmosphere.runtime.version" value="2.1.2.vaadin2" /> - <property name="jquery.version" value="2.0.3" /> + <property name="jquery.js" location="lib/jquery/jquery-1.11.0.js" /> <path id="classpath.compile.custom" /> @@ -42,11 +42,10 @@ <unzip src="${temp.dir}/jquery.war" dest="${jquery.unpack}"> <patternset> <include name="**/jquery.atmosphere.js" /> - <include name="**/jquery-${jquery.version}.js" /> </patternset> <mapper type="flatten" /> </unzip> - <loadfile srcfile="${jquery.unpack}/jquery-${jquery.version}.js" property="jquery.js.contents" /> + <loadfile srcfile="${jquery.js}" property="jquery.js.contents" /> <loadfile srcfile="${jquery.unpack}/jquery.atmosphere.js" property="jquery.atmosphere.js.contents" /> <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/vaadinPush.js.tpl" property="vaadinPush.js.contents"> diff --git a/push/ivy.xml b/push/ivy.xml index ebdb673cb0..1b98969fca 100644 --- a/push/ivy.xml +++ b/push/ivy.xml @@ -3,7 +3,7 @@ <!-- Keep the version number in sync with build.xml --> <!ENTITY atmosphere.runtime.version "2.1.2.vaadin2"> - <!ENTITY atmosphere.js.version "2.1.5.vaadin1"> + <!ENTITY atmosphere.js.version "2.1.5.vaadin4"> ]> <ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" diff --git a/push/lib/jquery/jquery-1.11.0.js b/push/lib/jquery/jquery-1.11.0.js new file mode 100644 index 0000000000..3c88fa8b7f --- /dev/null +++ b/push/lib/jquery/jquery-1.11.0.js @@ -0,0 +1,10337 @@ +/*! + * jQuery JavaScript Library v1.11.0 + * http://jquery.com/ + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * + * Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-01-23T21:02Z + */ + +(function( global, factory ) { + + if ( typeof module === "object" && typeof module.exports === "object" ) { + // For CommonJS and CommonJS-like environments where a proper window is present, + // execute the factory and get jQuery + // For environments that do not inherently posses a window with a document + // (such as Node.js), expose a jQuery-making factory as module.exports + // This accentuates the need for the creation of a real window + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Can't do this because several apps including ASP.NET trace +// the stack via arguments.caller.callee and Firefox dies if +// you try to trace through "use strict" call chains. (#13335) +// Support: Firefox 18+ +// + +var deletedIds = []; + +var slice = deletedIds.slice; + +var concat = deletedIds.concat; + +var push = deletedIds.push; + +var indexOf = deletedIds.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var trim = "".trim; + +var support = {}; + + + +var + version = "1.11.0", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }, + + // Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE) + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, + + // Matches dashed string for camelizing + rmsPrefix = /^-ms-/, + rdashAlpha = /-([\da-z])/gi, + + // Used by jQuery.camelCase as callback to replace() + fcamelCase = function( all, letter ) { + return letter.toUpperCase(); + }; + +jQuery.fn = jQuery.prototype = { + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // Start with an empty selector + selector: "", + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + return num != null ? + + // Return a 'clean' array + ( num < 0 ? this[ num + this.length ] : this[ num ] ) : + + // Return just the object + slice.call( this ); + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + ret.context = this.context; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + // (You can seed the arguments with an array of args, but this is + // only used internally.) + each: function( callback, args ) { + return jQuery.each( this, callback, args ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map(this, function( elem, i ) { + return callback.call( elem, i, elem ); + })); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[j] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(null); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: deletedIds.sort, + splice: deletedIds.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var src, copyIsArray, copy, name, options, clone, + target = arguments[0] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !jQuery.isFunction(target) ) { + target = {}; + } + + // extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + // Only deal with non-null/undefined values + if ( (options = arguments[ i ]) != null ) { + // Extend the base object + for ( name in options ) { + src = target[ name ]; + copy = options[ name ]; + + // Prevent never-ending loop + if ( target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) { + if ( copyIsArray ) { + copyIsArray = false; + clone = src && jQuery.isArray(src) ? src : []; + + } else { + clone = src && jQuery.isPlainObject(src) ? src : {}; + } + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend({ + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + // See test/unit/core.js for details concerning isFunction. + // Since version 1.3, DOM methods and functions like alert + // aren't supported. They return false on IE (#2968). + isFunction: function( obj ) { + return jQuery.type(obj) === "function"; + }, + + isArray: Array.isArray || function( obj ) { + return jQuery.type(obj) === "array"; + }, + + isWindow: function( obj ) { + /* jshint eqeqeq: false */ + return obj != null && obj == obj.window; + }, + + isNumeric: function( obj ) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + return obj - parseFloat( obj ) >= 0; + }, + + isEmptyObject: function( obj ) { + var name; + for ( name in obj ) { + return false; + } + return true; + }, + + isPlainObject: function( obj ) { + var key; + + // Must be an Object. + // Because of IE, we also have to check the presence of the constructor property. + // Make sure that DOM nodes and window objects don't pass through, as well + if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) { + return false; + } + + try { + // Not own constructor property must be Object + if ( obj.constructor && + !hasOwn.call(obj, "constructor") && + !hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) { + return false; + } + } catch ( e ) { + // IE8,9 Will throw exceptions on certain host objects #9897 + return false; + } + + // Support: IE<9 + // Handle iteration over inherited properties before own properties. + if ( support.ownLast ) { + for ( key in obj ) { + return hasOwn.call( obj, key ); + } + } + + // Own properties are enumerated firstly, so to speed up, + // if last one is own, then all properties are own. + for ( key in obj ) {} + + return key === undefined || hasOwn.call( obj, key ); + }, + + type: function( obj ) { + if ( obj == null ) { + return obj + ""; + } + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call(obj) ] || "object" : + typeof obj; + }, + + // Evaluates a script in a global context + // Workarounds based on findings by Jim Driscoll + // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context + globalEval: function( data ) { + if ( data && jQuery.trim( data ) ) { + // We use execScript on Internet Explorer + // We use an anonymous function so that context is window + // rather than jQuery in Firefox + ( window.execScript || function( data ) { + window[ "eval" ].call( window, data ); + } )( data ); + } + }, + + // Convert dashed to camelCase; used by the css and data modules + // Microsoft forgot to hump their vendor prefix (#9572) + camelCase: function( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); + }, + + nodeName: function( elem, name ) { + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + }, + + // args is for internal usage only + each: function( obj, callback, args ) { + var value, + i = 0, + length = obj.length, + isArray = isArraylike( obj ); + + if ( args ) { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.apply( obj[ i ], args ); + + if ( value === false ) { + break; + } + } + } + + // A special, fast, case for the most common use of each + } else { + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } else { + for ( i in obj ) { + value = callback.call( obj[ i ], i, obj[ i ] ); + + if ( value === false ) { + break; + } + } + } + } + + return obj; + }, + + // Use native String.trim function wherever possible + trim: trim && !trim.call("\uFEFF\xA0") ? + function( text ) { + return text == null ? + "" : + trim.call( text ); + } : + + // Otherwise use our own trimming functionality + function( text ) { + return text == null ? + "" : + ( text + "" ).replace( rtrim, "" ); + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArraylike( Object(arr) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + var len; + + if ( arr ) { + if ( indexOf ) { + return indexOf.call( arr, elem, i ); + } + + len = arr.length; + i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0; + + for ( ; i < len; i++ ) { + // Skip accessing in sparse arrays + if ( i in arr && arr[ i ] === elem ) { + return i; + } + } + } + + return -1; + }, + + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + while ( j < len ) { + first[ i++ ] = second[ j++ ]; + } + + // Support: IE<9 + // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists) + if ( len !== len ) { + while ( second[j] !== undefined ) { + first[ i++ ] = second[ j++ ]; + } + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var value, + i = 0, + length = elems.length, + isArray = isArraylike( elems ), + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArray ) { + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return concat.apply( [], ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // Bind a function to a context, optionally partially applying any + // arguments. + proxy: function( fn, context ) { + var args, proxy, tmp; + + if ( typeof context === "string" ) { + tmp = fn[ context ]; + context = fn; + fn = tmp; + } + + // Quick check to determine if target is callable, in the spec + // this throws a TypeError, but we will just return undefined. + if ( !jQuery.isFunction( fn ) ) { + return undefined; + } + + // Simulated bind + args = slice.call( arguments, 2 ); + proxy = function() { + return fn.apply( context || this, args.concat( slice.call( arguments ) ) ); + }; + + // Set the guid of unique handler to the same of original handler, so it can be removed + proxy.guid = fn.guid = fn.guid || jQuery.guid++; + + return proxy; + }, + + now: function() { + return +( new Date() ); + }, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +}); + +// Populate the class2type map +jQuery.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +}); + +function isArraylike( obj ) { + var length = obj.length, + type = jQuery.type( obj ); + + if ( type === "function" || jQuery.isWindow( obj ) ) { + return false; + } + + if ( obj.nodeType === 1 && length ) { + return true; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v1.10.16 + * http://sizzlejs.com/ + * + * Copyright 2013 jQuery Foundation, Inc. and other contributors + * Released under the MIT license + * http://jquery.org/license + * + * Date: 2014-01-13 + */ +(function( window ) { + +var i, + support, + Expr, + getText, + isXML, + compile, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + -(new Date()), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // General-purpose constants + strundefined = typeof undefined, + MAX_NEGATIVE = 1 << 31, + + // Instance methods + hasOwn = ({}).hasOwnProperty, + arr = [], + pop = arr.pop, + push_native = arr.push, + push = arr.push, + slice = arr.slice, + // Use a stripped-down indexOf if we can't use a native one + indexOf = arr.indexOf || function( elem ) { + var i = 0, + len = this.length; + for ( ; i < len; i++ ) { + if ( this[i] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + // http://www.w3.org/TR/css3-syntax/#characters + characterEncoding = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", + + // Loosely modeled on CSS identifier characters + // An unquoted value should be a CSS identifier http://www.w3.org/TR/css3-selectors/#attribute-selectors + // Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier + identifier = characterEncoding.replace( "w", "w#" ), + + // Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace + + "*(?:([*^$|!~]?=)" + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]", + + // Prefer arguments quoted, + // then not containing pseudos/brackets, + // then attribute selectors/non-parenthetical expressions, + // then anything else + // These preferences are here to reduce the number of selectors + // needing tokenize in the PSEUDO preFilter + pseudos = ":(" + characterEncoding + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + attributes.replace( 3, 8 ) + ")*)|.*)\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ), + + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + characterEncoding + ")" ), + "CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ), + "TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace + + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace + + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + rescape = /'|\\/g, + + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ), + funescape = function( _, escaped, escapedWhitespace ) { + var high = "0x" + escaped - 0x10000; + // NaN means non-codepoint + // Support: Firefox + // Workaround erroneous numeric interpretation of +"0x" + return high !== high || escapedWhitespace ? + escaped : + high < 0 ? + // BMP codepoint + String.fromCharCode( high + 0x10000 ) : + // Supplemental Plane codepoint (surrogate pair) + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }; + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + (arr = slice.call( preferredDoc.childNodes )), + preferredDoc.childNodes + ); + // Support: Android<4.0 + // Detect silently failing push.apply + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + push_native.apply( target, slice.call(els) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + // Can't trust NodeList.length + while ( (target[j++] = els[i++]) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var match, elem, m, nodeType, + // QSA vars + i, groups, old, nid, newContext, newSelector; + + if ( ( context ? context.ownerDocument || context : preferredDoc ) !== document ) { + setDocument( context ); + } + + context = context || document; + results = results || []; + + if ( !selector || typeof selector !== "string" ) { + return results; + } + + if ( (nodeType = context.nodeType) !== 1 && nodeType !== 9 ) { + return []; + } + + if ( documentIsHTML && !seed ) { + + // Shortcuts + if ( (match = rquickExpr.exec( selector )) ) { + // Speed-up: Sizzle("#ID") + if ( (m = match[1]) ) { + if ( nodeType === 9 ) { + elem = context.getElementById( m ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document (jQuery #6963) + if ( elem && elem.parentNode ) { + // Handle the case where IE, Opera, and Webkit return items + // by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + } else { + // Context is not a document + if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) && + contains( context, elem ) && elem.id === m ) { + results.push( elem ); + return results; + } + } + + // Speed-up: Sizzle("TAG") + } else if ( match[2] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Speed-up: Sizzle(".CLASS") + } else if ( (m = match[3]) && support.getElementsByClassName && context.getElementsByClassName ) { + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // QSA path + if ( support.qsa && (!rbuggyQSA || !rbuggyQSA.test( selector )) ) { + nid = old = expando; + newContext = context; + newSelector = nodeType === 9 && selector; + + // qSA works strangely on Element-rooted queries + // We can work around this by specifying an extra ID on the root + // and working up from there (Thanks to Andrew Dupont for the technique) + // IE 8 doesn't work on object elements + if ( nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) { + groups = tokenize( selector ); + + if ( (old = context.getAttribute("id")) ) { + nid = old.replace( rescape, "\\$&" ); + } else { + context.setAttribute( "id", nid ); + } + nid = "[id='" + nid + "'] "; + + i = groups.length; + while ( i-- ) { + groups[i] = nid + toSelector( groups[i] ); + } + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || context; + newSelector = groups.join(","); + } + + if ( newSelector ) { + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch(qsaError) { + } finally { + if ( !old ) { + context.removeAttribute("id"); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {Function(string, Object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return (cache[ key + " " ] = value); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created div and expects a boolean result + */ +function assert( fn ) { + var div = document.createElement("div"); + + try { + return !!fn( div ); + } catch (e) { + return false; + } finally { + // Remove from its parent by default + if ( div.parentNode ) { + div.parentNode.removeChild( div ); + } + // release memory in IE + div = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split("|"), + i = attrs.length; + + while ( i-- ) { + Expr.attrHandle[ arr[i] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + ( ~b.sourceIndex || MAX_NEGATIVE ) - + ( ~a.sourceIndex || MAX_NEGATIVE ); + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( (cur = cur.nextSibling) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return (name === "input" || name === "button") && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction(function( argument ) { + argument = +argument; + return markFunction(function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ (j = matchIndexes[i]) ] ) { + seed[j] = !(matches[j] = seed[j]); + } + } + }); + }); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== strundefined && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + // documentElement is verified for cases where it doesn't yet exist + // (such as loading iframes in IE - #4833) + var documentElement = elem && (elem.ownerDocument || elem).documentElement; + return documentElement ? documentElement.nodeName !== "HTML" : false; +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, + doc = node ? node.ownerDocument || node : preferredDoc, + parent = doc.defaultView; + + // If no document and documentElement is available, return + if ( doc === document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Set our document + document = doc; + docElem = doc.documentElement; + + // Support tests + documentIsHTML = !isXML( doc ); + + // Support: IE>8 + // If iframe document is assigned to "document" variable and if iframe has been reloaded, + // IE will throw "permission denied" error when accessing "document" variable, see jQuery #13936 + // IE6-8 do not support the defaultView property so parent will be undefined + if ( parent && parent !== parent.top ) { + // IE11 does not have attachEvent, so all must suffer + if ( parent.addEventListener ) { + parent.addEventListener( "unload", function() { + setDocument(); + }, false ); + } else if ( parent.attachEvent ) { + parent.attachEvent( "onunload", function() { + setDocument(); + }); + } + } + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties (excepting IE8 booleans) + support.attributes = assert(function( div ) { + div.className = "i"; + return !div.getAttribute("className"); + }); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert(function( div ) { + div.appendChild( doc.createComment("") ); + return !div.getElementsByTagName("*").length; + }); + + // Check if getElementsByClassName can be trusted + support.getElementsByClassName = rnative.test( doc.getElementsByClassName ) && assert(function( div ) { + div.innerHTML = "<div class='a'></div><div class='a i'></div>"; + + // Support: Safari<4 + // Catch class over-caching + div.firstChild.className = "i"; + // Support: Opera<10 + // Catch gEBCN failure to find non-leading classes + return div.getElementsByClassName("i").length === 2; + }); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert(function( div ) { + docElem.appendChild( div ).id = expando; + return !doc.getElementsByName || !doc.getElementsByName( expando ).length; + }); + + // ID find and filter + if ( support.getById ) { + Expr.find["ID"] = function( id, context ) { + if ( typeof context.getElementById !== strundefined && documentIsHTML ) { + var m = context.getElementById( id ); + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + return m && m.parentNode ? [m] : []; + } + }; + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute("id") === attrId; + }; + }; + } else { + // Support: IE6/7 + // getElementById is not reliable as a find shortcut + delete Expr.find["ID"]; + + Expr.filter["ID"] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id"); + return node && node.value === attrId; + }; + }; + } + + // Tag + Expr.find["TAG"] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== strundefined ) { + return context.getElementsByTagName( tag ); + } + } : + function( tag, context ) { + var elem, + tmp = [], + i = 0, + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( (elem = results[i++]) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find["CLASS"] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== strundefined && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See http://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert(function( div ) { + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // http://bugs.jquery.com/ticket/12359 + div.innerHTML = "<select t=''><option selected=''></option></select>"; + + // Support: IE8, Opera 10-12 + // Nothing should be selected when empty strings follow ^= or $= or *= + if ( div.querySelectorAll("[t^='']").length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !div.querySelectorAll("[selected]").length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":checked").length ) { + rbuggyQSA.push(":checked"); + } + }); + + assert(function( div ) { + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = doc.createElement("input"); + input.setAttribute( "type", "hidden" ); + div.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( div.querySelectorAll("[name=d]").length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( !div.querySelectorAll(":enabled").length ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Opera 10-11 does not throw on post-comma invalid pseudos + div.querySelectorAll("*,:x"); + rbuggyQSA.push(",.*:"); + }); + } + + if ( (support.matchesSelector = rnative.test( (matches = docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector) )) ) { + + assert(function( div ) { + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( div, "div" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( div, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + }); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join("|") ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join("|") ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully does not implement inclusive descendent + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + )); + } : + function( a, b ) { + if ( b ) { + while ( (b = b.parentNode) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + compare = ( a.ownerDocument || a ) === ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + (!support.sortDetached && b.compareDocumentPosition( a ) === compare) ) { + + // Choose the first element that is related to our preferred document + if ( a === doc || a.ownerDocument === preferredDoc && contains(preferredDoc, a) ) { + return -1; + } + if ( b === doc || b.ownerDocument === preferredDoc && contains(preferredDoc, b) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + return a === doc ? -1 : + b === doc ? 1 : + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf.call( sortInput, a ) - indexOf.call( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( (cur = cur.parentNode) ) { + ap.unshift( cur ); + } + cur = b; + while ( (cur = cur.parentNode) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[i] === bp[i] ) { + i++; + } + + return i ? + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[i], bp[i] ) : + + // Otherwise nodes in our document sort first + ap[i] === preferredDoc ? -1 : + bp[i] === preferredDoc ? 1 : + 0; + }; + + return doc; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + // Make sure that attribute selectors are quoted + expr = expr.replace( rattributeQuotes, "='$1']" ); + + if ( support.matchesSelector && documentIsHTML && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch(e) {} + } + + return Sizzle( expr, document, null, [elem] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + // Set document vars if needed + if ( ( context.ownerDocument || context ) !== document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + // Set document vars if needed + if ( ( elem.ownerDocument || elem ) !== document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + (val = elem.getAttributeNode(name)) && val.specified ? + val.value : + null; +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( (elem = results[i++]) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + // If no nodeType, this is expected to be an array + while ( (node = elem[i++]) ) { + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[1] = match[1].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[3] = ( match[4] || match[5] || "" ).replace( runescape, funescape ); + + if ( match[2] === "~=" ) { + match[3] = " " + match[3] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[1] = match[1].toLowerCase(); + + if ( match[1].slice( 0, 3 ) === "nth" ) { + // nth-* requires argument + if ( !match[3] ) { + Sizzle.error( match[0] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[4] = +( match[4] ? match[5] + (match[6] || 1) : 2 * ( match[3] === "even" || match[3] === "odd" ) ); + match[5] = +( ( match[7] + match[8] ) || match[3] === "odd" ); + + // other types prohibit arguments + } else if ( match[3] ) { + Sizzle.error( match[0] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[5] && match[2]; + + if ( matchExpr["CHILD"].test( match[0] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[3] && match[4] !== undefined ) { + match[2] = match[4]; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + // Get excess from tokenize (recursively) + (excess = tokenize( unquoted, true )) && + // advance to the next closing parenthesis + (excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) { + + // excess is a negative index + match[0] = match[0].slice( 0, excess ); + match[2] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { return true; } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + (pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) && + classCache( className, function( elem ) { + return pattern.test( typeof elem.className === "string" && elem.className || typeof elem.getAttribute !== strundefined && elem.getAttribute("class") || "" ); + }); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + }; + }, + + "CHILD": function( type, what, argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, context, xml ) { + var cache, outerCache, node, diff, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( (node = node[ dir ]) ) { + if ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) { + return false; + } + } + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + // Seek `elem` from a previously-cached index + outerCache = parent[ expando ] || (parent[ expando ] = {}); + cache = outerCache[ type ] || []; + nodeIndex = cache[0] === dirruns && cache[1]; + diff = cache[0] === dirruns && cache[2]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( (node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + (diff = nodeIndex = 0) || start.pop()) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + outerCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + // Use previously-cached element index if available + } else if ( useCache && (cache = (elem[ expando ] || (elem[ expando ] = {}))[ type ]) && cache[0] === dirruns ) { + diff = cache[1]; + + // xml :nth-child(...) or :nth-last-child(...) or :nth(-last)?-of-type(...) + } else { + // Use the same loop as above to seek `elem` from the start + while ( (node = ++nodeIndex && node && node[ dir ] || + (diff = nodeIndex = 0) || start.pop()) ) { + + if ( ( ofType ? node.nodeName.toLowerCase() === name : node.nodeType === 1 ) && ++diff ) { + // Cache the index of each encountered element + if ( useCache ) { + (node[ expando ] || (node[ expando ] = {}))[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction(function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf.call( seed, matched[i] ); + seed[ idx ] = !( matches[ idx ] = matched[i] ); + } + }) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + // Potentially complex pseudos + "not": markFunction(function( selector ) { + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction(function( seed, matches, context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( (elem = unmatched[i]) ) { + seed[i] = !(matches[i] = elem); + } + } + }) : + function( elem, context, xml ) { + input[0] = elem; + matcher( input, null, xml, results ); + return !results.pop(); + }; + }), + + "has": markFunction(function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + }), + + "contains": markFunction(function( text ) { + return function( elem ) { + return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1; + }; + }), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + // lang value must be a valid identifier + if ( !ridentifier.test(lang || "") ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( (elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute("xml:lang") || elem.getAttribute("lang")) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( (elem = elem.parentNode) && elem.nodeType === 1 ); + return false; + }; + }), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && (!document.hasFocus || document.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex); + }, + + // Boolean properties + "enabled": function( elem ) { + return elem.disabled === false; + }, + + "disabled": function( elem ) { + return elem.disabled === true; + }, + + "checked": function( elem ) { + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected); + }, + + "selected": function( elem ) { + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos["empty"]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo(function() { + return [ 0 ]; + }), + + "last": createPositionalPseudo(function( matchIndexes, length ) { + return [ length - 1 ]; + }), + + "eq": createPositionalPseudo(function( matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + }), + + "even": createPositionalPseudo(function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "odd": createPositionalPseudo(function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "lt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }), + + "gt": createPositionalPseudo(function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + }) + } +}; + +Expr.pseudos["nth"] = Expr.pseudos["eq"]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +function tokenize( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || (match = rcomma.exec( soFar )) ) { + if ( match ) { + // Don't consume trailing commas as valid + soFar = soFar.slice( match[0].length ) || soFar; + } + groups.push( (tokens = []) ); + } + + matched = false; + + // Combinators + if ( (match = rcombinators.exec( soFar )) ) { + matched = match.shift(); + tokens.push({ + value: matched, + // Cast descendant combinators to space + type: match[0].replace( rtrim, " " ) + }); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] || + (match = preFilters[ type ]( match ))) ) { + matched = match.shift(); + tokens.push({ + value: matched, + type: type, + matches: match + }); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +} + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[i].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + checkNonElements = base && dir === "parentNode", + doneName = done++; + + return combinator.first ? + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from dir caching + if ( xml ) { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( (elem = elem[ dir ]) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || (elem[ expando ] = {}); + if ( (oldCache = outerCache[ dir ]) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return (newCache[ 2 ] = oldCache[ 2 ]); + } else { + // Reuse newcache so results back-propagate to previous elements + outerCache[ dir ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( (newCache[ 2 ] = matcher( elem, context, xml )) ) { + return true; + } + } + } + } + } + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[i]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[0]; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( (elem = unmatched[i]) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction(function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( (elem = temp[i]) ) { + matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) ) { + // Restore matcherIn since elem is not yet a final match + temp.push( (matcherIn[i] = elem) ); + } + } + postFinder( null, (matcherOut = []), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( (elem = matcherOut[i]) && + (temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) { + + seed[temp] = !(results[temp] = elem); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + }); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[0].type ], + implicitRelative = leadingRelative || Expr.relative[" "], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf.call( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + return ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + (checkContext = context).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + } ]; + + for ( ; i < len; i++ ) { + if ( (matcher = Expr.relative[ tokens[i].type ]) ) { + matchers = [ addCombinator(elementMatcher( matchers ), matcher) ]; + } else { + matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[j].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens.slice( 0, i - 1 ).concat({ value: tokens[ i - 2 ].type === " " ? "*" : "" }) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( (tokens = tokens.slice( j )) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find["TAG"]( "*", outermost ), + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.random() || 0.1), + len = elems.length; + + if ( outermost ) { + outermostContext = context !== document && context; + } + + // Add elements passing elementMatchers directly to results + // Keep `i` a string if there are no elements so `matchedCount` will be "00" below + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: <number>) matching elements by id + for ( ; i !== len && (elem = elems[i]) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + while ( (matcher = elementMatchers[j++]) ) { + if ( matcher( elem, context, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + // They will have gone through all possible matchers + if ( (elem = !matcher && elem) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // Apply set filters to unmatched elements + matchedCount += i; + if ( bySet && i !== matchedCount ) { + j = 0; + while ( (matcher = setMatchers[j++]) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !(unmatched[i] || setMatched[i]) ) { + setMatched[i] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + // Generate a function of recursive functions that can be used to check each element + if ( !group ) { + group = tokenize( selector ); + } + i = group.length; + while ( i-- ) { + cached = matcherFromTokens( group[i] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) ); + } + return cached; +}; + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[i], results ); + } + return results; +} + +function select( selector, context, results, seed ) { + var i, tokens, token, type, find, + match = tokenize( selector ); + + if ( !seed ) { + // Try to minimize operations if there is only one group + if ( match.length === 1 ) { + + // Take a shortcut and set the context if the root selector is an ID + tokens = match[0] = match[0].slice( 0 ); + if ( tokens.length > 2 && (token = tokens[0]).type === "ID" && + support.getById && context.nodeType === 9 && documentIsHTML && + Expr.relative[ tokens[1].type ] ) { + + context = ( Expr.find["ID"]( token.matches[0].replace(runescape, funescape), context ) || [] )[0]; + if ( !context ) { + return results; + } + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr["needsContext"].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[i]; + + // Abort if we hit a combinator + if ( Expr.relative[ (type = token.type) ] ) { + break; + } + if ( (find = Expr.find[ type ]) ) { + // Search, expanding context for leading sibling combinators + if ( (seed = find( + token.matches[0].replace( runescape, funescape ), + rsibling.test( tokens[0].type ) && testContext( context.parentNode ) || context + )) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + } + + // Compile and execute a filtering function + // Provide `match` to avoid retokenization if we modified the selector above + compile( selector, match )( + seed, + context, + !documentIsHTML, + results, + rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +} + +// One-time assignments + +// Sort stability +support.sortStable = expando.split("").sort( sortOrder ).join("") === expando; + +// Support: Chrome<14 +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert(function( div1 ) { + // Should return 1, but returns 4 (following) + return div1.compareDocumentPosition( document.createElement("div") ) & 1; +}); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert(function( div ) { + div.innerHTML = "<a href='#'></a>"; + return div.firstChild.getAttribute("href") === "#" ; +}) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + }); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert(function( div ) { + div.innerHTML = "<input/>"; + div.firstChild.setAttribute( "value", "" ); + return div.firstChild.getAttribute( "value" ) === ""; +}) ) { + addHandle( "value", function( elem, name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + }); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert(function( div ) { + return div.getAttribute("disabled") == null; +}) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + (val = elem.getAttributeNode( name )) && val.specified ? + val.value : + null; + } + }); +} + +return Sizzle; + +})( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; +jQuery.expr[":"] = jQuery.expr.pseudos; +jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; + + + +var rneedsContext = jQuery.expr.match.needsContext; + +var rsingleTag = (/^<(\w+)\s*\/?>(?:<\/\1>|)$/); + + + +var risSimple = /^.[^:#\[\.,]*$/; + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( jQuery.isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + /* jshint -W018 */ + return !!qualifier.call( elem, i, elem ) !== not; + }); + + } + + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + }); + + } + + if ( typeof qualifier === "string" ) { + if ( risSimple.test( qualifier ) ) { + return jQuery.filter( qualifier, elements, not ); + } + + qualifier = jQuery.filter( qualifier, elements ); + } + + return jQuery.grep( elements, function( elem ) { + return ( jQuery.inArray( elem, qualifier ) >= 0 ) !== not; + }); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + return elems.length === 1 && elem.nodeType === 1 ? + jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : [] : + jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + })); +}; + +jQuery.fn.extend({ + find: function( selector ) { + var i, + ret = [], + self = this, + len = self.length; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + }) ); + } + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + // Needed because $( selector, context ) becomes $( context ).find( selector ) + ret = this.pushStack( len > 1 ? jQuery.unique( ret ) : ret ); + ret.selector = this.selector ? this.selector + " " + selector : selector; + return ret; + }, + filter: function( selector ) { + return this.pushStack( winnow(this, selector || [], false) ); + }, + not: function( selector ) { + return this.pushStack( winnow(this, selector || [], true) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +}); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // Use the correct document accordingly with window argument (sandbox) + document = window.document, + + // A simple way to check for HTML strings + // Prioritize #id over <tag> to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, + + init = jQuery.fn.init = function( selector, context ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) { + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && (match[1] || !context) ) { + + // HANDLE: $(html) -> $(array) + if ( match[1] ) { + context = context instanceof jQuery ? context[0] : context; + + // scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[1], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + // Properties of context are called as methods if possible + if ( jQuery.isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[2] ); + + // Check parentNode to catch when Blackberry 4.6 returns + // nodes that are no longer in the document #6963 + if ( elem && elem.parentNode ) { + // Handle the case where IE and Opera return items + // by name instead of ID + if ( elem.id !== match[2] ) { + return rootjQuery.find( selector ); + } + + // Otherwise, we inject the element directly into the jQuery object + this.length = 1; + this[0] = elem; + } + + this.context = document; + this.selector = selector; + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || rootjQuery ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this.context = this[0] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( jQuery.isFunction( selector ) ) { + return typeof rootjQuery.ready !== "undefined" ? + rootjQuery.ready( selector ) : + // Execute immediately if ready is not present + selector( jQuery ); + } + + if ( selector.selector !== undefined ) { + this.selector = selector.selector; + this.context = selector.context; + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + // methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.extend({ + dir: function( elem, dir, until ) { + var matched = [], + cur = elem[ dir ]; + + while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) { + if ( cur.nodeType === 1 ) { + matched.push( cur ); + } + cur = cur[dir]; + } + return matched; + }, + + sibling: function( n, elem ) { + var r = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + r.push( n ); + } + } + + return r; + } +}); + +jQuery.fn.extend({ + has: function( target ) { + var i, + targets = jQuery( target, this ), + len = targets.length; + + return this.filter(function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( this, targets[i] ) ) { + return true; + } + } + }); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ? + jQuery( selectors, context || this.context ) : + 0; + + for ( ; i < l; i++ ) { + for ( cur = this[i]; cur && cur !== context; cur = cur.parentNode ) { + // Always skip document fragments + if ( cur.nodeType < 11 && (pos ? + pos.index(cur) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector(cur, selectors)) ) { + + matched.push( cur ); + break; + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.unique( matched ) : matched ); + }, + + // Determine the position of an element within + // the matched set of elements + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[0] && this[0].parentNode ) ? this.first().prevAll().length : -1; + } + + // index in selector + if ( typeof elem === "string" ) { + return jQuery.inArray( this[0], jQuery( elem ) ); + } + + // Locate the position of the desired element + return jQuery.inArray( + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[0] : elem, this ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.unique( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter(selector) + ); + } +}); + +function sibling( cur, dir ) { + do { + cur = cur[ dir ]; + } while ( cur && cur.nodeType !== 1 ); + + return cur; +} + +jQuery.each({ + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return jQuery.dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, i, until ) { + return jQuery.dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return jQuery.dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return jQuery.dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, i, until ) { + return jQuery.dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, i, until ) { + return jQuery.dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return jQuery.sibling( elem.firstChild ); + }, + contents: function( elem ) { + return jQuery.nodeName( elem, "iframe" ) ? + elem.contentDocument || elem.contentWindow.document : + jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var ret = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + ret = jQuery.filter( selector, ret ); + } + + if ( this.length > 1 ) { + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + ret = jQuery.unique( ret ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + ret = ret.reverse(); + } + } + + return this.pushStack( ret ); + }; +}); +var rnotwhite = (/\S+/g); + + + +// String to Object options format cache +var optionsCache = {}; + +// Convert String-formatted options into Object-formatted ones and store in cache +function createOptions( options ) { + var object = optionsCache[ options ] = {}; + jQuery.each( options.match( rnotwhite ) || [], function( _, flag ) { + object[ flag ] = true; + }); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + ( optionsCache[ options ] || createOptions( options ) ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + // Last fire value (for non-forgettable lists) + memory, + // Flag to know if list was already fired + fired, + // End of the loop when firing + firingLength, + // Index of currently firing callback (modified by remove if needed) + firingIndex, + // First callback to fire (used internally by add and fireWith) + firingStart, + // Actual callback list + list = [], + // Stack of fire calls for repeatable lists + stack = !options.once && [], + // Fire callbacks + fire = function( data ) { + memory = options.memory && data; + fired = true; + firingIndex = firingStart || 0; + firingStart = 0; + firingLength = list.length; + firing = true; + for ( ; list && firingIndex < firingLength; firingIndex++ ) { + if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) { + memory = false; // To prevent further calls using add + break; + } + } + firing = false; + if ( list ) { + if ( stack ) { + if ( stack.length ) { + fire( stack.shift() ); + } + } else if ( memory ) { + list = []; + } else { + self.disable(); + } + } + }, + // Actual Callbacks object + self = { + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + // First, we save the current length + var start = list.length; + (function add( args ) { + jQuery.each( args, function( _, arg ) { + var type = jQuery.type( arg ); + if ( type === "function" ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && type !== "string" ) { + // Inspect recursively + add( arg ); + } + }); + })( arguments ); + // Do we need to add the callbacks to the + // current firing batch? + if ( firing ) { + firingLength = list.length; + // With memory, if we're not firing then + // we should call right away + } else if ( memory ) { + firingStart = start; + fire( memory ); + } + } + return this; + }, + // Remove a callback from the list + remove: function() { + if ( list ) { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + // Handle firing indexes + if ( firing ) { + if ( index <= firingLength ) { + firingLength--; + } + if ( index <= firingIndex ) { + firingIndex--; + } + } + } + }); + } + return this; + }, + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? jQuery.inArray( fn, list ) > -1 : !!( list && list.length ); + }, + // Remove all callbacks from the list + empty: function() { + list = []; + firingLength = 0; + return this; + }, + // Have the list do nothing anymore + disable: function() { + list = stack = memory = undefined; + return this; + }, + // Is it disabled? + disabled: function() { + return !list; + }, + // Lock the list in its current state + lock: function() { + stack = undefined; + if ( !memory ) { + self.disable(); + } + return this; + }, + // Is it locked? + locked: function() { + return !stack; + }, + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( list && ( !fired || stack ) ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + if ( firing ) { + stack.push( args ); + } else { + fire( args ); + } + } + return this; + }, + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +jQuery.extend({ + + Deferred: function( func ) { + var tuples = [ + // action, add listener, listener list, final state + [ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ], + [ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ], + [ "notify", "progress", jQuery.Callbacks("memory") ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + then: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + return jQuery.Deferred(function( newDefer ) { + jQuery.each( tuples, function( i, tuple ) { + var fn = jQuery.isFunction( fns[ i ] ) && fns[ i ]; + // deferred[ done | fail | progress ] for forwarding actions to newDefer + deferred[ tuple[1] ](function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && jQuery.isFunction( returned.promise ) ) { + returned.promise() + .done( newDefer.resolve ) + .fail( newDefer.reject ) + .progress( newDefer.notify ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments ); + } + }); + }); + fns = null; + }).promise(); + }, + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Keep pipe for back-compat + promise.pipe = promise.then; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 3 ]; + + // promise[ done | fail | progress ] = list.add + promise[ tuple[1] ] = list.add; + + // Handle state + if ( stateString ) { + list.add(function() { + // state = [ resolved | rejected ] + state = stateString; + + // [ reject_list | resolve_list ].disable; progress_list.lock + }, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock ); + } + + // deferred[ resolve | reject | notify ] + deferred[ tuple[0] ] = function() { + deferred[ tuple[0] + "With" ]( this === deferred ? promise : this, arguments ); + return this; + }; + deferred[ tuple[0] + "With" ] = list.fireWith; + }); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( subordinate /* , ..., subordinateN */ ) { + var i = 0, + resolveValues = slice.call( arguments ), + length = resolveValues.length, + + // the count of uncompleted subordinates + remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0, + + // the master Deferred. If resolveValues consist of only a single Deferred, just use that. + deferred = remaining === 1 ? subordinate : jQuery.Deferred(), + + // Update function for both resolve and progress values + updateFunc = function( i, contexts, values ) { + return function( value ) { + contexts[ i ] = this; + values[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( values === progressValues ) { + deferred.notifyWith( contexts, values ); + + } else if ( !(--remaining) ) { + deferred.resolveWith( contexts, values ); + } + }; + }, + + progressValues, progressContexts, resolveContexts; + + // add listeners to Deferred subordinates; treat others as resolved + if ( length > 1 ) { + progressValues = new Array( length ); + progressContexts = new Array( length ); + resolveContexts = new Array( length ); + for ( ; i < length; i++ ) { + if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) { + resolveValues[ i ].promise() + .done( updateFunc( i, resolveContexts, resolveValues ) ) + .fail( deferred.reject ) + .progress( updateFunc( i, progressContexts, progressValues ) ); + } else { + --remaining; + } + } + } + + // if we're not waiting on anything, resolve the master + if ( !remaining ) { + deferred.resolveWith( resolveContexts, resolveValues ); + } + + return deferred.promise(); + } +}); + + +// The deferred used on DOM ready +var readyList; + +jQuery.fn.ready = function( fn ) { + // Add the callback + jQuery.ready.promise().done( fn ); + + return this; +}; + +jQuery.extend({ + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Hold (or release) the ready event + holdReady: function( hold ) { + if ( hold ) { + jQuery.readyWait++; + } else { + jQuery.ready( true ); + } + }, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443). + if ( !document.body ) { + return setTimeout( jQuery.ready ); + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + + // Trigger any bound ready events + if ( jQuery.fn.trigger ) { + jQuery( document ).trigger("ready").off("ready"); + } + } +}); + +/** + * Clean-up method for dom ready events + */ +function detach() { + if ( document.addEventListener ) { + document.removeEventListener( "DOMContentLoaded", completed, false ); + window.removeEventListener( "load", completed, false ); + + } else { + document.detachEvent( "onreadystatechange", completed ); + window.detachEvent( "onload", completed ); + } +} + +/** + * The ready event handler and self cleanup method + */ +function completed() { + // readyState === "complete" is good enough for us to call the dom ready in oldIE + if ( document.addEventListener || event.type === "load" || document.readyState === "complete" ) { + detach(); + jQuery.ready(); + } +} + +jQuery.ready.promise = function( obj ) { + if ( !readyList ) { + + readyList = jQuery.Deferred(); + + // Catch cases where $(document).ready() is called after the browser event has already occurred. + // we once tried to use readyState "interactive" here, but it caused issues like the one + // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15 + if ( document.readyState === "complete" ) { + // Handle it asynchronously to allow scripts the opportunity to delay ready + setTimeout( jQuery.ready ); + + // Standards-based browsers support DOMContentLoaded + } else if ( document.addEventListener ) { + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed, false ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed, false ); + + // If IE event model is used + } else { + // Ensure firing before onload, maybe late but safe also for iframes + document.attachEvent( "onreadystatechange", completed ); + + // A fallback to window.onload, that will always work + window.attachEvent( "onload", completed ); + + // If IE and not a frame + // continually check to see if the document is ready + var top = false; + + try { + top = window.frameElement == null && document.documentElement; + } catch(e) {} + + if ( top && top.doScroll ) { + (function doScrollCheck() { + if ( !jQuery.isReady ) { + + try { + // Use the trick by Diego Perini + // http://javascript.nwbox.com/IEContentLoaded/ + top.doScroll("left"); + } catch(e) { + return setTimeout( doScrollCheck, 50 ); + } + + // detach all dom ready events + detach(); + + // and execute any waiting functions + jQuery.ready(); + } + })(); + } + } + } + return readyList.promise( obj ); +}; + + +var strundefined = typeof undefined; + + + +// Support: IE<9 +// Iteration over object's inherited properties before its own +var i; +for ( i in jQuery( support ) ) { + break; +} +support.ownLast = i !== "0"; + +// Note: most support tests are defined in their respective modules. +// false until the test is run +support.inlineBlockNeedsLayout = false; + +jQuery(function() { + // We need to execute this one support test ASAP because we need to know + // if body.style.zoom needs to be set. + + var container, div, + body = document.getElementsByTagName("body")[0]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + // Setup + container = document.createElement( "div" ); + container.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px"; + + div = document.createElement( "div" ); + body.appendChild( container ).appendChild( div ); + + if ( typeof div.style.zoom !== strundefined ) { + // Support: IE<8 + // Check if natively block-level elements act like inline-block + // elements when setting their display to 'inline' and giving + // them layout + div.style.cssText = "border:0;margin:0;width:1px;padding:1px;display:inline;zoom:1"; + + if ( (support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 )) ) { + // Prevent IE 6 from affecting layout for positioned elements #11048 + // Prevent IE from shrinking the body in IE 7 mode #12869 + // Support: IE<8 + body.style.zoom = 1; + } + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE + container = div = null; +}); + + + + +(function() { + var div = document.createElement( "div" ); + + // Execute the test only if not already executed in another module. + if (support.deleteExpando == null) { + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + } + + // Null elements to avoid leaks in IE. + div = null; +})(); + + +/** + * Determines whether an object can have data + */ +jQuery.acceptData = function( elem ) { + var noData = jQuery.noData[ (elem.nodeName + " ").toLowerCase() ], + nodeType = +elem.nodeType || 1; + + // Do not set data on non-element DOM nodes because it will not be cleared (#8335). + return nodeType !== 1 && nodeType !== 9 ? + false : + + // Nodes accept data unless otherwise specified; rejection can be conditional + !noData || noData !== true && elem.getAttribute("classid") === noData; +}; + + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /([A-Z])/g; + +function dataAttr( elem, key, data ) { + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + + var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase(); + + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = data === "true" ? true : + data === "false" ? false : + data === "null" ? null : + // Only convert to a number if it doesn't change the string + +data + "" === data ? +data : + rbrace.test( data ) ? jQuery.parseJSON( data ) : + data; + } catch( e ) {} + + // Make sure we set the data so it isn't changed later + jQuery.data( elem, key, data ); + + } else { + data = undefined; + } + } + + return data; +} + +// checks a cache object for emptiness +function isEmptyDataObject( obj ) { + var name; + for ( name in obj ) { + + // if the public data object is empty, the private is still empty + if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) { + continue; + } + if ( name !== "toJSON" ) { + return false; + } + } + + return true; +} + +function internalData( elem, name, data, pvt /* Internal Use Only */ ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var ret, thisCache, + internalKey = jQuery.expando, + + // We have to handle DOM nodes and JS objects differently because IE6-7 + // can't GC object references properly across the DOM-JS boundary + isNode = elem.nodeType, + + // Only DOM nodes need the global jQuery cache; JS object data is + // attached directly to the object so GC can occur automatically + cache = isNode ? jQuery.cache : elem, + + // Only defining an ID for JS objects if its cache already exists allows + // the code to shortcut on the same path as a DOM node with no cache + id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey; + + // Avoid doing any more work than we need to when trying to get data on an + // object that has no data at all + if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === "string" ) { + return; + } + + if ( !id ) { + // Only DOM nodes need a new unique ID for each element since their data + // ends up in the global cache + if ( isNode ) { + id = elem[ internalKey ] = deletedIds.pop() || jQuery.guid++; + } else { + id = internalKey; + } + } + + if ( !cache[ id ] ) { + // Avoid exposing jQuery metadata on plain JS objects when the object + // is serialized using JSON.stringify + cache[ id ] = isNode ? {} : { toJSON: jQuery.noop }; + } + + // An object can be passed to jQuery.data instead of a key/value pair; this gets + // shallow copied over onto the existing cache + if ( typeof name === "object" || typeof name === "function" ) { + if ( pvt ) { + cache[ id ] = jQuery.extend( cache[ id ], name ); + } else { + cache[ id ].data = jQuery.extend( cache[ id ].data, name ); + } + } + + thisCache = cache[ id ]; + + // jQuery data() is stored in a separate object inside the object's internal data + // cache in order to avoid key collisions between internal data and user-defined + // data. + if ( !pvt ) { + if ( !thisCache.data ) { + thisCache.data = {}; + } + + thisCache = thisCache.data; + } + + if ( data !== undefined ) { + thisCache[ jQuery.camelCase( name ) ] = data; + } + + // Check for both converted-to-camel and non-converted data property names + // If a data property was specified + if ( typeof name === "string" ) { + + // First Try to find as-is property data + ret = thisCache[ name ]; + + // Test for null|undefined property data + if ( ret == null ) { + + // Try to find the camelCased property + ret = thisCache[ jQuery.camelCase( name ) ]; + } + } else { + ret = thisCache; + } + + return ret; +} + +function internalRemoveData( elem, name, pvt ) { + if ( !jQuery.acceptData( elem ) ) { + return; + } + + var thisCache, i, + isNode = elem.nodeType, + + // See jQuery.data for more information + cache = isNode ? jQuery.cache : elem, + id = isNode ? elem[ jQuery.expando ] : jQuery.expando; + + // If there is already no cache entry for this object, there is no + // purpose in continuing + if ( !cache[ id ] ) { + return; + } + + if ( name ) { + + thisCache = pvt ? cache[ id ] : cache[ id ].data; + + if ( thisCache ) { + + // Support array or space separated string names for data keys + if ( !jQuery.isArray( name ) ) { + + // try the string as a key before any manipulation + if ( name in thisCache ) { + name = [ name ]; + } else { + + // split the camel cased version by spaces unless a key with the spaces exists + name = jQuery.camelCase( name ); + if ( name in thisCache ) { + name = [ name ]; + } else { + name = name.split(" "); + } + } + } else { + // If "name" is an array of keys... + // When data is initially created, via ("key", "val") signature, + // keys will be converted to camelCase. + // Since there is no way to tell _how_ a key was added, remove + // both plain key and camelCase key. #12786 + // This will only penalize the array argument path. + name = name.concat( jQuery.map( name, jQuery.camelCase ) ); + } + + i = name.length; + while ( i-- ) { + delete thisCache[ name[i] ]; + } + + // If there is no data left in the cache, we want to continue + // and let the cache object itself get destroyed + if ( pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache) ) { + return; + } + } + } + + // See jQuery.data for more information + if ( !pvt ) { + delete cache[ id ].data; + + // Don't destroy the parent cache unless the internal data object + // had been the only thing left in it + if ( !isEmptyDataObject( cache[ id ] ) ) { + return; + } + } + + // Destroy the cache + if ( isNode ) { + jQuery.cleanData( [ elem ], true ); + + // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080) + /* jshint eqeqeq: false */ + } else if ( support.deleteExpando || cache != cache.window ) { + /* jshint eqeqeq: true */ + delete cache[ id ]; + + // When all else fails, null + } else { + cache[ id ] = null; + } +} + +jQuery.extend({ + cache: {}, + + // The following elements (space-suffixed to avoid Object.prototype collisions) + // throw uncatchable exceptions if you attempt to set expando properties + noData: { + "applet ": true, + "embed ": true, + // ...but Flash objects (which have this classid) *can* handle expandos + "object ": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + }, + + hasData: function( elem ) { + elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ]; + return !!elem && !isEmptyDataObject( elem ); + }, + + data: function( elem, name, data ) { + return internalData( elem, name, data ); + }, + + removeData: function( elem, name ) { + return internalRemoveData( elem, name ); + }, + + // For internal use only. + _data: function( elem, name, data ) { + return internalData( elem, name, data, true ); + }, + + _removeData: function( elem, name ) { + return internalRemoveData( elem, name, true ); + } +}); + +jQuery.fn.extend({ + data: function( key, value ) { + var i, name, data, + elem = this[0], + attrs = elem && elem.attributes; + + // Special expections of .data basically thwart jQuery.access, + // so implement the relevant behavior ourselves + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = jQuery.data( elem ); + + if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + name = attrs[i].name; + + if ( name.indexOf("data-") === 0 ) { + name = jQuery.camelCase( name.slice(5) ); + + dataAttr( elem, name, data[ name ] ); + } + } + jQuery._data( elem, "parsedAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each(function() { + jQuery.data( this, key ); + }); + } + + return arguments.length > 1 ? + + // Sets one value + this.each(function() { + jQuery.data( this, key, value ); + }) : + + // Gets one value + // Try to fetch any internally stored data first + elem ? dataAttr( elem, key, jQuery.data( elem, key ) ) : undefined; + }, + + removeData: function( key ) { + return this.each(function() { + jQuery.removeData( this, key ); + }); + } +}); + + +jQuery.extend({ + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = jQuery._data( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || jQuery.isArray(data) ) { + queue = jQuery._data( elem, type, jQuery.makeArray(data) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // not intended for public consumption - generates a queueHooks object, or returns the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return jQuery._data( elem, key ) || jQuery._data( elem, key, { + empty: jQuery.Callbacks("once memory").add(function() { + jQuery._removeData( elem, type + "queue" ); + jQuery._removeData( elem, key ); + }) + }); + } +}); + +jQuery.fn.extend({ + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[0], type ); + } + + return data === undefined ? + this : + this.each(function() { + var queue = jQuery.queue( this, type, data ); + + // ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[0] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + }); + }, + dequeue: function( type ) { + return this.each(function() { + jQuery.dequeue( this, type ); + }); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = jQuery._data( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +}); +var pnum = (/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/).source; + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var isHidden = function( elem, el ) { + // isHidden might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem ); + }; + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = jQuery.access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + length = elems.length, + bulk = key == null; + + // Sets many values + if ( jQuery.type( key ) === "object" ) { + chainable = true; + for ( i in key ) { + jQuery.access( elems, fn, i, key[i], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !jQuery.isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < length; i++ ) { + fn( elems[i], key, raw ? value : value.call( elems[i], i, fn( elems[i], key ) ) ); + } + } + } + + return chainable ? + elems : + + // Gets + bulk ? + fn.call( elems ) : + length ? fn( elems[0], key ) : emptyGet; +}; +var rcheckableType = (/^(?:checkbox|radio)$/i); + + + +(function() { + var fragment = document.createDocumentFragment(), + div = document.createElement("div"), + input = document.createElement("input"); + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a>"; + + // IE strips leading whitespace when .innerHTML is used + support.leadingWhitespace = div.firstChild.nodeType === 3; + + // Make sure that tbody elements aren't automatically inserted + // IE will insert them into empty tables + support.tbody = !div.getElementsByTagName( "tbody" ).length; + + // Make sure that link elements get serialized correctly by innerHTML + // This requires a wrapper element in IE + support.htmlSerialize = !!div.getElementsByTagName( "link" ).length; + + // Makes sure cloning an html5 element does not cause problems + // Where outerHTML is undefined, this still works + support.html5Clone = + document.createElement( "nav" ).cloneNode( true ).outerHTML !== "<:nav></:nav>"; + + // Check if a disconnected checkbox will retain its checked + // value of true after appended to the DOM (IE6/7) + input.type = "checkbox"; + input.checked = true; + fragment.appendChild( input ); + support.appendChecked = input.checked; + + // Make sure textarea (and checkbox) defaultValue is properly cloned + // Support: IE6-IE11+ + div.innerHTML = "<textarea>x</textarea>"; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // #11217 - WebKit loses check when the name is after the checked attribute + fragment.appendChild( div ); + div.innerHTML = "<input type='radio' checked='checked' name='t'/>"; + + // Support: Safari 5.1, iOS 5.1, Android 4.x, Android 2.3 + // old WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE<9 + // Opera does not clone events (and typeof div.attachEvent === undefined). + // IE9-10 clones events bound via attachEvent, but they don't trigger with .click() + support.noCloneEvent = true; + if ( div.attachEvent ) { + div.attachEvent( "onclick", function() { + support.noCloneEvent = false; + }); + + div.cloneNode( true ).click(); + } + + // Execute the test only if not already executed in another module. + if (support.deleteExpando == null) { + // Support: IE<9 + support.deleteExpando = true; + try { + delete div.test; + } catch( e ) { + support.deleteExpando = false; + } + } + + // Null elements to avoid leaks in IE. + fragment = div = input = null; +})(); + + +(function() { + var i, eventName, + div = document.createElement( "div" ); + + // Support: IE<9 (lack submit/change bubble), Firefox 23+ (lack focusin event) + for ( i in { submit: true, change: true, focusin: true }) { + eventName = "on" + i; + + if ( !(support[ i + "Bubbles" ] = eventName in window) ) { + // Beware of CSP restrictions (https://developer.mozilla.org/en/Security/CSP) + div.setAttribute( eventName, "t" ); + support[ i + "Bubbles" ] = div.attributes[ eventName ].expando === false; + } + } + + // Null elements to avoid leaks in IE. + div = null; +})(); + + +var rformElems = /^(?:input|select|textarea)$/i, + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|contextmenu)|click/, + rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)$/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + var tmp, events, t, handleObjIn, + special, eventHandle, handleObj, + handlers, type, namespaces, origType, + elemData = jQuery._data( elem ); + + // Don't attach events to noData or text/comment nodes (but allow plain objects) + if ( !elemData ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !(events = elemData.events) ) { + events = elemData.events = {}; + } + if ( !(eventHandle = elemData.handle) ) { + eventHandle = elemData.handle = function( e ) { + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ? + jQuery.event.dispatch.apply( eventHandle.elem, arguments ) : + undefined; + }; + // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events + eventHandle.elem = elem; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend({ + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join(".") + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !(handlers = events[ type ]) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener/attachEvent if the special events handler returns false + if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + // Bind the global event handler to the element + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle, false ); + + } else if ( elem.attachEvent ) { + elem.attachEvent( "on" + type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + // Nullify elem to prevent memory leaks in IE + elem = null; + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + var j, handleObj, tmp, + origCount, t, events, + special, handlers, type, + namespaces, origType, + elemData = jQuery.hasData( elem ) && jQuery._data( elem ); + + if ( !elemData || !(events = elemData.events) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnotwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[t] ) || []; + type = origType = tmp[1]; + namespaces = ( tmp[2] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[2] && new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + delete elemData.handle; + + // removeData also checks for emptiness and clears the expando if empty + // so use it instead of delete + jQuery._removeData( elem, "events" ); + } + }, + + trigger: function( event, data, elem, onlyHandlers ) { + var handle, ontype, cur, + bubbleType, special, tmp, i, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split(".") : []; + + cur = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf(".") >= 0 ) { + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split("."); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf(":") < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join("."); + event.namespace_re = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === (elem.ownerDocument || document) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( (cur = eventPath[i++]) && !event.isPropagationStopped() ) { + + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && jQuery.acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( (!special._default || special._default.apply( eventPath.pop(), data ) === false) && + jQuery.acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name name as the event. + // Can't use an .isFunction() check here because IE6/7 fails that test. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && elem[ type ] && !jQuery.isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + try { + elem[ type ](); + } catch ( e ) { + // IE<9 dies on focus/blur to hidden element (#1486,#12518) + // only reproducible on winXP IE8 native, not IE9 in IE8 mode + } + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + dispatch: function( event ) { + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( event ); + + var i, ret, handleObj, matched, j, + handlerQueue = [], + args = slice.call( arguments ), + handlers = ( jQuery._data( this, "events" ) || {} )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[0] = event; + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( (matched = handlerQueue[ i++ ]) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( (handleObj = matched.handlers[ j++ ]) && !event.isImmediatePropagationStopped() ) { + + // Triggered event must either 1) have no namespace, or + // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace). + if ( !event.namespace_re || event.namespace_re.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler ) + .apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( (event.result = ret) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var sel, handleObj, matches, i, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + // Black-hole SVG <use> instance trees (#13180) + // Avoid non-left-click bubbling in Firefox (#3861) + if ( delegateCount && cur.nodeType && (!event.button || event.type !== "click") ) { + + /* jshint eqeqeq: false */ + for ( ; cur != this; cur = cur.parentNode || this ) { + /* jshint eqeqeq: true */ + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && (cur.disabled !== true || event.type !== "click") ) { + matches = []; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matches[ sel ] === undefined ) { + matches[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) >= 0 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matches[ sel ] ) { + matches.push( handleObj ); + } + } + if ( matches.length ) { + handlerQueue.push({ elem: cur, handlers: matches }); + } + } + } + } + + // Add the remaining (directly-bound) handlers + if ( delegateCount < handlers.length ) { + handlerQueue.push({ elem: this, handlers: handlers.slice( delegateCount ) }); + } + + return handlerQueue; + }, + + fix: function( event ) { + if ( event[ jQuery.expando ] ) { + return event; + } + + // Create a writable copy of the event object and normalize some properties + var i, prop, copy, + type = event.type, + originalEvent = event, + fixHook = this.fixHooks[ type ]; + + if ( !fixHook ) { + this.fixHooks[ type ] = fixHook = + rmouseEvent.test( type ) ? this.mouseHooks : + rkeyEvent.test( type ) ? this.keyHooks : + {}; + } + copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props; + + event = new jQuery.Event( originalEvent ); + + i = copy.length; + while ( i-- ) { + prop = copy[ i ]; + event[ prop ] = originalEvent[ prop ]; + } + + // Support: IE<9 + // Fix target property (#1925) + if ( !event.target ) { + event.target = originalEvent.srcElement || document; + } + + // Support: Chrome 23+, Safari? + // Target should not be a text node (#504, #13143) + if ( event.target.nodeType === 3 ) { + event.target = event.target.parentNode; + } + + // Support: IE<9 + // For mouse/key events, metaKey==false if it's undefined (#3368, #11328) + event.metaKey = !!event.metaKey; + + return fixHook.filter ? fixHook.filter( event, originalEvent ) : event; + }, + + // Includes some event props shared by KeyEvent and MouseEvent + props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "), + + fixHooks: {}, + + keyHooks: { + props: "char charCode key keyCode".split(" "), + filter: function( event, original ) { + + // Add which for key events + if ( event.which == null ) { + event.which = original.charCode != null ? original.charCode : original.keyCode; + } + + return event; + } + }, + + mouseHooks: { + props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "), + filter: function( event, original ) { + var body, eventDoc, doc, + button = original.button, + fromElement = original.fromElement; + + // Calculate pageX/Y if missing and clientX/Y available + if ( event.pageX == null && original.clientX != null ) { + eventDoc = event.target.ownerDocument || document; + doc = eventDoc.documentElement; + body = eventDoc.body; + + event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 ); + event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 ); + } + + // Add relatedTarget, if necessary + if ( !event.relatedTarget && fromElement ) { + event.relatedTarget = fromElement === event.target ? original.toElement : fromElement; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + // Note: button is not normalized, so don't use it + if ( !event.which && button !== undefined ) { + event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) ); + } + + return event; + } + }, + + special: { + load: { + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + focus: { + // Fire native event if possible so blur/focus sequence is correct + trigger: function() { + if ( this !== safeActiveElement() && this.focus ) { + try { + this.focus(); + return false; + } catch ( e ) { + // Support: IE<9 + // If we error on focus to hidden element (#1486, #12518), + // let .trigger() run the handlers + } + } + }, + delegateType: "focusin" + }, + blur: { + trigger: function() { + if ( this === safeActiveElement() && this.blur ) { + this.blur(); + return false; + } + }, + delegateType: "focusout" + }, + click: { + // For checkbox, fire native event so checked state will be right + trigger: function() { + if ( jQuery.nodeName( this, "input" ) && this.type === "checkbox" && this.click ) { + this.click(); + return false; + } + }, + + // For cross-browser consistency, don't fire native .click() on links + _default: function( event ) { + return jQuery.nodeName( event.target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Even when returnValue equals to undefined Firefox will still show alert + if ( event.result !== undefined ) { + event.originalEvent.returnValue = event.result; + } + } + } + }, + + simulate: function( type, elem, event, bubble ) { + // Piggyback on a donor event to simulate a different one. + // Fake originalEvent to avoid donor's stopPropagation, but if the + // simulated event prevents default then we do the same on the donor. + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true, + originalEvent: {} + } + ); + if ( bubble ) { + jQuery.event.trigger( e, null, elem ); + } else { + jQuery.event.dispatch.call( elem, e ); + } + if ( e.isDefaultPrevented() ) { + event.preventDefault(); + } + } +}; + +jQuery.removeEvent = document.removeEventListener ? + function( elem, type, handle ) { + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle, false ); + } + } : + function( elem, type, handle ) { + var name = "on" + type; + + if ( elem.detachEvent ) { + + // #8545, #7054, preventing memory leaks for custom events in IE6-8 + // detachEvent needed property on element, by name of that event, to properly expose it to GC + if ( typeof elem[ name ] === strundefined ) { + elem[ name ] = null; + } + + elem.detachEvent( name, handle ); + } + }; + +jQuery.Event = function( src, props ) { + // Allow instantiation without the 'new' keyword + if ( !(this instanceof jQuery.Event) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && ( + // Support: IE < 9 + src.returnValue === false || + // Support: Android < 4.0 + src.getPreventDefault && src.getPreventDefault() ) ? + returnTrue : + returnFalse; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || jQuery.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + if ( !e ) { + return; + } + + // If preventDefault exists, run it on the original event + if ( e.preventDefault ) { + e.preventDefault(); + + // Support: IE + // Otherwise set the returnValue property of the original event to false + } else { + e.returnValue = false; + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + if ( !e ) { + return; + } + // If stopPropagation exists, run it on the original event + if ( e.stopPropagation ) { + e.stopPropagation(); + } + + // Support: IE + // Set the cancelBubble property of the original event to true + e.cancelBubble = true; + }, + stopImmediatePropagation: function() { + this.isImmediatePropagationStopped = returnTrue; + this.stopPropagation(); + } +}; + +// Create mouseenter/leave events using mouseover/out and event-time checks +jQuery.each({ + mouseenter: "mouseover", + mouseleave: "mouseout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mousenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || (related !== target && !jQuery.contains( target, related )) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +}); + +// IE submit delegation +if ( !support.submitBubbles ) { + + jQuery.event.special.submit = { + setup: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Lazy-add a submit handler when a descendant form may potentially be submitted + jQuery.event.add( this, "click._submit keypress._submit", function( e ) { + // Node name check avoids a VML-related crash in IE (#9807) + var elem = e.target, + form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined; + if ( form && !jQuery._data( form, "submitBubbles" ) ) { + jQuery.event.add( form, "submit._submit", function( event ) { + event._submit_bubble = true; + }); + jQuery._data( form, "submitBubbles", true ); + } + }); + // return undefined since we don't need an event listener + }, + + postDispatch: function( event ) { + // If form was submitted by the user, bubble the event up the tree + if ( event._submit_bubble ) { + delete event._submit_bubble; + if ( this.parentNode && !event.isTrigger ) { + jQuery.event.simulate( "submit", this.parentNode, event, true ); + } + } + }, + + teardown: function() { + // Only need this for delegated form submit events + if ( jQuery.nodeName( this, "form" ) ) { + return false; + } + + // Remove delegated handlers; cleanData eventually reaps submit handlers attached above + jQuery.event.remove( this, "._submit" ); + } + }; +} + +// IE change delegation and checkbox/radio fix +if ( !support.changeBubbles ) { + + jQuery.event.special.change = { + + setup: function() { + + if ( rformElems.test( this.nodeName ) ) { + // IE doesn't fire change on a check/radio until blur; trigger it on click + // after a propertychange. Eat the blur-change in special.change.handle. + // This still fires onchange a second time for check/radio after blur. + if ( this.type === "checkbox" || this.type === "radio" ) { + jQuery.event.add( this, "propertychange._change", function( event ) { + if ( event.originalEvent.propertyName === "checked" ) { + this._just_changed = true; + } + }); + jQuery.event.add( this, "click._change", function( event ) { + if ( this._just_changed && !event.isTrigger ) { + this._just_changed = false; + } + // Allow triggered, simulated change events (#11500) + jQuery.event.simulate( "change", this, event, true ); + }); + } + return false; + } + // Delegated event; lazy-add a change handler on descendant inputs + jQuery.event.add( this, "beforeactivate._change", function( e ) { + var elem = e.target; + + if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "changeBubbles" ) ) { + jQuery.event.add( elem, "change._change", function( event ) { + if ( this.parentNode && !event.isSimulated && !event.isTrigger ) { + jQuery.event.simulate( "change", this.parentNode, event, true ); + } + }); + jQuery._data( elem, "changeBubbles", true ); + } + }); + }, + + handle: function( event ) { + var elem = event.target; + + // Swallow native change events from checkbox/radio, we already triggered them above + if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) { + return event.handleObj.handler.apply( this, arguments ); + } + }, + + teardown: function() { + jQuery.event.remove( this, "._change" ); + + return !rformElems.test( this.nodeName ); + } + }; +} + +// Create "bubbling" focus and blur events +if ( !support.focusinBubbles ) { + jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + jQuery._data( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this, + attaches = jQuery._data( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + jQuery._removeData( doc, fix ); + } else { + jQuery._data( doc, fix, attaches ); + } + } + }; + }); +} + +jQuery.fn.extend({ + + on: function( types, selector, data, fn, /*INTERNAL*/ one ) { + var type, origFn; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + this.on( type, selector, data, types[ type ], one ); + } + return this; + } + + if ( data == null && fn == null ) { + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return this; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return this.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + }); + }, + one: function( types, selector, data, fn ) { + return this.on( types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each(function() { + jQuery.event.remove( this, types, fn, selector ); + }); + }, + + trigger: function( type, data ) { + return this.each(function() { + jQuery.event.trigger( type, data, this ); + }); + }, + triggerHandler: function( type, data ) { + var elem = this[0]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +}); + + +function createSafeFragment( document ) { + var list = nodeNames.split( "|" ), + safeFrag = document.createDocumentFragment(); + + if ( safeFrag.createElement ) { + while ( list.length ) { + safeFrag.createElement( + list.pop() + ); + } + } + return safeFrag; +} + +var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" + + "header|hgroup|mark|meter|nav|output|progress|section|summary|time|video", + rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g, + rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"), + rleadingWhitespace = /^\s+/, + rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, + rtagName = /<([\w:]+)/, + rtbody = /<tbody/i, + rhtml = /<|&#?\w+;/, + rnoInnerhtml = /<(?:script|style|link)/i, + // checked="checked" or checked + rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i, + rscriptType = /^$|\/(?:java|ecma)script/i, + rscriptTypeMasked = /^true\/(.*)/, + rcleanScript = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, + + // We have to close these tags to support XHTML (#13200) + wrapMap = { + option: [ 1, "<select multiple='multiple'>", "</select>" ], + legend: [ 1, "<fieldset>", "</fieldset>" ], + area: [ 1, "<map>", "</map>" ], + param: [ 1, "<object>", "</object>" ], + thead: [ 1, "<table>", "</table>" ], + tr: [ 2, "<table><tbody>", "</tbody></table>" ], + col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ], + td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ], + + // IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags, + // unless wrapped in a div with non-breaking characters in front of it. + _default: support.htmlSerialize ? [ 0, "", "" ] : [ 1, "X<div>", "</div>" ] + }, + safeFragment = createSafeFragment( document ), + fragmentDiv = safeFragment.appendChild( document.createElement("div") ); + +wrapMap.optgroup = wrapMap.option; +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +function getAll( context, tag ) { + var elems, elem, + i = 0, + found = typeof context.getElementsByTagName !== strundefined ? context.getElementsByTagName( tag || "*" ) : + typeof context.querySelectorAll !== strundefined ? context.querySelectorAll( tag || "*" ) : + undefined; + + if ( !found ) { + for ( found = [], elems = context.childNodes || context; (elem = elems[i]) != null; i++ ) { + if ( !tag || jQuery.nodeName( elem, tag ) ) { + found.push( elem ); + } else { + jQuery.merge( found, getAll( elem, tag ) ); + } + } + } + + return tag === undefined || tag && jQuery.nodeName( context, tag ) ? + jQuery.merge( [ context ], found ) : + found; +} + +// Used in buildFragment, fixes the defaultChecked property +function fixDefaultChecked( elem ) { + if ( rcheckableType.test( elem.type ) ) { + elem.defaultChecked = elem.checked; + } +} + +// Support: IE<8 +// Manipulating tables requires a tbody +function manipulationTarget( elem, content ) { + return jQuery.nodeName( elem, "table" ) && + jQuery.nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ? + + elem.getElementsByTagName("tbody")[0] || + elem.appendChild( elem.ownerDocument.createElement("tbody") ) : + elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = (jQuery.find.attr( elem, "type" ) !== null) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + var match = rscriptTypeMasked.exec( elem.type ); + if ( match ) { + elem.type = match[1]; + } else { + elem.removeAttribute("type"); + } + return elem; +} + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var elem, + i = 0; + for ( ; (elem = elems[i]) != null; i++ ) { + jQuery._data( elem, "globalEval", !refElements || jQuery._data( refElements[i], "globalEval" ) ); + } +} + +function cloneCopyEvent( src, dest ) { + + if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) { + return; + } + + var type, i, l, + oldData = jQuery._data( src ), + curData = jQuery._data( dest, oldData ), + events = oldData.events; + + if ( events ) { + delete curData.handle; + curData.events = {}; + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + + // make the cloned public data object a copy from the original + if ( curData.data ) { + curData.data = jQuery.extend( {}, curData.data ); + } +} + +function fixCloneNodeIssues( src, dest ) { + var nodeName, e, data; + + // We do not need to do anything for non-Elements + if ( dest.nodeType !== 1 ) { + return; + } + + nodeName = dest.nodeName.toLowerCase(); + + // IE6-8 copies events bound via attachEvent when using cloneNode. + if ( !support.noCloneEvent && dest[ jQuery.expando ] ) { + data = jQuery._data( dest ); + + for ( e in data.events ) { + jQuery.removeEvent( dest, e, data.handle ); + } + + // Event data gets referenced instead of copied if the expando gets copied too + dest.removeAttribute( jQuery.expando ); + } + + // IE blanks contents when cloning scripts, and tries to evaluate newly-set text + if ( nodeName === "script" && dest.text !== src.text ) { + disableScript( dest ).text = src.text; + restoreScript( dest ); + + // IE6-10 improperly clones children of object elements using classid. + // IE10 throws NoModificationAllowedError if parent is null, #12132. + } else if ( nodeName === "object" ) { + if ( dest.parentNode ) { + dest.outerHTML = src.outerHTML; + } + + // This path appears unavoidable for IE9. When cloning an object + // element in IE9, the outerHTML strategy above is not sufficient. + // If the src has innerHTML and the destination does not, + // copy the src.innerHTML into the dest.innerHTML. #10324 + if ( support.html5Clone && ( src.innerHTML && !jQuery.trim(dest.innerHTML) ) ) { + dest.innerHTML = src.innerHTML; + } + + } else if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + // IE6-8 fails to persist the checked state of a cloned checkbox + // or radio button. Worse, IE6-7 fail to give the cloned element + // a checked appearance if the defaultChecked value isn't also set + + dest.defaultChecked = dest.checked = src.checked; + + // IE6-7 get confused and end up setting the value of a cloned + // checkbox/radio button to an empty string instead of "on" + if ( dest.value !== src.value ) { + dest.value = src.value; + } + + // IE6-8 fails to return the selected option to the default selected + // state when cloning options + } else if ( nodeName === "option" ) { + dest.defaultSelected = dest.selected = src.defaultSelected; + + // IE6-8 fails to set the defaultValue to the correct value when + // cloning other types of input fields + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +jQuery.extend({ + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var destElements, node, clone, i, srcElements, + inPage = jQuery.contains( elem.ownerDocument, elem ); + + if ( support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) { + clone = elem.cloneNode( true ); + + // IE<=8 does not properly clone detached, unknown element nodes + } else { + fragmentDiv.innerHTML = elem.outerHTML; + fragmentDiv.removeChild( clone = fragmentDiv.firstChild ); + } + + if ( (!support.noCloneEvent || !support.noCloneChecked) && + (elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) { + + // We eschew Sizzle here for performance reasons: http://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + // Fix all IE cloning issues + for ( i = 0; (node = srcElements[i]) != null; ++i ) { + // Ensure that the destination node is not null; Fixes #9587 + if ( destElements[i] ) { + fixCloneNodeIssues( node, destElements[i] ); + } + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0; (node = srcElements[i]) != null; i++ ) { + cloneCopyEvent( node, destElements[i] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + destElements = srcElements = node = null; + + // Return the cloned set + return clone; + }, + + buildFragment: function( elems, context, scripts, selection ) { + var j, elem, contains, + tmp, tag, tbody, wrap, + l = elems.length, + + // Ensure a safe fragment + safe = createSafeFragment( context ), + + nodes = [], + i = 0; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( jQuery.type( elem ) === "object" ) { + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || safe.appendChild( context.createElement("div") ); + + // Deserialize a standard representation + tag = (rtagName.exec( elem ) || [ "", "" ])[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + + tmp.innerHTML = wrap[1] + elem.replace( rxhtmlTag, "<$1></$2>" ) + wrap[2]; + + // Descend through wrappers to the right content + j = wrap[0]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Manually add leading whitespace removed by IE + if ( !support.leadingWhitespace && rleadingWhitespace.test( elem ) ) { + nodes.push( context.createTextNode( rleadingWhitespace.exec( elem )[0] ) ); + } + + // Remove IE's autoinserted <tbody> from table fragments + if ( !support.tbody ) { + + // String was a <table>, *may* have spurious <tbody> + elem = tag === "table" && !rtbody.test( elem ) ? + tmp.firstChild : + + // String was a bare <thead> or <tfoot> + wrap[1] === "<table>" && !rtbody.test( elem ) ? + tmp : + 0; + + j = elem && elem.childNodes.length; + while ( j-- ) { + if ( jQuery.nodeName( (tbody = elem.childNodes[j]), "tbody" ) && !tbody.childNodes.length ) { + elem.removeChild( tbody ); + } + } + } + + jQuery.merge( nodes, tmp.childNodes ); + + // Fix #12392 for WebKit and IE > 9 + tmp.textContent = ""; + + // Fix #12392 for oldIE + while ( tmp.firstChild ) { + tmp.removeChild( tmp.firstChild ); + } + + // Remember the top-level container for proper cleanup + tmp = safe.lastChild; + } + } + } + + // Fix #11356: Clear elements from fragment + if ( tmp ) { + safe.removeChild( tmp ); + } + + // Reset defaultChecked for any radios and checkboxes + // about to be appended to the DOM in IE 6/7 (#8060) + if ( !support.appendChecked ) { + jQuery.grep( getAll( nodes, "input" ), fixDefaultChecked ); + } + + i = 0; + while ( (elem = nodes[ i++ ]) ) { + + // #4087 - If origin and destination elements are the same, and this is + // that element, do not do anything + if ( selection && jQuery.inArray( elem, selection ) !== -1 ) { + continue; + } + + contains = jQuery.contains( elem.ownerDocument, elem ); + + // Append to fragment + tmp = getAll( safe.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( contains ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( (elem = tmp[ j++ ]) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + tmp = null; + + return safe; + }, + + cleanData: function( elems, /* internal */ acceptData ) { + var elem, type, id, data, + i = 0, + internalKey = jQuery.expando, + cache = jQuery.cache, + deleteExpando = support.deleteExpando, + special = jQuery.event.special; + + for ( ; (elem = elems[i]) != null; i++ ) { + if ( acceptData || jQuery.acceptData( elem ) ) { + + id = elem[ internalKey ]; + data = id && cache[ id ]; + + if ( data ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Remove cache only if it was not already removed by jQuery.event.remove + if ( cache[ id ] ) { + + delete cache[ id ]; + + // IE does not allow us to delete expando properties from nodes, + // nor does it have a removeAttribute function on Document nodes; + // we must handle all of these cases + if ( deleteExpando ) { + delete elem[ internalKey ]; + + } else if ( typeof elem.removeAttribute !== strundefined ) { + elem.removeAttribute( internalKey ); + + } else { + elem[ internalKey ] = null; + } + + deletedIds.push( id ); + } + } + } + } + } +}); + +jQuery.fn.extend({ + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) ); + }, null, value, arguments.length ); + }, + + append: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + }); + }, + + prepend: function() { + return this.domManip( arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + }); + }, + + before: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + }); + }, + + after: function() { + return this.domManip( arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + }); + }, + + remove: function( selector, keepData /* Internal Use Only */ ) { + var elem, + elems = selector ? jQuery.filter( selector, this ) : this, + i = 0; + + for ( ; (elem = elems[i]) != null; i++ ) { + + if ( !keepData && elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem ) ); + } + + if ( elem.parentNode ) { + if ( keepData && jQuery.contains( elem.ownerDocument, elem ) ) { + setGlobalEval( getAll( elem, "script" ) ); + } + elem.parentNode.removeChild( elem ); + } + } + + return this; + }, + + empty: function() { + var elem, + i = 0; + + for ( ; (elem = this[i]) != null; i++ ) { + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + } + + // Remove any remaining nodes + while ( elem.firstChild ) { + elem.removeChild( elem.firstChild ); + } + + // If this is a select, ensure that it displays empty (#12336) + // Support: IE<9 + if ( elem.options && jQuery.nodeName( elem, "select" ) ) { + elem.options.length = 0; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map(function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + }); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined ) { + return elem.nodeType === 1 ? + elem.innerHTML.replace( rinlinejQuery, "" ) : + undefined; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + ( support.htmlSerialize || !rnoshimcache.test( value ) ) && + ( support.leadingWhitespace || !rleadingWhitespace.test( value ) ) && + !wrapMap[ (rtagName.exec( value ) || [ "", "" ])[ 1 ].toLowerCase() ] ) { + + value = value.replace( rxhtmlTag, "<$1></$2>" ); + + try { + for (; i < l; i++ ) { + // Remove element nodes and prevent memory leaks + elem = this[i] || {}; + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch(e) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var arg = arguments[ 0 ]; + + // Make the changes, replacing each context element with the new content + this.domManip( arguments, function( elem ) { + arg = this.parentNode; + + jQuery.cleanData( getAll( this ) ); + + if ( arg ) { + arg.replaceChild( elem, this ); + } + }); + + // Force removal if there was no new content (e.g., from empty arguments) + return arg && (arg.length || arg.nodeType) ? this : this.remove(); + }, + + detach: function( selector ) { + return this.remove( selector, true ); + }, + + domManip: function( args, callback ) { + + // Flatten any nested arrays + args = concat.apply( [], args ); + + var first, node, hasScripts, + scripts, doc, fragment, + i = 0, + l = this.length, + set = this, + iNoClone = l - 1, + value = args[0], + isFunction = jQuery.isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( isFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return this.each(function( index ) { + var self = set.eq( index ); + if ( isFunction ) { + args[0] = value.call( this, index, self.html() ); + } + self.domManip( args, callback ); + }); + } + + if ( l ) { + fragment = jQuery.buildFragment( args, this[ 0 ].ownerDocument, false, this ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + if ( first ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( this[i], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !jQuery._data( node, "globalEval" ) && jQuery.contains( doc, node ) ) { + + if ( node.src ) { + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl ) { + jQuery._evalUrl( node.src ); + } + } else { + jQuery.globalEval( ( node.text || node.textContent || node.innerHTML || "" ).replace( rcleanScript, "" ) ); + } + } + } + } + + // Fix #11809: Avoid leaking memory + fragment = first = null; + } + } + + return this; + } +}); + +jQuery.each({ + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + i = 0, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone(true); + jQuery( insert[i] )[ original ]( elems ); + + // Modern browsers can apply jQuery collections as arrays, but oldIE needs a .get() + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +}); + + +var iframe, + elemdisplay = {}; + +/** + * Retrieve the actual display of a element + * @param {String} name nodeName of the element + * @param {Object} doc Document object + */ +// Called only from within defaultDisplay +function actualDisplay( name, doc ) { + var elem = jQuery( doc.createElement( name ) ).appendTo( doc.body ), + + // getDefaultComputedStyle might be reliably used only on attached element + display = window.getDefaultComputedStyle ? + + // Use of this method is a temporary fix (more like optmization) until something better comes along, + // since it was removed from specification and supported only in FF + window.getDefaultComputedStyle( elem[ 0 ] ).display : jQuery.css( elem[ 0 ], "display" ); + + // We don't have any data stored on the element, + // so use "detach" method as fast way to get rid of the element + elem.detach(); + + return display; +} + +/** + * Try to determine the default display value of an element + * @param {String} nodeName + */ +function defaultDisplay( nodeName ) { + var doc = document, + display = elemdisplay[ nodeName ]; + + if ( !display ) { + display = actualDisplay( nodeName, doc ); + + // If the simple way fails, read from inside an iframe + if ( display === "none" || !display ) { + + // Use the already-created iframe if possible + iframe = (iframe || jQuery( "<iframe frameborder='0' width='0' height='0'/>" )).appendTo( doc.documentElement ); + + // Always write a new HTML skeleton so Webkit and Firefox don't choke on reuse + doc = ( iframe[ 0 ].contentWindow || iframe[ 0 ].contentDocument ).document; + + // Support: IE + doc.write(); + doc.close(); + + display = actualDisplay( nodeName, doc ); + iframe.detach(); + } + + // Store the correct default display + elemdisplay[ nodeName ] = display; + } + + return display; +} + + +(function() { + var a, shrinkWrapBlocksVal, + div = document.createElement( "div" ), + divReset = + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" + + "display:block;padding:0;margin:0;border:0"; + + // Setup + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + a = div.getElementsByTagName( "a" )[ 0 ]; + + a.style.cssText = "float:left;opacity:.5"; + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + support.opacity = /^0.5/.test( a.style.opacity ); + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + support.cssFloat = !!a.style.cssFloat; + + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + // Null elements to avoid leaks in IE. + a = div = null; + + support.shrinkWrapBlocks = function() { + var body, container, div, containerStyles; + + if ( shrinkWrapBlocksVal == null ) { + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body ) { + // Test fired too early or in an unsupported environment, exit. + return; + } + + containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px"; + container = document.createElement( "div" ); + div = document.createElement( "div" ); + + body.appendChild( container ).appendChild( div ); + + // Will be changed later if needed. + shrinkWrapBlocksVal = false; + + if ( typeof div.style.zoom !== strundefined ) { + // Support: IE6 + // Check if elements with layout shrink-wrap their children + div.style.cssText = divReset + ";width:1px;padding:1px;zoom:1"; + div.innerHTML = "<div></div>"; + div.firstChild.style.width = "5px"; + shrinkWrapBlocksVal = div.offsetWidth !== 3; + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE. + body = container = div = null; + } + + return shrinkWrapBlocksVal; + }; + +})(); +var rmargin = (/^margin/); + +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + + + +var getStyles, curCSS, + rposition = /^(top|right|bottom|left)$/; + +if ( window.getComputedStyle ) { + getStyles = function( elem ) { + return elem.ownerDocument.defaultView.getComputedStyle( elem, null ); + }; + + curCSS = function( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is only needed for .css('filter') in IE9, see #12537 + ret = computed ? computed.getPropertyValue( name ) || computed[ name ] : undefined; + + if ( computed ) { + + if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right + // Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels + // this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values + if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + // Support: IE + // IE returns zIndex value as an integer. + return ret === undefined ? + ret : + ret + ""; + }; +} else if ( document.documentElement.currentStyle ) { + getStyles = function( elem ) { + return elem.currentStyle; + }; + + curCSS = function( elem, name, computed ) { + var left, rs, rsLeft, ret, + style = elem.style; + + computed = computed || getStyles( elem ); + ret = computed ? computed[ name ] : undefined; + + // Avoid setting ret to empty string here + // so we don't default to auto + if ( ret == null && style && style[ name ] ) { + ret = style[ name ]; + } + + // From the awesome hack by Dean Edwards + // http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291 + + // If we're not dealing with a regular pixel number + // but a number that has a weird ending, we need to convert it to pixels + // but not position css attributes, as those are proportional to the parent element instead + // and we can't measure the parent instead because it might trigger a "stacking dolls" problem + if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) { + + // Remember the original values + left = style.left; + rs = elem.runtimeStyle; + rsLeft = rs && rs.left; + + // Put in the new values to get a computed value out + if ( rsLeft ) { + rs.left = elem.currentStyle.left; + } + style.left = name === "fontSize" ? "1em" : ret; + ret = style.pixelLeft + "px"; + + // Revert the changed values + style.left = left; + if ( rsLeft ) { + rs.left = rsLeft; + } + } + + // Support: IE + // IE returns zIndex value as an integer. + return ret === undefined ? + ret : + ret + "" || "auto"; + }; +} + + + + +function addGetHookIf( conditionFn, hookFn ) { + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + var condition = conditionFn(); + + if ( condition == null ) { + // The test was not ready at this point; screw the hook this time + // but check again when needed next time. + return; + } + + if ( condition ) { + // Hook not needed (or it's not possible to use it due to missing dependency), + // remove it. + // Since there are no other hooks for marginRight, remove the whole object. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + + return (this.get = hookFn).apply( this, arguments ); + } + }; +} + + +(function() { + var a, reliableHiddenOffsetsVal, boxSizingVal, boxSizingReliableVal, + pixelPositionVal, reliableMarginRightVal, + div = document.createElement( "div" ), + containerStyles = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px", + divReset = + "-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;" + + "display:block;padding:0;margin:0;border:0"; + + // Setup + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + a = div.getElementsByTagName( "a" )[ 0 ]; + + a.style.cssText = "float:left;opacity:.5"; + + // Make sure that element opacity exists + // (IE uses filter instead) + // Use a regex to work around a WebKit issue. See #5145 + support.opacity = /^0.5/.test( a.style.opacity ); + + // Verify style float existence + // (IE uses styleFloat instead of cssFloat) + support.cssFloat = !!a.style.cssFloat; + + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + // Null elements to avoid leaks in IE. + a = div = null; + + jQuery.extend(support, { + reliableHiddenOffsets: function() { + if ( reliableHiddenOffsetsVal != null ) { + return reliableHiddenOffsetsVal; + } + + var container, tds, isSupported, + div = document.createElement( "div" ), + body = document.getElementsByTagName( "body" )[ 0 ]; + + if ( !body ) { + // Return for frameset docs that don't have a body + return; + } + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + + container = document.createElement( "div" ); + container.style.cssText = containerStyles; + + body.appendChild( container ).appendChild( div ); + + // Support: IE8 + // Check if table cells still have offsetWidth/Height when they are set + // to display:none and there are still other visible table cells in a + // table row; if so, offsetWidth/Height are not reliable for use when + // determining if an element has been hidden directly using + // display:none (it is still safe to use offsets if a parent element is + // hidden; don safety goggles and see bug #4512 for more information). + div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>"; + tds = div.getElementsByTagName( "td" ); + tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none"; + isSupported = ( tds[ 0 ].offsetHeight === 0 ); + + tds[ 0 ].style.display = ""; + tds[ 1 ].style.display = "none"; + + // Support: IE8 + // Check if empty table cells still have offsetWidth/Height + reliableHiddenOffsetsVal = isSupported && ( tds[ 0 ].offsetHeight === 0 ); + + body.removeChild( container ); + + // Null elements to avoid leaks in IE. + div = body = null; + + return reliableHiddenOffsetsVal; + }, + + boxSizing: function() { + if ( boxSizingVal == null ) { + computeStyleTests(); + } + return boxSizingVal; + }, + + boxSizingReliable: function() { + if ( boxSizingReliableVal == null ) { + computeStyleTests(); + } + return boxSizingReliableVal; + }, + + pixelPosition: function() { + if ( pixelPositionVal == null ) { + computeStyleTests(); + } + return pixelPositionVal; + }, + + reliableMarginRight: function() { + var body, container, div, marginDiv; + + // Use window.getComputedStyle because jsdom on node.js will break without it. + if ( reliableMarginRightVal == null && window.getComputedStyle ) { + body = document.getElementsByTagName( "body" )[ 0 ]; + if ( !body ) { + // Test fired too early or in an unsupported environment, exit. + return; + } + + container = document.createElement( "div" ); + div = document.createElement( "div" ); + container.style.cssText = containerStyles; + + body.appendChild( container ).appendChild( div ); + + // Check if div with explicit width and no margin-right incorrectly + // gets computed margin-right based on width of container. (#3333) + // Fails in WebKit before Feb 2011 nightlies + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + marginDiv = div.appendChild( document.createElement( "div" ) ); + marginDiv.style.cssText = div.style.cssText = divReset; + marginDiv.style.marginRight = marginDiv.style.width = "0"; + div.style.width = "1px"; + + reliableMarginRightVal = + !parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight ); + + body.removeChild( container ); + } + + return reliableMarginRightVal; + } + }); + + function computeStyleTests() { + var container, div, + body = document.getElementsByTagName( "body" )[ 0 ]; + + if ( !body ) { + // Test fired too early or in an unsupported environment, exit. + return; + } + + container = document.createElement( "div" ); + div = document.createElement( "div" ); + container.style.cssText = containerStyles; + + body.appendChild( container ).appendChild( div ); + + div.style.cssText = + "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;" + + "position:absolute;display:block;padding:1px;border:1px;width:4px;" + + "margin-top:1%;top:1%"; + + // Workaround failing boxSizing test due to offsetWidth returning wrong value + // with some non-1 values of body zoom, ticket #13543 + jQuery.swap( body, body.style.zoom != null ? { zoom: 1 } : {}, function() { + boxSizingVal = div.offsetWidth === 4; + }); + + // Will be changed later if needed. + boxSizingReliableVal = true; + pixelPositionVal = false; + reliableMarginRightVal = true; + + // Use window.getComputedStyle because jsdom on node.js will break without it. + if ( window.getComputedStyle ) { + pixelPositionVal = ( window.getComputedStyle( div, null ) || {} ).top !== "1%"; + boxSizingReliableVal = + ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px"; + } + + body.removeChild( container ); + + // Null elements to avoid leaks in IE. + div = body = null; + } + +})(); + + +// A method for quickly swapping in/out CSS properties to get correct calculations. +jQuery.swap = function( elem, options, callback, args ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.apply( elem, args || [] ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var + ralpha = /alpha\([^)]*\)/i, + ropacity = /opacity\s*=\s*([^)]*)/, + + // swappable if display is none or starts with table except "table", "table-cell", or "table-caption" + // see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rnumsplit = new RegExp( "^(" + pnum + ")(.*)$", "i" ), + rrelNum = new RegExp( "^([+-])=(" + pnum + ")", "i" ), + + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: 0, + fontWeight: 400 + }, + + cssPrefixes = [ "Webkit", "O", "Moz", "ms" ]; + + +// return a css property mapped to a potentially vendor prefixed property +function vendorPropName( style, name ) { + + // shortcut for names that are not vendor prefixed + if ( name in style ) { + return name; + } + + // check for vendor prefixed names + var capName = name.charAt(0).toUpperCase() + name.slice(1), + origName = name, + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in style ) { + return name; + } + } + + return origName; +} + +function showHide( elements, show ) { + var display, elem, hidden, + values = [], + index = 0, + length = elements.length; + + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + values[ index ] = jQuery._data( elem, "olddisplay" ); + display = elem.style.display; + if ( show ) { + // Reset the inline display of this element to learn if it is + // being hidden by cascaded rules or not + if ( !values[ index ] && display === "none" ) { + elem.style.display = ""; + } + + // Set elements which have been overridden with display: none + // in a stylesheet to whatever the default browser style is + // for such an element + if ( elem.style.display === "" && isHidden( elem ) ) { + values[ index ] = jQuery._data( elem, "olddisplay", defaultDisplay(elem.nodeName) ); + } + } else { + + if ( !values[ index ] ) { + hidden = isHidden( elem ); + + if ( display && display !== "none" || !hidden ) { + jQuery._data( elem, "olddisplay", hidden ? display : jQuery.css( elem, "display" ) ); + } + } + } + } + + // Set the display of most of the elements in a second loop + // to avoid the constant reflow + for ( index = 0; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + if ( !show || elem.style.display === "none" || elem.style.display === "" ) { + elem.style.display = show ? values[ index ] || "" : "none"; + } + } + + return elements; +} + +function setPositiveNumber( elem, value, subtract ) { + var matches = rnumsplit.exec( value ); + return matches ? + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) : + value; +} + +function augmentWidthOrHeight( elem, name, extra, isBorderBox, styles ) { + var i = extra === ( isBorderBox ? "border" : "content" ) ? + // If we already have the right measurement, avoid augmentation + 4 : + // Otherwise initialize for horizontal or vertical properties + name === "width" ? 1 : 0, + + val = 0; + + for ( ; i < 4; i += 2 ) { + // both box models exclude margin, so add it if we want it + if ( extra === "margin" ) { + val += jQuery.css( elem, extra + cssExpand[ i ], true, styles ); + } + + if ( isBorderBox ) { + // border-box includes padding, so remove it if we want content + if ( extra === "content" ) { + val -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // at this point, extra isn't border nor margin, so remove border + if ( extra !== "margin" ) { + val -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } else { + // at this point, extra isn't content, so add padding + val += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // at this point, extra isn't content nor padding, so add border + if ( extra !== "padding" ) { + val += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + return val; +} + +function getWidthOrHeight( elem, name, extra ) { + + // Start with offset property, which is equivalent to the border-box value + var valueIsBorderBox = true, + val = name === "width" ? elem.offsetWidth : elem.offsetHeight, + styles = getStyles( elem ), + isBorderBox = support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // some non-html elements return undefined for offsetWidth, so check for null/undefined + // svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285 + // MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668 + if ( val <= 0 || val == null ) { + // Fall back to computed then uncomputed css if necessary + val = curCSS( elem, name, styles ); + if ( val < 0 || val == null ) { + val = elem.style[ name ]; + } + + // Computed unit is not pixels. Stop here and return. + if ( rnumnonpx.test(val) ) { + return val; + } + + // we need the check for style in case a browser which returns unreliable values + // for getComputedStyle silently falls back to the reliable elem.style + valueIsBorderBox = isBorderBox && ( support.boxSizingReliable() || val === elem.style[ name ] ); + + // Normalize "", auto, and prepare for extra + val = parseFloat( val ) || 0; + } + + // use the active box-sizing model to add/subtract irrelevant styles + return ( val + + augmentWidthOrHeight( + elem, + name, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles + ) + ) + "px"; +} + +jQuery.extend({ + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "columnCount": true, + "fillOpacity": true, + "fontWeight": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: { + // normalize float css property + "float": support.cssFloat ? "cssFloat" : "styleFloat" + }, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = jQuery.camelCase( name ), + style = elem.style; + + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // convert relative number strings (+= or -=) to relative numbers. #7345 + if ( type === "string" && (ret = rrelNum.exec( value )) ) { + value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) ); + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set. See: #7116 + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add 'px' to the (except for certain CSS properties) + if ( type === "number" && !jQuery.cssNumber[ origName ] ) { + value += "px"; + } + + // Fixes #8908, it can be done more correctly by specifing setters in cssHooks, + // but it would mean to define eight (for every problematic property) identical functions + if ( !support.clearCloneStyle && value === "" && name.indexOf("background") === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) { + + // Support: IE + // Swallow errors from 'invalid' CSS values (#5509) + try { + // Support: Chrome, Safari + // Setting style to blank string required to delete "style: x !important;" + style[ name ] = ""; + style[ name ] = value; + } catch(e) {} + } + + } else { + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) { + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var num, val, hooks, + origName = jQuery.camelCase( name ); + + // Make sure that we're working with the right name + name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) ); + + // gets hook for the prefixed version + // followed by the unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + //convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Return, converting to number if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || jQuery.isNumeric( num ) ? num || 0 : val; + } + return val; + } +}); + +jQuery.each([ "height", "width" ], function( i, name ) { + jQuery.cssHooks[ name ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + // certain elements can have dimension info if we invisibly show them + // however, it must have a current display style that would benefit from this + return elem.offsetWidth === 0 && rdisplayswap.test( jQuery.css( elem, "display" ) ) ? + jQuery.swap( elem, cssShow, function() { + return getWidthOrHeight( elem, name, extra ); + }) : + getWidthOrHeight( elem, name, extra ); + } + }, + + set: function( elem, value, extra ) { + var styles = extra && getStyles( elem ); + return setPositiveNumber( elem, value, extra ? + augmentWidthOrHeight( + elem, + name, + extra, + support.boxSizing() && jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + styles + ) : 0 + ); + } + }; +}); + +if ( !support.opacity ) { + jQuery.cssHooks.opacity = { + get: function( elem, computed ) { + // IE uses filters for opacity + return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ? + ( 0.01 * parseFloat( RegExp.$1 ) ) + "" : + computed ? "1" : ""; + }, + + set: function( elem, value ) { + var style = elem.style, + currentStyle = elem.currentStyle, + opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "", + filter = currentStyle && currentStyle.filter || style.filter || ""; + + // IE has trouble with opacity if it does not have layout + // Force it by setting the zoom level + style.zoom = 1; + + // if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652 + // if value === "", then remove inline opacity #12685 + if ( ( value >= 1 || value === "" ) && + jQuery.trim( filter.replace( ralpha, "" ) ) === "" && + style.removeAttribute ) { + + // Setting style.filter to null, "" & " " still leave "filter:" in the cssText + // if "filter:" is present at all, clearType is disabled, we want to avoid this + // style.removeAttribute is IE Only, but so apparently is this code path... + style.removeAttribute( "filter" ); + + // if there is no filter style applied in a css rule or unset inline opacity, we are done + if ( value === "" || currentStyle && !currentStyle.filter ) { + return; + } + } + + // otherwise, set new filter values + style.filter = ralpha.test( filter ) ? + filter.replace( ralpha, opacity ) : + filter + " " + opacity; + } + }; +} + +jQuery.cssHooks.marginRight = addGetHookIf( support.reliableMarginRight, + function( elem, computed ) { + if ( computed ) { + // WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right + // Work around by temporarily setting element display to inline-block + return jQuery.swap( elem, { "display": "inline-block" }, + curCSS, [ elem, "marginRight" ] ); + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each({ + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // assumes a single number if not a string + parts = typeof value === "string" ? value.split(" ") : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( !rmargin.test( prefix ) ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +}); + +jQuery.fn.extend({ + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( jQuery.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + }, + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each(function() { + if ( isHidden( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + }); + } +}); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || "swing"; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + if ( tween.elem[ tween.prop ] != null && + (!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) { + return tween.elem[ tween.prop ]; + } + + // passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails + // so, simple values such as "10px" are parsed to Float. + // complex values such as "rotate(1rad)" are returned as is. + result = jQuery.css( tween.elem, tween.prop, "" ); + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + // use step hook for back compat - use cssHook if its there - use .style if its + // available and use plain properties where available + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 +// Panic based approach to setting things on disconnected nodes + +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + } +}; + +jQuery.fx = Tween.prototype.init; + +// Back Compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, timerId, + rfxtypes = /^(?:toggle|show|hide)$/, + rfxnum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ), + rrun = /queueHooks$/, + animationPrefilters = [ defaultPrefilter ], + tweeners = { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ), + target = tween.cur(), + parts = rfxnum.exec( value ), + unit = parts && parts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + start = ( jQuery.cssNumber[ prop ] || unit !== "px" && +target ) && + rfxnum.exec( jQuery.css( tween.elem, prop ) ), + scale = 1, + maxIterations = 20; + + if ( start && start[ 3 ] !== unit ) { + // Trust units reported by jQuery.css + unit = unit || start[ 3 ]; + + // Make sure we update the tween properties later on + parts = parts || []; + + // Iteratively approximate from a nonzero starting point + start = +target || 1; + + do { + // If previous iteration zeroed out, double until we get *something* + // Use a string for doubling factor so we don't accidentally see scale as unchanged below + scale = scale || ".5"; + + // Adjust and apply + start = start / scale; + jQuery.style( tween.elem, prop, start + unit ); + + // Update scale, tolerating zero or NaN from tween.cur() + // And breaking the loop if scale is unchanged or perfect, or if we've just had enough + } while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations ); + } + + // Update tween properties + if ( parts ) { + start = tween.start = +start || +target || 0; + tween.unit = unit; + // If a +=/-= token was provided, we're doing a relative animation + tween.end = parts[ 1 ] ? + start + ( parts[ 1 ] + 1 ) * parts[ 2 ] : + +parts[ 2 ]; + } + + return tween; + } ] + }; + +// Animations created synchronously will run synchronously +function createFxNow() { + setTimeout(function() { + fxNow = undefined; + }); + return ( fxNow = jQuery.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + attrs = { height: type }, + i = 0; + + // if we include width, step value is 1 to do all cssExpand values, + // if we don't include width, step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4 ; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( (tween = collection[ index ].call( animation, prop, value )) ) { + + // we're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + /* jshint validthis: true */ + var prop, value, toggle, tween, hooks, oldfire, display, dDisplay, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHidden( elem ), + dataShow = jQuery._data( elem, "fxshow" ); + + // handle queue: false promises + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always(function() { + // doing this makes sure that the complete handler will be called + // before this completes + anim.always(function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + }); + }); + } + + // height/width overflow pass + if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) { + // Make sure that nothing sneaks out + // Record all 3 overflow attributes because IE does not + // change the overflow attribute when overflowX and + // overflowY are set to the same value + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Set display property to inline-block for height/width + // animations on inline elements that are having width/height animated + display = jQuery.css( elem, "display" ); + dDisplay = defaultDisplay( elem.nodeName ); + if ( display === "none" ) { + display = dDisplay; + } + if ( display === "inline" && + jQuery.css( elem, "float" ) === "none" ) { + + // inline-level elements accept inline-block; + // block-level elements need to be inline with layout + if ( !support.inlineBlockNeedsLayout || dDisplay === "inline" ) { + style.display = "inline-block"; + } else { + style.zoom = 1; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + if ( !support.shrinkWrapBlocks() ) { + anim.always(function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + }); + } + } + + // show/hide pass + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.exec( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // If there is dataShow left over from a stopped hide or show and we are going to proceed with show, we should pretend to be hidden + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + if ( !jQuery.isEmptyObject( orig ) ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = jQuery._data( elem, "fxshow", {} ); + } + + // store state if its toggle - enables .stop().toggle() to "reverse" + if ( toggle ) { + dataShow.hidden = !hidden; + } + if ( hidden ) { + jQuery( elem ).show(); + } else { + anim.done(function() { + jQuery( elem ).hide(); + }); + } + anim.done(function() { + var prop; + jQuery._removeData( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + }); + for ( prop in orig ) { + tween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = tween.start; + if ( hidden ) { + tween.end = tween.start; + tween.start = prop === "width" || prop === "height" ? 1 : 0; + } + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = jQuery.camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( jQuery.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // not quite $.extend, this wont overwrite keys already present. + // also - reusing 'index' from above because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = animationPrefilters.length, + deferred = jQuery.Deferred().always( function() { + // don't match elem in the :animated selector + delete tick.elem; + }), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + // archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ]); + + if ( percent < 1 && length ) { + return remaining; + } else { + deferred.resolveWith( elem, [ animation ] ); + return false; + } + }, + animation = deferred.promise({ + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { specialEasing: {} }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + // if we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length ; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // resolve when we played the last frame + // otherwise, reject + if ( gotoEnd ) { + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + }), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length ; index++ ) { + result = animationPrefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( jQuery.isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + }) + ); + + // attach callbacks from options + return animation.progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); +} + +jQuery.Animation = jQuery.extend( Animation, { + tweener: function( props, callback ) { + if ( jQuery.isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.split(" "); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length ; index++ ) { + prop = props[ index ]; + tweeners[ prop ] = tweeners[ prop ] || []; + tweeners[ prop ].unshift( callback ); + } + }, + + prefilter: function( callback, prepend ) { + if ( prepend ) { + animationPrefilters.unshift( callback ); + } else { + animationPrefilters.push( callback ); + } + } +}); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + jQuery.isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing + }; + + opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration : + opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default; + + // normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( jQuery.isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend({ + fadeTo: function( speed, to, easing, callback ) { + + // show any hidden elements after setting opacity to 0 + return this.filter( isHidden ).css( "opacity", 0 ).show() + + // animate to the value specified + .end().animate({ opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || jQuery._data( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue && type !== false ) { + this.queue( type || "fx", [] ); + } + + return this.each(function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = jQuery._data( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) { + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // start the next in the queue if the last step wasn't forced + // timers currently will call their complete callbacks, which will dequeue + // but only if they were gotoEnd + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + }); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each(function() { + var index, + data = jQuery._data( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // enable finishing flag on private data + data.finish = true; + + // empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // turn off finishing flag + delete data.finish; + }); + } +}); + +jQuery.each([ "toggle", "show", "hide" ], function( i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +}); + +// Generate shortcuts for custom animations +jQuery.each({ + slideDown: genFx("show"), + slideUp: genFx("hide"), + slideToggle: genFx("toggle"), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +}); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + timers = jQuery.timers, + i = 0; + + fxNow = jQuery.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + // Checks the timer has not already been removed + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + if ( timer() ) { + jQuery.fx.start(); + } else { + jQuery.timers.pop(); + } +}; + +jQuery.fx.interval = 13; + +jQuery.fx.start = function() { + if ( !timerId ) { + timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval ); + } +}; + +jQuery.fx.stop = function() { + clearInterval( timerId ); + timerId = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = setTimeout( next, time ); + hooks.stop = function() { + clearTimeout( timeout ); + }; + }); +}; + + +(function() { + var a, input, select, opt, + div = document.createElement("div" ); + + // Setup + div.setAttribute( "className", "t" ); + div.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>"; + a = div.getElementsByTagName("a")[ 0 ]; + + // First batch of tests. + select = document.createElement("select"); + opt = select.appendChild( document.createElement("option") ); + input = div.getElementsByTagName("input")[ 0 ]; + + a.style.cssText = "top:1px"; + + // Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7) + support.getSetAttribute = div.className !== "t"; + + // Get the style information from getAttribute + // (IE uses .cssText instead) + support.style = /top/.test( a.getAttribute("style") ); + + // Make sure that URLs aren't manipulated + // (IE normalizes it by default) + support.hrefNormalized = a.getAttribute("href") === "/a"; + + // Check the default checkbox/radio value ("" on WebKit; "on" elsewhere) + support.checkOn = !!input.value; + + // Make sure that a selected-by-default option has a working selected property. + // (WebKit defaults to false instead of true, IE too, if it's in an optgroup) + support.optSelected = opt.selected; + + // Tests for enctype support on a form (#6743) + support.enctype = !!document.createElement("form").enctype; + + // Make sure that the options inside disabled selects aren't marked as disabled + // (WebKit marks them as disabled) + select.disabled = true; + support.optDisabled = !opt.disabled; + + // Support: IE8 only + // Check if we can trust getAttribute("value") + input = document.createElement( "input" ); + input.setAttribute( "value", "" ); + support.input = input.getAttribute( "value" ) === ""; + + // Check if an input maintains its value after becoming a radio + input.value = "t"; + input.setAttribute( "type", "radio" ); + support.radioValue = input.value === "t"; + + // Null elements to avoid leaks in IE. + a = input = select = opt = div = null; +})(); + + +var rreturn = /\r/g; + +jQuery.fn.extend({ + val: function( value ) { + var hooks, ret, isFunction, + elem = this[0]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) { + return ret; + } + + ret = elem.value; + + return typeof ret === "string" ? + // handle most common string cases + ret.replace(rreturn, "") : + // handle cases where value is null/undef or number + ret == null ? "" : ret; + } + + return; + } + + isFunction = jQuery.isFunction( value ); + + return this.each(function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( isFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + } else if ( typeof val === "number" ) { + val += ""; + } else if ( jQuery.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + }); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + }); + } +}); + +jQuery.extend({ + valHooks: { + option: { + get: function( elem ) { + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + jQuery.text( elem ); + } + }, + select: { + get: function( elem ) { + var value, option, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one" || index < 0, + values = one ? null : [], + max = one ? index + 1 : options.length, + i = index < 0 ? + max : + one ? index : 0; + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // oldIE doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + // Don't return options that are disabled or in a disabled optgroup + ( support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) && + ( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + if ( jQuery.inArray( jQuery.valHooks.option.get( option ), values ) >= 0 ) { + + // Support: IE6 + // When new option element is added to select box we need to + // force reflow of newly added node in order to workaround delay + // of initialization properties + try { + option.selected = optionSet = true; + + } catch ( _ ) { + + // Will be executed only in IE6 + option.scrollHeight; + } + + } else { + option.selected = false; + } + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + + return options; + } + } + } +}); + +// Radios and checkboxes getter/setter +jQuery.each([ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( jQuery.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + // Support: Webkit + // "" is returned instead of "on" if a value isn't specified + return elem.getAttribute("value") === null ? "on" : elem.value; + }; + } +}); + + + + +var nodeHook, boolHook, + attrHandle = jQuery.expr.attrHandle, + ruseDefault = /^(?:checked|selected)$/i, + getSetAttribute = support.getSetAttribute, + getSetInput = support.input; + +jQuery.fn.extend({ + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each(function() { + jQuery.removeAttr( this, name ); + }); + } +}); + +jQuery.extend({ + attr: function( elem, name, value ) { + var hooks, ret, + nType = elem.nodeType; + + // don't get/set attributes on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === strundefined ) { + return jQuery.prop( elem, name, value ); + } + + // All attributes are lowercase + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + name = name.toLowerCase(); + hooks = jQuery.attrHooks[ name ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : nodeHook ); + } + + if ( value !== undefined ) { + + if ( value === null ) { + jQuery.removeAttr( elem, name ); + + } else if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) { + return ret; + + } else { + elem.setAttribute( name, value + "" ); + return value; + } + + } else if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) { + return ret; + + } else { + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? + undefined : + ret; + } + }, + + removeAttr: function( elem, value ) { + var name, propName, + i = 0, + attrNames = value && value.match( rnotwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( (name = attrNames[i++]) ) { + propName = jQuery.propFix[ name ] || name; + + // Boolean attributes get special treatment (#10870) + if ( jQuery.expr.match.bool.test( name ) ) { + // Set corresponding property to false + if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + elem[ propName ] = false; + // Support: IE<9 + // Also clear defaultChecked/defaultSelected (if appropriate) + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = + elem[ propName ] = false; + } + + // See #9699 for explanation of this approach (setting first, then removal) + } else { + jQuery.attr( elem, name, "" ); + } + + elem.removeAttribute( getSetAttribute ? name : propName ); + } + } + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) { + // Setting the type on a radio button after the value resets the value in IE6-9 + // Reset value to default in case type is set after value during creation + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + } +}); + +// Hook for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else if ( getSetInput && getSetAttribute || !ruseDefault.test( name ) ) { + // IE<8 needs the *property* name + elem.setAttribute( !getSetAttribute && jQuery.propFix[ name ] || name, name ); + + // Use defaultChecked and defaultSelected for oldIE + } else { + elem[ jQuery.camelCase( "default-" + name ) ] = elem[ name ] = true; + } + + return name; + } +}; + +// Retrieve booleans specially +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( i, name ) { + + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = getSetInput && getSetAttribute || !ruseDefault.test( name ) ? + function( elem, name, isXML ) { + var ret, handle; + if ( !isXML ) { + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ name ]; + attrHandle[ name ] = ret; + ret = getter( elem, name, isXML ) != null ? + name.toLowerCase() : + null; + attrHandle[ name ] = handle; + } + return ret; + } : + function( elem, name, isXML ) { + if ( !isXML ) { + return elem[ jQuery.camelCase( "default-" + name ) ] ? + name.toLowerCase() : + null; + } + }; +}); + +// fix oldIE attroperties +if ( !getSetInput || !getSetAttribute ) { + jQuery.attrHooks.value = { + set: function( elem, value, name ) { + if ( jQuery.nodeName( elem, "input" ) ) { + // Does not return so that setAttribute is also used + elem.defaultValue = value; + } else { + // Use nodeHook if defined (#1954); otherwise setAttribute is fine + return nodeHook && nodeHook.set( elem, value, name ); + } + } + }; +} + +// IE6/7 do not support getting/setting some attributes with get/setAttribute +if ( !getSetAttribute ) { + + // Use this for any attribute in IE6/7 + // This fixes almost every IE6/7 issue + nodeHook = { + set: function( elem, value, name ) { + // Set the existing or create a new attribute node + var ret = elem.getAttributeNode( name ); + if ( !ret ) { + elem.setAttributeNode( + (ret = elem.ownerDocument.createAttribute( name )) + ); + } + + ret.value = value += ""; + + // Break association with cloned elements by also using setAttribute (#9646) + if ( name === "value" || value === elem.getAttribute( name ) ) { + return value; + } + } + }; + + // Some attributes are constructed with empty-string values when not defined + attrHandle.id = attrHandle.name = attrHandle.coords = + function( elem, name, isXML ) { + var ret; + if ( !isXML ) { + return (ret = elem.getAttributeNode( name )) && ret.value !== "" ? + ret.value : + null; + } + }; + + // Fixing value retrieval on a button requires this module + jQuery.valHooks.button = { + get: function( elem, name ) { + var ret = elem.getAttributeNode( name ); + if ( ret && ret.specified ) { + return ret.value; + } + }, + set: nodeHook.set + }; + + // Set contenteditable to false on removals(#10429) + // Setting to empty string throws an error as an invalid value + jQuery.attrHooks.contenteditable = { + set: function( elem, value, name ) { + nodeHook.set( elem, value === "" ? false : value, name ); + } + }; + + // Set width and height to auto instead of 0 on empty string( Bug #8150 ) + // This is for removals + jQuery.each([ "width", "height" ], function( i, name ) { + jQuery.attrHooks[ name ] = { + set: function( elem, value ) { + if ( value === "" ) { + elem.setAttribute( name, "auto" ); + return value; + } + } + }; + }); +} + +if ( !support.style ) { + jQuery.attrHooks.style = { + get: function( elem ) { + // Return undefined in the case of empty string + // Note: IE uppercases css property names, but if we were to .toLowerCase() + // .cssText, that would destroy case senstitivity in URL's, like in "background" + return elem.style.cssText || undefined; + }, + set: function( elem, value ) { + return ( elem.style.cssText = value + "" ); + } + }; +} + + + + +var rfocusable = /^(?:input|select|textarea|button|object)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend({ + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + name = jQuery.propFix[ name ] || name; + return this.each(function() { + // try/catch handles cases where IE balks (such as removing a property on window) + try { + this[ name ] = undefined; + delete this[ name ]; + } catch( e ) {} + }); + } +}); + +jQuery.extend({ + propFix: { + "for": "htmlFor", + "class": "className" + }, + + prop: function( elem, name, value ) { + var ret, hooks, notxml, + nType = elem.nodeType; + + // don't get/set properties on text, comment and attribute nodes + if ( !elem || nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + notxml = nType !== 1 || !jQuery.isXMLDoc( elem ); + + if ( notxml ) { + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + return hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ? + ret : + ( elem[ name ] = value ); + + } else { + return hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ? + ret : + elem[ name ]; + } + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + // elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set + // http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + return tabindex ? + parseInt( tabindex, 10 ) : + rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ? + 0 : + -1; + } + } + } +}); + +// Some attributes require a special call on IE +// http://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !support.hrefNormalized ) { + // href/src property should get the full normalized URL (#10299/#12915) + jQuery.each([ "href", "src" ], function( i, name ) { + jQuery.propHooks[ name ] = { + get: function( elem ) { + return elem.getAttribute( name, 4 ); + } + }; + }); +} + +// Support: Safari, IE9+ +// mis-reports the default selected property of an option +// Accessing the parent's selectedIndex property fixes it +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + var parent = elem.parentNode; + + if ( parent ) { + parent.selectedIndex; + + // Make sure that it also works with optgroups, see #5701 + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + return null; + } + }; +} + +jQuery.each([ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +}); + +// IE6/7 call enctype encoding +if ( !support.enctype ) { + jQuery.propFix.enctype = "encoding"; +} + + + + +var rclass = /[\t\r\n\f]/g; + +jQuery.fn.extend({ + addClass: function( value ) { + var classes, elem, cur, clazz, j, finalValue, + i = 0, + len = this.length, + proceed = typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).addClass( value.call( this, j, this.className ) ); + }); + } + + if ( proceed ) { + // The disjunction here is for better compressibility (see removeClass) + classes = ( value || "" ).match( rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + " " + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // only assign if different to avoid unneeded rendering. + finalValue = jQuery.trim( cur ); + if ( elem.className !== finalValue ) { + elem.className = finalValue; + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, clazz, j, finalValue, + i = 0, + len = this.length, + proceed = arguments.length === 0 || typeof value === "string" && value; + + if ( jQuery.isFunction( value ) ) { + return this.each(function( j ) { + jQuery( this ).removeClass( value.call( this, j, this.className ) ); + }); + } + if ( proceed ) { + classes = ( value || "" ).match( rnotwhite ) || []; + + for ( ; i < len; i++ ) { + elem = this[ i ]; + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( elem.className ? + ( " " + elem.className + " " ).replace( rclass, " " ) : + "" + ); + + if ( cur ) { + j = 0; + while ( (clazz = classes[j++]) ) { + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) >= 0 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // only assign if different to avoid unneeded rendering. + finalValue = value ? jQuery.trim( cur ) : ""; + if ( elem.className !== finalValue ) { + elem.className = finalValue; + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value; + + if ( typeof stateVal === "boolean" && type === "string" ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( jQuery.isFunction( value ) ) { + return this.each(function( i ) { + jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal ); + }); + } + + return this.each(function() { + if ( type === "string" ) { + // toggle individual class names + var className, + i = 0, + self = jQuery( this ), + classNames = value.match( rnotwhite ) || []; + + while ( (className = classNames[ i++ ]) ) { + // check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( type === strundefined || type === "boolean" ) { + if ( this.className ) { + // store className if set + jQuery._data( this, "__className__", this.className ); + } + + // If the element has a class name or if we're passed "false", + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || ""; + } + }); + }, + + hasClass: function( selector ) { + var className = " " + selector + " ", + i = 0, + l = this.length; + for ( ; i < l; i++ ) { + if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) { + return true; + } + } + + return false; + } +}); + + + + +// Return jQuery for attributes-only inclusion + + +jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " + + "mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " + + "change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) { + + // Handle event binding + jQuery.fn[ name ] = function( data, fn ) { + return arguments.length > 0 ? + this.on( name, null, data, fn ) : + this.trigger( name ); + }; +}); + +jQuery.fn.extend({ + hover: function( fnOver, fnOut ) { + return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver ); + }, + + bind: function( types, data, fn ) { + return this.on( types, null, data, fn ); + }, + unbind: function( types, fn ) { + return this.off( types, null, fn ); + }, + + delegate: function( selector, types, data, fn ) { + return this.on( types, selector, data, fn ); + }, + undelegate: function( selector, types, fn ) { + // ( namespace ) or ( selector, types [, fn] ) + return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn ); + } +}); + + +var nonce = jQuery.now(); + +var rquery = (/\?/); + + + +var rvalidtokens = /(,)|(\[|{)|(}|])|"(?:[^"\\\r\n]|\\["\\\/bfnrt]|\\u[\da-fA-F]{4})*"\s*:?|true|false|null|-?(?!0\d)\d+(?:\.\d+|)(?:[eE][+-]?\d+|)/g; + +jQuery.parseJSON = function( data ) { + // Attempt to parse using the native JSON parser first + if ( window.JSON && window.JSON.parse ) { + // Support: Android 2.3 + // Workaround failure to string-cast null input + return window.JSON.parse( data + "" ); + } + + var requireNonComma, + depth = null, + str = jQuery.trim( data + "" ); + + // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains + // after removing valid tokens + return str && !jQuery.trim( str.replace( rvalidtokens, function( token, comma, open, close ) { + + // Force termination if we see a misplaced comma + if ( requireNonComma && comma ) { + depth = 0; + } + + // Perform no more replacements after returning to outermost depth + if ( depth === 0 ) { + return token; + } + + // Commas must not follow "[", "{", or "," + requireNonComma = open || comma; + + // Determine new depth + // array/object open ("[" or "{"): depth += true - false (increment) + // array/object close ("]" or "}"): depth += false - true (decrement) + // other cases ("," or primitive): depth += true - true (numeric cast) + depth += !close - !open; + + // Remove this token + return ""; + }) ) ? + ( Function( "return " + str ) )() : + jQuery.error( "Invalid JSON: " + data ); +}; + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml, tmp; + if ( !data || typeof data !== "string" ) { + return null; + } + try { + if ( window.DOMParser ) { // Standard + tmp = new DOMParser(); + xml = tmp.parseFromString( data, "text/xml" ); + } else { // IE + xml = new ActiveXObject( "Microsoft.XMLDOM" ); + xml.async = "false"; + xml.loadXML( data ); + } + } catch( e ) { + xml = undefined; + } + if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + // Document location + ajaxLocParts, + ajaxLocation, + + rhash = /#.*$/, + rts = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + rurl = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat("*"); + +// #8138, IE may throw an exception when accessing +// a field from window.location if document.domain has been set +try { + ajaxLocation = location.href; +} catch( e ) { + // Use the href attribute of an A element + // since IE will modify it given document.location + ajaxLocation = document.createElement( "a" ); + ajaxLocation.href = ""; + ajaxLocation = ajaxLocation.href; +} + +// Segment location into parts +ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || []; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnotwhite ) || []; + + if ( jQuery.isFunction( func ) ) { + // For each dataType in the dataTypeExpression + while ( (dataType = dataTypes[i++]) ) { + // Prepend if requested + if ( dataType.charAt( 0 ) === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + (structure[ dataType ] = structure[ dataType ] || []).unshift( func ); + + // Otherwise append + } else { + (structure[ dataType ] = structure[ dataType ] || []).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + }); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var deep, key, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || (deep = {}) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + var firstDataType, ct, finalDataType, type, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader("Content-Type"); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s[ "throws" ] ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend({ + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: ajaxLocation, + type: "GET", + isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /xml/, + html: /html/, + json: /json/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": jQuery.parseJSON, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var // Cross-domain detection vars + parts, + // Loop variable + i, + // URL without anti-cache param + cacheURL, + // Response headers as string + responseHeadersString, + // timeout handle + timeoutTimer, + + // To know if global events are to be dispatched + fireGlobals, + + transport, + // Response headers + responseHeaders, + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + // Callbacks context + callbackContext = s.context || s, + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks("once memory"), + // Status-dependent callbacks + statusCode = s.statusCode || {}, + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + // The jqXHR state + state = 0, + // Default abort message + strAbort = "canceled", + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( state === 2 ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( (match = rheaders.exec( responseHeadersString )) ) { + responseHeaders[ match[1].toLowerCase() ] = match[ 2 ]; + } + } + match = responseHeaders[ key.toLowerCase() ]; + } + return match == null ? null : match; + }, + + // Raw string + getAllResponseHeaders: function() { + return state === 2 ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + var lname = name.toLowerCase(); + if ( !state ) { + name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( !state ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( state < 2 ) { + for ( code in map ) { + // Lazy-add the new callback in a way that preserves old ones + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } else { + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ).complete = completeDeferred.add; + jqXHR.success = jqXHR.done; + jqXHR.error = jqXHR.fail; + + // Remove hash character (#7531: and string promotion) + // Add protocol if not provided (#5866: IE7 issue with protocol-less urls) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || ajaxLocation ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().match( rnotwhite ) || [ "" ]; + + // A cross-domain request is in order when we have a protocol:host:port mismatch + if ( s.crossDomain == null ) { + parts = rurl.exec( s.url.toLowerCase() ); + s.crossDomain = !!( parts && + ( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] || + ( parts[ 3 ] || ( parts[ 1 ] === "http:" ? "80" : "443" ) ) !== + ( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? "80" : "443" ) ) ) + ); + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( state === 2 ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + fireGlobals = s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger("ajaxStart"); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + cacheURL = s.url; + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // If data is available, append data to url + if ( s.data ) { + cacheURL = ( s.url += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data ); + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add anti-cache in url if needed + if ( s.cache === false ) { + s.url = rts.test( cacheURL ) ? + + // If there is already a '_' parameter, set its value + cacheURL.replace( rts, "$1_=" + nonce++ ) : + + // Otherwise add one to the end + cacheURL + ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + nonce++; + } + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ? + s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) { + // Abort if not done already and return + return jqXHR.abort(); + } + + // aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + for ( i in { success: 1, error: 1, complete: 1 } ) { + jqXHR[ i ]( s[ i ] ); + } + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = setTimeout(function() { + jqXHR.abort("timeout"); + }, s.timeout ); + } + + try { + state = 1; + transport.send( requestHeaders, done ); + } catch ( e ) { + // Propagate exception as error if not done + if ( state < 2 ) { + done( -1, e ); + // Simply rethrow otherwise + } else { + throw e; + } + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Called once + if ( state === 2 ) { + return; + } + + // State is "done" now + state = 2; + + // Clear timeout if it exists + if ( timeoutTimer ) { + clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader("Last-Modified"); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader("etag"); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + // We extract error from statusText + // then normalize statusText and status for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger("ajaxStop"); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +}); + +jQuery.each( [ "get", "post" ], function( i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + // shift arguments if data argument was omitted + if ( jQuery.isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + return jQuery.ajax({ + url: url, + type: method, + dataType: type, + data: data, + success: callback + }); + }; +}); + +// Attach a bunch of functions for handling common AJAX events +jQuery.each( [ "ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend" ], function( i, type ) { + jQuery.fn[ type ] = function( fn ) { + return this.on( type, fn ); + }; +}); + + +jQuery._evalUrl = function( url ) { + return jQuery.ajax({ + url: url, + type: "GET", + dataType: "script", + async: false, + global: false, + "throws": true + }); +}; + + +jQuery.fn.extend({ + wrapAll: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapAll( html.call(this, i) ); + }); + } + + if ( this[0] ) { + // The elements to wrap the target around + var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true); + + if ( this[0].parentNode ) { + wrap.insertBefore( this[0] ); + } + + wrap.map(function() { + var elem = this; + + while ( elem.firstChild && elem.firstChild.nodeType === 1 ) { + elem = elem.firstChild; + } + + return elem; + }).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( jQuery.isFunction( html ) ) { + return this.each(function(i) { + jQuery(this).wrapInner( html.call(this, i) ); + }); + } + + return this.each(function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + }); + }, + + wrap: function( html ) { + var isFunction = jQuery.isFunction( html ); + + return this.each(function(i) { + jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html ); + }); + }, + + unwrap: function() { + return this.parent().each(function() { + if ( !jQuery.nodeName( this, "body" ) ) { + jQuery( this ).replaceWith( this.childNodes ); + } + }).end(); + } +}); + + +jQuery.expr.filters.hidden = function( elem ) { + // Support: Opera <= 12.12 + // Opera reports offsetWidths and offsetHeights less than zero on some elements + return elem.offsetWidth <= 0 && elem.offsetHeight <= 0 || + (!support.reliableHiddenOffsets() && + ((elem.style && elem.style.display) || jQuery.css( elem, "display" )) === "none"); +}; + +jQuery.expr.filters.visible = function( elem ) { + return !jQuery.expr.filters.hidden( elem ); +}; + + + + +var r20 = /%20/g, + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( jQuery.isArray( obj ) ) { + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + // Item is non-scalar (array or object), encode its numeric index. + buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add ); + } + }); + + } else if ( !traditional && jQuery.type( obj ) === "object" ) { + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, value ) { + // If value is a function, invoke it and return its value + value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value ); + s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value ); + }; + + // Set traditional to true for jQuery <= 1.3.2 behavior. + if ( traditional === undefined ) { + traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + }); + + } else { + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ).replace( r20, "+" ); +}; + +jQuery.fn.extend({ + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map(function() { + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + }) + .filter(function() { + var type = this.type; + // Use .is(":disabled") so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + }) + .map(function( i, elem ) { + var val = jQuery( this ).val(); + + return val == null ? + null : + jQuery.isArray( val ) ? + jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }) : + { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + }).get(); + } +}); + + +// Create the request object +// (This is still attached to ajaxSettings for backward compatibility) +jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ? + // Support: IE6+ + function() { + + // XHR cannot access local files, always use ActiveX for that case + return !this.isLocal && + + // Support: IE7-8 + // oldIE XHR does not support non-RFC2616 methods (#13240) + // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx + // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9 + // Although this check for six methods instead of eight + // since IE also does not support "trace" and "connect" + /^(get|post|head|put|delete|options)$/i.test( this.type ) && + + createStandardXHR() || createActiveXHR(); + } : + // For all other browsers, use the standard XMLHttpRequest object + createStandardXHR; + +var xhrId = 0, + xhrCallbacks = {}, + xhrSupported = jQuery.ajaxSettings.xhr(); + +// Support: IE<10 +// Open requests must be manually aborted on unload (#5280) +if ( window.ActiveXObject ) { + jQuery( window ).on( "unload", function() { + for ( var key in xhrCallbacks ) { + xhrCallbacks[ key ]( undefined, true ); + } + }); +} + +// Determine support properties +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +xhrSupported = support.ajax = !!xhrSupported; + +// Create transport if the browser can provide an xhr +if ( xhrSupported ) { + + jQuery.ajaxTransport(function( options ) { + // Cross domain only allowed if supported through XMLHttpRequest + if ( !options.crossDomain || support.cors ) { + + var callback; + + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(), + id = ++xhrId; + + // Open the socket + xhr.open( options.type, options.url, options.async, options.username, options.password ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers["X-Requested-With"] ) { + headers["X-Requested-With"] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + // Support: IE<9 + // IE's ActiveXObject throws a 'Type Mismatch' exception when setting + // request header to a null-value. + // + // To keep consistent with other XHR implementations, cast the value + // to string and ignore `undefined`. + if ( headers[ i ] !== undefined ) { + xhr.setRequestHeader( i, headers[ i ] + "" ); + } + } + + // Do send the request + // This may raise an exception which is actually + // handled in jQuery.ajax (so no try/catch here) + xhr.send( ( options.hasContent && options.data ) || null ); + + // Listener + callback = function( _, isAbort ) { + var status, statusText, responses; + + // Was never called and is aborted or complete + if ( callback && ( isAbort || xhr.readyState === 4 ) ) { + // Clean up + delete xhrCallbacks[ id ]; + callback = undefined; + xhr.onreadystatechange = jQuery.noop; + + // Abort manually if needed + if ( isAbort ) { + if ( xhr.readyState !== 4 ) { + xhr.abort(); + } + } else { + responses = {}; + status = xhr.status; + + // Support: IE<10 + // Accessing binary-data responseText throws an exception + // (#11426) + if ( typeof xhr.responseText === "string" ) { + responses.text = xhr.responseText; + } + + // Firefox throws an exception when accessing + // statusText for faulty cross-domain requests + try { + statusText = xhr.statusText; + } catch( e ) { + // We normalize with Webkit giving an empty statusText + statusText = ""; + } + + // Filter status for non standard behaviors + + // If the request is local and we have data: assume a success + // (success with no data won't get notified, that's the best we + // can do given current implementations) + if ( !status && options.isLocal && !options.crossDomain ) { + status = responses.text ? 200 : 404; + // IE - #1450: sometimes returns 1223 when it should be 204 + } else if ( status === 1223 ) { + status = 204; + } + } + } + + // Call complete if needed + if ( responses ) { + complete( status, statusText, responses, xhr.getAllResponseHeaders() ); + } + }; + + if ( !options.async ) { + // if we're in sync mode we fire the callback + callback(); + } else if ( xhr.readyState === 4 ) { + // (IE6 & IE7) if it's in cache and has been + // retrieved directly we need to fire the callback + setTimeout( callback ); + } else { + // Add to the list of active xhr callbacks + xhr.onreadystatechange = xhrCallbacks[ id ] = callback; + } + }, + + abort: function() { + if ( callback ) { + callback( undefined, true ); + } + } + }; + } + }); +} + +// Functions to create xhrs +function createStandardXHR() { + try { + return new window.XMLHttpRequest(); + } catch( e ) {} +} + +function createActiveXHR() { + try { + return new window.ActiveXObject( "Microsoft.XMLHTTP" ); + } catch( e ) {} +} + + + + +// Install script dataType +jQuery.ajaxSetup({ + accepts: { + script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /(?:java|ecma)script/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +}); + +// Handle cache's special case and global +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + s.global = false; + } +}); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function(s) { + + // This transport only deals with cross domain requests + if ( s.crossDomain ) { + + var script, + head = document.head || jQuery("head")[0] || document.documentElement; + + return { + + send: function( _, callback ) { + + script = document.createElement("script"); + + script.async = true; + + if ( s.scriptCharset ) { + script.charset = s.scriptCharset; + } + + script.src = s.url; + + // Attach handlers for all browsers + script.onload = script.onreadystatechange = function( _, isAbort ) { + + if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) { + + // Handle memory leak in IE + script.onload = script.onreadystatechange = null; + + // Remove the script + if ( script.parentNode ) { + script.parentNode.removeChild( script ); + } + + // Dereference the script + script = null; + + // Callback if not abort + if ( !isAbort ) { + callback( 200, "success" ); + } + } + }; + + // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending + // Use native DOM manipulation to avoid our domManip AJAX trickery + head.insertBefore( script, head.firstChild ); + }, + + abort: function() { + if ( script ) { + script.onload( undefined, true ); + } + } + }; + } +}); + + + + +var oldCallbacks = [], + rjsonp = /(=)\?(?=&|$)|\?\?/; + +// Default jsonp settings +jQuery.ajaxSetup({ + jsonp: "callback", + jsonpCallback: function() { + var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) ); + this[ callback ] = true; + return callback; + } +}); + +// Detect, normalize options and install callbacks for jsonp requests +jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) { + + var callbackName, overwritten, responseContainer, + jsonProp = s.jsonp !== false && ( rjsonp.test( s.url ) ? + "url" : + typeof s.data === "string" && !( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") && rjsonp.test( s.data ) && "data" + ); + + // Handle iff the expected data type is "jsonp" or we have a parameter to set + if ( jsonProp || s.dataTypes[ 0 ] === "jsonp" ) { + + // Get callback name, remembering preexisting value associated with it + callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ? + s.jsonpCallback() : + s.jsonpCallback; + + // Insert callback into url or form data + if ( jsonProp ) { + s[ jsonProp ] = s[ jsonProp ].replace( rjsonp, "$1" + callbackName ); + } else if ( s.jsonp !== false ) { + s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName; + } + + // Use data converter to retrieve json after script execution + s.converters["script json"] = function() { + if ( !responseContainer ) { + jQuery.error( callbackName + " was not called" ); + } + return responseContainer[ 0 ]; + }; + + // force json dataType + s.dataTypes[ 0 ] = "json"; + + // Install callback + overwritten = window[ callbackName ]; + window[ callbackName ] = function() { + responseContainer = arguments; + }; + + // Clean-up function (fires after converters) + jqXHR.always(function() { + // Restore preexisting value + window[ callbackName ] = overwritten; + + // Save back as free + if ( s[ callbackName ] ) { + // make sure that re-using the options doesn't screw things around + s.jsonpCallback = originalSettings.jsonpCallback; + + // save the callback name for future use + oldCallbacks.push( callbackName ); + } + + // Call if it was a function and we have a response + if ( responseContainer && jQuery.isFunction( overwritten ) ) { + overwritten( responseContainer[ 0 ] ); + } + + responseContainer = overwritten = undefined; + }); + + // Delegate to script + return "script"; + } +}); + + + + +// data: string of html +// context (optional): If specified, the fragment will be created in this context, defaults to document +// keepScripts (optional): If true, will include scripts passed in the html string +jQuery.parseHTML = function( data, context, keepScripts ) { + if ( !data || typeof data !== "string" ) { + return null; + } + if ( typeof context === "boolean" ) { + keepScripts = context; + context = false; + } + context = context || document; + + var parsed = rsingleTag.exec( data ), + scripts = !keepScripts && []; + + // Single tag + if ( parsed ) { + return [ context.createElement( parsed[1] ) ]; + } + + parsed = jQuery.buildFragment( [ data ], context, scripts ); + + if ( scripts && scripts.length ) { + jQuery( scripts ).remove(); + } + + return jQuery.merge( [], parsed.childNodes ); +}; + + +// Keep a copy of the old load method +var _load = jQuery.fn.load; + +/** + * Load a url into a page + */ +jQuery.fn.load = function( url, params, callback ) { + if ( typeof url !== "string" && _load ) { + return _load.apply( this, arguments ); + } + + var selector, response, type, + self = this, + off = url.indexOf(" "); + + if ( off >= 0 ) { + selector = url.slice( off, url.length ); + url = url.slice( 0, off ); + } + + // If it's a function + if ( jQuery.isFunction( params ) ) { + + // We assume that it's the callback + callback = params; + params = undefined; + + // Otherwise, build a param string + } else if ( params && typeof params === "object" ) { + type = "POST"; + } + + // If we have elements to modify, make the request + if ( self.length > 0 ) { + jQuery.ajax({ + url: url, + + // if "type" variable is undefined, then "GET" method will be used + type: type, + dataType: "html", + data: params + }).done(function( responseText ) { + + // Save response for use in complete callback + response = arguments; + + self.html( selector ? + + // If a selector was specified, locate the right elements in a dummy div + // Exclude scripts to avoid IE 'Permission Denied' errors + jQuery("<div>").append( jQuery.parseHTML( responseText ) ).find( selector ) : + + // Otherwise use the full result + responseText ); + + }).complete( callback && function( jqXHR, status ) { + self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] ); + }); + } + + return this; +}; + + + + +jQuery.expr.filters.animated = function( elem ) { + return jQuery.grep(jQuery.timers, function( fn ) { + return elem === fn.elem; + }).length; +}; + + + + + +var docElem = window.document.documentElement; + +/** + * Gets a window from an element + */ +function getWindow( elem ) { + return jQuery.isWindow( elem ) ? + elem : + elem.nodeType === 9 ? + elem.defaultView || elem.parentWindow : + false; +} + +jQuery.offset = { + setOffset: function( elem, options, i ) { + var curPosition, curLeft, curCSSTop, curTop, curOffset, curCSSLeft, calculatePosition, + position = jQuery.css( elem, "position" ), + curElem = jQuery( elem ), + props = {}; + + // set position first, in-case top/left are set even on static elem + if ( position === "static" ) { + elem.style.position = "relative"; + } + + curOffset = curElem.offset(); + curCSSTop = jQuery.css( elem, "top" ); + curCSSLeft = jQuery.css( elem, "left" ); + calculatePosition = ( position === "absolute" || position === "fixed" ) && + jQuery.inArray("auto", [ curCSSTop, curCSSLeft ] ) > -1; + + // need to be able to calculate position if either top or left is auto and position is either absolute or fixed + if ( calculatePosition ) { + curPosition = curElem.position(); + curTop = curPosition.top; + curLeft = curPosition.left; + } else { + curTop = parseFloat( curCSSTop ) || 0; + curLeft = parseFloat( curCSSLeft ) || 0; + } + + if ( jQuery.isFunction( options ) ) { + options = options.call( elem, i, curOffset ); + } + + if ( options.top != null ) { + props.top = ( options.top - curOffset.top ) + curTop; + } + if ( options.left != null ) { + props.left = ( options.left - curOffset.left ) + curLeft; + } + + if ( "using" in options ) { + options.using.call( elem, props ); + } else { + curElem.css( props ); + } + } +}; + +jQuery.fn.extend({ + offset: function( options ) { + if ( arguments.length ) { + return options === undefined ? + this : + this.each(function( i ) { + jQuery.offset.setOffset( this, options, i ); + }); + } + + var docElem, win, + box = { top: 0, left: 0 }, + elem = this[ 0 ], + doc = elem && elem.ownerDocument; + + if ( !doc ) { + return; + } + + docElem = doc.documentElement; + + // Make sure it's not a disconnected DOM node + if ( !jQuery.contains( docElem, elem ) ) { + return box; + } + + // If we don't have gBCR, just use 0,0 rather than error + // BlackBerry 5, iOS 3 (original iPhone) + if ( typeof elem.getBoundingClientRect !== strundefined ) { + box = elem.getBoundingClientRect(); + } + win = getWindow( doc ); + return { + top: box.top + ( win.pageYOffset || docElem.scrollTop ) - ( docElem.clientTop || 0 ), + left: box.left + ( win.pageXOffset || docElem.scrollLeft ) - ( docElem.clientLeft || 0 ) + }; + }, + + position: function() { + if ( !this[ 0 ] ) { + return; + } + + var offsetParent, offset, + parentOffset = { top: 0, left: 0 }, + elem = this[ 0 ]; + + // fixed elements are offset from window (parentOffset = {top:0, left: 0}, because it is its only offset parent + if ( jQuery.css( elem, "position" ) === "fixed" ) { + // we assume that getBoundingClientRect is available when computed position is fixed + offset = elem.getBoundingClientRect(); + } else { + // Get *real* offsetParent + offsetParent = this.offsetParent(); + + // Get correct offsets + offset = this.offset(); + if ( !jQuery.nodeName( offsetParent[ 0 ], "html" ) ) { + parentOffset = offsetParent.offset(); + } + + // Add offsetParent borders + parentOffset.top += jQuery.css( offsetParent[ 0 ], "borderTopWidth", true ); + parentOffset.left += jQuery.css( offsetParent[ 0 ], "borderLeftWidth", true ); + } + + // Subtract parent offsets and element margins + // note: when an element has margin: auto the offsetLeft and marginLeft + // are the same in Safari causing offset.left to incorrectly be 0 + return { + top: offset.top - parentOffset.top - jQuery.css( elem, "marginTop", true ), + left: offset.left - parentOffset.left - jQuery.css( elem, "marginLeft", true) + }; + }, + + offsetParent: function() { + return this.map(function() { + var offsetParent = this.offsetParent || docElem; + + while ( offsetParent && ( !jQuery.nodeName( offsetParent, "html" ) && jQuery.css( offsetParent, "position" ) === "static" ) ) { + offsetParent = offsetParent.offsetParent; + } + return offsetParent || docElem; + }); + } +}); + +// Create scrollLeft and scrollTop methods +jQuery.each( { scrollLeft: "pageXOffset", scrollTop: "pageYOffset" }, function( method, prop ) { + var top = /Y/.test( prop ); + + jQuery.fn[ method ] = function( val ) { + return access( this, function( elem, method, val ) { + var win = getWindow( elem ); + + if ( val === undefined ) { + return win ? (prop in win) ? win[ prop ] : + win.document.documentElement[ method ] : + elem[ method ]; + } + + if ( win ) { + win.scrollTo( + !top ? val : jQuery( win ).scrollLeft(), + top ? val : jQuery( win ).scrollTop() + ); + + } else { + elem[ method ] = val; + } + }, method, val, arguments.length, null ); + }; +}); + +// Add the top/left cssHooks using jQuery.fn.position +// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084 +// getComputedStyle returns percent when specified for top/left/bottom/right +// rather than make the css module depend on the offset module, we just check for it here +jQuery.each( [ "top", "left" ], function( i, prop ) { + jQuery.cssHooks[ prop ] = addGetHookIf( support.pixelPosition, + function( elem, computed ) { + if ( computed ) { + computed = curCSS( elem, prop ); + // if curCSS returns percentage, fallback to offset + return rnumnonpx.test( computed ) ? + jQuery( elem ).position()[ prop ] + "px" : + computed; + } + } + ); +}); + + +// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods +jQuery.each( { Height: "height", Width: "width" }, function( name, type ) { + jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) { + // margin is only for outerHeight, outerWidth + jQuery.fn[ funcName ] = function( margin, value ) { + var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ), + extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" ); + + return access( this, function( elem, type, value ) { + var doc; + + if ( jQuery.isWindow( elem ) ) { + // As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there + // isn't a whole lot we can do. See pull request at this URL for discussion: + // https://github.com/jquery/jquery/pull/764 + return elem.document.documentElement[ "client" + name ]; + } + + // Get document width or height + if ( elem.nodeType === 9 ) { + doc = elem.documentElement; + + // Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest + // unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it. + return Math.max( + elem.body[ "scroll" + name ], doc[ "scroll" + name ], + elem.body[ "offset" + name ], doc[ "offset" + name ], + doc[ "client" + name ] + ); + } + + return value === undefined ? + // Get width or height on the element, requesting but not forcing parseFloat + jQuery.css( elem, type, extra ) : + + // Set width or height on the element + jQuery.style( elem, type, value, extra ); + }, type, chainable ? margin : undefined, chainable, null ); + }; + }); +}); + + +// The number of elements contained in the matched element set +jQuery.fn.size = function() { + return this.length; +}; + +jQuery.fn.andSelf = jQuery.fn.addBack; + + + + +// Register as a named AMD module, since jQuery can be concatenated with other +// files that may use define, but not via a proper concatenation script that +// understands anonymous AMD modules. A named AMD is safest and most robust +// way to register. Lowercase jquery is used because AMD module names are +// derived from file names, and jQuery is normally delivered in a lowercase +// file name. Do this after creating the global so that if an AMD module wants +// to call noConflict to hide this version of jQuery, it will work. +if ( typeof define === "function" && define.amd ) { + define( "jquery", [], function() { + return jQuery; + }); +} + + + + +var + // Map over jQuery in case of overwrite + _jQuery = window.jQuery, + + // Map over the $ in case of overwrite + _$ = window.$; + +jQuery.noConflict = function( deep ) { + if ( window.$ === jQuery ) { + window.$ = _$; + } + + if ( deep && window.jQuery === jQuery ) { + window.jQuery = _jQuery; + } + + return jQuery; +}; + +// Expose jQuery and $ identifiers, even in +// AMD (#7102#comment:10, https://github.com/jquery/jquery/pull/557) +// and CommonJS for browser emulators (#13566) +if ( typeof noGlobal === strundefined ) { + window.jQuery = window.$ = jQuery; +} + + + + +return jQuery; + +})); diff --git a/scripts/automerge7.sh b/scripts/automerge7.sh deleted file mode 100755 index abc577f6b9..0000000000 --- a/scripts/automerge7.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash - -IGNORE=7.0 -FROM=7.2 -TO=master - -IGNORE_HEAD=origin/$IGNORE -FROM_HEAD=origin/$FROM -PUSH="origin HEAD:refs/for/$TO" -EMAIL_AUTHOR= -if [ "$1" = "email" ] -then - EMAIL_AUTHOR=1 -fi - -show() { - sCommit=$1 - if [ "$sCommit" == "" ] - then - echo "show() missing commit id" - exit 1 - fi - git show -s $sCommit -} -merge() { - mCommit=$1 - if [ "$mCommit" == "" ] - then - echo "merge() missing commit id" - exit 2 - fi - -# echo "merge($mCommit)" - - git merge -m "Should be overwritten by merge script" $mCommit $2 - if [ "$?" != "0" ] - then - echo "Merge failed for commit $mCommit" - echo "Manual merge is needed" - exit 3 - fi - # Add a change id using git hook - git commit --amend --no-edit - -} - -pushMerged() { -# echo "pushMerged()" - git push $PUSH - if [ "$?" != "0" ] - then - echo "Push failed!" - exit 4 - fi -} - -maybe_commit_and_push() { -# echo "maybe_commit_and_push()" - cpCommit=$1 - if [ "$cpCommit" == "" ] - then - # Nothing to merge currently - return - fi - cpCommitMsg=$2 - if [ "$cpCommitMsg" == "" ] - then - echo "Internal error, no commit message passed to maybe_commit_and_push()" - exit 5 - fi -# echo "maybe_commit_and_push: Merging $cpCommit" - merge $cpCommit - echo -e "Merge changes from $FROM_HEAD\n\n$cpCommitMsg"|git commit --amend -F - - pushMerged -} - -can_merge() { - commit=$1 - git merge --no-commit --no-ff $commit > /dev/null 2>&1 - result=$? - git reset --hard HEAD > /dev/null 2>&1 - return $result -} - -nothingToCommit=`git status | grep "nothing to commit"` -if [ "$nothingToCommit" == "" ] -then - git status - echo "Can not merge when there are unstaged changes." - exit 6 -fi - -git checkout $TO -git fetch - -pending=`git log $TO..$FROM_HEAD ^$IGNORE_HEAD --reverse|grep "^commit "|sed "s/commit //"` - -pendingCommit= -pendingCommitMessage= -for commit in $pending -do - echo "Checking $commit..." - mergeDirective=`git log -n 1 --format=%B $commit|grep "^Merge:"|sed "s/Merge: //"` - commitMsg=`git log -n 1 --format=oneline --abbrev-commit $commit | sed 's/\\\\/\\\\\\\\/g'` #Multiple levels of unescaping, sed just changes \ to \\ - if [ "$mergeDirective" == "" ] - then - if can_merge $commit - then - pendingCommit=$commit - pendingCommitMessage=$pendingCommitMessage"$commitMsg\n" - echo pendingCommitMessage: $pendingCommitMessage - else - maybe_commit_and_push $pendingCommit "$pendingCommitMessage" - pendingCommit= - pendingCommitMessage= - echo - echo "Stopping merge at $commit because of merge conflicts" - echo "The following commit must be manually merged." - show $commit - - if [ "$EMAIL_AUTHOR" = "1" ] - then - author=`git show --format=%aE -s $commit` - echo "Email sent to $author" - (show $commit ; echo ; git merge $commit) |mail -s "Merge of your commit $commit to $TO failed" $author - fi - exit 7 - fi - elif [ "$mergeDirective" == "no" ] - then - maybe_commit_and_push $pendingCommit "$pendingCommitMessage" - pendingCommit= - pendingCommitMessage= - echo - echo "Doing a no-op merge because of Merge: no for $commit" - git log -n 1 --format=%B $commit - echo - # Do a no-op merge - git merge $commit -s ours - echo -e "No-op merge from $FROM_HEAD\n\n$commitMsg"|git commit --amend -F - - pushMerged - elif [ "$mergeDirective" == "manual" ] - then - maybe_commit_and_push $pendingCommit "$pendingCommitMessage" - pendingCommit= - pendingCommitMessage= - echo - echo "Stopping merge at $commit (merge: manual)" - echo "The following commit must be manually merged." - show $commit - exit 8 - else - maybe_commit_and_push $pendingCommit "$pendingCommitMessage" - pendingCommit= - pendingCommitMessage= - echo - echo "Commit $commit contains an unknown merge directive, Merge: $mergeDirective" - echo "Stopping merge." - show $commit - exit 9 - fi -done - -# Push any pending merges -maybe_commit_and_push $pendingCommit "$pendingCommitMessage" diff --git a/scripts/install-local-maven.sh b/scripts/install-local-maven.sh new file mode 100755 index 0000000000..2883258808 --- /dev/null +++ b/scripts/install-local-maven.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +if [ ! -e "vaadin-shared" ] +then + echo "You must run this in the directory containing folders for the various vaadin-* modules." + echo "If you run this in the project directory, go to result/artifacts/<version>/" + echo "If you run this on build artifacts from the build server, run it in the directory where you unzipped the artifacts" + exit 1 +fi + +for base in * +do + if [ ! -d $base ] + then + continue + fi + + pushd $base + version=`ls $base-*.pom|sed "s/$base-//"|sed "s/.pom//"` + pomTemplate="$base-$version.pom" + if [ -e "$pomTemplate" ] + then + id=$base-$version + pomFile=$pomTemplate-modified + file=$id.jar + javadocFile=$id-javadoc.jar + sourcesFile=$id-sources.jar + + # Install using real version for easy testing + cat $pomTemplate|sed "s/<version>7.*-SNAPSHOT</<version>$version</g" > $pomFile + + echo "Installing $base $version..." + if [ -e "$javadocFile" ] + then + mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file -DpomFile=$pomFile -Djavadoc=$javadocFile -Dsources=$sourcesFile -Dfile=$file + else + mvn org.apache.maven.plugins:maven-install-plugin:2.5.1:install-file -DpomFile=$pomFile -Dfile=$file + fi + fi + popd +done
\ No newline at end of file diff --git a/server/src/com/vaadin/annotations/AutoGenerated.java b/server/src/com/vaadin/annotations/AutoGenerated.java index 22435da1d4..1ad9f67ad1 100644 --- a/server/src/com/vaadin/annotations/AutoGenerated.java +++ b/server/src/com/vaadin/annotations/AutoGenerated.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/JavaScript.java b/server/src/com/vaadin/annotations/JavaScript.java index 3e9c46083d..445ef75ddf 100644 --- a/server/src/com/vaadin/annotations/JavaScript.java +++ b/server/src/com/vaadin/annotations/JavaScript.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/PreserveOnRefresh.java b/server/src/com/vaadin/annotations/PreserveOnRefresh.java index 801c1e78f2..7f4ef3ffe5 100644 --- a/server/src/com/vaadin/annotations/PreserveOnRefresh.java +++ b/server/src/com/vaadin/annotations/PreserveOnRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -32,7 +32,7 @@ import com.vaadin.ui.UI; * current UI instance when a reload is detected. * <p> * Whenever a request is received that reloads a preserved UI, the UI's - * {@link UI#reinit(com.vaadin.server.VaadinRequest) reinit} method is invoked + * {@link UI#refresh(com.vaadin.server.VaadinRequest) refresh} method is invoked * by the framework. * <p> * By using diff --git a/server/src/com/vaadin/annotations/Push.java b/server/src/com/vaadin/annotations/Push.java index 9965d535ba..b6a28c1560 100644 --- a/server/src/com/vaadin/annotations/Push.java +++ b/server/src/com/vaadin/annotations/Push.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/StyleSheet.java b/server/src/com/vaadin/annotations/StyleSheet.java index bc5b011873..191e39ee24 100644 --- a/server/src/com/vaadin/annotations/StyleSheet.java +++ b/server/src/com/vaadin/annotations/StyleSheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/Theme.java b/server/src/com/vaadin/annotations/Theme.java index 12fa4bf409..61c47389ad 100644 --- a/server/src/com/vaadin/annotations/Theme.java +++ b/server/src/com/vaadin/annotations/Theme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/Title.java b/server/src/com/vaadin/annotations/Title.java index 2a22f92747..38a3d75f17 100644 --- a/server/src/com/vaadin/annotations/Title.java +++ b/server/src/com/vaadin/annotations/Title.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/VaadinServletConfiguration.java b/server/src/com/vaadin/annotations/VaadinServletConfiguration.java index e65869c27a..00af38ecc1 100644 --- a/server/src/com/vaadin/annotations/VaadinServletConfiguration.java +++ b/server/src/com/vaadin/annotations/VaadinServletConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/annotations/Widgetset.java b/server/src/com/vaadin/annotations/Widgetset.java index 006bf59acf..c6ef6a7194 100644 --- a/server/src/com/vaadin/annotations/Widgetset.java +++ b/server/src/com/vaadin/annotations/Widgetset.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Buffered.java b/server/src/com/vaadin/data/Buffered.java index c4c79ae13f..469f9987a4 100644 --- a/server/src/com/vaadin/data/Buffered.java +++ b/server/src/com/vaadin/data/Buffered.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/BufferedValidatable.java b/server/src/com/vaadin/data/BufferedValidatable.java index d57bbc6008..6f9d952d2f 100644 --- a/server/src/com/vaadin/data/BufferedValidatable.java +++ b/server/src/com/vaadin/data/BufferedValidatable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Collapsible.java b/server/src/com/vaadin/data/Collapsible.java index 04f5e8259c..0ef290312d 100644 --- a/server/src/com/vaadin/data/Collapsible.java +++ b/server/src/com/vaadin/data/Collapsible.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Container.java b/server/src/com/vaadin/data/Container.java index 1e053d1091..8e99bac541 100644 --- a/server/src/com/vaadin/data/Container.java +++ b/server/src/com/vaadin/data/Container.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -582,60 +582,6 @@ public interface Container extends Serializable { public Item addItemAt(int index, Object newItemId) throws UnsupportedOperationException; - /** - * An <code>Event</code> object specifying information about the added - * items. - */ - public interface ItemAddEvent extends ItemSetChangeEvent { - - /** - * Gets the item id of the first added item. - * - * @return item id of the first added item - */ - public Object getFirstItemId(); - - /** - * Gets the index of the first added item. - * - * @return index of the first added item - */ - public int getFirstIndex(); - - /** - * Gets the number of the added items. - * - * @return the number of added items. - */ - public int getAddedItemsCount(); - } - - /** - * An <code>Event</code> object specifying information about the removed - * items. - */ - public interface ItemRemoveEvent extends ItemSetChangeEvent { - /** - * Gets the item id of the first removed item. - * - * @return item id of the first removed item - */ - public Object getFirstItemId(); - - /** - * Gets the index of the first removed item. - * - * @return index of the first removed item - */ - public int getFirstIndex(); - - /** - * Gets the number of the removed items. - * - * @return the number of removed items - */ - public int getRemovedItemsCount(); - } } /** diff --git a/server/src/com/vaadin/data/ContainerHelpers.java b/server/src/com/vaadin/data/ContainerHelpers.java index f794656c83..817bec9474 100644 --- a/server/src/com/vaadin/data/ContainerHelpers.java +++ b/server/src/com/vaadin/data/ContainerHelpers.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Item.java b/server/src/com/vaadin/data/Item.java index 8704810803..13f965f098 100644 --- a/server/src/com/vaadin/data/Item.java +++ b/server/src/com/vaadin/data/Item.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Property.java b/server/src/com/vaadin/data/Property.java index 0aa6de1c2e..74ae1f86ec 100644 --- a/server/src/com/vaadin/data/Property.java +++ b/server/src/com/vaadin/data/Property.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Validatable.java b/server/src/com/vaadin/data/Validatable.java index b933f5c6e9..1ae7cd8cee 100644 --- a/server/src/com/vaadin/data/Validatable.java +++ b/server/src/com/vaadin/data/Validatable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/Validator.java b/server/src/com/vaadin/data/Validator.java index 4f3fbe2cc3..d567267338 100644 --- a/server/src/com/vaadin/data/Validator.java +++ b/server/src/com/vaadin/data/Validator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java index 6616f9f24e..e5d53b759d 100644 --- a/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/BeanFieldGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/fieldgroup/Caption.java b/server/src/com/vaadin/data/fieldgroup/Caption.java index e05ae15e28..efe6f99d9a 100644 --- a/server/src/com/vaadin/data/fieldgroup/Caption.java +++ b/server/src/com/vaadin/data/fieldgroup/Caption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java b/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java index c1e4b4933e..b1bf58199a 100644 --- a/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java +++ b/server/src/com/vaadin/data/fieldgroup/DefaultFieldGroupFieldFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java index 7edcc9719c..e647bdbf6d 100644 --- a/server/src/com/vaadin/data/fieldgroup/FieldGroup.java +++ b/server/src/com/vaadin/data/fieldgroup/FieldGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -312,12 +312,18 @@ public class FieldGroup implements Serializable { "The given field is not part of this FieldBinder"); } + TransactionalPropertyWrapper<?> wrapper = null; Property fieldDataSource = field.getPropertyDataSource(); if (fieldDataSource instanceof TransactionalPropertyWrapper) { - fieldDataSource = ((TransactionalPropertyWrapper) fieldDataSource) + wrapper = (TransactionalPropertyWrapper<?>) fieldDataSource; + fieldDataSource = ((TransactionalPropertyWrapper<?>) fieldDataSource) .getWrappedProperty(); + } if (fieldDataSource == getItemProperty(propertyId)) { + if (null != wrapper) { + wrapper.detachFromProperty(); + } field.setPropertyDataSource(null); } fieldToPropertyId.remove(field); diff --git a/server/src/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java b/server/src/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java index 222e979bce..4aad08ba8d 100644 --- a/server/src/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java +++ b/server/src/com/vaadin/data/fieldgroup/FieldGroupFieldFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/fieldgroup/PropertyId.java b/server/src/com/vaadin/data/fieldgroup/PropertyId.java index 575a5b7720..c38af0e89b 100644 --- a/server/src/com/vaadin/data/fieldgroup/PropertyId.java +++ b/server/src/com/vaadin/data/fieldgroup/PropertyId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/AbstractBeanContainer.java b/server/src/com/vaadin/data/util/AbstractBeanContainer.java index d94588bdc9..adf6313770 100644 --- a/server/src/com/vaadin/data/util/AbstractBeanContainer.java +++ b/server/src/com/vaadin/data/util/AbstractBeanContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -222,7 +222,6 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends @Override public boolean removeAllItems() { int origSize = size(); - IDTYPE firstItem = getFirstVisibleItem(); internalRemoveAllItems(); @@ -235,7 +234,7 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends // fire event only if the visible view changed, regardless of whether // filtered out items were removed or not if (origSize != 0) { - fireItemsRemoved(0, firstItem, origSize); + fireItemSetChange(); } return true; @@ -680,8 +679,6 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends protected void addAll(Collection<? extends BEANTYPE> collection) throws IllegalStateException, IllegalArgumentException { boolean modified = false; - int origSize = size(); - for (BEANTYPE bean : collection) { // TODO skipping invalid beans - should not allow them in javadoc? if (bean == null @@ -702,22 +699,13 @@ public abstract class AbstractBeanContainer<IDTYPE, BEANTYPE> extends if (modified) { // Filter the contents when all items have been added if (isFiltered()) { - doFilterContainer(!getFilters().isEmpty()); - } - if (visibleNewItemsWasAdded(origSize)) { - // fire event about added items - int firstPosition = origSize; - IDTYPE firstItemId = getVisibleItemIds().get(firstPosition); - int affectedItems = size() - origSize; - fireItemsAdded(firstPosition, firstItemId, affectedItems); + filterAll(); + } else { + fireItemSetChange(); } } } - private boolean visibleNewItemsWasAdded(int origSize) { - return size() > origSize; - } - /** * Use the bean resolver to get the identifier for a bean. * diff --git a/server/src/com/vaadin/data/util/AbstractContainer.java b/server/src/com/vaadin/data/util/AbstractContainer.java index 4724f8e8b8..dafdd15b06 100644 --- a/server/src/com/vaadin/data/util/AbstractContainer.java +++ b/server/src/com/vaadin/data/util/AbstractContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java b/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java index cae9f30fc9..b19cddb021 100644 --- a/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java +++ b/server/src/com/vaadin/data/util/AbstractInMemoryContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,10 +15,8 @@ */ package com.vaadin.data.util; -import java.io.Serializable; import java.util.Collection; import java.util.Collections; -import java.util.EventObject; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedList; @@ -148,83 +146,6 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE } } - private static abstract class BaseItemAddOrRemoveEvent extends EventObject - implements Serializable { - protected Object itemId; - protected int index; - protected int count; - - public BaseItemAddOrRemoveEvent(Container source, Object itemId, - int index, int count) { - super(source); - this.itemId = itemId; - this.index = index; - this.count = count; - } - - public Container getContainer() { - return (Container) getSource(); - } - - public Object getFirstItemId() { - return itemId; - } - - public int getFirstIndex() { - return index; - } - - public int getAffectedItemsCount() { - return count; - } - } - - /** - * An <code>Event</code> object specifying information about the added - * items. - * - * <p> - * This class provides information about the first added item and the number - * of added items. - * </p> - */ - protected static class BaseItemAddEvent extends BaseItemAddOrRemoveEvent - implements Container.Indexed.ItemAddEvent { - - public BaseItemAddEvent(Container source, Object itemId, int index, - int count) { - super(source, itemId, index, count); - } - - @Override - public int getAddedItemsCount() { - return getAffectedItemsCount(); - } - } - - /** - * An <code>Event</code> object specifying information about the removed - * items. - * - * <p> - * This class provides information about the first removed item and the - * number of removed items. - * </p> - */ - protected static class BaseItemRemoveEvent extends BaseItemAddOrRemoveEvent - implements Container.Indexed.ItemRemoveEvent { - - public BaseItemRemoveEvent(Container source, Object itemId, int index, - int count) { - super(source, itemId, index, count); - } - - @Override - public int getRemovedItemsCount() { - return getAffectedItemsCount(); - } - } - /** * Get an item even if filtered out. * @@ -977,69 +898,36 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE * Notify item set change listeners that an item has been added to the * container. * + * Unless subclasses specify otherwise, the default notification indicates a + * full refresh. + * * @param postion - * position of the added item in the view + * position of the added item in the view (if visible) * @param itemId * id of the added item * @param item * the added item */ protected void fireItemAdded(int position, ITEMIDTYPE itemId, ITEMCLASS item) { - fireItemsAdded(position, itemId, 1); - } - - /** - * Notify item set change listeners that items has been added to the - * container. - * - * @param firstPosition - * position of the first visible added item in the view - * @param firstItemId - * id of the first visible added item - * @param numberOfItems - * the number of visible added items - */ - protected void fireItemsAdded(int firstPosition, ITEMIDTYPE firstItemId, - int numberOfItems) { - BaseItemAddEvent addEvent = new BaseItemAddEvent(this, firstItemId, - firstPosition, numberOfItems); - fireItemSetChange(addEvent); + fireItemSetChange(); } /** * Notify item set change listeners that an item has been removed from the * container. * - * @param position - * position of the removed item in the view prior to removal + * Unless subclasses specify otherwise, the default notification indicates a + * full refresh. * + * @param postion + * position of the removed item in the view prior to removal (if + * was visible) * @param itemId * id of the removed item, of type {@link Object} to satisfy * {@link Container#removeItem(Object)} API */ protected void fireItemRemoved(int position, Object itemId) { - fireItemsRemoved(position, itemId, 1); - } - - /** - * Notify item set change listeners that items has been removed from the - * container. - * - * @param firstPosition - * position of the first visible removed item in the view prior - * to removal - * @param firstItemId - * id of the first visible removed item, of type {@link Object} - * to satisfy {@link Container#removeItem(Object)} API - * @param numberOfItems - * the number of removed visible items - * - */ - protected void fireItemsRemoved(int firstPosition, Object firstItemId, - int numberOfItems) { - BaseItemRemoveEvent removeEvent = new BaseItemRemoveEvent(this, - firstItemId, firstPosition, numberOfItems); - fireItemSetChange(removeEvent); + fireItemSetChange(); } // visible and filtered item identifier lists @@ -1058,21 +946,6 @@ public abstract class AbstractInMemoryContainer<ITEMIDTYPE, PROPERTYIDCLASS, ITE } /** - * Returns the item id of the first visible item after filtering. 'Null' is - * returned if there is no visible items. - * - * For internal use only. - * - * @return item id of the first visible item - */ - protected ITEMIDTYPE getFirstVisibleItem() { - if (!getVisibleItemIds().isEmpty()) { - return getVisibleItemIds().get(0); - } - return null; - } - - /** * Returns true is the container has active filters. * * @return true if the container is currently filtered diff --git a/server/src/com/vaadin/data/util/AbstractProperty.java b/server/src/com/vaadin/data/util/AbstractProperty.java index 903f2f50f2..ee79fcd91e 100644 --- a/server/src/com/vaadin/data/util/AbstractProperty.java +++ b/server/src/com/vaadin/data/util/AbstractProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/BeanContainer.java b/server/src/com/vaadin/data/util/BeanContainer.java index 4e435aabcc..9b878d627e 100644 --- a/server/src/com/vaadin/data/util/BeanContainer.java +++ b/server/src/com/vaadin/data/util/BeanContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/BeanItem.java b/server/src/com/vaadin/data/util/BeanItem.java index 49f5f95898..ac3ef86434 100644 --- a/server/src/com/vaadin/data/util/BeanItem.java +++ b/server/src/com/vaadin/data/util/BeanItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/BeanItemContainer.java b/server/src/com/vaadin/data/util/BeanItemContainer.java index e7b38d8b88..d5d399f0f8 100644 --- a/server/src/com/vaadin/data/util/BeanItemContainer.java +++ b/server/src/com/vaadin/data/util/BeanItemContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java b/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java index bb592245f1..eafd3573bc 100644 --- a/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java +++ b/server/src/com/vaadin/data/util/ContainerHierarchicalWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/ContainerOrderedWrapper.java b/server/src/com/vaadin/data/util/ContainerOrderedWrapper.java index b227d3ea08..483753da88 100644 --- a/server/src/com/vaadin/data/util/ContainerOrderedWrapper.java +++ b/server/src/com/vaadin/data/util/ContainerOrderedWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/DefaultItemSorter.java b/server/src/com/vaadin/data/util/DefaultItemSorter.java index 5ef1571a97..9728ccbd51 100644 --- a/server/src/com/vaadin/data/util/DefaultItemSorter.java +++ b/server/src/com/vaadin/data/util/DefaultItemSorter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/FilesystemContainer.java b/server/src/com/vaadin/data/util/FilesystemContainer.java index 449ba07ef6..7ceda49918 100644 --- a/server/src/com/vaadin/data/util/FilesystemContainer.java +++ b/server/src/com/vaadin/data/util/FilesystemContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/HierarchicalContainer.java b/server/src/com/vaadin/data/util/HierarchicalContainer.java index 45bea5018f..2235e77b34 100644 --- a/server/src/com/vaadin/data/util/HierarchicalContainer.java +++ b/server/src/com/vaadin/data/util/HierarchicalContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java b/server/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java index bc98d39c16..1c7960f954 100644 --- a/server/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java +++ b/server/src/com/vaadin/data/util/HierarchicalContainerOrderedWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/IndexedContainer.java b/server/src/com/vaadin/data/util/IndexedContainer.java index 5d20919208..68960335d7 100644 --- a/server/src/com/vaadin/data/util/IndexedContainer.java +++ b/server/src/com/vaadin/data/util/IndexedContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -226,7 +226,6 @@ public class IndexedContainer extends @Override public boolean removeAllItems() { int origSize = size(); - Object firstItem = getFirstVisibleItem(); internalRemoveAllItems(); @@ -236,7 +235,7 @@ public class IndexedContainer extends // filtered out items were removed or not if (origSize != 0) { // Sends a change event - fireItemsRemoved(0, firstItem, origSize); + fireItemSetChange(); } return true; @@ -621,7 +620,8 @@ public class IndexedContainer extends @Override protected void fireItemAdded(int position, Object itemId, Item item) { if (position >= 0) { - super.fireItemAdded(position, itemId, item); + fireItemSetChange(new IndexedContainer.ItemSetChangeEvent(this, + position)); } } @@ -1211,5 +1211,4 @@ public class IndexedContainer extends public Collection<Filter> getContainerFilters() { return super.getContainerFilters(); } - } diff --git a/server/src/com/vaadin/data/util/ItemSorter.java b/server/src/com/vaadin/data/util/ItemSorter.java index 89293157a6..141f84ad43 100644 --- a/server/src/com/vaadin/data/util/ItemSorter.java +++ b/server/src/com/vaadin/data/util/ItemSorter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java index 76bd57117d..7432d036fb 100644 --- a/server/src/com/vaadin/data/util/LegacyPropertyHelper.java +++ b/server/src/com/vaadin/data/util/LegacyPropertyHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/ListSet.java b/server/src/com/vaadin/data/util/ListSet.java index 55ef398b20..ccc9e0dbfd 100644 --- a/server/src/com/vaadin/data/util/ListSet.java +++ b/server/src/com/vaadin/data/util/ListSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/MethodProperty.java b/server/src/com/vaadin/data/util/MethodProperty.java index d7323d872f..5ec8ebffe0 100644 --- a/server/src/com/vaadin/data/util/MethodProperty.java +++ b/server/src/com/vaadin/data/util/MethodProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/MethodPropertyDescriptor.java b/server/src/com/vaadin/data/util/MethodPropertyDescriptor.java index 007fdc4adc..04a6ab1cc9 100644 --- a/server/src/com/vaadin/data/util/MethodPropertyDescriptor.java +++ b/server/src/com/vaadin/data/util/MethodPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -143,4 +143,4 @@ public class MethodPropertyDescriptor<BT> implements private static final Logger getLogger() { return Logger.getLogger(MethodPropertyDescriptor.class.getName()); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/NestedMethodProperty.java b/server/src/com/vaadin/data/util/NestedMethodProperty.java index 8fe3b9d4c5..d252902d58 100644 --- a/server/src/com/vaadin/data/util/NestedMethodProperty.java +++ b/server/src/com/vaadin/data/util/NestedMethodProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/NestedPropertyDescriptor.java b/server/src/com/vaadin/data/util/NestedPropertyDescriptor.java index b2055fe776..ca423b34ed 100644 --- a/server/src/com/vaadin/data/util/NestedPropertyDescriptor.java +++ b/server/src/com/vaadin/data/util/NestedPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/ObjectProperty.java b/server/src/com/vaadin/data/util/ObjectProperty.java index 12d058aaca..8a2daa443c 100644 --- a/server/src/com/vaadin/data/util/ObjectProperty.java +++ b/server/src/com/vaadin/data/util/ObjectProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/PropertyFormatter.java b/server/src/com/vaadin/data/util/PropertyFormatter.java index b91a2426de..e188ce8bc3 100644 --- a/server/src/com/vaadin/data/util/PropertyFormatter.java +++ b/server/src/com/vaadin/data/util/PropertyFormatter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/PropertysetItem.java b/server/src/com/vaadin/data/util/PropertysetItem.java index be156434a5..f463a52f54 100644 --- a/server/src/com/vaadin/data/util/PropertysetItem.java +++ b/server/src/com/vaadin/data/util/PropertysetItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/TextFileProperty.java b/server/src/com/vaadin/data/util/TextFileProperty.java index 0df6765d77..22fd8168a1 100644 --- a/server/src/com/vaadin/data/util/TextFileProperty.java +++ b/server/src/com/vaadin/data/util/TextFileProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java b/server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java index 6b0119c503..c3cef6a0ec 100644 --- a/server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java +++ b/server/src/com/vaadin/data/util/TransactionalPropertyWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,18 +48,32 @@ public class TransactionalPropertyWrapper<T> extends AbstractProperty<T> private boolean inTransaction = false; private boolean valueChangePending; private T valueBeforeTransaction; + private final ValueChangeListener listener = new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + fireValueChange(); + } + }; public TransactionalPropertyWrapper(Property<T> wrappedProperty) { this.wrappedProperty = wrappedProperty; if (wrappedProperty instanceof ValueChangeNotifier) { ((ValueChangeNotifier) wrappedProperty) - .addListener(new ValueChangeListener() { + .addValueChangeListener(listener); + } + } - @Override - public void valueChange(ValueChangeEvent event) { - fireValueChange(); - } - }); + /** + * Removes the ValueChangeListener from wrapped Property that was added by + * TransactionalPropertyWrapper. + * + * @since 7.1.15 + */ + public void detachFromProperty() { + if (wrappedProperty instanceof ValueChangeNotifier) { + ((ValueChangeNotifier) wrappedProperty) + .removeValueChangeListener(listener); } } diff --git a/server/src/com/vaadin/data/util/VaadinPropertyDescriptor.java b/server/src/com/vaadin/data/util/VaadinPropertyDescriptor.java index 62b5888047..51084d9115 100644 --- a/server/src/com/vaadin/data/util/VaadinPropertyDescriptor.java +++ b/server/src/com/vaadin/data/util/VaadinPropertyDescriptor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java b/server/src/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java index 237f01bb22..9054f258c7 100644 --- a/server/src/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java +++ b/server/src/com/vaadin/data/util/converter/AbstractStringToNumberConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/Converter.java b/server/src/com/vaadin/data/util/converter/Converter.java index 3c391af434..a7188ebb33 100644 --- a/server/src/com/vaadin/data/util/converter/Converter.java +++ b/server/src/com/vaadin/data/util/converter/Converter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/ConverterFactory.java b/server/src/com/vaadin/data/util/converter/ConverterFactory.java index 91a0aa0577..0280be4a73 100644 --- a/server/src/com/vaadin/data/util/converter/ConverterFactory.java +++ b/server/src/com/vaadin/data/util/converter/ConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/ConverterUtil.java b/server/src/com/vaadin/data/util/converter/ConverterUtil.java index 3457c16755..91e11a6222 100644 --- a/server/src/com/vaadin/data/util/converter/ConverterUtil.java +++ b/server/src/com/vaadin/data/util/converter/ConverterUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/DateToLongConverter.java b/server/src/com/vaadin/data/util/converter/DateToLongConverter.java index 6aedc74f6d..fffe80352e 100644 --- a/server/src/com/vaadin/data/util/converter/DateToLongConverter.java +++ b/server/src/com/vaadin/data/util/converter/DateToLongConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/DateToSqlDateConverter.java b/server/src/com/vaadin/data/util/converter/DateToSqlDateConverter.java index 7c252d78f2..6a7e8327a1 100644 --- a/server/src/com/vaadin/data/util/converter/DateToSqlDateConverter.java +++ b/server/src/com/vaadin/data/util/converter/DateToSqlDateConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java index 4d3717e9ba..fdf858a528 100644 --- a/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java +++ b/server/src/com/vaadin/data/util/converter/DefaultConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/ReverseConverter.java b/server/src/com/vaadin/data/util/converter/ReverseConverter.java index 6fa07696db..2495dc631a 100644 --- a/server/src/com/vaadin/data/util/converter/ReverseConverter.java +++ b/server/src/com/vaadin/data/util/converter/ReverseConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java b/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java index 75d4cedd23..549f156f61 100644 --- a/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToBigDecimalConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToBooleanConverter.java b/server/src/com/vaadin/data/util/converter/StringToBooleanConverter.java index 6af0933731..0e802da879 100644 --- a/server/src/com/vaadin/data/util/converter/StringToBooleanConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToBooleanConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToDateConverter.java b/server/src/com/vaadin/data/util/converter/StringToDateConverter.java index e3917c6a52..8f0db24caf 100644 --- a/server/src/com/vaadin/data/util/converter/StringToDateConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToDateConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToDoubleConverter.java b/server/src/com/vaadin/data/util/converter/StringToDoubleConverter.java index c593d256da..f514eac648 100644 --- a/server/src/com/vaadin/data/util/converter/StringToDoubleConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToDoubleConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToFloatConverter.java b/server/src/com/vaadin/data/util/converter/StringToFloatConverter.java index 6fcb83a770..f4d7f97853 100644 --- a/server/src/com/vaadin/data/util/converter/StringToFloatConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToFloatConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToIntegerConverter.java b/server/src/com/vaadin/data/util/converter/StringToIntegerConverter.java index f6f668ad4d..59a46babe1 100644 --- a/server/src/com/vaadin/data/util/converter/StringToIntegerConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToIntegerConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/converter/StringToLongConverter.java b/server/src/com/vaadin/data/util/converter/StringToLongConverter.java index 3532336787..cd7cf49042 100644 --- a/server/src/com/vaadin/data/util/converter/StringToLongConverter.java +++ b/server/src/com/vaadin/data/util/converter/StringToLongConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java b/server/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java index 25924f8e61..28e6cda34e 100644 --- a/server/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java +++ b/server/src/com/vaadin/data/util/filter/AbstractJunctionFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -85,4 +85,4 @@ public abstract class AbstractJunctionFilter implements Filter { } return hash; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/filter/And.java b/server/src/com/vaadin/data/util/filter/And.java index 101040889b..938aedae95 100644 --- a/server/src/com/vaadin/data/util/filter/And.java +++ b/server/src/com/vaadin/data/util/filter/And.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/Between.java b/server/src/com/vaadin/data/util/filter/Between.java index a76821981a..48a610ed57 100644 --- a/server/src/com/vaadin/data/util/filter/Between.java +++ b/server/src/com/vaadin/data/util/filter/Between.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/Compare.java b/server/src/com/vaadin/data/util/filter/Compare.java index 1396c46d36..1fcbe85580 100644 --- a/server/src/com/vaadin/data/util/filter/Compare.java +++ b/server/src/com/vaadin/data/util/filter/Compare.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/IsNull.java b/server/src/com/vaadin/data/util/filter/IsNull.java index 6907a016a1..9bcfe40c03 100644 --- a/server/src/com/vaadin/data/util/filter/IsNull.java +++ b/server/src/com/vaadin/data/util/filter/IsNull.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/Like.java b/server/src/com/vaadin/data/util/filter/Like.java index e0e2c9275c..9b7b2af292 100644 --- a/server/src/com/vaadin/data/util/filter/Like.java +++ b/server/src/com/vaadin/data/util/filter/Like.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/Not.java b/server/src/com/vaadin/data/util/filter/Not.java index 6892d199d0..a677e7f752 100644 --- a/server/src/com/vaadin/data/util/filter/Not.java +++ b/server/src/com/vaadin/data/util/filter/Not.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/Or.java b/server/src/com/vaadin/data/util/filter/Or.java index 0e952b63ce..69d20513a2 100644 --- a/server/src/com/vaadin/data/util/filter/Or.java +++ b/server/src/com/vaadin/data/util/filter/Or.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/SimpleStringFilter.java b/server/src/com/vaadin/data/util/filter/SimpleStringFilter.java index a214e69846..ea5e93277e 100644 --- a/server/src/com/vaadin/data/util/filter/SimpleStringFilter.java +++ b/server/src/com/vaadin/data/util/filter/SimpleStringFilter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/filter/UnsupportedFilterException.java b/server/src/com/vaadin/data/util/filter/UnsupportedFilterException.java index 0a28139406..42a7784da8 100644 --- a/server/src/com/vaadin/data/util/filter/UnsupportedFilterException.java +++ b/server/src/com/vaadin/data/util/filter/UnsupportedFilterException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -44,4 +44,4 @@ public class UnsupportedFilterException extends RuntimeException implements public UnsupportedFilterException(String message, Exception cause) { super(message, cause); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java b/server/src/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java index 5095f0c6af..12d806a8d5 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/CacheFlushNotifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/CacheMap.java b/server/src/com/vaadin/data/util/sqlcontainer/CacheMap.java index 338874c3ae..cdeff873d0 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/CacheMap.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/CacheMap.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -40,4 +40,4 @@ class CacheMap<K, V> extends LinkedHashMap<K, V> { int getCacheLimit() { return cacheLimit; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java b/server/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java index d8448a2b50..e89b8c02a8 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/ColumnProperty.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java b/server/src/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java index 2a9d49bf55..ed8eb3c0ff 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/OptimisticLockException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java b/server/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java index 8dc31922dd..dcad8f7c5d 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/Reference.java b/server/src/com/vaadin/data/util/sqlcontainer/Reference.java index cdc1c46102..e82f63ad2f 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/Reference.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/Reference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java index c375bd5a4a..8674b9dca0 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/RowId.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/RowId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/RowItem.java b/server/src/com/vaadin/data/util/sqlcontainer/RowItem.java index 39bbf5990f..ddb5de1d31 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/RowItem.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/RowItem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java index 32b46df166..683140d279 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/SQLUtil.java b/server/src/com/vaadin/data/util/sqlcontainer/SQLUtil.java index 91220fc763..e5282c867a 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/SQLUtil.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/SQLUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java index 03f7f23fdd..6c1e07756f 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/TemporaryRowId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java b/server/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java index 06c552d10e..acad5beed9 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -81,4 +81,4 @@ public class J2EEConnectionPool implements JDBCConnectionPool { dataSource = null; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java b/server/src/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java index b980f9022e..11669075a3 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/connection/JDBCConnectionPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java b/server/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java index fbd1e9d770..57ea188cb4 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPool.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java b/server/src/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java index f36b583e07..e7fd9f4aa4 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/AbstractTransactionalQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java index 6895e02147..79a5b6c067 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java index 3a5cd8f660..b6fa56055d 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java index 65205b3866..9df72f5b98 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformStatementDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/OrderBy.java b/server/src/com/vaadin/data/util/sqlcontainer/query/OrderBy.java index e50ac6d1b2..2bafa5dc0c 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/OrderBy.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/OrderBy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java b/server/src/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java index 416440c61a..413dd55ab9 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/QueryDelegate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java index b54a630e04..bb000bd8f5 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/TableQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java index 43c0933e0a..84dfe9b865 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/DefaultSQLGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java index 9443d5ea5a..5a1f2003cd 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/MSSQLGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -110,4 +110,4 @@ public class MSSQLGenerator extends DefaultSQLGenerator { sh.setQueryString(query.toString()); return sh; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java index 4a26d54ace..86508d37c4 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/OracleGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -121,4 +121,4 @@ public class OracleGenerator extends DefaultSQLGenerator { return sh; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java index a3bad3495f..53ff924a36 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/SQLGenerator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java index 3f96e51110..ed849b51ec 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/StatementHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java index 315ec8058a..a3d9b90705 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/AndTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java index bc42ba1318..13d3553742 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/BetweenTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java index f769541442..d8d5cc61fb 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/CompareTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java index 8f74a726a9..0ece263ef4 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/FilterTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java index b406812386..764a04eece 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/IsNullTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java index 1aeae86284..07e544d40b 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/LikeTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java index cf53f6d82e..1bbc2a8e7e 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/NotTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java index 1c45c4fd25..00b4d5421b 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/OrTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java index c95dd369e6..b277551209 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/QueryBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java index c81c74b304..9bfda5fb34 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/SimpleStringTranslator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java index 5b2c8116f4..0132260a0c 100644 --- a/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java +++ b/server/src/com/vaadin/data/util/sqlcontainer/query/generator/filter/StringDecorator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/AbstractStringValidator.java b/server/src/com/vaadin/data/validator/AbstractStringValidator.java index 4941783bd3..70227afa67 100644 --- a/server/src/com/vaadin/data/validator/AbstractStringValidator.java +++ b/server/src/com/vaadin/data/validator/AbstractStringValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/AbstractValidator.java b/server/src/com/vaadin/data/validator/AbstractValidator.java index 7c4d84655c..b0894bbdbf 100644 --- a/server/src/com/vaadin/data/validator/AbstractValidator.java +++ b/server/src/com/vaadin/data/validator/AbstractValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/BeanValidator.java b/server/src/com/vaadin/data/validator/BeanValidator.java index 54efa51ac1..b25f7e687c 100644 --- a/server/src/com/vaadin/data/validator/BeanValidator.java +++ b/server/src/com/vaadin/data/validator/BeanValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -180,4 +180,4 @@ public class BeanValidator implements Validator { return javaxBeanValidator; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/data/validator/CompositeValidator.java b/server/src/com/vaadin/data/validator/CompositeValidator.java index 065bd2bbe3..f3b7133b9d 100644 --- a/server/src/com/vaadin/data/validator/CompositeValidator.java +++ b/server/src/com/vaadin/data/validator/CompositeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/DateRangeValidator.java b/server/src/com/vaadin/data/validator/DateRangeValidator.java index 2263ecc89f..3add69c207 100644 --- a/server/src/com/vaadin/data/validator/DateRangeValidator.java +++ b/server/src/com/vaadin/data/validator/DateRangeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/DoubleRangeValidator.java b/server/src/com/vaadin/data/validator/DoubleRangeValidator.java index e5e8a6cb6e..8992e2644a 100644 --- a/server/src/com/vaadin/data/validator/DoubleRangeValidator.java +++ b/server/src/com/vaadin/data/validator/DoubleRangeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/DoubleValidator.java b/server/src/com/vaadin/data/validator/DoubleValidator.java index 55093b6a40..e40cf3eecf 100644 --- a/server/src/com/vaadin/data/validator/DoubleValidator.java +++ b/server/src/com/vaadin/data/validator/DoubleValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/EmailValidator.java b/server/src/com/vaadin/data/validator/EmailValidator.java index aa7a921d51..853c855a37 100644 --- a/server/src/com/vaadin/data/validator/EmailValidator.java +++ b/server/src/com/vaadin/data/validator/EmailValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/IntegerRangeValidator.java b/server/src/com/vaadin/data/validator/IntegerRangeValidator.java index 759a9f3ae7..6ef848bed3 100644 --- a/server/src/com/vaadin/data/validator/IntegerRangeValidator.java +++ b/server/src/com/vaadin/data/validator/IntegerRangeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/IntegerValidator.java b/server/src/com/vaadin/data/validator/IntegerValidator.java index db2d510946..f52ba0ab3a 100644 --- a/server/src/com/vaadin/data/validator/IntegerValidator.java +++ b/server/src/com/vaadin/data/validator/IntegerValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/NullValidator.java b/server/src/com/vaadin/data/validator/NullValidator.java index 451ee9c10f..42cf419973 100644 --- a/server/src/com/vaadin/data/validator/NullValidator.java +++ b/server/src/com/vaadin/data/validator/NullValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/RangeValidator.java b/server/src/com/vaadin/data/validator/RangeValidator.java index 5e82a37b51..5ba3aef363 100644 --- a/server/src/com/vaadin/data/validator/RangeValidator.java +++ b/server/src/com/vaadin/data/validator/RangeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/RegexpValidator.java b/server/src/com/vaadin/data/validator/RegexpValidator.java index f85bce9281..74e1f89253 100644 --- a/server/src/com/vaadin/data/validator/RegexpValidator.java +++ b/server/src/com/vaadin/data/validator/RegexpValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/data/validator/StringLengthValidator.java b/server/src/com/vaadin/data/validator/StringLengthValidator.java index d314f38783..efb551c614 100644 --- a/server/src/com/vaadin/data/validator/StringLengthValidator.java +++ b/server/src/com/vaadin/data/validator/StringLengthValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/Action.java b/server/src/com/vaadin/event/Action.java index d872ef2541..1af1de6e6d 100644 --- a/server/src/com/vaadin/event/Action.java +++ b/server/src/com/vaadin/event/Action.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ActionManager.java b/server/src/com/vaadin/event/ActionManager.java index 8d7a64b364..b42a5d8dde 100644 --- a/server/src/com/vaadin/event/ActionManager.java +++ b/server/src/com/vaadin/event/ActionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ConnectorActionManager.java b/server/src/com/vaadin/event/ConnectorActionManager.java index 297f78f179..0816ba48df 100644 --- a/server/src/com/vaadin/event/ConnectorActionManager.java +++ b/server/src/com/vaadin/event/ConnectorActionManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ConnectorEvent.java b/server/src/com/vaadin/event/ConnectorEvent.java index 6e1526435f..3dc73b864a 100644 --- a/server/src/com/vaadin/event/ConnectorEvent.java +++ b/server/src/com/vaadin/event/ConnectorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -28,4 +28,4 @@ public abstract class ConnectorEvent extends EventObject { public ClientConnector getConnector() { return (ClientConnector) getSource(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/ConnectorEventListener.java b/server/src/com/vaadin/event/ConnectorEventListener.java index 7461e31888..e3cb9c283b 100644 --- a/server/src/com/vaadin/event/ConnectorEventListener.java +++ b/server/src/com/vaadin/event/ConnectorEventListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import java.util.EventListener; public interface ConnectorEventListener extends EventListener, Serializable { -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/DataBoundTransferable.java b/server/src/com/vaadin/event/DataBoundTransferable.java index e5e23223fb..d461692b2e 100644 --- a/server/src/com/vaadin/event/DataBoundTransferable.java +++ b/server/src/com/vaadin/event/DataBoundTransferable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/EventRouter.java b/server/src/com/vaadin/event/EventRouter.java index fdc543143b..b662dfcb36 100644 --- a/server/src/com/vaadin/event/EventRouter.java +++ b/server/src/com/vaadin/event/EventRouter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/FieldEvents.java b/server/src/com/vaadin/event/FieldEvents.java index 61c342891b..364ac76ffd 100644 --- a/server/src/com/vaadin/event/FieldEvents.java +++ b/server/src/com/vaadin/event/FieldEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ItemClickEvent.java b/server/src/com/vaadin/event/ItemClickEvent.java index b055fda3a1..a151257442 100644 --- a/server/src/com/vaadin/event/ItemClickEvent.java +++ b/server/src/com/vaadin/event/ItemClickEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/LayoutEvents.java b/server/src/com/vaadin/event/LayoutEvents.java index 47cb011898..e4432b7c7a 100644 --- a/server/src/com/vaadin/event/LayoutEvents.java +++ b/server/src/com/vaadin/event/LayoutEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -161,4 +161,4 @@ public interface LayoutEvents { childComponent); } } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/ListenerMethod.java b/server/src/com/vaadin/event/ListenerMethod.java index 20523920fd..3311ed705e 100644 --- a/server/src/com/vaadin/event/ListenerMethod.java +++ b/server/src/com/vaadin/event/ListenerMethod.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/MethodEventSource.java b/server/src/com/vaadin/event/MethodEventSource.java index 999470a98a..ddfc87ca8c 100644 --- a/server/src/com/vaadin/event/MethodEventSource.java +++ b/server/src/com/vaadin/event/MethodEventSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/MouseEvents.java b/server/src/com/vaadin/event/MouseEvents.java index fe3300e434..b32ce06587 100644 --- a/server/src/com/vaadin/event/MouseEvents.java +++ b/server/src/com/vaadin/event/MouseEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ShortcutAction.java b/server/src/com/vaadin/event/ShortcutAction.java index 5ec4d3bfa0..09accae1c7 100644 --- a/server/src/com/vaadin/event/ShortcutAction.java +++ b/server/src/com/vaadin/event/ShortcutAction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/ShortcutListener.java b/server/src/com/vaadin/event/ShortcutListener.java index 8b946f1234..ccfe68d6fb 100644 --- a/server/src/com/vaadin/event/ShortcutListener.java +++ b/server/src/com/vaadin/event/ShortcutListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/Transferable.java b/server/src/com/vaadin/event/Transferable.java index 69b158d790..9cfbba5161 100644 --- a/server/src/com/vaadin/event/Transferable.java +++ b/server/src/com/vaadin/event/Transferable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/TransferableImpl.java b/server/src/com/vaadin/event/TransferableImpl.java index dae18bfb15..9c8e79f1bf 100644 --- a/server/src/com/vaadin/event/TransferableImpl.java +++ b/server/src/com/vaadin/event/TransferableImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/UIEvents.java b/server/src/com/vaadin/event/UIEvents.java index 321bfc9251..e986386da8 100644 --- a/server/src/com/vaadin/event/UIEvents.java +++ b/server/src/com/vaadin/event/UIEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/DragAndDropEvent.java b/server/src/com/vaadin/event/dd/DragAndDropEvent.java index 4e31e55063..661c7ed1cc 100644 --- a/server/src/com/vaadin/event/dd/DragAndDropEvent.java +++ b/server/src/com/vaadin/event/dd/DragAndDropEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/DragSource.java b/server/src/com/vaadin/event/dd/DragSource.java index 447ee32589..8e4d43bfc4 100644 --- a/server/src/com/vaadin/event/dd/DragSource.java +++ b/server/src/com/vaadin/event/dd/DragSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -61,4 +61,4 @@ public interface DragSource extends Component { */ public Transferable getTransferable(Map<String, Object> rawVariables); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/DropHandler.java b/server/src/com/vaadin/event/dd/DropHandler.java index 3bb5e955a2..c45ae7e7d3 100644 --- a/server/src/com/vaadin/event/dd/DropHandler.java +++ b/server/src/com/vaadin/event/dd/DropHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/DropTarget.java b/server/src/com/vaadin/event/dd/DropTarget.java index e7a49a0f6f..f96170cf98 100644 --- a/server/src/com/vaadin/event/dd/DropTarget.java +++ b/server/src/com/vaadin/event/dd/DropTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -51,4 +51,4 @@ public interface DropTarget extends Component { public TargetDetails translateDropTargetDetails( Map<String, Object> clientVariables); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/TargetDetails.java b/server/src/com/vaadin/event/dd/TargetDetails.java index 7719349a92..b5635bc2a8 100644 --- a/server/src/com/vaadin/event/dd/TargetDetails.java +++ b/server/src/com/vaadin/event/dd/TargetDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/TargetDetailsImpl.java b/server/src/com/vaadin/event/dd/TargetDetailsImpl.java index 374c4a67f7..1138215f3f 100644 --- a/server/src/com/vaadin/event/dd/TargetDetailsImpl.java +++ b/server/src/com/vaadin/event/dd/TargetDetailsImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -55,4 +55,4 @@ public class TargetDetailsImpl implements TargetDetails { return dropTarget; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java index b324e7a9bb..fa6a4c2b9a 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptAll.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -45,4 +45,4 @@ public final class AcceptAll extends ClientSideCriterion { public boolean accept(DragAndDropEvent dragEvent) { return true; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java index 2f76bfc609..a968cd8741 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -84,4 +84,4 @@ public interface AcceptCriterion extends Serializable { * @return */ public boolean accept(DragAndDropEvent dragEvent); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/And.java b/server/src/com/vaadin/event/dd/acceptcriteria/And.java index 6dc9593e17..b2fc1b1b94 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/And.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/And.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -63,4 +63,4 @@ public class And extends ClientSideCriterion { return true; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java index b3c0636800..6bb227a95e 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java b/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java index e9c2834ccd..57f4d8253b 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -62,4 +62,4 @@ public class ContainsDataFlavor extends ClientSideCriterion { // extending classes use client side implementation from this class return ContainsDataFlavor.class.getCanonicalName(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/Not.java b/server/src/com/vaadin/event/dd/acceptcriteria/Not.java index 7f48a0913c..95f96bbf08 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/Not.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/Not.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -48,4 +48,4 @@ public class Not extends ClientSideCriterion { return !acceptCriterion.accept(dragEvent); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/Or.java b/server/src/com/vaadin/event/dd/acceptcriteria/Or.java index 9676576cc1..e300606464 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/Or.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/Or.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -61,4 +61,4 @@ public class Or extends ClientSideCriterion { return false; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java index 0cb2ae2055..8b769ee031 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java index 0cc2f0a1a5..8e9fdecdae 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -76,4 +76,4 @@ public class SourceIs extends ClientSideCriterion { return false; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java index e10672cc1a..c49f126941 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIsTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -60,4 +60,4 @@ public class SourceIsTarget extends ClientSideCriterion { return instance; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java b/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java index d6b844e610..42fb5dfa11 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -81,4 +81,4 @@ public class TargetDetailIs extends ClientSideCriterion { // sub classes by default use VDropDetailEquals a client implementation return TargetDetailIs.class.getCanonicalName(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/navigator/NavigationStateManager.java b/server/src/com/vaadin/navigator/NavigationStateManager.java index 5b3d3410ea..d454d044cb 100644 --- a/server/src/com/vaadin/navigator/NavigationStateManager.java +++ b/server/src/com/vaadin/navigator/NavigationStateManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -60,4 +60,4 @@ public interface NavigationStateManager extends Serializable { * This method should only be called by a Navigator. */ public void setNavigator(Navigator navigator); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index dbcec00ba9..80dad2244e 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,7 +16,7 @@ package com.vaadin.navigator; /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/navigator/View.java b/server/src/com/vaadin/navigator/View.java index 1c3e17876b..76b76f5520 100644 --- a/server/src/com/vaadin/navigator/View.java +++ b/server/src/com/vaadin/navigator/View.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -46,4 +46,4 @@ public interface View extends Serializable { * */ public void enter(ViewChangeEvent event); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/navigator/ViewChangeListener.java b/server/src/com/vaadin/navigator/ViewChangeListener.java index d4989f7018..7d3f2b6044 100644 --- a/server/src/com/vaadin/navigator/ViewChangeListener.java +++ b/server/src/com/vaadin/navigator/ViewChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -130,4 +130,4 @@ public interface ViewChangeListener extends Serializable { */ public void afterViewChange(ViewChangeEvent event); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/navigator/ViewDisplay.java b/server/src/com/vaadin/navigator/ViewDisplay.java index 6db95ea84d..36aa5dadc2 100644 --- a/server/src/com/vaadin/navigator/ViewDisplay.java +++ b/server/src/com/vaadin/navigator/ViewDisplay.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -38,4 +38,4 @@ public interface ViewDisplay extends Serializable { * new view to show */ public void showView(View view); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/navigator/ViewProvider.java b/server/src/com/vaadin/navigator/ViewProvider.java index 64b2043d92..ecf4e51073 100644 --- a/server/src/com/vaadin/navigator/ViewProvider.java +++ b/server/src/com/vaadin/navigator/ViewProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -53,4 +53,4 @@ public interface ViewProvider extends Serializable { * @return newly created view (null if none available for the view name) */ public View getView(String viewName); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java index a73ca3d985..92c235167c 100644 --- a/server/src/com/vaadin/server/AbstractClientConnector.java +++ b/server/src/com/vaadin/server/AbstractClientConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -132,13 +132,22 @@ public abstract class AbstractClientConnector implements ClientConnector, /* Documentation copied from interface */ @Override public void markAsDirty() { - assert getSession() == null || getSession().hasLock() : "Session must be locked when markAsDirty() is called"; + assert getSession() == null || getSession().hasLock() : buildLockAssertMessage("markAsDirty()"); UI uI = getUI(); if (uI != null) { uI.getConnectorTracker().markDirty(this); } } + private String buildLockAssertMessage(String method) { + if (VaadinService.isOtherSessionLocked(getSession())) { + return "The session of this connecor is not locked, but there is another session that is locked. " + + "This might be caused by accidentally using a connector that belongs to another session."; + } else { + return "Session must be locked when " + method + " is called"; + } + } + /** * Registers an RPC interface implementation for this component. * @@ -217,7 +226,7 @@ public abstract class AbstractClientConnector implements ClientConnector, * @see #getState() */ protected SharedState getState(boolean markAsDirty) { - assert getSession() == null || getSession().hasLock() : "Session must be locked when getState() is called"; + assert getSession() == null || getSession().hasLock() : buildLockAssertMessage("getState()"); if (null == sharedState) { sharedState = createState(); @@ -339,13 +348,16 @@ public abstract class AbstractClientConnector implements ClientConnector, @Override public Iterator<ClientConnector> iterator() { CombinedIterator<ClientConnector> iterator = new CombinedIterator<ClientConnector>(); - iterator.addIterator(connector.getExtensions().iterator()); if (connector instanceof HasComponents) { HasComponents hasComponents = (HasComponents) connector; iterator.addIterator(hasComponents.iterator()); } + Collection<Extension> extensions = connector.getExtensions(); + if (extensions.size() > 0) { + iterator.addIterator(extensions.iterator()); + } return iterator; } } diff --git a/server/src/com/vaadin/server/AbstractErrorMessage.java b/server/src/com/vaadin/server/AbstractErrorMessage.java index bd40a75b33..c733cc493e 100644 --- a/server/src/com/vaadin/server/AbstractErrorMessage.java +++ b/server/src/com/vaadin/server/AbstractErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/AbstractExtension.java b/server/src/com/vaadin/server/AbstractExtension.java index 0387ad1b08..7148e6e84c 100644 --- a/server/src/com/vaadin/server/AbstractExtension.java +++ b/server/src/com/vaadin/server/AbstractExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/AbstractJavaScriptExtension.java b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java index c184abac7d..acf6a870c6 100644 --- a/server/src/com/vaadin/server/AbstractJavaScriptExtension.java +++ b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/BootstrapFragmentResponse.java b/server/src/com/vaadin/server/BootstrapFragmentResponse.java index ead0ce6281..14a12a20ec 100644 --- a/server/src/com/vaadin/server/BootstrapFragmentResponse.java +++ b/server/src/com/vaadin/server/BootstrapFragmentResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/BootstrapHandler.java b/server/src/com/vaadin/server/BootstrapHandler.java index bfdbea3086..3c75764075 100644 --- a/server/src/com/vaadin/server/BootstrapHandler.java +++ b/server/src/com/vaadin/server/BootstrapHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -156,10 +156,6 @@ public abstract class BootstrapHandler extends SynchronizedRequestHandler { public boolean synchronizedHandleRequest(VaadinSession session, VaadinRequest request, VaadinResponse response) throws IOException { try { - // Update WebBrowser here only to make WebBrowser information - // available in init for LegacyApplications - session.getBrowser().updateRequestDetails(request); - List<UIProvider> uiProviders = session.getUIProviders(); UIClassSelectionEvent classSelectionEvent = new UIClassSelectionEvent( diff --git a/server/src/com/vaadin/server/BootstrapListener.java b/server/src/com/vaadin/server/BootstrapListener.java index 52acc352a3..374268dbdc 100644 --- a/server/src/com/vaadin/server/BootstrapListener.java +++ b/server/src/com/vaadin/server/BootstrapListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/BootstrapPageResponse.java b/server/src/com/vaadin/server/BootstrapPageResponse.java index e3337fe90c..e57ed413f0 100644 --- a/server/src/com/vaadin/server/BootstrapPageResponse.java +++ b/server/src/com/vaadin/server/BootstrapPageResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/BootstrapResponse.java b/server/src/com/vaadin/server/BootstrapResponse.java index 78fcc27c6f..59e18d4c8a 100644 --- a/server/src/com/vaadin/server/BootstrapResponse.java +++ b/server/src/com/vaadin/server/BootstrapResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/BrowserWindowOpener.java b/server/src/com/vaadin/server/BrowserWindowOpener.java index a6e420f89c..df03e76bcd 100644 --- a/server/src/com/vaadin/server/BrowserWindowOpener.java +++ b/server/src/com/vaadin/server/BrowserWindowOpener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ClassResource.java b/server/src/com/vaadin/server/ClassResource.java index 5b3db968f7..5fb30095ed 100644 --- a/server/src/com/vaadin/server/ClassResource.java +++ b/server/src/com/vaadin/server/ClassResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ClientConnector.java b/server/src/com/vaadin/server/ClientConnector.java index 3c06d5743c..e61ba50a3a 100644 --- a/server/src/com/vaadin/server/ClientConnector.java +++ b/server/src/com/vaadin/server/ClientConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ClientMethodInvocation.java b/server/src/com/vaadin/server/ClientMethodInvocation.java index 3a6a87a53c..e51138d7bf 100644 --- a/server/src/com/vaadin/server/ClientMethodInvocation.java +++ b/server/src/com/vaadin/server/ClientMethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -134,4 +134,4 @@ public class ClientMethodInvocation implements Serializable, } } } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java index 07c195a1c1..2d88ae3b53 100644 --- a/server/src/com/vaadin/server/ComponentSizeValidator.java +++ b/server/src/com/vaadin/server/ComponentSizeValidator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/CompositeErrorMessage.java b/server/src/com/vaadin/server/CompositeErrorMessage.java index 1645285f9b..ee2af74994 100644 --- a/server/src/com/vaadin/server/CompositeErrorMessage.java +++ b/server/src/com/vaadin/server/CompositeErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ConnectorResource.java b/server/src/com/vaadin/server/ConnectorResource.java index 8682f8ce6f..3c4fb1955f 100644 --- a/server/src/com/vaadin/server/ConnectorResource.java +++ b/server/src/com/vaadin/server/ConnectorResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java index e4315e9694..6c486a2d65 100644 --- a/server/src/com/vaadin/server/ConnectorResourceHandler.java +++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java index 90f09d1642..39329c32ce 100644 --- a/server/src/com/vaadin/server/Constants.java +++ b/server/src/com/vaadin/server/Constants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/CustomizedSystemMessages.java b/server/src/com/vaadin/server/CustomizedSystemMessages.java index a4b8f9e64b..f7049e3688 100644 --- a/server/src/com/vaadin/server/CustomizedSystemMessages.java +++ b/server/src/com/vaadin/server/CustomizedSystemMessages.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -330,4 +330,4 @@ public class CustomizedSystemMessages extends SystemMessages implements this.cookiesDisabledMessage = cookiesDisabledMessage; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java index b2a66ee2a9..e72b411720 100644 --- a/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java +++ b/server/src/com/vaadin/server/DefaultDeploymentConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/DefaultErrorHandler.java b/server/src/com/vaadin/server/DefaultErrorHandler.java index f8b684f1d1..bbb15b4d62 100644 --- a/server/src/com/vaadin/server/DefaultErrorHandler.java +++ b/server/src/com/vaadin/server/DefaultErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -138,4 +138,4 @@ public class DefaultErrorHandler implements ErrorHandler { return null; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/DefaultSystemMessagesProvider.java b/server/src/com/vaadin/server/DefaultSystemMessagesProvider.java index 9029a262e4..17177c36ca 100644 --- a/server/src/com/vaadin/server/DefaultSystemMessagesProvider.java +++ b/server/src/com/vaadin/server/DefaultSystemMessagesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java index d624f77cc6..2a1a59dbe6 100644 --- a/server/src/com/vaadin/server/DefaultUIProvider.java +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/DeploymentConfiguration.java b/server/src/com/vaadin/server/DeploymentConfiguration.java index 8c24379db3..b600d01cbd 100644 --- a/server/src/com/vaadin/server/DeploymentConfiguration.java +++ b/server/src/com/vaadin/server/DeploymentConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java index 4e66831f1d..681c438967 100644 --- a/server/src/com/vaadin/server/DownloadStream.java +++ b/server/src/com/vaadin/server/DownloadStream.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/DragAndDropService.java b/server/src/com/vaadin/server/DragAndDropService.java index 0402a4997e..087a670b5b 100644 --- a/server/src/com/vaadin/server/DragAndDropService.java +++ b/server/src/com/vaadin/server/DragAndDropService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/EncodeResult.java b/server/src/com/vaadin/server/EncodeResult.java index 87fefef548..55a97aa829 100644 --- a/server/src/com/vaadin/server/EncodeResult.java +++ b/server/src/com/vaadin/server/EncodeResult.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ErrorEvent.java b/server/src/com/vaadin/server/ErrorEvent.java index 0fae9cbfa8..5f8cb4eaca 100644 --- a/server/src/com/vaadin/server/ErrorEvent.java +++ b/server/src/com/vaadin/server/ErrorEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -121,4 +121,4 @@ public class ErrorEvent implements Serializable { return session.getErrorHandler(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/ErrorHandler.java b/server/src/com/vaadin/server/ErrorHandler.java index 64f2455ed5..9c3af4c999 100644 --- a/server/src/com/vaadin/server/ErrorHandler.java +++ b/server/src/com/vaadin/server/ErrorHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -29,4 +29,4 @@ public interface ErrorHandler extends Serializable { * the fired event. */ public void error(ErrorEvent event); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/ErrorHandlingRunnable.java b/server/src/com/vaadin/server/ErrorHandlingRunnable.java index 3970a14ee8..8ec24c0bcb 100644 --- a/server/src/com/vaadin/server/ErrorHandlingRunnable.java +++ b/server/src/com/vaadin/server/ErrorHandlingRunnable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ErrorMessage.java b/server/src/com/vaadin/server/ErrorMessage.java index 72b32ab074..0171b95e54 100644 --- a/server/src/com/vaadin/server/ErrorMessage.java +++ b/server/src/com/vaadin/server/ErrorMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Extension.java b/server/src/com/vaadin/server/Extension.java index 0f3d81598e..b27c58b4bc 100644 --- a/server/src/com/vaadin/server/Extension.java +++ b/server/src/com/vaadin/server/Extension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ExternalResource.java b/server/src/com/vaadin/server/ExternalResource.java index e2f43b4b27..0c724ae19f 100644 --- a/server/src/com/vaadin/server/ExternalResource.java +++ b/server/src/com/vaadin/server/ExternalResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java index bd7d9caafd..42c2f76e1a 100644 --- a/server/src/com/vaadin/server/FileDownloader.java +++ b/server/src/com/vaadin/server/FileDownloader.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/FileResource.java b/server/src/com/vaadin/server/FileResource.java index 688c25385f..de14e2f0f2 100644 --- a/server/src/com/vaadin/server/FileResource.java +++ b/server/src/com/vaadin/server/FileResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/FontAwesome.java b/server/src/com/vaadin/server/FontAwesome.java index a7f4c7b342..71a2249dca 100644 --- a/server/src/com/vaadin/server/FontAwesome.java +++ b/server/src/com/vaadin/server/FontAwesome.java @@ -13,6 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ + package com.vaadin.server; /** diff --git a/server/src/com/vaadin/server/FontIcon.java b/server/src/com/vaadin/server/FontIcon.java index 45279f2c44..2ada45084f 100644 --- a/server/src/com/vaadin/server/FontIcon.java +++ b/server/src/com/vaadin/server/FontIcon.java @@ -13,6 +13,7 @@ * License for the specific language governing permissions and limitations under * the License. */ + package com.vaadin.server; import com.vaadin.shared.ui.label.ContentMode; diff --git a/server/src/com/vaadin/server/GAEVaadinServlet.java b/server/src/com/vaadin/server/GAEVaadinServlet.java index 6690da7562..df7cd0a66e 100644 --- a/server/src/com/vaadin/server/GAEVaadinServlet.java +++ b/server/src/com/vaadin/server/GAEVaadinServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/GlobalResourceHandler.java b/server/src/com/vaadin/server/GlobalResourceHandler.java index 4235d85024..d1ef125534 100644 --- a/server/src/com/vaadin/server/GlobalResourceHandler.java +++ b/server/src/com/vaadin/server/GlobalResourceHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java index 895c1e615b..53fb1f838b 100644 --- a/server/src/com/vaadin/server/JavaScriptCallbackHelper.java +++ b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/JsonCodec.java b/server/src/com/vaadin/server/JsonCodec.java index d5e1082487..08345714fd 100644 --- a/server/src/com/vaadin/server/JsonCodec.java +++ b/server/src/com/vaadin/server/JsonCodec.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -72,13 +72,13 @@ public class JsonCodec implements Serializable { public JSONArray put(Object value) { throw new UnsupportedOperationException( "Immutable empty JSONArray."); - }; + } @Override public JSONArray put(int index, Object value) { throw new UnsupportedOperationException( "Immutable empty JSONArray."); - }; + } }; public static interface BeanProperty extends Serializable { diff --git a/server/src/com/vaadin/server/JsonPaintTarget.java b/server/src/com/vaadin/server/JsonPaintTarget.java index cd09b2a44b..47c69f1a30 100644 --- a/server/src/com/vaadin/server/JsonPaintTarget.java +++ b/server/src/com/vaadin/server/JsonPaintTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/KeyMapper.java b/server/src/com/vaadin/server/KeyMapper.java index 64773b5b3b..0e4b7edc77 100644 --- a/server/src/com/vaadin/server/KeyMapper.java +++ b/server/src/com/vaadin/server/KeyMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LegacyApplication.java b/server/src/com/vaadin/server/LegacyApplication.java index 44649067c5..d03b3d7f96 100644 --- a/server/src/com/vaadin/server/LegacyApplication.java +++ b/server/src/com/vaadin/server/LegacyApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -270,4 +270,4 @@ public abstract class LegacyApplication implements ErrorHandler { public void setLogoutURL(String logoutURL) { this.logoutURL = logoutURL; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java index c75cd097e5..0977071806 100644 --- a/server/src/com/vaadin/server/LegacyApplicationUIProvider.java +++ b/server/src/com/vaadin/server/LegacyApplicationUIProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LegacyCommunicationManager.java b/server/src/com/vaadin/server/LegacyCommunicationManager.java index 2b278e4858..0dda5661bd 100644 --- a/server/src/com/vaadin/server/LegacyCommunicationManager.java +++ b/server/src/com/vaadin/server/LegacyCommunicationManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LegacyPaint.java b/server/src/com/vaadin/server/LegacyPaint.java index 8d59dfd5ea..91ff103db6 100644 --- a/server/src/com/vaadin/server/LegacyPaint.java +++ b/server/src/com/vaadin/server/LegacyPaint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LegacyVaadinPortlet.java b/server/src/com/vaadin/server/LegacyVaadinPortlet.java index 8bebb36427..606809d893 100644 --- a/server/src/com/vaadin/server/LegacyVaadinPortlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinPortlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LegacyVaadinServlet.java b/server/src/com/vaadin/server/LegacyVaadinServlet.java index a70befba1d..8ef16b50bc 100644 --- a/server/src/com/vaadin/server/LegacyVaadinServlet.java +++ b/server/src/com/vaadin/server/LegacyVaadinServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/LocaleService.java b/server/src/com/vaadin/server/LocaleService.java index 031ceb433c..0274d227ab 100644 --- a/server/src/com/vaadin/server/LocaleService.java +++ b/server/src/com/vaadin/server/LocaleService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/NoInputStreamException.java b/server/src/com/vaadin/server/NoInputStreamException.java index 7569a46bf8..9f12c52fdf 100644 --- a/server/src/com/vaadin/server/NoInputStreamException.java +++ b/server/src/com/vaadin/server/NoInputStreamException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/NoOutputStreamException.java b/server/src/com/vaadin/server/NoOutputStreamException.java index f5e8d8c1f0..8dce2194e8 100644 --- a/server/src/com/vaadin/server/NoOutputStreamException.java +++ b/server/src/com/vaadin/server/NoOutputStreamException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java index 70b8306bc3..d58ba548e3 100644 --- a/server/src/com/vaadin/server/Page.java +++ b/server/src/com/vaadin/server/Page.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -636,7 +636,7 @@ public class Page implements Serializable { } public void init(VaadinRequest request) { - // NOTE: UI.reinit makes assumptions about the semantics of this method. + // NOTE: UI.refresh makes assumptions about the semantics of this method. // It should be kept in sync if this method is changed. // Extract special parameter sent by vaadinBootstrap.js diff --git a/server/src/com/vaadin/server/PaintException.java b/server/src/com/vaadin/server/PaintException.java index 0345cf911b..a7025598b2 100644 --- a/server/src/com/vaadin/server/PaintException.java +++ b/server/src/com/vaadin/server/PaintException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/PaintTarget.java b/server/src/com/vaadin/server/PaintTarget.java index 76b41ce7dd..902cb13816 100644 --- a/server/src/com/vaadin/server/PaintTarget.java +++ b/server/src/com/vaadin/server/PaintTarget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/RequestHandler.java b/server/src/com/vaadin/server/RequestHandler.java index 097a3e034b..b667ed038c 100644 --- a/server/src/com/vaadin/server/RequestHandler.java +++ b/server/src/com/vaadin/server/RequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Resource.java b/server/src/com/vaadin/server/Resource.java index 79de02b0d6..20e0bb7f9a 100644 --- a/server/src/com/vaadin/server/Resource.java +++ b/server/src/com/vaadin/server/Resource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ResourceReference.java b/server/src/com/vaadin/server/ResourceReference.java index 4bc8febd72..31dfa41ef9 100644 --- a/server/src/com/vaadin/server/ResourceReference.java +++ b/server/src/com/vaadin/server/ResourceReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Responsive.java b/server/src/com/vaadin/server/Responsive.java index d69c204c94..9209f14ff9 100644 --- a/server/src/com/vaadin/server/Responsive.java +++ b/server/src/com/vaadin/server/Responsive.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -49,7 +49,7 @@ import com.vaadin.ui.Component; * * <pre> * CssLayout layout = new CssLayout(); - * layout.setStyleName("responsive"); + * layout.setStyleName("responsive"); * layout.setSizeFull(); * Responsive.makeResponsive(layout); * </pre> diff --git a/server/src/com/vaadin/server/RestrictedRenderResponse.java b/server/src/com/vaadin/server/RestrictedRenderResponse.java index 9434666281..5bee476cff 100644 --- a/server/src/com/vaadin/server/RestrictedRenderResponse.java +++ b/server/src/com/vaadin/server/RestrictedRenderResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -181,4 +181,4 @@ class RestrictedRenderResponse implements RenderResponse, Serializable { // NOP return null; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/Scrollable.java b/server/src/com/vaadin/server/Scrollable.java index c5a1bc07b1..ae6828e339 100644 --- a/server/src/com/vaadin/server/Scrollable.java +++ b/server/src/com/vaadin/server/Scrollable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServerRpcManager.java b/server/src/com/vaadin/server/ServerRpcManager.java index a1682cb453..3a2cb3a32c 100644 --- a/server/src/com/vaadin/server/ServerRpcManager.java +++ b/server/src/com/vaadin/server/ServerRpcManager.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServerRpcMethodInvocation.java b/server/src/com/vaadin/server/ServerRpcMethodInvocation.java index 43942a77eb..d3f8531406 100644 --- a/server/src/com/vaadin/server/ServerRpcMethodInvocation.java +++ b/server/src/com/vaadin/server/ServerRpcMethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServiceDestroyEvent.java b/server/src/com/vaadin/server/ServiceDestroyEvent.java index 2ae4cc10af..2ed0bbf8f1 100644 --- a/server/src/com/vaadin/server/ServiceDestroyEvent.java +++ b/server/src/com/vaadin/server/ServiceDestroyEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServiceDestroyListener.java b/server/src/com/vaadin/server/ServiceDestroyListener.java index ad4966dd58..1549d82d51 100644 --- a/server/src/com/vaadin/server/ServiceDestroyListener.java +++ b/server/src/com/vaadin/server/ServiceDestroyListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServiceException.java b/server/src/com/vaadin/server/ServiceException.java index c73553e3aa..2bc36bc1d7 100644 --- a/server/src/com/vaadin/server/ServiceException.java +++ b/server/src/com/vaadin/server/ServiceException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ServletPortletHelper.java b/server/src/com/vaadin/server/ServletPortletHelper.java index c14467a10e..2ec747ba3a 100644 --- a/server/src/com/vaadin/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/server/ServletPortletHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionDestroyEvent.java b/server/src/com/vaadin/server/SessionDestroyEvent.java index dfb2b3358c..a64fce0b64 100644 --- a/server/src/com/vaadin/server/SessionDestroyEvent.java +++ b/server/src/com/vaadin/server/SessionDestroyEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionDestroyListener.java b/server/src/com/vaadin/server/SessionDestroyListener.java index ec1c136140..29daa60a40 100644 --- a/server/src/com/vaadin/server/SessionDestroyListener.java +++ b/server/src/com/vaadin/server/SessionDestroyListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionExpiredException.java b/server/src/com/vaadin/server/SessionExpiredException.java index 1da5d4ab1d..d70498e7cb 100644 --- a/server/src/com/vaadin/server/SessionExpiredException.java +++ b/server/src/com/vaadin/server/SessionExpiredException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionExpiredHandler.java b/server/src/com/vaadin/server/SessionExpiredHandler.java index 6a7896f3d1..3d6de95dea 100644 --- a/server/src/com/vaadin/server/SessionExpiredHandler.java +++ b/server/src/com/vaadin/server/SessionExpiredHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionInitEvent.java b/server/src/com/vaadin/server/SessionInitEvent.java index a69264a945..76262c6140 100644 --- a/server/src/com/vaadin/server/SessionInitEvent.java +++ b/server/src/com/vaadin/server/SessionInitEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SessionInitListener.java b/server/src/com/vaadin/server/SessionInitListener.java index 8476d719ce..2bbb8e3d1f 100644 --- a/server/src/com/vaadin/server/SessionInitListener.java +++ b/server/src/com/vaadin/server/SessionInitListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/Sizeable.java b/server/src/com/vaadin/server/Sizeable.java index decace3d10..ede5e6ab3b 100644 --- a/server/src/com/vaadin/server/Sizeable.java +++ b/server/src/com/vaadin/server/Sizeable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -81,6 +81,12 @@ public interface Sizeable extends Serializable { @Deprecated public static final Unit UNITS_PERCENTAGE = Unit.PERCENTAGE; + /** + * @deprecated As of 7.3, use instead {@link #setSizeUndefined()}, + * {@link #setHeightUndefined()} and + * {@link #setWidthUndefined()} + */ + @Deprecated public static final float SIZE_UNDEFINED = -1; public enum Unit { @@ -253,4 +259,18 @@ public interface Sizeable extends Serializable { */ public void setSizeUndefined(); + /** + * Clears any defined width + * + * @since 7.3 + */ + public void setWidthUndefined(); + + /** + * Clears any defined height + * + * @since 7.3 + */ + public void setHeightUndefined(); + } diff --git a/server/src/com/vaadin/server/StreamResource.java b/server/src/com/vaadin/server/StreamResource.java index 7210bcaffb..248d62338b 100644 --- a/server/src/com/vaadin/server/StreamResource.java +++ b/server/src/com/vaadin/server/StreamResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/StreamVariable.java b/server/src/com/vaadin/server/StreamVariable.java index 046b1119dd..c7b84c92d6 100644 --- a/server/src/com/vaadin/server/StreamVariable.java +++ b/server/src/com/vaadin/server/StreamVariable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SynchronizedRequestHandler.java b/server/src/com/vaadin/server/SynchronizedRequestHandler.java index c695855d7d..56abfbb8f3 100644 --- a/server/src/com/vaadin/server/SynchronizedRequestHandler.java +++ b/server/src/com/vaadin/server/SynchronizedRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SystemError.java b/server/src/com/vaadin/server/SystemError.java index cd4e499112..834055e1e1 100644 --- a/server/src/com/vaadin/server/SystemError.java +++ b/server/src/com/vaadin/server/SystemError.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SystemMessageException.java b/server/src/com/vaadin/server/SystemMessageException.java index c6e68cd562..854d8001f6 100644 --- a/server/src/com/vaadin/server/SystemMessageException.java +++ b/server/src/com/vaadin/server/SystemMessageException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -66,4 +66,4 @@ public class SystemMessageException extends RuntimeException { return cause; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/SystemMessages.java b/server/src/com/vaadin/server/SystemMessages.java index 299c725207..51e9da5800 100644 --- a/server/src/com/vaadin/server/SystemMessages.java +++ b/server/src/com/vaadin/server/SystemMessages.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -297,4 +297,4 @@ public class SystemMessages implements Serializable { : null); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/SystemMessagesInfo.java b/server/src/com/vaadin/server/SystemMessagesInfo.java index 57e4e0c122..195cf3c711 100644 --- a/server/src/com/vaadin/server/SystemMessagesInfo.java +++ b/server/src/com/vaadin/server/SystemMessagesInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/SystemMessagesProvider.java b/server/src/com/vaadin/server/SystemMessagesProvider.java index 91273ba7d4..a69cc0b159 100644 --- a/server/src/com/vaadin/server/SystemMessagesProvider.java +++ b/server/src/com/vaadin/server/SystemMessagesProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/ThemeResource.java b/server/src/com/vaadin/server/ThemeResource.java index 636542cb8a..45a2736bf3 100644 --- a/server/src/com/vaadin/server/ThemeResource.java +++ b/server/src/com/vaadin/server/ThemeResource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/UIClassSelectionEvent.java b/server/src/com/vaadin/server/UIClassSelectionEvent.java index 1d4469cd12..9c9bbe5bc9 100644 --- a/server/src/com/vaadin/server/UIClassSelectionEvent.java +++ b/server/src/com/vaadin/server/UIClassSelectionEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/UICreateEvent.java b/server/src/com/vaadin/server/UICreateEvent.java index 45a4106e76..1688416ba5 100644 --- a/server/src/com/vaadin/server/UICreateEvent.java +++ b/server/src/com/vaadin/server/UICreateEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/UIProvider.java b/server/src/com/vaadin/server/UIProvider.java index a76f396767..d3d834cad7 100644 --- a/server/src/com/vaadin/server/UIProvider.java +++ b/server/src/com/vaadin/server/UIProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -131,7 +131,7 @@ public abstract class UIProvider implements Serializable { * the value of window.name in the browser. * <p> * Whenever a preserved UI is reused, its - * {@link UI#reinit(com.vaadin.server.VaadinRequest) reinit} method is + * {@link UI#refresh(com.vaadin.server.VaadinRequest) refresh} method is * invoked by the framework first. * * diff --git a/server/src/com/vaadin/server/UIProviderEvent.java b/server/src/com/vaadin/server/UIProviderEvent.java index f5ed0ebaa5..1fcc0a3ddc 100644 --- a/server/src/com/vaadin/server/UIProviderEvent.java +++ b/server/src/com/vaadin/server/UIProviderEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java index 5fc00408a9..e5ea55b116 100644 --- a/server/src/com/vaadin/server/UnsupportedBrowserHandler.java +++ b/server/src/com/vaadin/server/UnsupportedBrowserHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -90,4 +90,4 @@ public class UnsupportedBrowserHandler extends SynchronizedRequestHandler { page.close(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/UploadException.java b/server/src/com/vaadin/server/UploadException.java index 7b8b889d45..1f1073b435 100644 --- a/server/src/com/vaadin/server/UploadException.java +++ b/server/src/com/vaadin/server/UploadException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/UserError.java b/server/src/com/vaadin/server/UserError.java index 2ff8fce966..ec1ac042f8 100644 --- a/server/src/com/vaadin/server/UserError.java +++ b/server/src/com/vaadin/server/UserError.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinPortlet.java b/server/src/com/vaadin/server/VaadinPortlet.java index b3ce238e72..77a1b18d10 100644 --- a/server/src/com/vaadin/server/VaadinPortlet.java +++ b/server/src/com/vaadin/server/VaadinPortlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinPortletRequest.java b/server/src/com/vaadin/server/VaadinPortletRequest.java index eae367a992..e1b521d57f 100644 --- a/server/src/com/vaadin/server/VaadinPortletRequest.java +++ b/server/src/com/vaadin/server/VaadinPortletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -239,4 +239,32 @@ public class VaadinPortletRequest extends PortletRequestWrapper implements return null; } + /** + * Gets the currently processed portlet request. The current portlet request + * is automatically defined when the request is started. The current portlet + * request can not be used in e.g. background threads because of the way + * server implementations reuse request instances. + * + * @return the current portlet request instance if available, otherwise + * <code>null</code> + * + */ + public static PortletRequest getCurrentPortletRequest() { + return VaadinPortletService.getCurrentPortletRequest(); + + } + + /** + * Gets the currently processed Vaadin portlet request. The current request + * is automatically defined when the request is started. The current request + * can not be used in e.g. background threads because of the way server + * implementations reuse request instances. + * + * @return the current Vaadin portlet request instance if available, + * otherwise <code>null</code> + * + */ + public static VaadinPortletRequest getCurrent() { + return VaadinPortletService.getCurrentRequest(); + } } diff --git a/server/src/com/vaadin/server/VaadinPortletResponse.java b/server/src/com/vaadin/server/VaadinPortletResponse.java index ccb35a2c91..7a0a68d116 100644 --- a/server/src/com/vaadin/server/VaadinPortletResponse.java +++ b/server/src/com/vaadin/server/VaadinPortletResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -140,4 +140,4 @@ public class VaadinPortletResponse implements VaadinResponse { public void addCookie(Cookie cookie) { response.addProperty(cookie); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/VaadinPortletService.java b/server/src/com/vaadin/server/VaadinPortletService.java index dceeec8e91..2b290b4cc4 100644 --- a/server/src/com/vaadin/server/VaadinPortletService.java +++ b/server/src/com/vaadin/server/VaadinPortletService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -248,15 +248,49 @@ public class VaadinPortletService extends VaadinService { return type; } + /** + * Gets the currently processed portlet request. The current portlet request + * is automatically defined when the request is started. The current portlet + * request can not be used in e.g. background threads because of the way + * server implementations reuse request instances. + * + * @return the current portlet request instance if available, otherwise + * <code>null</code> + * + */ public static PortletRequest getCurrentPortletRequest() { - VaadinRequest currentRequest = VaadinService.getCurrentRequest(); - if (currentRequest instanceof VaadinPortletRequest) { - return ((VaadinPortletRequest) currentRequest).getPortletRequest(); + VaadinPortletRequest currentRequest = getCurrentRequest(); + if (currentRequest != null) { + return currentRequest.getPortletRequest(); } else { return null; } } + /** + * Gets the currently processed Vaadin portlet request. The current request + * is automatically defined when the request is started. The current request + * can not be used in e.g. background threads because of the way server + * implementations reuse request instances. + * + * @return the current Vaadin portlet request instance if available, + * otherwise <code>null</code> + * + */ + public static VaadinPortletRequest getCurrentRequest() { + return (VaadinPortletRequest) VaadinService.getCurrentRequest(); + } + + /** + * Gets the currently processed Vaadin portlet response. The current + * response is automatically defined when the request is started. The + * current response can not be used in e.g. background threads because of + * the way server implementations reuse response instances. + * + * @return the current Vaadin portlet response instance if available, + * otherwise <code>null</code> + * + */ public static VaadinPortletResponse getCurrentResponse() { return (VaadinPortletResponse) VaadinService.getCurrentResponse(); } diff --git a/server/src/com/vaadin/server/VaadinPortletSession.java b/server/src/com/vaadin/server/VaadinPortletSession.java index 39416213c3..23b578cea2 100644 --- a/server/src/com/vaadin/server/VaadinPortletSession.java +++ b/server/src/com/vaadin/server/VaadinPortletSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinRequest.java b/server/src/com/vaadin/server/VaadinRequest.java index 08338f3620..538e0af598 100644 --- a/server/src/com/vaadin/server/VaadinRequest.java +++ b/server/src/com/vaadin/server/VaadinRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinResponse.java b/server/src/com/vaadin/server/VaadinResponse.java index 0cd3abb3f9..1d5fcf141f 100644 --- a/server/src/com/vaadin/server/VaadinResponse.java +++ b/server/src/com/vaadin/server/VaadinResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinService.java b/server/src/com/vaadin/server/VaadinService.java index b96e284e6e..08bc6f5c79 100644 --- a/server/src/com/vaadin/server/VaadinService.java +++ b/server/src/com/vaadin/server/VaadinService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -750,6 +750,9 @@ public abstract class VaadinService implements Serializable { session.storeInSession(this, request.getWrappedSession()); + // Initial WebBrowser data comes from the request + session.getBrowser().updateRequestDetails(request); + // Initial locale comes from the request Locale locale = request.getLocale(); session.setLocale(locale); @@ -938,12 +941,12 @@ public abstract class VaadinService implements Serializable { } /** - * Gets the currently processed Vaadin request. The current request is - * automatically defined when the request is started. The current request + * Gets the currently processed Vaadin response. The current response is + * automatically defined when the request is started. The current response * can not be used in e.g. background threads because of the way server - * implementations reuse request instances. + * implementations reuse response instances. * - * @return the current Vaadin request instance if available, otherwise + * @return the current Vaadin response instance if available, otherwise * <code>null</code> * * @see #setCurrentInstances(VaadinRequest, VaadinResponse) @@ -982,7 +985,7 @@ public abstract class VaadinService implements Serializable { // Get UI id from the request String uiIdString = request.getParameter(UIConstants.UI_ID_PARAMETER); UI ui = null; - if (uiIdString != null) { + if (uiIdString != null && session != null) { int uiId = Integer.parseInt(uiIdString); ui = session.getUIById(uiId); } diff --git a/server/src/com/vaadin/server/VaadinServlet.java b/server/src/com/vaadin/server/VaadinServlet.java index 2d4d11785a..81c3f374ea 100644 --- a/server/src/com/vaadin/server/VaadinServlet.java +++ b/server/src/com/vaadin/server/VaadinServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinServletRequest.java b/server/src/com/vaadin/server/VaadinServletRequest.java index e2b1fadc75..c68eefedb1 100644 --- a/server/src/com/vaadin/server/VaadinServletRequest.java +++ b/server/src/com/vaadin/server/VaadinServletRequest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -76,4 +76,4 @@ public class VaadinServletRequest extends HttpServletRequestWrapper implements public VaadinServletService getService() { return vaadinService; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/VaadinServletResponse.java b/server/src/com/vaadin/server/VaadinServletResponse.java index 845e56522e..fd688a594c 100644 --- a/server/src/com/vaadin/server/VaadinServletResponse.java +++ b/server/src/com/vaadin/server/VaadinServletResponse.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -81,4 +81,4 @@ public class VaadinServletResponse extends HttpServletResponseWrapper implements public VaadinServletService getService() { return vaadinService; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/VaadinServletService.java b/server/src/com/vaadin/server/VaadinServletService.java index daefad0644..a4ff3943c9 100644 --- a/server/src/com/vaadin/server/VaadinServletService.java +++ b/server/src/com/vaadin/server/VaadinServletService.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VaadinSession.java b/server/src/com/vaadin/server/VaadinSession.java index ac518c1902..bbabd881f8 100644 --- a/server/src/com/vaadin/server/VaadinSession.java +++ b/server/src/com/vaadin/server/VaadinSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/VariableOwner.java b/server/src/com/vaadin/server/VariableOwner.java index 2bfd3c0652..87a820e8b7 100644 --- a/server/src/com/vaadin/server/VariableOwner.java +++ b/server/src/com/vaadin/server/VariableOwner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/WebBrowser.java b/server/src/com/vaadin/server/WebBrowser.java index 4d1027f0e4..af20bcbb8f 100644 --- a/server/src/com/vaadin/server/WebBrowser.java +++ b/server/src/com/vaadin/server/WebBrowser.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/WrappedHttpSession.java b/server/src/com/vaadin/server/WrappedHttpSession.java index aed3be1ca0..137ccf2cdd 100644 --- a/server/src/com/vaadin/server/WrappedHttpSession.java +++ b/server/src/com/vaadin/server/WrappedHttpSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/WrappedPortletSession.java b/server/src/com/vaadin/server/WrappedPortletSession.java index e1e98e0501..37991aab39 100644 --- a/server/src/com/vaadin/server/WrappedPortletSession.java +++ b/server/src/com/vaadin/server/WrappedPortletSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/WrappedSession.java b/server/src/com/vaadin/server/WrappedSession.java index 57d3ef6a8c..b839e5d87a 100644 --- a/server/src/com/vaadin/server/WrappedSession.java +++ b/server/src/com/vaadin/server/WrappedSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/AbstractStreamingEvent.java b/server/src/com/vaadin/server/communication/AbstractStreamingEvent.java index b97a60fd56..1f546b2489 100644 --- a/server/src/com/vaadin/server/communication/AbstractStreamingEvent.java +++ b/server/src/com/vaadin/server/communication/AbstractStreamingEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java index a4290a31cf..f8ef360eda 100644 --- a/server/src/com/vaadin/server/communication/AtmospherePushConnection.java +++ b/server/src/com/vaadin/server/communication/AtmospherePushConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,6 +17,7 @@ package com.vaadin.server.communication; import java.io.IOException; +import java.io.ObjectInputStream; import java.io.Reader; import java.io.Serializable; import java.io.StringReader; @@ -117,11 +118,11 @@ public class AtmospherePushConnection implements PushConnection { CONNECTED; } - private State state = State.DISCONNECTED; private UI ui; - private AtmosphereResource resource; - private FragmentedMessage incomingMessage; - private Future<Object> outgoingMessage; + private transient State state = State.DISCONNECTED; + private transient AtmosphereResource resource; + private transient FragmentedMessage incomingMessage; + private transient Future<Object> outgoingMessage; public AtmospherePushConnection(UI ui) { this.ui = ui; @@ -209,6 +210,7 @@ public class AtmospherePushConnection implements PushConnection { @Override public boolean isConnected() { + assert state != null; assert (state == State.CONNECTED) ^ (resource == null); return state == State.CONNECTED; } @@ -287,12 +289,35 @@ public class AtmospherePushConnection implements PushConnection { outgoingMessage = null; } + try { + resource.close(); + } catch (IOException e) { + getLogger() + .log(Level.INFO, "Error when closing push connection", e); + } resource = null; state = State.DISCONNECTED; } + /** + * Returns the state of this connection. + */ + protected State getState() { + return state; + } + + /** + * Reinitializes this PushConnection after deserialization. The connection + * is initially in disconnected state; the client will handle the + * reconnecting. + */ + private void readObject(ObjectInputStream stream) throws IOException, + ClassNotFoundException { + stream.defaultReadObject(); + state = State.DISCONNECTED; + } + private static Logger getLogger() { return Logger.getLogger(AtmospherePushConnection.class.getName()); } - } diff --git a/server/src/com/vaadin/server/communication/ClientRpcWriter.java b/server/src/com/vaadin/server/communication/ClientRpcWriter.java index 285adac7a5..1090fdbab9 100644 --- a/server/src/com/vaadin/server/communication/ClientRpcWriter.java +++ b/server/src/com/vaadin/server/communication/ClientRpcWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/ConnectorHierarchyWriter.java b/server/src/com/vaadin/server/communication/ConnectorHierarchyWriter.java index 467bddbdce..653048b930 100644 --- a/server/src/com/vaadin/server/communication/ConnectorHierarchyWriter.java +++ b/server/src/com/vaadin/server/communication/ConnectorHierarchyWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/ConnectorTypeWriter.java b/server/src/com/vaadin/server/communication/ConnectorTypeWriter.java index eaa1c83ff2..0bafd20a81 100644 --- a/server/src/com/vaadin/server/communication/ConnectorTypeWriter.java +++ b/server/src/com/vaadin/server/communication/ConnectorTypeWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/DateSerializer.java b/server/src/com/vaadin/server/communication/DateSerializer.java index 9179eb922b..429941abfd 100644 --- a/server/src/com/vaadin/server/communication/DateSerializer.java +++ b/server/src/com/vaadin/server/communication/DateSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/FileUploadHandler.java b/server/src/com/vaadin/server/communication/FileUploadHandler.java index 7decfc2c0f..22c6a76106 100644 --- a/server/src/com/vaadin/server/communication/FileUploadHandler.java +++ b/server/src/com/vaadin/server/communication/FileUploadHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/HeartbeatHandler.java b/server/src/com/vaadin/server/communication/HeartbeatHandler.java index 04cb1b5a25..c6711d1d18 100644 --- a/server/src/com/vaadin/server/communication/HeartbeatHandler.java +++ b/server/src/com/vaadin/server/communication/HeartbeatHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/JSONSerializer.java b/server/src/com/vaadin/server/communication/JSONSerializer.java index fe609c70b6..91105d6ffd 100644 --- a/server/src/com/vaadin/server/communication/JSONSerializer.java +++ b/server/src/com/vaadin/server/communication/JSONSerializer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/LegacyUidlWriter.java b/server/src/com/vaadin/server/communication/LegacyUidlWriter.java index ad99a2d8b5..43ea1aca67 100644 --- a/server/src/com/vaadin/server/communication/LegacyUidlWriter.java +++ b/server/src/com/vaadin/server/communication/LegacyUidlWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/MetadataWriter.java b/server/src/com/vaadin/server/communication/MetadataWriter.java index 5ad7186c24..17c893fe40 100644 --- a/server/src/com/vaadin/server/communication/MetadataWriter.java +++ b/server/src/com/vaadin/server/communication/MetadataWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -77,7 +77,8 @@ public class MetadataWriter implements Serializable { // sessionExpiredURL after timer expires. if (messages != null && messages.getSessionExpiredMessage() == null && messages.getSessionExpiredCaption() == null - && messages.isSessionExpiredNotificationEnabled()) { + && messages.isSessionExpiredNotificationEnabled() + && ui.getSession().getSession() != null) { int newTimeoutInterval = ui.getSession().getSession() .getMaxInactiveInterval(); if (repaintAll || (timeoutInterval != newTimeoutInterval)) { diff --git a/server/src/com/vaadin/server/communication/PortletBootstrapHandler.java b/server/src/com/vaadin/server/communication/PortletBootstrapHandler.java index dd6d3c9283..66b08fdadd 100644 --- a/server/src/com/vaadin/server/communication/PortletBootstrapHandler.java +++ b/server/src/com/vaadin/server/communication/PortletBootstrapHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -121,4 +121,4 @@ public class PortletBootstrapHandler extends BootstrapHandler { return parameters; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/communication/PortletDummyRequestHandler.java b/server/src/com/vaadin/server/communication/PortletDummyRequestHandler.java index 8383cf607b..a79f5e96f2 100644 --- a/server/src/com/vaadin/server/communication/PortletDummyRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PortletDummyRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/PortletListenerNotifier.java b/server/src/com/vaadin/server/communication/PortletListenerNotifier.java index 34e007c770..3aa3426d2f 100644 --- a/server/src/com/vaadin/server/communication/PortletListenerNotifier.java +++ b/server/src/com/vaadin/server/communication/PortletListenerNotifier.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/PortletStateAwareRequestHandler.java b/server/src/com/vaadin/server/communication/PortletStateAwareRequestHandler.java index 4072aae359..a1276025d8 100644 --- a/server/src/com/vaadin/server/communication/PortletStateAwareRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PortletStateAwareRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/PortletUIInitHandler.java b/server/src/com/vaadin/server/communication/PortletUIInitHandler.java index d5d1e6b98d..b3cda44592 100644 --- a/server/src/com/vaadin/server/communication/PortletUIInitHandler.java +++ b/server/src/com/vaadin/server/communication/PortletUIInitHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/PublishedFileHandler.java b/server/src/com/vaadin/server/communication/PublishedFileHandler.java index 8fe0f7085f..56edffd16d 100644 --- a/server/src/com/vaadin/server/communication/PublishedFileHandler.java +++ b/server/src/com/vaadin/server/communication/PublishedFileHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -110,7 +110,14 @@ public class PublishedFileHandler implements RequestHandler { return true; } - // TODO Check and set cache headers + // Set caching for the published file + String cacheControl = "public, max-age=0, must-revalidate"; + int resourceCacheTime = request.getService() + .getDeploymentConfiguration().getResourceCacheTime(); + if (resourceCacheTime > 0) { + cacheControl = "max-age=" + String.valueOf(resourceCacheTime); + } + response.setHeader("Cache-Control", cacheControl); OutputStream out = null; try { diff --git a/server/src/com/vaadin/server/communication/PushConnection.java b/server/src/com/vaadin/server/communication/PushConnection.java index cab3c94824..d5a0d6e9bc 100644 --- a/server/src/com/vaadin/server/communication/PushConnection.java +++ b/server/src/com/vaadin/server/communication/PushConnection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,6 +16,8 @@ package com.vaadin.server.communication; +import java.io.Serializable; + import com.vaadin.ui.UI; /** @@ -30,7 +32,7 @@ import com.vaadin.ui.UI; * @author Vaadin Ltd * @since 7.1 */ -public interface PushConnection { +public interface PushConnection extends Serializable { /** * Pushes pending state changes and client RPC calls to the client. Can be @@ -53,4 +55,4 @@ public interface PushConnection { */ public boolean isConnected(); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/communication/PushHandler.java b/server/src/com/vaadin/server/communication/PushHandler.java index e028968494..983ada3279 100644 --- a/server/src/com/vaadin/server/communication/PushHandler.java +++ b/server/src/com/vaadin/server/communication/PushHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -186,46 +186,6 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter { } }; - /** - * Callback used when a connection is closed, either deliberately or because - * an error occurred. - */ - private final PushEventCallback disconnectCallback = new PushEventCallback() { - @Override - public void run(AtmosphereResource resource, UI ui) throws IOException { - PushMode pushMode = ui.getPushConfiguration().getPushMode(); - AtmospherePushConnection connection = getConnectionForUI(ui); - - String id = resource.uuid(); - - if (connection == null) { - getLogger() - .log(Level.WARNING, - "Could not find push connection to close: {0} with transport {1}", - new Object[] { id, resource.transport() }); - } else { - if (!pushMode.isEnabled()) { - /* - * The client is expected to close the connection after push - * mode has been set to disabled. - */ - getLogger().log(Level.FINER, - "Connection closed for resource {0}", id); - } else { - /* - * Unexpected cancel, e.g. if the user closes the browser - * tab. - */ - getLogger() - .log(Level.FINER, - "Connection unexpectedly closed for resource {0} with transport {1}", - new Object[] { id, resource.transport() }); - } - connection.disconnect(); - } - } - }; - private VaadinServletService service; public PushHandler(VaadinServletService service) { @@ -428,7 +388,12 @@ public class PushHandler extends AtmosphereResourceEventListenerAdapter { "Connection unexpectedly closed for resource {0} with transport {1}", new Object[] { id, resource.transport() }); } - ui.setPushConnection(null); + if (pushConnection.isConnected()) { + // disconnect() assumes the push connection is connected but + // this method can currently be called more than once during + // disconnect, depending on the situation + pushConnection.disconnect(); + } } } catch (final Exception e) { diff --git a/server/src/com/vaadin/server/communication/PushRequestHandler.java b/server/src/com/vaadin/server/communication/PushRequestHandler.java index 883a873ef6..db14e73c1a 100644 --- a/server/src/com/vaadin/server/communication/PushRequestHandler.java +++ b/server/src/com/vaadin/server/communication/PushRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/ResourceWriter.java b/server/src/com/vaadin/server/communication/ResourceWriter.java index 080027943f..2c5d1b409b 100644 --- a/server/src/com/vaadin/server/communication/ResourceWriter.java +++ b/server/src/com/vaadin/server/communication/ResourceWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/ServerRpcHandler.java b/server/src/com/vaadin/server/communication/ServerRpcHandler.java index 3e7aec7cac..89d87567d7 100644 --- a/server/src/com/vaadin/server/communication/ServerRpcHandler.java +++ b/server/src/com/vaadin/server/communication/ServerRpcHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/ServletBootstrapHandler.java b/server/src/com/vaadin/server/communication/ServletBootstrapHandler.java index 4b6517c30f..46909cecee 100644 --- a/server/src/com/vaadin/server/communication/ServletBootstrapHandler.java +++ b/server/src/com/vaadin/server/communication/ServletBootstrapHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -45,4 +45,4 @@ public class ServletBootstrapHandler extends BootstrapHandler { } return themeName; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/server/communication/ServletUIInitHandler.java b/server/src/com/vaadin/server/communication/ServletUIInitHandler.java index 6286c161f2..b3b1684809 100644 --- a/server/src/com/vaadin/server/communication/ServletUIInitHandler.java +++ b/server/src/com/vaadin/server/communication/ServletUIInitHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/SessionRequestHandler.java b/server/src/com/vaadin/server/communication/SessionRequestHandler.java index 244cb0121d..383ad2d541 100644 --- a/server/src/com/vaadin/server/communication/SessionRequestHandler.java +++ b/server/src/com/vaadin/server/communication/SessionRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/SharedStateWriter.java b/server/src/com/vaadin/server/communication/SharedStateWriter.java index fdf834387f..6a318f0758 100644 --- a/server/src/com/vaadin/server/communication/SharedStateWriter.java +++ b/server/src/com/vaadin/server/communication/SharedStateWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/StreamingEndEventImpl.java b/server/src/com/vaadin/server/communication/StreamingEndEventImpl.java index f8cfb160be..6d87d0cc8b 100644 --- a/server/src/com/vaadin/server/communication/StreamingEndEventImpl.java +++ b/server/src/com/vaadin/server/communication/StreamingEndEventImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/StreamingErrorEventImpl.java b/server/src/com/vaadin/server/communication/StreamingErrorEventImpl.java index 9d9a19e4fe..a96f759216 100644 --- a/server/src/com/vaadin/server/communication/StreamingErrorEventImpl.java +++ b/server/src/com/vaadin/server/communication/StreamingErrorEventImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/StreamingProgressEventImpl.java b/server/src/com/vaadin/server/communication/StreamingProgressEventImpl.java index 69f3bfb29c..7f2428a55d 100644 --- a/server/src/com/vaadin/server/communication/StreamingProgressEventImpl.java +++ b/server/src/com/vaadin/server/communication/StreamingProgressEventImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/StreamingStartEventImpl.java b/server/src/com/vaadin/server/communication/StreamingStartEventImpl.java index bd16f08801..a2ce075458 100644 --- a/server/src/com/vaadin/server/communication/StreamingStartEventImpl.java +++ b/server/src/com/vaadin/server/communication/StreamingStartEventImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/UIInitHandler.java b/server/src/com/vaadin/server/communication/UIInitHandler.java index 5dc44208d1..cf0de8e9ee 100644 --- a/server/src/com/vaadin/server/communication/UIInitHandler.java +++ b/server/src/com/vaadin/server/communication/UIInitHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -68,7 +68,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { try { assert UI.getCurrent() == null; - // Set browser information from the request + // Update browser information from the request session.getBrowser().updateRequestDetails(request); UI uI = getBrowserDetailsUI(request, session); @@ -266,7 +266,7 @@ public abstract class UIInitHandler extends SynchronizedRequestHandler { */ private void reinitUI(UI ui, VaadinRequest request) { UI.setCurrent(ui); - ui.doReinit(request); + ui.doRefresh(request); } /** diff --git a/server/src/com/vaadin/server/communication/UidlRequestHandler.java b/server/src/com/vaadin/server/communication/UidlRequestHandler.java index cf25910fa4..0d8ddb7bc7 100644 --- a/server/src/com/vaadin/server/communication/UidlRequestHandler.java +++ b/server/src/com/vaadin/server/communication/UidlRequestHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/communication/UidlWriter.java b/server/src/com/vaadin/server/communication/UidlWriter.java index 893a87972d..00522e2aa5 100644 --- a/server/src/com/vaadin/server/communication/UidlWriter.java +++ b/server/src/com/vaadin/server/communication/UidlWriter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java b/server/src/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java index 94ca9e7d5b..cfee2a320e 100644 --- a/server/src/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java +++ b/server/src/com/vaadin/server/themeutils/SASSAddonImportFileCreator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/widgetsetutils/ClassPathExplorer.java b/server/src/com/vaadin/server/widgetsetutils/ClassPathExplorer.java index 3ad76794de..063f4f5346 100644 --- a/server/src/com/vaadin/server/widgetsetutils/ClassPathExplorer.java +++ b/server/src/com/vaadin/server/widgetsetutils/ClassPathExplorer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java b/server/src/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java index 6d0818b2cd..f810a63a38 100644 --- a/server/src/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java +++ b/server/src/com/vaadin/server/widgetsetutils/WidgetSetBuilder.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java index 86a8948fdc..afc73f5ecc 100644 --- a/server/src/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/com/vaadin/ui/AbsoluteLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractColorPicker.java b/server/src/com/vaadin/ui/AbstractColorPicker.java index c3bdd49155..db4239f8a6 100644 --- a/server/src/com/vaadin/ui/AbstractColorPicker.java +++ b/server/src/com/vaadin/ui/AbstractColorPicker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -464,4 +464,4 @@ public abstract class AbstractColorPicker extends AbstractComponent implements public boolean isHtmlContentAllowed() { return getState().htmlContentAllowed; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 33aa689a88..b6289e0b7d 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -825,7 +825,27 @@ public abstract class AbstractComponent extends AbstractClientConnector */ @Override public void setSizeUndefined() { + setWidthUndefined(); + setHeightUndefined(); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setWidthUndefined() + */ + @Override + public void setWidthUndefined() { setWidth(-1, Unit.PIXELS); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.server.Sizeable#setHeightUndefined() + */ + @Override + public void setHeightUndefined() { setHeight(-1, Unit.PIXELS); } @@ -971,4 +991,24 @@ public abstract class AbstractComponent extends AbstractClientConnector actionManager.removeAction(shortcut); } } + + /** + * Determine whether a <code>content</code> component is equal to, or the + * ancestor of this component. + * + * @param content + * the potential ancestor element + * @return <code>true</code> if the relationship holds + */ + protected boolean isOrHasAncestor(Component content) { + if (content instanceof HasComponents) { + for (Component parent = this; parent != null; parent = parent + .getParent()) { + if (parent == content) { + return true; + } + } + } + return false; + } } diff --git a/server/src/com/vaadin/ui/AbstractComponentContainer.java b/server/src/com/vaadin/ui/AbstractComponentContainer.java index 4aacad680f..b1e69ba76b 100644 --- a/server/src/com/vaadin/ui/AbstractComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractComponentContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -196,15 +196,10 @@ public abstract class AbstractComponentContainer extends AbstractComponent */ @Override public void addComponent(Component c) { - if (c instanceof ComponentContainer) { - // Make sure we're not adding the component inside it's own content - for (Component parent = this; parent != null; parent = parent - .getParent()) { - if (parent == c) { - throw new IllegalArgumentException( - "Component cannot be added inside it's own content"); - } - } + // Make sure we're not adding the component inside it's own content + if (isOrHasAncestor(c)) { + throw new IllegalArgumentException( + "Component cannot be added inside it's own content"); } if (c.getParent() != null) { @@ -349,4 +344,4 @@ public abstract class AbstractComponentContainer extends AbstractComponent public Iterator<Component> getComponentIterator() { return iterator(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java index dc8310fb5e..8c574fd59e 100644 --- a/server/src/com/vaadin/ui/AbstractEmbedded.java +++ b/server/src/com/vaadin/ui/AbstractEmbedded.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index 300e130c4e..47ac953319 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java index 6769b6e513..d6e232035b 100644 --- a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java +++ b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractLayout.java b/server/src/com/vaadin/ui/AbstractLayout.java index c59fd4c96d..9cdb0a326a 100644 --- a/server/src/com/vaadin/ui/AbstractLayout.java +++ b/server/src/com/vaadin/ui/AbstractLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractMedia.java b/server/src/com/vaadin/ui/AbstractMedia.java index d7d593c29e..a841aa672e 100644 --- a/server/src/com/vaadin/ui/AbstractMedia.java +++ b/server/src/com/vaadin/ui/AbstractMedia.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index c9eb756daa..039c87333e 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -213,8 +213,12 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements if (oldLocation == -1) { addComponent(newComponent); } else if (newLocation == -1) { + Alignment alignment = getComponentAlignment(oldComponent); + float expandRatio = getExpandRatio(oldComponent); + removeComponent(oldComponent); addComponent(newComponent, oldLocation); + applyLayoutSettings(newComponent, alignment, expandRatio); } else { // Both old and new are in the layout if (oldLocation > newLocation) { @@ -444,4 +448,10 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements defaultComponentAlignment = defaultAlignment; } + private void applyLayoutSettings(Component target, Alignment alignment, + float expandRatio) { + setComponentAlignment(target, alignment); + setExpandRatio(target, expandRatio); + } + } diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java index a32d40b11d..b8db329906 100644 --- a/server/src/com/vaadin/ui/AbstractSelect.java +++ b/server/src/com/vaadin/ui/AbstractSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -904,7 +904,7 @@ public abstract class AbstractSelect extends AbstractField<Object> implements * if the underlying container don't support adding items with * identifiers */ - public void addItems(Collection<Object> itemIds) + public void addItems(Collection<?> itemIds) throws UnsupportedOperationException { addItems(itemIds.toArray()); } diff --git a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java index 534f01d4eb..ba108fc302 100644 --- a/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java +++ b/server/src/com/vaadin/ui/AbstractSingleComponentContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -123,6 +123,12 @@ public abstract class AbstractSingleComponentContainer extends */ @Override public void setContent(Component content) { + // Make sure we're not adding the component inside it's own content + if (isOrHasAncestor(content)) { + throw new IllegalArgumentException( + "Component cannot be added inside it's own content"); + } + Component oldContent = getContent(); if (oldContent == content) { // do not set the same content twice diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index e4f4543f1e..3a1b7ca35a 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index 8c61680d5c..25b34ae19f 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Accordion.java b/server/src/com/vaadin/ui/Accordion.java index cca0a7efb8..1d53937d24 100644 --- a/server/src/com/vaadin/ui/Accordion.java +++ b/server/src/com/vaadin/ui/Accordion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Alignment.java b/server/src/com/vaadin/ui/Alignment.java index abc710a179..57131494ac 100644 --- a/server/src/com/vaadin/ui/Alignment.java +++ b/server/src/com/vaadin/ui/Alignment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Audio.java b/server/src/com/vaadin/ui/Audio.java index d4e4f8aed2..845bbd13b5 100644 --- a/server/src/com/vaadin/ui/Audio.java +++ b/server/src/com/vaadin/ui/Audio.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/BrowserFrame.java b/server/src/com/vaadin/ui/BrowserFrame.java index e6167706ec..5717941ac5 100644 --- a/server/src/com/vaadin/ui/BrowserFrame.java +++ b/server/src/com/vaadin/ui/BrowserFrame.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Button.java b/server/src/com/vaadin/ui/Button.java index 765c805d37..5a5d03a3ee 100644 --- a/server/src/com/vaadin/ui/Button.java +++ b/server/src/com/vaadin/ui/Button.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Calendar.java b/server/src/com/vaadin/ui/Calendar.java index b0999451c3..59dfceec9b 100644 --- a/server/src/com/vaadin/ui/Calendar.java +++ b/server/src/com/vaadin/ui/Calendar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/CheckBox.java b/server/src/com/vaadin/ui/CheckBox.java index ac33f5e410..3c4ce1c528 100644 --- a/server/src/com/vaadin/ui/CheckBox.java +++ b/server/src/com/vaadin/ui/CheckBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ColorPicker.java b/server/src/com/vaadin/ui/ColorPicker.java index 342504c9f6..f65b67db72 100644 --- a/server/src/com/vaadin/ui/ColorPicker.java +++ b/server/src/com/vaadin/ui/ColorPicker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ColorPickerArea.java b/server/src/com/vaadin/ui/ColorPickerArea.java index 0d589356a3..94f64cf256 100644 --- a/server/src/com/vaadin/ui/ColorPickerArea.java +++ b/server/src/com/vaadin/ui/ColorPickerArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java index da29618efe..048726dc84 100644 --- a/server/src/com/vaadin/ui/ComboBox.java +++ b/server/src/com/vaadin/ui/ComboBox.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index c385805675..e10b5e1cd9 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ComponentContainer.java b/server/src/com/vaadin/ui/ComponentContainer.java index fd7d5f7646..2d5b4ffa9a 100644 --- a/server/src/com/vaadin/ui/ComponentContainer.java +++ b/server/src/com/vaadin/ui/ComponentContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java index af03dade3a..f7eae0013a 100644 --- a/server/src/com/vaadin/ui/ConnectorTracker.java +++ b/server/src/com/vaadin/ui/ConnectorTracker.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -209,15 +209,6 @@ public class ConnectorTracker implements Serializable { } } - private void removeFromGlobalResourceHandler(ClientConnector connector) { - GlobalResourceHandler globalResourceHandler = uI.getSession() - .getGlobalResourceHandler(false); - // Nothing to do if there is no handler - if (globalResourceHandler != null) { - globalResourceHandler.unregisterConnector(connector); - } - } - /** * Checks whether the given connector has already been initialized in the * browser. The given connector should be registered with this connector @@ -289,17 +280,9 @@ public class ConnectorTracker implements Serializable { * to the application. This should only be called by the framework. */ public void cleanConnectorMap() { - // Remove connectors that have been unregistered - for (ClientConnector connector : unregisteredConnectors) { - ClientConnector removedConnector = connectorIdToConnector - .remove(connector.getConnectorId()); - assert removedConnector == connector; - - removeFromGlobalResourceHandler(connector); - uninitializedConnectors.remove(connector); - diffStates.remove(connector); + if (!unregisteredConnectors.isEmpty()) { + removeUnregisteredConnectors(); } - unregisteredConnectors.clear(); // Do this expensive check only with assertions enabled assert isHierarchyComplete() : "The connector hierarchy is corrupted. " @@ -309,12 +292,14 @@ public class ConnectorTracker implements Serializable { // remove detached components from paintableIdMap so they // can be GC'ed - Iterator<String> iterator = connectorIdToConnector.keySet().iterator(); - + Iterator<ClientConnector> iterator = connectorIdToConnector.values() + .iterator(); + GlobalResourceHandler globalResourceHandler = uI.getSession() + .getGlobalResourceHandler(false); while (iterator.hasNext()) { - String connectorId = iterator.next(); - ClientConnector connector = connectorIdToConnector.get(connectorId); - if (getUIForConnector(connector) != uI) { + ClientConnector connector = iterator.next(); + assert connector != null; + if (connector.getUI() != uI) { // If connector is no longer part of this uI, // remove it from the map. If it is re-attached to the // application at some point it will be re-added through @@ -328,7 +313,9 @@ public class ConnectorTracker implements Serializable { "cleanConnectorMap unregistered connector {0}. This should have been done when the connector was detached.", getConnectorAndParentInfo(connector)); - removeFromGlobalResourceHandler(connector); + if (globalResourceHandler != null) { + globalResourceHandler.unregisterConnector(connector); + } uninitializedConnectors.remove(connector); diffStates.remove(connector); iterator.remove(); @@ -349,6 +336,24 @@ public class ConnectorTracker implements Serializable { cleanStreamVariables(); } + private void removeUnregisteredConnectors() { + GlobalResourceHandler globalResourceHandler = uI.getSession() + .getGlobalResourceHandler(false); + + for (ClientConnector connector : unregisteredConnectors) { + ClientConnector removedConnector = connectorIdToConnector + .remove(connector.getConnectorId()); + assert removedConnector == connector; + + if (globalResourceHandler != null) { + globalResourceHandler.unregisterConnector(connector); + } + uninitializedConnectors.remove(connector); + diffStates.remove(connector); + } + unregisteredConnectors.clear(); + } + private boolean isHierarchyComplete() { boolean noErrors = true; @@ -393,25 +398,6 @@ public class ConnectorTracker implements Serializable { } /** - * Finds the uI that the connector is attached to. - * - * @param connector - * The connector to lookup - * @return The uI the connector is attached to or null if it is not attached - * to any uI. - */ - private UI getUIForConnector(ClientConnector connector) { - if (connector == null) { - return null; - } - if (connector instanceof Component) { - return ((Component) connector).getUI(); - } - - return getUIForConnector(connector.getParent()); - } - - /** * Mark the connector as dirty. This should not be done while the response * is being written. * @@ -727,11 +713,12 @@ public class ConnectorTracker implements Serializable { */ private void cleanStreamVariables() { if (pidToNameToStreamVariable != null) { + ConnectorTracker connectorTracker = uI.getConnectorTracker(); Iterator<String> iterator = pidToNameToStreamVariable.keySet() .iterator(); while (iterator.hasNext()) { String connectorId = iterator.next(); - if (uI.getConnectorTracker().getConnector(connectorId) == null) { + if (connectorTracker.getConnector(connectorId) == null) { // Owner is no longer attached to the session Map<String, StreamVariable> removed = pidToNameToStreamVariable .get(connectorId); diff --git a/server/src/com/vaadin/ui/CssLayout.java b/server/src/com/vaadin/ui/CssLayout.java index f72ffcbb96..7fdae32bd1 100644 --- a/server/src/com/vaadin/ui/CssLayout.java +++ b/server/src/com/vaadin/ui/CssLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/CustomComponent.java b/server/src/com/vaadin/ui/CustomComponent.java index 9e004f7a17..cfd109d175 100644 --- a/server/src/com/vaadin/ui/CustomComponent.java +++ b/server/src/com/vaadin/ui/CustomComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/CustomField.java b/server/src/com/vaadin/ui/CustomField.java index d3c66e4c38..0fdb6eba34 100644 --- a/server/src/com/vaadin/ui/CustomField.java +++ b/server/src/com/vaadin/ui/CustomField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/CustomLayout.java b/server/src/com/vaadin/ui/CustomLayout.java index 37c9a4fa21..fd56ed9219 100644 --- a/server/src/com/vaadin/ui/CustomLayout.java +++ b/server/src/com/vaadin/ui/CustomLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java index 17dda73b95..7ab7732079 100644 --- a/server/src/com/vaadin/ui/DateField.java +++ b/server/src/com/vaadin/ui/DateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/DefaultFieldFactory.java b/server/src/com/vaadin/ui/DefaultFieldFactory.java index 6ff3687e0e..ad6461686c 100644 --- a/server/src/com/vaadin/ui/DefaultFieldFactory.java +++ b/server/src/com/vaadin/ui/DefaultFieldFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java index 2ab3e872c6..cb94a774a5 100644 --- a/server/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Embedded.java b/server/src/com/vaadin/ui/Embedded.java index 53354db0f4..1086da8d09 100644 --- a/server/src/com/vaadin/ui/Embedded.java +++ b/server/src/com/vaadin/ui/Embedded.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Field.java b/server/src/com/vaadin/ui/Field.java index 447ae2c0e6..f191e1bdd7 100644 --- a/server/src/com/vaadin/ui/Field.java +++ b/server/src/com/vaadin/ui/Field.java @@ -1,12 +1,12 @@ /* - * Copyright 2000-2013 Vaadin Ltd. - * + * 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 @@ -21,14 +21,23 @@ import com.vaadin.data.Property; import com.vaadin.ui.Component.Focusable; /** - * TODO document - * + * Field interface is implemented by all classes (field components) that have a + * value that the user can change through the user interface. + * + * Field components are built upon the framework defined in the Field interface + * and the {@link com.vaadin.AbstractField} base class. + * + * The Field interface inherits the {@link com.vaadin.ui.Component} + * superinterface and also the {@link com.vaadin.ui.Property} interface to have + * a value for the field. + * + * * @author Vaadin Ltd. - * + * * @param T * the type of values in the field, which might not be the same type * as that of the data source if converters are used - * + * * @author IT Mill Ltd. */ public interface Field<T> extends Component, BufferedValidatable, Property<T>, @@ -37,9 +46,9 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Is this field required. - * + * * Required fields must filled by the user. - * + * * @return <code>true</code> if the field is required,otherwise * <code>false</code>. * @since 3.1 @@ -48,7 +57,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Sets the field required. Required fields must filled by the user. - * + * * @param required * Is the field required. * @since 3.1 @@ -57,7 +66,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Sets the error message to be displayed if a required field is empty. - * + * * @param requiredMessage * Error message. * @since 5.2.6 @@ -67,7 +76,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Gets the error message that is to be displayed if a required field is * empty. - * + * * @return Error message. * @since 5.2.6 */ @@ -76,7 +85,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * An <code>Event</code> object specifying the Field whose value has been * changed. - * + * * @author Vaadin Ltd. * @since 3.0 */ @@ -86,7 +95,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Constructs a new event object with the specified source field object. - * + * * @param source * the field that caused the event. */ @@ -96,7 +105,7 @@ public interface Field<T> extends Component, BufferedValidatable, Property<T>, /** * Gets the Property which triggered the event. - * + * * @return the Source Property of the event. */ @Override diff --git a/server/src/com/vaadin/ui/Flash.java b/server/src/com/vaadin/ui/Flash.java index cc00a07aa8..791202f4a9 100644 --- a/server/src/com/vaadin/ui/Flash.java +++ b/server/src/com/vaadin/ui/Flash.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java index 706c103cd7..5653a83cee 100644 --- a/server/src/com/vaadin/ui/Form.java +++ b/server/src/com/vaadin/ui/Form.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/FormFieldFactory.java b/server/src/com/vaadin/ui/FormFieldFactory.java index 0cf7666704..124e0fcb9a 100644 --- a/server/src/com/vaadin/ui/FormFieldFactory.java +++ b/server/src/com/vaadin/ui/FormFieldFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/FormLayout.java b/server/src/com/vaadin/ui/FormLayout.java index 9dc0b24cad..1c8b196b31 100644 --- a/server/src/com/vaadin/ui/FormLayout.java +++ b/server/src/com/vaadin/ui/FormLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 53a25c1c83..00e50aafc4 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/HasComponents.java b/server/src/com/vaadin/ui/HasComponents.java index 7de944c0f2..6273e8053b 100644 --- a/server/src/com/vaadin/ui/HasComponents.java +++ b/server/src/com/vaadin/ui/HasComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/HorizontalLayout.java b/server/src/com/vaadin/ui/HorizontalLayout.java index dbf691dc95..54569570b9 100644 --- a/server/src/com/vaadin/ui/HorizontalLayout.java +++ b/server/src/com/vaadin/ui/HorizontalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/HorizontalSplitPanel.java b/server/src/com/vaadin/ui/HorizontalSplitPanel.java index 2346bc7acd..14bfdba023 100644 --- a/server/src/com/vaadin/ui/HorizontalSplitPanel.java +++ b/server/src/com/vaadin/ui/HorizontalSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Html5File.java b/server/src/com/vaadin/ui/Html5File.java index d548fe6d71..87ea83c8c9 100644 --- a/server/src/com/vaadin/ui/Html5File.java +++ b/server/src/com/vaadin/ui/Html5File.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -74,4 +74,4 @@ public class Html5File implements Serializable { return streamVariable; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java index 93bcb0ec51..7b0294a450 100644 --- a/server/src/com/vaadin/ui/Image.java +++ b/server/src/com/vaadin/ui/Image.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/InlineDateField.java b/server/src/com/vaadin/ui/InlineDateField.java index 0aadad2f1f..e6f0f5d7a0 100644 --- a/server/src/com/vaadin/ui/InlineDateField.java +++ b/server/src/com/vaadin/ui/InlineDateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/JavaScript.java b/server/src/com/vaadin/ui/JavaScript.java index 9078d1b7ac..68c8c9a6e4 100644 --- a/server/src/com/vaadin/ui/JavaScript.java +++ b/server/src/com/vaadin/ui/JavaScript.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/JavaScriptFunction.java b/server/src/com/vaadin/ui/JavaScriptFunction.java index 410bae12d9..2c026abd1a 100644 --- a/server/src/com/vaadin/ui/JavaScriptFunction.java +++ b/server/src/com/vaadin/ui/JavaScriptFunction.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Label.java b/server/src/com/vaadin/ui/Label.java index 71d54fc29a..b4685adcea 100644 --- a/server/src/com/vaadin/ui/Label.java +++ b/server/src/com/vaadin/ui/Label.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Layout.java b/server/src/com/vaadin/ui/Layout.java index dc16b186f2..6cf2cec249 100644 --- a/server/src/com/vaadin/ui/Layout.java +++ b/server/src/com/vaadin/ui/Layout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/LegacyComponent.java b/server/src/com/vaadin/ui/LegacyComponent.java index 33e3acb3d2..7f71162c94 100644 --- a/server/src/com/vaadin/ui/LegacyComponent.java +++ b/server/src/com/vaadin/ui/LegacyComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/LegacyWindow.java b/server/src/com/vaadin/ui/LegacyWindow.java index 458b09390d..fe71d14430 100644 --- a/server/src/com/vaadin/ui/LegacyWindow.java +++ b/server/src/com/vaadin/ui/LegacyWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -477,4 +477,4 @@ public class LegacyWindow extends UI { getContent().removeAllComponents(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java index e1a47777bd..2731e93ef2 100644 --- a/server/src/com/vaadin/ui/Link.java +++ b/server/src/com/vaadin/ui/Link.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ListSelect.java b/server/src/com/vaadin/ui/ListSelect.java index 60b95f7fde..9f44407db9 100644 --- a/server/src/com/vaadin/ui/ListSelect.java +++ b/server/src/com/vaadin/ui/ListSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/LoadingIndicatorConfiguration.java b/server/src/com/vaadin/ui/LoadingIndicatorConfiguration.java index 57ccdc1b64..46fe7ead35 100644 --- a/server/src/com/vaadin/ui/LoadingIndicatorConfiguration.java +++ b/server/src/com/vaadin/ui/LoadingIndicatorConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index 67d7182ecb..1f0e3fc3b3 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/MenuBar.java b/server/src/com/vaadin/ui/MenuBar.java index 545a1e9e3e..17a2f8e391 100644 --- a/server/src/com/vaadin/ui/MenuBar.java +++ b/server/src/com/vaadin/ui/MenuBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/NativeButton.java b/server/src/com/vaadin/ui/NativeButton.java index 1eb81b17ba..3c220719b5 100644 --- a/server/src/com/vaadin/ui/NativeButton.java +++ b/server/src/com/vaadin/ui/NativeButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/NativeSelect.java b/server/src/com/vaadin/ui/NativeSelect.java index d21203e47c..51f5536588 100644 --- a/server/src/com/vaadin/ui/NativeSelect.java +++ b/server/src/com/vaadin/ui/NativeSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Notification.java b/server/src/com/vaadin/ui/Notification.java index 31fa265b02..aaf25a9e9d 100644 --- a/server/src/com/vaadin/ui/Notification.java +++ b/server/src/com/vaadin/ui/Notification.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,7 +21,6 @@ import java.io.Serializable; import com.vaadin.server.Page; import com.vaadin.server.Resource; import com.vaadin.shared.Position; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; /** * A notification message, used to display temporary messages to the user - for @@ -64,7 +63,27 @@ import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; */ public class Notification implements Serializable { public enum Type { - HUMANIZED_MESSAGE, WARNING_MESSAGE, ERROR_MESSAGE, TRAY_NOTIFICATION, ASSISTIVE_NOTIFICATION; + HUMANIZED_MESSAGE("humanized"), WARNING_MESSAGE("warning"), ERROR_MESSAGE( + "error"), TRAY_NOTIFICATION("tray"), + /** + * @since 7.2 + */ + ASSISTIVE_NOTIFICATION("assistive"); + + private String style; + + Type(String style) { + this.style = style; + } + + /** + * @since 7.2 + * + * @return the style name for this notification type. + */ + public String getStyle() { + return style; + } } @Deprecated @@ -187,44 +206,28 @@ public class Notification implements Serializable { } private void setType(Type type) { + styleName = type.getStyle(); switch (type) { case WARNING_MESSAGE: delayMsec = 1500; - styleName = "warning"; - setNavigationConfiguration("Warning: ", "", Role.ALERT); break; case ERROR_MESSAGE: delayMsec = -1; - styleName = "error"; - setNavigationConfiguration("Error: ", " - close with ESC", - Role.ALERT); break; case TRAY_NOTIFICATION: delayMsec = 3000; position = Position.BOTTOM_RIGHT; - styleName = "tray"; - setNavigationConfiguration("Info: ", "", Role.STATUS); break; case ASSISTIVE_NOTIFICATION: delayMsec = 3000; position = Position.ASSISTIVE; - styleName = "assistive"; - setNavigationConfiguration("Note: ", "", Role.ALERT); break; case HUMANIZED_MESSAGE: default: - styleName = "humanized"; - setNavigationConfiguration("Info: ", "", Role.ALERT); break; } } - private void setNavigationConfiguration(String prefix, String postfix, - Role ariaRole) { - UI.getCurrent().getNotificationConfiguration() - .setStyleConfiguration(styleName, prefix, postfix, ariaRole); - } - /** * Gets the caption part of the notification message. * @@ -340,132 +343,6 @@ public class Notification implements Serializable { } /** - * Sets the accessibility prefix for a notification type. - * - * This prefix is read to assistive device users before the content of the - * notification, but not visible on the page. - * - * @param type - * Type of the notification - * @param prefix - * String that is placed before the notification content - */ - public void setAssistivePrefixForType(Type type, String prefix) { - UI.getCurrent().getNotificationConfiguration() - .setAssistivePrefixForStyle(getStyle(type), prefix); - } - - /** - * Gets the accessibility prefix for a notification type. - * - * This prefix is read to assistive device users before the content of the - * notification, but not visible on the page. - * - * @param type - * Type of the notification - * @return The accessibility prefix for the provided notification type - */ - public String getAssistivePrefixForType(Type type) { - return UI.getCurrent().getNotificationConfiguration() - .getAssistivePrefixForStyle(getStyle(type)); - } - - /** - * Sets the accessibility postfix for a notification type. - * - * This postfix is read to assistive device users after the content of the - * notification, but not visible on the page. - * - * @param type - * Type of the notification - * @param postfix - * String that is placed after the notification content - */ - public void setAssistivePostfixForType(Type type, String postfix) { - UI.getCurrent().getNotificationConfiguration() - .setAssistivePostfixForStyle(getStyle(type), postfix); - } - - /** - * Gets the accessibility postfix for a notification type. - * - * This postfix is read to assistive device users after the content of the - * notification, but not visible on the page. - * - * @param type - * Type of the notification - * @return The accessibility postfix for the provided notification type - */ - public String getAssistivePostfixForType(Type type) { - return UI.getCurrent().getNotificationConfiguration() - .getAssistivePostfixForStyle(getStyle(type)); - } - - /** - * Sets the WAI-ARIA role for a notification type. - * - * This role defines how an assistive device handles a notification. - * Available roles are alert and status (@see <a - * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles - * Model</a>). - * - * The default role is alert. - * - * @param type - * Type of the notification - * @param role - * Role to set for the notification type - */ - public void setAssistiveRoleForType(Type type, Role role) { - UI.getCurrent().getNotificationConfiguration() - .setAssistiveRoleForStyle(getStyle(type), role); - } - - /** - * Gets the WAI-ARIA role for a notification type. - * - * This role defines how an assistive device handles a notification. - * Available roles are alert and status (@see <a - * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles - * Model</a>) - * - * The default role is alert. - * - * @param type - * Type of the notification - * @return Role to set for the notification type - */ - public Role getAssistiveRoleForType(Type type) { - return UI.getCurrent().getNotificationConfiguration() - .getAssistiveRoleForStyle(getStyle(type)); - } - - private String getStyle(Type type) { - String style = ""; - - switch (type) { - case WARNING_MESSAGE: - style = "warning"; - break; - case ERROR_MESSAGE: - style = "error"; - break; - case TRAY_NOTIFICATION: - style = "tray"; - break; - case ASSISTIVE_NOTIFICATION: - style = "assistive"; - break; - case HUMANIZED_MESSAGE: - default: - style = "humanized"; - break; - } - - return style; - } - - /** * Sets whether html is allowed in the caption and description. If set to * true, the texts are passed to the browser as html and the developer is * responsible for ensuring no harmful html is used. If set to false, the diff --git a/server/src/com/vaadin/ui/NotificationConfiguration.java b/server/src/com/vaadin/ui/NotificationConfiguration.java index 52d3e76d63..faab329f88 100644 --- a/server/src/com/vaadin/ui/NotificationConfiguration.java +++ b/server/src/com/vaadin/ui/NotificationConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,112 +21,99 @@ package com.vaadin.ui; import java.io.Serializable; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; -import com.vaadin.shared.ui.ui.UIState.NotificationConfigurationState; +import com.vaadin.shared.ui.ui.NotificationRole; +import com.vaadin.shared.ui.ui.UIState.NotificationTypeConfiguration; +import com.vaadin.ui.Notification.Type; /** * Provides methods for configuring the notification. - * + * * @author Vaadin Ltd - * @since 7.1 + * @since 7.2 */ public interface NotificationConfiguration extends Serializable { - public void setStyleConfiguration(String style, String prefix, - String postfix, Role ariaRole); - /** - * Returns the complete configuration object for the given notification - * style. - * - * @param style - * String of the notification style to return - * @return The notification configuration object - */ - public NotificationConfigurationBean getStyleConfiguration(String style); - - /** - * Sets the accessibility prefix for the given notification style. - * - * This prefix is read to assistive device users in front of the content of - * the notification, but not visible on the page. - * - * @param style - * String of the notification style + * Sets the accessibility prefix for a notification type. + * <p> + * This prefix is read to assistive device users before the content of the + * notification, but not visible on the page. + * + * @param type + * type of the notification * @param prefix - * String that is placed before the notification content + * string that is placed before the notification content */ - public void setAssistivePrefixForStyle(String style, String prefix); + public void setAssistivePrefix(Type type, String prefix); /** - * Returns the accessibility prefix for the given notification style. - * - * This prefix is read to assistive device users in front of the content of - * the notification, but not visible on the page. - * - * @param style - * String of the notification style - * @return The prefix of the provided notification style + * Gets the accessibility prefix for a notification type. + * <p> + * This prefix is read to assistive device users before the content of the + * notification, but not visible on the page. + * + * @param type + * type of the notification + * @return The accessibility prefix for the provided notification type */ - public String getAssistivePrefixForStyle(String style); + public String getAssistivePrefix(Type type); /** - * Sets the accessibility postfix for the given notification style. - * + * Sets the accessibility postfix for a notification type. + * <p> * This postfix is read to assistive device users after the content of the * notification, but not visible on the page. - * - * @param style - * String of the notification style + * + * @param type + * type of the notification * @param postfix - * String that is placed after the notification content + * string that is placed after the notification content */ - public void setAssistivePostfixForStyle(String style, String postfix); + public void setAssistivePostfix(Type type, String postfix); /** - * Returns the accessibility postfix for the given notification style. - * + * Gets the accessibility postfix for a notification type. + * <p> * This postfix is read to assistive device users after the content of the * notification, but not visible on the page. - * - * @param style - * String of the notification style - * @return The postfix of the provided notification style + * + * @param type + * type of the notification + * @return The accessibility postfix for the provided notification type */ - public String getAssistivePostfixForStyle(String style); + public String getAssistivePostfix(Type type); /** - * Sets the WAI-ARIA role for a notification style. - * + * Sets the WAI-ARIA role for a notification type. + * <p> * This role defines how an assistive device handles a notification. - * Available roles are alert, alertdialog and status (@see <a + * Available roles are alert and status (@see <a * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles - * Model</a>) - * + * Model</a>). + * * The default role is alert. - * - * @param style - * String of the notification style + * + * @param type + * type of the notification * @param role - * Role to set for the notification type + * role to set for the notification type */ - public void setAssistiveRoleForStyle(String style, Role role); + public void setAssistiveRole(Type type, NotificationRole role); /** - * Returns the WAI-ARIA role for a notification style. - * + * Gets the WAI-ARIA role for a notification type. + * <p> * This role defines how an assistive device handles a notification. - * Available roles are alert, alertdialog and status (@see <a + * Available roles are alert and status (@see <a * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles - * Model</a> ) - * + * Model</a>) + * <p> * The default role is alert. - * - * @param style - * String of the notification style - * @return The current Role for the notification type + * + * @param type + * type of the notification + * @return role to set for the notification type */ - public Role getAssistiveRoleForStyle(String style); + public NotificationRole getAssistiveRole(Type type); } class NotificationConfigurationImpl implements NotificationConfiguration { @@ -137,133 +124,62 @@ class NotificationConfigurationImpl implements NotificationConfiguration { this.ui = ui; } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#setStyleConfiguration(java.lang - * .String, java.lang.String, java.lang.String, - * com.vaadin.ui.NotificationConfiguration.Role) - */ - @Override - public void setStyleConfiguration(String style, String prefix, - String postfix, Role ariaRole) { - getState().setup.put(style, new NotificationConfigurationBean(prefix, - postfix, ariaRole)); - } - - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#getStyleConfiguration(java.lang - * .String) - */ @Override - public NotificationConfigurationBean getStyleConfiguration(String style) { - return getState(false).setup.get(style); + public void setAssistivePrefix(Type type, String prefix) { + getConfigurationBean(type).prefix = prefix; } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#setStylePrefix(java.lang.String, - * java.lang.String) - */ @Override - public void setAssistivePrefixForStyle(String style, String prefix) { - getConfigurationBean(style).setAssistivePrefix(prefix); - } - - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#getStylePrefix(java.lang.String) - */ - @Override - public String getAssistivePrefixForStyle(String style) { - NotificationConfigurationBean styleSetup = getState().setup.get(style); + public String getAssistivePrefix(Type type) { + NotificationTypeConfiguration styleSetup = getTypeConf(type); if (styleSetup != null) { - return styleSetup.getAssistivePrefix(); + return styleSetup.prefix; } return null; } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#setStylePostfix(com.vaadin.ui - * .Notification.Type, java.lang.String) - */ @Override - public void setAssistivePostfixForStyle(String style, String postfix) { - getConfigurationBean(style).setAssistivePostfix(postfix); + public void setAssistivePostfix(Type type, String postfix) { + getConfigurationBean(type).postfix = postfix; } - /* - * (non-Javadoc) - * - * @see - * com.vaadin.ui.NotificationConfiguration#getStylePostfix(com.vaadin.ui - * .Notification.Type) - */ @Override - public String getAssistivePostfixForStyle(String style) { - NotificationConfigurationBean styleSetup = getState().setup.get(style); + public String getAssistivePostfix(Type type) { + NotificationTypeConfiguration styleSetup = getTypeConf(type); if (styleSetup != null) { - return styleSetup.getAssistivePostfix(); + return styleSetup.postfix; } return null; } - /* - * (non-Javadoc) - * - * @see com.vaadin.ui.NotificationConfiguration#setStyleRole(com.vaadin.ui. - * Notification.Type, com.vaadin.ui.NotificationConfiguration.Role) - */ @Override - public void setAssistiveRoleForStyle(String style, Role role) { - getConfigurationBean(style).setAssistiveRole(role); + public void setAssistiveRole(Type type, NotificationRole role) { + getConfigurationBean(type).notificationRole = role; } - /* - * (non-Javadoc) - * - * @see com.vaadin.ui.NotificationConfiguration#getStyleRole(com.vaadin.ui. - * Notification.Type) - */ @Override - public Role getAssistiveRoleForStyle(String style) { - NotificationConfigurationBean styleSetup = getState().setup.get(style); + public NotificationRole getAssistiveRole(Type type) { + NotificationTypeConfiguration styleSetup = getTypeConf(type); if (styleSetup != null) { - return styleSetup.getAssistiveRole(); + return styleSetup.notificationRole; } return null; } - private NotificationConfigurationBean getConfigurationBean(String style) { - NotificationConfigurationBean styleSetup = getState().setup.get(style); + private NotificationTypeConfiguration getConfigurationBean(Type type) { + NotificationTypeConfiguration styleSetup = getTypeConf(type); if (styleSetup == null) { - styleSetup = new NotificationConfigurationBean(); - getState().setup.put(style, styleSetup); + styleSetup = new NotificationTypeConfiguration(); + ui.getState().notificationConfigurations.put(type.getStyle(), styleSetup); } return styleSetup; } - private NotificationConfigurationState getState() { - return ui.getState().notificationConfiguration; + private NotificationTypeConfiguration getTypeConf(Type type) { + return ui.getState().notificationConfigurations.get(type.getStyle()); } - - private NotificationConfigurationState getState(boolean markAsDirty) { - return ui.getState(markAsDirty).notificationConfiguration; - } - } diff --git a/server/src/com/vaadin/ui/OptionGroup.java b/server/src/com/vaadin/ui/OptionGroup.java index 0b81321023..393f5399f6 100644 --- a/server/src/com/vaadin/ui/OptionGroup.java +++ b/server/src/com/vaadin/ui/OptionGroup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index 7d962c246b..34ff6ec112 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/PasswordField.java b/server/src/com/vaadin/ui/PasswordField.java index 52f47c5c89..107e40c149 100644 --- a/server/src/com/vaadin/ui/PasswordField.java +++ b/server/src/com/vaadin/ui/PasswordField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/PopupDateField.java b/server/src/com/vaadin/ui/PopupDateField.java index f0bb0d74fe..61aac16a97 100644 --- a/server/src/com/vaadin/ui/PopupDateField.java +++ b/server/src/com/vaadin/ui/PopupDateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/PopupView.java b/server/src/com/vaadin/ui/PopupView.java index 28a78ab31a..b347576b22 100644 --- a/server/src/com/vaadin/ui/PopupView.java +++ b/server/src/com/vaadin/ui/PopupView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/ProgressBar.java b/server/src/com/vaadin/ui/ProgressBar.java index 3f8aab6d7c..bf52cefefe 100644 --- a/server/src/com/vaadin/ui/ProgressBar.java +++ b/server/src/com/vaadin/ui/ProgressBar.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -149,4 +149,4 @@ public class ProgressBar extends AbstractField<Float> implements getState().state = newValue; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/ProgressIndicator.java b/server/src/com/vaadin/ui/ProgressIndicator.java index 6da18fc29d..6e436169e3 100644 --- a/server/src/com/vaadin/ui/ProgressIndicator.java +++ b/server/src/com/vaadin/ui/ProgressIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/PushConfiguration.java b/server/src/com/vaadin/ui/PushConfiguration.java index 49738c5aff..84f59d0313 100644 --- a/server/src/com/vaadin/ui/PushConfiguration.java +++ b/server/src/com/vaadin/ui/PushConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/RichTextArea.java b/server/src/com/vaadin/ui/RichTextArea.java index cd95988bd4..9d05181541 100644 --- a/server/src/com/vaadin/ui/RichTextArea.java +++ b/server/src/com/vaadin/ui/RichTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Select.java b/server/src/com/vaadin/ui/Select.java index 2fc1b692cc..e63cba3eaa 100644 --- a/server/src/com/vaadin/ui/Select.java +++ b/server/src/com/vaadin/ui/Select.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/SelectiveRenderer.java b/server/src/com/vaadin/ui/SelectiveRenderer.java index 7c871e3c25..5c4d052a53 100644 --- a/server/src/com/vaadin/ui/SelectiveRenderer.java +++ b/server/src/com/vaadin/ui/SelectiveRenderer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/SingleComponentContainer.java b/server/src/com/vaadin/ui/SingleComponentContainer.java index 7a525d0182..9feee84f15 100644 --- a/server/src/com/vaadin/ui/SingleComponentContainer.java +++ b/server/src/com/vaadin/ui/SingleComponentContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Slider.java b/server/src/com/vaadin/ui/Slider.java index 44fc49ba9b..e108c74ba2 100644 --- a/server/src/com/vaadin/ui/Slider.java +++ b/server/src/com/vaadin/ui/Slider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 8e2c40fc0f..2fdb3b40a7 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -292,34 +292,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * @return the created {@link Tab} */ public Tab addTab(Component c, String caption, Resource icon) { - return addTab(c, caption, icon, "", components.size()); - } - - /** - * Adds a new tab into TabSheet. - * - * The first tab added to a tab sheet is automatically selected and a tab - * selection event is fired. - * - * If the component is already present in the tab sheet, changes its caption - * and icon and icon alternate text and returns the corresponding (old) tab, - * preserving other tab metadata. - * - * @param c - * the component to be added onto tab - should not be null. - * @param caption - * the caption to be set for the component and used rendered in - * tab bar - * @param icon - * the icon to be set for the component and used rendered in tab - * bar - * @param iconAltText - * the alternate text for the icon - * @return the created {@link Tab} - */ - public Tab addTab(Component c, String caption, Resource icon, - String iconAltText) { - return addTab(c, caption, icon, iconAltText, components.size()); + return addTab(c, caption, icon, components.size()); } /** @@ -344,43 +317,13 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, * the position at where the the tab should be added. * @return the created {@link Tab} */ - public Tab addTab(Component c, String caption, Resource icon, int position) { - return addTab(c, caption, icon, "", position); - } - - /** - * Adds a new tab into TabSheet. - * - * The first tab added to a tab sheet is automatically selected and a tab - * selection event is fired. - * - * If the component is already present in the tab sheet, changes its caption - * and icon and icon alternate text and returns the corresponding (old) tab, - * preserving other tab metadata like the position. - * - * @param tabComponent - * the component to be added onto tab - should not be null. - * @param caption - * the caption to be set for the component and used rendered in - * tab bar - * @param icon - * the icon to be set for the component and used rendered in tab - * bar - * @param iconAltText - * the alternate text for the icon - * @param position - * the position at where the the tab should be added. - * @return the created {@link Tab} - */ - public Tab addTab(Component tabComponent, String caption, Resource icon, - String iconAltText, int position) { - + public Tab addTab(Component tabComponent, String caption, Resource icon, int position) { if (tabComponent == null) { return null; } else if (tabs.containsKey(tabComponent)) { Tab tab = tabs.get(tabComponent); tab.setCaption(caption); - tab.setIcon(icon, iconAltText); + tab.setIcon(icon); return tab; } else { components.add(position, tabComponent); @@ -461,11 +404,11 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, Tab tab = ((TabSheet) source).getTab(c); caption = tab.getCaption(); icon = tab.getIcon(); - iconAltText = tab.getIconAltText(); + iconAltText = tab.getIconAlternateText(); } source.removeComponent(c); - addTab(c, caption, icon, iconAltText); - + Tab tab = addTab(c, caption, icon); + tab.setIconAlternateText(iconAltText); } } @@ -968,16 +911,20 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, /** * Gets the icon alt text for the tab. + * + * @since 7.2 */ - public String getIconAltText(); + public String getIconAlternateText(); /** * Sets the icon alt text for the tab. - * + * + * @since 7.2 + * * @param iconAltText * the icon to set */ - public void setIconAltText(String iconAltText); + public void setIconAlternateText(String iconAltText); /** * Gets the description for the tab. The description can be used to @@ -1135,12 +1082,12 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, } @Override - public String getIconAltText() { + public String getIconAlternateText() { return tabState.iconAltText; } @Override - public void setIconAltText(String iconAltText) { + public void setIconAlternateText(String iconAltText) { tabState.iconAltText = iconAltText; markAsDirty(); } @@ -1428,7 +1375,7 @@ public class TabSheet extends AbstractComponentContainer implements Focusable, */ private static void copyTabMetadata(Tab from, Tab to) { to.setCaption(from.getCaption()); - to.setIcon(from.getIcon(), from.getIconAltText()); + to.setIcon(from.getIcon(), from.getIconAlternateText()); to.setDescription(from.getDescription()); to.setVisible(from.isVisible()); to.setEnabled(from.isEnabled()); diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index 06e82dedcb..a8265662ea 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -2647,6 +2647,10 @@ public class Table extends AbstractSelect implements Action.Container, * new container contains properties that are not meant to be shown you * should use {@link Table#setContainerDataSource(Container, Collection)} * instead, especially if the table is editable. + * <p> + * Keeps propertyValueConverters if the corresponding id exists in the new + * data source and is of a compatible type. + * </p> * * @param newDataSource * the new data source. @@ -2681,9 +2685,14 @@ public class Table extends AbstractSelect implements Action.Container, /** * Sets the container data source and the columns that will be visible. * Columns are shown in the collection's iteration order. + * <p> + * Keeps propertyValueConverters if the corresponding id exists in the new + * data source and is of a compatible type. + * </p> * * @see Table#setContainerDataSource(Container) * @see Table#setVisibleColumns(Object[]) + * @see Table#setConverter(Object, Converter<String, ?>) * * @param newDataSource * the new data source. @@ -2702,6 +2711,26 @@ public class Table extends AbstractSelect implements Action.Container, visibleIds = new ArrayList<Object>(); } + // Retain propertyValueConverters if their corresponding ids are + // properties of the new + // data source and are of a compatible type + if (propertyValueConverters != null) { + Collection<?> newPropertyIds = newDataSource + .getContainerPropertyIds(); + LinkedList<Object> retainableValueConverters = new LinkedList<Object>(); + for (Object propertyId : newPropertyIds) { + Converter<String, ?> converter = getConverter(propertyId); + if (converter != null) { + if (typeIsCompatible(converter.getModelType(), + newDataSource.getType(propertyId))) { + retainableValueConverters.add(propertyId); + } + } + } + propertyValueConverters.keySet().retainAll( + retainableValueConverters); + } + // Assures that the data source is ordered by making unordered // containers ordered by wrapping them if (newDataSource instanceof Container.Ordered) { @@ -2738,6 +2767,20 @@ public class Table extends AbstractSelect implements Action.Container, } /** + * Checks if class b can be safely assigned to class a. + * + * @param a + * @param b + * @return + */ + private boolean typeIsCompatible(Class<?> a, Class<?> b) { + // TODO Implement this check properly + // Basically we need to do a a.isAssignableFrom(b) + // with special considerations for primitive types. + return true; + } + + /** * Gets items ids from a range of key values * * @param startRowKey @@ -2914,12 +2957,19 @@ public class Table extends AbstractSelect implements Action.Container, if (value != null) { reqFirstRowToPaint = value.intValue(); } + value = (Integer) variables.get("reqrows"); if (value != null) { reqRowsToPaint = value.intValue(); + int size = size(); // sanity check - if (reqFirstRowToPaint + reqRowsToPaint > size()) { - reqRowsToPaint = size() - reqFirstRowToPaint; + + if (reqFirstRowToPaint >= size) { + reqFirstRowToPaint = size; + } + + if (reqFirstRowToPaint + reqRowsToPaint > size) { + reqRowsToPaint = size - reqFirstRowToPaint; } } } @@ -4229,6 +4279,8 @@ public class Table extends AbstractSelect implements Action.Container, columnIcons.remove(propertyId); columnHeaders.remove(propertyId); columnFooters.remove(propertyId); + // If a propertyValueConverter was defined for the property, remove it. + propertyValueConverters.remove(propertyId); return super.removeContainerProperty(propertyId); } @@ -4706,7 +4758,15 @@ public class Table extends AbstractSelect implements Action.Container, if (refreshingPreviouslyEnabled) { enableContentRefreshing(true); } - + if (propertyId.length > 0 && ascending.length > 0) { + // The first propertyId is the primary sorting criterion, + // therefore the sort indicator should be there + sortAscending = ascending[0]; + sortContainerPropertyId = propertyId[0]; + } else { + sortAscending = true; + sortContainerPropertyId = null; + } } else if (c != null) { throw new UnsupportedOperationException( "Underlying Data does not allow sorting"); @@ -5844,16 +5904,13 @@ public class Table extends AbstractSelect implements Action.Container, throw new IllegalArgumentException("PropertyId " + propertyId + " must be in the container"); } - // FIXME: This check should be here but primitive types like Boolean - // formatter for boolean property must be handled - // if (!converter.getSourceType().isAssignableFrom(getType(propertyId))) - // { - // throw new IllegalArgumentException("Property type (" - // + getType(propertyId) - // + ") must match converter source type (" - // + converter.getSourceType() + ")"); - // } + if (!typeIsCompatible(converter.getModelType(), getType(propertyId))) { + throw new IllegalArgumentException("Property type (" + + getType(propertyId) + + ") must match converter source type (" + + converter.getModelType() + ")"); + } propertyValueConverters.put(propertyId, (Converter<String, Object>) converter); refreshRowCache(); diff --git a/server/src/com/vaadin/ui/TableFieldFactory.java b/server/src/com/vaadin/ui/TableFieldFactory.java index 3b840d2816..3c946dcec2 100644 --- a/server/src/com/vaadin/ui/TableFieldFactory.java +++ b/server/src/com/vaadin/ui/TableFieldFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TextArea.java b/server/src/com/vaadin/ui/TextArea.java index 6e5b9da2f4..56c97f58eb 100644 --- a/server/src/com/vaadin/ui/TextArea.java +++ b/server/src/com/vaadin/ui/TextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TextField.java b/server/src/com/vaadin/ui/TextField.java index ba6252bf78..fb1e4284a2 100644 --- a/server/src/com/vaadin/ui/TextField.java +++ b/server/src/com/vaadin/ui/TextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TooltipConfiguration.java b/server/src/com/vaadin/ui/TooltipConfiguration.java index f9120aa18d..ecb8ac7534 100644 --- a/server/src/com/vaadin/ui/TooltipConfiguration.java +++ b/server/src/com/vaadin/ui/TooltipConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java index 15175b5a8b..a86a9bd64b 100644 --- a/server/src/com/vaadin/ui/Tree.java +++ b/server/src/com/vaadin/ui/Tree.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TreeTable.java b/server/src/com/vaadin/ui/TreeTable.java index 1c13eae8d9..9bca20587b 100644 --- a/server/src/com/vaadin/ui/TreeTable.java +++ b/server/src/com/vaadin/ui/TreeTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/TwinColSelect.java b/server/src/com/vaadin/ui/TwinColSelect.java index 61487be1d4..37e3b7ccb9 100644 --- a/server/src/com/vaadin/ui/TwinColSelect.java +++ b/server/src/com/vaadin/ui/TwinColSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 275aeb4c79..562b30f81d 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -553,7 +553,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements private Navigator navigator; - private transient PushConnection pushConnection = null; + private PushConnection pushConnection = null; private LocaleService localeService = new LocaleService(this, getState(false).localeServiceState); @@ -669,10 +669,10 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @param request * the request that caused this UI to be reloaded */ - public void doReinit(VaadinRequest request) { + public void doRefresh(VaadinRequest request) { // This is a horrible hack. We want to have the most recent location and - // browser window size available in reinit(), but we want to call - // listeners, if any, only after reinit(). So we momentarily assign the + // browser window size available in refresh(), but we want to call + // listeners, if any, only after refresh(). So we momentarily assign the // old values back before setting the new values again to ensure the // events are properly fired. @@ -684,7 +684,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements page.init(request); - reinit(request); + refresh(request); URI newLocation = page.getLocation(); int newWidth = page.getBrowserWindowWidth(); @@ -710,7 +710,7 @@ public abstract class UI extends AbstractSingleComponentContainer implements * @param request * the request that caused this UI to be reloaded */ - protected void reinit(VaadinRequest request) { + protected void refresh(VaadinRequest request) { } /** @@ -1626,5 +1626,4 @@ public abstract class UI extends AbstractSingleComponentContainer implements public String getEmbedId() { return embedId; } - } diff --git a/server/src/com/vaadin/ui/UIDetachedException.java b/server/src/com/vaadin/ui/UIDetachedException.java index 07207b0bf3..7cd7f0889e 100644 --- a/server/src/com/vaadin/ui/UIDetachedException.java +++ b/server/src/com/vaadin/ui/UIDetachedException.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/UniqueSerializable.java b/server/src/com/vaadin/ui/UniqueSerializable.java index 2bcc7c2028..f5d68e8a71 100644 --- a/server/src/com/vaadin/ui/UniqueSerializable.java +++ b/server/src/com/vaadin/ui/UniqueSerializable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java index 5677b1a16e..869c32751a 100644 --- a/server/src/com/vaadin/ui/Upload.java +++ b/server/src/com/vaadin/ui/Upload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/VerticalLayout.java b/server/src/com/vaadin/ui/VerticalLayout.java index 9c4067bd38..12819e50bc 100644 --- a/server/src/com/vaadin/ui/VerticalLayout.java +++ b/server/src/com/vaadin/ui/VerticalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/VerticalSplitPanel.java b/server/src/com/vaadin/ui/VerticalSplitPanel.java index 7ad9a51e36..4476d5a19b 100644 --- a/server/src/com/vaadin/ui/VerticalSplitPanel.java +++ b/server/src/com/vaadin/ui/VerticalSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Video.java b/server/src/com/vaadin/ui/Video.java index d6dc918da0..e690218e6f 100644 --- a/server/src/com/vaadin/ui/Video.java +++ b/server/src/com/vaadin/ui/Video.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index d3afdaacf1..149fcd536f 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,9 +18,6 @@ package com.vaadin.ui; import java.io.Serializable; import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; import java.util.Map; import com.vaadin.event.FieldEvents.BlurEvent; @@ -41,7 +38,7 @@ import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.window.WindowMode; import com.vaadin.shared.ui.window.WindowServerRpc; import com.vaadin.shared.ui.window.WindowState; -import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.shared.ui.window.WindowRole; import com.vaadin.util.ReflectTools; /** @@ -1017,15 +1014,15 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * window. Text contained in these components will be read by assistive * devices when it is opened. * - * @param connectors - * with the components to use as description + * @param components + * the components to use as description */ - public void setAssistiveDescription(Connector... connectors) { - if (connectors == null) { + public void setAssistiveDescription(Component... components) { + if (components == null) { throw new IllegalArgumentException( "Parameter connectors must be non-null"); } else { - getState().contentDescription = connectors; + getState().contentDescription = components; } } @@ -1034,11 +1031,19 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, * contained in these components will be read by assistive devices when the * window is opened. * - * @return list of previously set components + * @return array of previously set components */ - public List<Connector> getAssistiveDescription() { - return Collections.unmodifiableList(Arrays - .asList(getState().contentDescription)); + public Component[] getAssistiveDescription() { + Connector[] contentDescription = getState().contentDescription; + if (contentDescription == null) { + return null; + } + + Component[] target = new Component[contentDescription.length]; + System.arraycopy(contentDescription, 0, target, 0, + contentDescription.length); + + return target; } /** diff --git a/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvent.java b/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvent.java index 1f012157b5..dfb59e148b 100644 --- a/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvent.java +++ b/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvents.java b/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvents.java index 1904d69898..f01b465dd2 100644 --- a/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvents.java +++ b/server/src/com/vaadin/ui/components/calendar/CalendarComponentEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/CalendarDateRange.java b/server/src/com/vaadin/ui/components/calendar/CalendarDateRange.java index b78fda3136..18b98e1f6c 100644 --- a/server/src/com/vaadin/ui/components/calendar/CalendarDateRange.java +++ b/server/src/com/vaadin/ui/components/calendar/CalendarDateRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/CalendarTargetDetails.java b/server/src/com/vaadin/ui/components/calendar/CalendarTargetDetails.java index 1a3ef67377..3ea6c4d8f4 100644 --- a/server/src/com/vaadin/ui/components/calendar/CalendarTargetDetails.java +++ b/server/src/com/vaadin/ui/components/calendar/CalendarTargetDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/ContainerEventProvider.java b/server/src/com/vaadin/ui/components/calendar/ContainerEventProvider.java index 37ea255d27..7c19395df2 100644 --- a/server/src/com/vaadin/ui/components/calendar/ContainerEventProvider.java +++ b/server/src/com/vaadin/ui/components/calendar/ContainerEventProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -224,8 +224,8 @@ public class ContainerEventProvider implements CalendarEditableEventProvider, } if (styleNameProperty != null && item.getItemPropertyIds().contains(styleNameProperty)) { - basicEvent.setDescription(String.valueOf(item.getItemProperty( - descriptionProperty).getValue())); + basicEvent.setStyleName(String.valueOf(item.getItemProperty( + styleNameProperty).getValue())); } event = basicEvent; } diff --git a/server/src/com/vaadin/ui/components/calendar/event/BasicEvent.java b/server/src/com/vaadin/ui/components/calendar/event/BasicEvent.java index 3f14145f0c..a1ccad2712 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/BasicEvent.java +++ b/server/src/com/vaadin/ui/components/calendar/event/BasicEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/event/BasicEventProvider.java b/server/src/com/vaadin/ui/components/calendar/event/BasicEventProvider.java index b2b74a5e52..9fa6baadad 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/BasicEventProvider.java +++ b/server/src/com/vaadin/ui/components/calendar/event/BasicEventProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java b/server/src/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java index 13e84df666..920600368e 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java +++ b/server/src/com/vaadin/ui/components/calendar/event/CalendarEditableEventProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/event/CalendarEvent.java b/server/src/com/vaadin/ui/components/calendar/event/CalendarEvent.java index 531ee72c7f..2ad8c777ff 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/CalendarEvent.java +++ b/server/src/com/vaadin/ui/components/calendar/event/CalendarEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java b/server/src/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java index fefb2ca9b6..35719a13f3 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java +++ b/server/src/com/vaadin/ui/components/calendar/event/CalendarEventProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java b/server/src/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java index e8a27ad50f..df708697b8 100644 --- a/server/src/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java +++ b/server/src/com/vaadin/ui/components/calendar/event/EditableCalendarEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java index 65e9c94dec..f4d47f89d4 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicBackwardHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java index ac2470e008..8d366ed52f 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicDateClickHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java index ae4c5fcc12..418e03d24a 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicEventMoveHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java index ee7fc27360..6141c84c5b 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicEventResizeHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java index e36c9e5756..96c3c097dc 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicForwardHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java b/server/src/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java index 846fd7dd53..c52d0a5a82 100644 --- a/server/src/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java +++ b/server/src/com/vaadin/ui/components/calendar/handler/BasicWeekClickHandler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java b/server/src/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java index 7ce5a7fd7e..b55b55357f 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorChangeEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -40,4 +40,4 @@ public class ColorChangeEvent extends Event { public Color getColor() { return color; } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorChangeListener.java b/server/src/com/vaadin/ui/components/colorpicker/ColorChangeListener.java index 7afbde5028..6db148989c 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorChangeListener.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -39,4 +39,4 @@ public interface ColorChangeListener extends Serializable { */ void colorChanged(ColorChangeEvent event); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java index 5ff166b201..6147fcdd96 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGradient.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -137,4 +137,4 @@ public class ColorPickerGradient extends AbstractComponent implements protected ColorPickerGradientState getState() { return (ColorPickerGradientState) super.getState(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java index 9123245033..002f36d99d 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerGrid.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -254,4 +254,4 @@ public class ColorPickerGrid extends AbstractComponent implements ColorSelector protected ColorPickerGridState getState() { return (ColorPickerGridState) super.getState(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java index de8c5db195..a3297a282c 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerHistory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -214,4 +214,4 @@ public class ColorPickerHistory extends CustomComponent implements public void colorChanged(ColorChangeEvent event) { fireEvent(new ColorChangeEvent(this, event.getColor())); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java index 9774211bea..e7b412f7eb 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -776,4 +776,4 @@ public class ColorPickerPopup extends Window implements ClickListener, public static Logger getLogger() { return Logger.getLogger(ColorPickerPopup.class.getName()); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java index 45c6dc76c3..ae00b267ce 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerPreview.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,7 +19,6 @@ import java.lang.reflect.Method; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.validator.RegexpValidator; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; @@ -67,13 +66,12 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, this.color = color; field = new TextField(); - field.setReadOnly(true); field.setImmediate(true); field.setSizeFull(); field.setStyleName("v-colorpicker-preview-textfield"); field.setData(this); field.addValueChangeListener(this); - field.addValidator(new RegexpValidator("#[0-9a-fA-F]{6}", true, "")); + addComponent(field); setColor(color); @@ -85,7 +83,6 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, // Unregister listener field.removeValueChangeListener(this); - field.setReadOnly(false); String colorCSS = color.getCSS(); field.setValue(colorCSS); @@ -97,7 +94,6 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, } // Re-register listener - field.setReadOnly(true); field.addValueChangeListener(this); // Set the text color @@ -130,21 +126,63 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, @Override public void valueChange(ValueChangeEvent event) { String value = (String) event.getProperty().getValue(); - - if (!field.isValid()) { + try { + if (value != null) { + /* + * Description of supported formats see + * http://www.w3schools.com/cssref/css_colors_legal.asp + */ + if (value.length() == 7 && value.startsWith("#")) { + // CSS color format (e.g. #000000) + int red = Integer.parseInt(value.substring(1, 3), 16); + int green = Integer.parseInt(value.substring(3, 5), 16); + int blue = Integer.parseInt(value.substring(5, 7), 16); + color = new Color(red, green, blue); + + } else if (value.startsWith("rgb")) { + // RGB color format rgb/rgba(255,255,255,0.1) + String[] colors = value.substring(value.indexOf("(") + 1, + value.length() - 1).split(","); + + int red = Integer.parseInt(colors[0]); + int green = Integer.parseInt(colors[1]); + int blue = Integer.parseInt(colors[2]); + if (colors.length > 3) { + int alpha = (int) (Double.parseDouble(colors[3]) * 255d); + color = new Color(red, green, blue, alpha); + } else { + color = new Color(red, green, blue); + } + + } else if (value.startsWith("hsl")) { + // HSL color format hsl/hsla(100,50%,50%,1.0) + String[] colors = value.substring(value.indexOf("(") + 1, + value.length() - 1).split(","); + + int hue = Integer.parseInt(colors[0]); + int saturation = Integer.parseInt(colors[1] + .replace("%", "")); + int lightness = Integer + .parseInt(colors[2].replace("%", "")); + int rgb = Color.HSLtoRGB(hue, saturation, lightness); + + if (colors.length > 3) { + int alpha = (int) (Double.parseDouble(colors[3]) * 255d); + color = new Color(rgb); + color.setAlpha(alpha); + } else { + color = new Color(rgb); + } + } + + oldValue = value; + fireEvent(new ColorChangeEvent((Component) field.getData(), + color)); + } + + } catch (NumberFormatException nfe) { + // Revert value field.setValue(oldValue); - return; - } else { - oldValue = value; - } - - if (value != null && value.length() == 7) { - int red = Integer.parseInt(value.substring(1, 3), 16); - int green = Integer.parseInt(value.substring(3, 5), 16); - int blue = Integer.parseInt(value.substring(5, 7), 16); - color = new Color(red, green, blue); - - fireEvent(new ColorChangeEvent((Component) field.getData(), color)); } } @@ -155,4 +193,4 @@ public class ColorPickerPreview extends CssLayout implements ColorSelector, protected String getCss(Component c) { return "background: " + color.getCSS(); } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java index 263349c17c..8e441b25ee 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorPickerSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -230,4 +230,4 @@ public class ColorPickerSelect extends CustomComponent implements grid.setColorGrid(createColors(new Color(0, 0, 0xFF), 14, 10)); } } -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/ColorSelector.java b/server/src/com/vaadin/ui/components/colorpicker/ColorSelector.java index 31ce2b2e5b..c282c22f62 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/ColorSelector.java +++ b/server/src/com/vaadin/ui/components/colorpicker/ColorSelector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -40,4 +40,4 @@ public interface ColorSelector extends Serializable, HasColorChangeListener { * @return the color */ public Color getColor(); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java b/server/src/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java index c84a90bf6f..eb16d8cbbe 100644 --- a/server/src/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java +++ b/server/src/com/vaadin/ui/components/colorpicker/HasColorChangeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -33,4 +33,4 @@ public interface HasColorChangeListener extends Serializable { */ void removeColorChangeListener(ColorChangeListener listener); -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/themes/BaseTheme.java b/server/src/com/vaadin/ui/themes/BaseTheme.java index b2f4fd632e..9421cf2341 100644 --- a/server/src/com/vaadin/ui/themes/BaseTheme.java +++ b/server/src/com/vaadin/ui/themes/BaseTheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -55,4 +55,4 @@ public class BaseTheme { * overflow. */ public static final String CLIP = "v-clip"; -}
\ No newline at end of file +} diff --git a/server/src/com/vaadin/ui/themes/ChameleonTheme.java b/server/src/com/vaadin/ui/themes/ChameleonTheme.java index 3822540452..6e230c426e 100644 --- a/server/src/com/vaadin/ui/themes/ChameleonTheme.java +++ b/server/src/com/vaadin/ui/themes/ChameleonTheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/themes/LiferayTheme.java b/server/src/com/vaadin/ui/themes/LiferayTheme.java index 78e7d61244..de56be39ac 100644 --- a/server/src/com/vaadin/ui/themes/LiferayTheme.java +++ b/server/src/com/vaadin/ui/themes/LiferayTheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/themes/Reindeer.java b/server/src/com/vaadin/ui/themes/Reindeer.java index f823c54c2a..6eeebd8a03 100644 --- a/server/src/com/vaadin/ui/themes/Reindeer.java +++ b/server/src/com/vaadin/ui/themes/Reindeer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/ui/themes/Runo.java b/server/src/com/vaadin/ui/themes/Runo.java index 390aa9d893..11f1bae682 100644 --- a/server/src/com/vaadin/ui/themes/Runo.java +++ b/server/src/com/vaadin/ui/themes/Runo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/util/ConnectorHelper.java b/server/src/com/vaadin/util/ConnectorHelper.java index e698e9222a..b3457068c3 100644 --- a/server/src/com/vaadin/util/ConnectorHelper.java +++ b/server/src/com/vaadin/util/ConnectorHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/util/CurrentInstance.java b/server/src/com/vaadin/util/CurrentInstance.java index 4c62ef49be..00d2e7346d 100644 --- a/server/src/com/vaadin/util/CurrentInstance.java +++ b/server/src/com/vaadin/util/CurrentInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/util/FileTypeResolver.java b/server/src/com/vaadin/util/FileTypeResolver.java index 8e8093b085..a49a0e2d01 100644 --- a/server/src/com/vaadin/util/FileTypeResolver.java +++ b/server/src/com/vaadin/util/FileTypeResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/util/ReflectTools.java b/server/src/com/vaadin/util/ReflectTools.java index 6fccd365fb..f56a68f223 100644 --- a/server/src/com/vaadin/util/ReflectTools.java +++ b/server/src/com/vaadin/util/ReflectTools.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/src/com/vaadin/util/SerializerHelper.java b/server/src/com/vaadin/util/SerializerHelper.java index 9d3ba56b82..793488d892 100644 --- a/server/src/com/vaadin/util/SerializerHelper.java +++ b/server/src/com/vaadin/util/SerializerHelper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/ClassInDefaultPackage.java b/server/tests/src/ClassInDefaultPackage.java index 1eb8bc4df5..52dc87e0e2 100644 --- a/server/tests/src/ClassInDefaultPackage.java +++ b/server/tests/src/ClassInDefaultPackage.java @@ -1,7 +1,7 @@ import org.junit.Ignore; /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java b/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java index b319c13e4e..a5fee5175e 100644 --- a/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java +++ b/server/tests/src/com/vaadin/data/DefaultFieldGroupFieldFactoryTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,8 +17,7 @@ package com.vaadin.data; import java.util.Date; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java index a01c2dea8f..3333cd7744 100644 --- a/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java +++ b/server/tests/src/com/vaadin/data/fieldgroup/BeanFieldGroupTest.java @@ -15,8 +15,7 @@ */ package com.vaadin.data.fieldgroup; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; public class BeanFieldGroupTest { diff --git a/server/tests/src/com/vaadin/data/fieldgroup/FieldGroupDate.java b/server/tests/src/com/vaadin/data/fieldgroup/FieldGroupDate.java index e11b6e50f8..07e36b93f9 100644 --- a/server/tests/src/com/vaadin/data/fieldgroup/FieldGroupDate.java +++ b/server/tests/src/com/vaadin/data/fieldgroup/FieldGroupDate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,8 +17,7 @@ package com.vaadin.data.fieldgroup; import java.util.Date; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/data/util/AbstractContainerTest.java b/server/tests/src/com/vaadin/data/util/AbstractContainerTest.java index 81c90ba07b..a443499a89 100644 --- a/server/tests/src/com/vaadin/data/util/AbstractContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/AbstractContainerTest.java @@ -3,9 +3,10 @@ package com.vaadin.data.util; import java.util.ArrayList; import java.util.List; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + import com.vaadin.data.Container; import com.vaadin.data.Container.Filterable; import com.vaadin.data.Container.ItemSetChangeEvent; diff --git a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java index a6c3bb0b8b..4e0e98ec43 100644 --- a/server/tests/src/com/vaadin/data/util/BeanContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanContainerTest.java @@ -7,7 +7,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Container; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/BeanItemContainerSortTest.java b/server/tests/src/com/vaadin/data/util/BeanItemContainerSortTest.java index 346e931f61..4f4e35258f 100644 --- a/server/tests/src/com/vaadin/data/util/BeanItemContainerSortTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanItemContainerSortTest.java @@ -7,8 +7,7 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; public class BeanItemContainerSortTest { diff --git a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java index b9633753b4..b58d962d96 100644 --- a/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanItemContainerTest.java @@ -8,17 +8,10 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; -import junit.framework.Assert; - -import org.easymock.Capture; -import org.easymock.EasyMock; +import org.junit.Assert; import com.vaadin.data.Container; -import com.vaadin.data.Container.Indexed.ItemAddEvent; -import com.vaadin.data.Container.Indexed.ItemRemoveEvent; -import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Item; -import com.vaadin.data.util.filter.Compare; /** * Test basic functionality of BeanItemContainer. @@ -734,182 +727,4 @@ public class BeanItemContainerTest extends AbstractBeanContainerTest { assertNull(container.getContainerProperty(john, "address.street") .getValue()); } - - public void testItemAddedEvent() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - ItemSetChangeListener addListener = createListenerMockFor(container); - addListener.containerItemSetChange(EasyMock.isA(ItemAddEvent.class)); - EasyMock.replay(addListener); - - container.addItem(bean); - - EasyMock.verify(addListener); - } - - public void testItemAddedEvent_AddedItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - - container.addItem(bean); - - assertEquals(bean, capturedEvent.getValue().getFirstItemId()); - } - - public void testItemAddedEvent_addItemAt_IndexOfAddedItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - container.addItem(bean); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - - container.addItemAt(1, new Person("")); - - assertEquals(1, capturedEvent.getValue().getFirstIndex()); - } - - public void testItemAddedEvent_addItemAfter_IndexOfAddedItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - container.addItem(bean); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - - container.addItemAfter(bean, new Person("")); - - assertEquals(1, capturedEvent.getValue().getFirstIndex()); - } - - public void testItemAddedEvent_amountOfAddedItems() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - List<Person> beans = Arrays.asList(new Person("Jack"), new Person( - "John")); - - container.addAll(beans); - - assertEquals(2, capturedEvent.getValue().getAddedItemsCount()); - } - - public void testItemAddedEvent_someItemsAreFiltered_amountOfAddedItemsIsReducedByAmountOfFilteredItems() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - List<Person> beans = Arrays.asList(new Person("Jack"), new Person( - "John")); - container.addFilter(new Compare.Equal("name", "John")); - - container.addAll(beans); - - assertEquals(1, capturedEvent.getValue().getAddedItemsCount()); - } - - public void testItemAddedEvent_someItemsAreFiltered_addedItemIsTheFirstVisibleItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - List<Person> beans = Arrays.asList(new Person("Jack"), bean); - container.addFilter(new Compare.Equal("name", "John")); - - container.addAll(beans); - - assertEquals(bean, capturedEvent.getValue().getFirstItemId()); - } - - public void testItemRemovedEvent() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - container.addItem(bean); - ItemSetChangeListener removeListener = createListenerMockFor(container); - removeListener.containerItemSetChange(EasyMock - .isA(ItemRemoveEvent.class)); - EasyMock.replay(removeListener); - - container.removeItem(bean); - - EasyMock.verify(removeListener); - } - - public void testItemRemovedEvent_RemovedItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - Person bean = new Person("John"); - container.addItem(bean); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeItem(bean); - - assertEquals(bean, capturedEvent.getValue().getFirstItemId()); - } - - public void testItemRemovedEvent_indexOfRemovedItem() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - container.addItem(new Person("Jack")); - Person secondBean = new Person("John"); - container.addItem(secondBean); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeItem(secondBean); - - assertEquals(1, capturedEvent.getValue().getFirstIndex()); - } - - public void testItemRemovedEvent_amountOfRemovedItems() { - BeanItemContainer<Person> container = new BeanItemContainer<Person>( - Person.class); - container.addItem(new Person("Jack")); - container.addItem(new Person("John")); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeAllItems(); - - assertEquals(2, capturedEvent.getValue().getRemovedItemsCount()); - } - - private Capture<ItemAddEvent> captureAddEvent( - ItemSetChangeListener addListener) { - Capture<ItemAddEvent> capturedEvent = new Capture<ItemAddEvent>(); - addListener.containerItemSetChange(EasyMock.capture(capturedEvent)); - return capturedEvent; - } - - private Capture<ItemRemoveEvent> captureRemoveEvent( - ItemSetChangeListener removeListener) { - Capture<ItemRemoveEvent> capturedEvent = new Capture<ItemRemoveEvent>(); - removeListener.containerItemSetChange(EasyMock.capture(capturedEvent)); - return capturedEvent; - } - - private ItemSetChangeListener createListenerMockFor( - BeanItemContainer<Person> container) { - ItemSetChangeListener listener = EasyMock - .createNiceMock(ItemSetChangeListener.class); - container.addItemSetChangeListener(listener); - return listener; - } } diff --git a/server/tests/src/com/vaadin/data/util/BeanItemTest.java b/server/tests/src/com/vaadin/data/util/BeanItemTest.java index e1ad75796c..b458856826 100644 --- a/server/tests/src/com/vaadin/data/util/BeanItemTest.java +++ b/server/tests/src/com/vaadin/data/util/BeanItemTest.java @@ -9,9 +9,10 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + /** * Test BeanItem specific features. * diff --git a/server/tests/src/com/vaadin/data/util/MethodPropertyMemoryConsumption.java b/server/tests/src/com/vaadin/data/util/MethodPropertyMemoryConsumption.java index caff33cf50..ce0711a29e 100644 --- a/server/tests/src/com/vaadin/data/util/MethodPropertyMemoryConsumption.java +++ b/server/tests/src/com/vaadin/data/util/MethodPropertyMemoryConsumption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/data/util/PerformanceTestIndexedContainer.java b/server/tests/src/com/vaadin/data/util/PerformanceTestIndexedContainer.java index 35335edd23..1c49017bf1 100644 --- a/server/tests/src/com/vaadin/data/util/PerformanceTestIndexedContainer.java +++ b/server/tests/src/com/vaadin/data/util/PerformanceTestIndexedContainer.java @@ -6,9 +6,10 @@ import java.util.Collections; import java.util.SortedSet; import java.util.TreeSet; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + public class PerformanceTestIndexedContainer extends TestCase { private static final int REPEATS = 10; diff --git a/server/tests/src/com/vaadin/data/util/PropertyDescriptorTest.java b/server/tests/src/com/vaadin/data/util/PropertyDescriptorTest.java index 12ded84fe2..68861536a9 100644 --- a/server/tests/src/com/vaadin/data/util/PropertyDescriptorTest.java +++ b/server/tests/src/com/vaadin/data/util/PropertyDescriptorTest.java @@ -7,9 +7,10 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + import com.vaadin.data.Property; import com.vaadin.data.util.NestedMethodPropertyTest.Person; diff --git a/server/tests/src/com/vaadin/data/util/PropertySetItemTest.java b/server/tests/src/com/vaadin/data/util/PropertySetItemTest.java index a3169332ec..ff83db4437 100644 --- a/server/tests/src/com/vaadin/data/util/PropertySetItemTest.java +++ b/server/tests/src/com/vaadin/data/util/PropertySetItemTest.java @@ -2,10 +2,10 @@ package com.vaadin.data.util; import java.util.Iterator; -import junit.framework.Assert; import junit.framework.TestCase; import org.easymock.EasyMock; +import org.junit.Assert; import com.vaadin.data.Item.PropertySetChangeEvent; import com.vaadin.data.Item.PropertySetChangeListener; diff --git a/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java b/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java index 5da0bdc8a2..eacee7e301 100644 --- a/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java +++ b/server/tests/src/com/vaadin/data/util/TestIndexedContainer.java @@ -2,14 +2,8 @@ package com.vaadin.data.util; import java.util.List; -import junit.framework.Assert; +import org.junit.Assert; -import org.easymock.Capture; -import org.easymock.EasyMock; - -import com.vaadin.data.Container.Indexed.ItemAddEvent; -import com.vaadin.data.Container.Indexed.ItemRemoveEvent; -import com.vaadin.data.Container.ItemSetChangeListener; import com.vaadin.data.Item; public class TestIndexedContainer extends AbstractInMemoryContainerTest { @@ -277,113 +271,6 @@ public class TestIndexedContainer extends AbstractInMemoryContainerTest { counter.assertNone(); } - public void testItemAddedEvent() { - IndexedContainer container = new IndexedContainer(); - ItemSetChangeListener addListener = createListenerMockFor(container); - addListener.containerItemSetChange(EasyMock.isA(ItemAddEvent.class)); - EasyMock.replay(addListener); - - container.addItem(); - - EasyMock.verify(addListener); - } - - public void testItemAddedEvent_AddedItem() { - IndexedContainer container = new IndexedContainer(); - ItemSetChangeListener addListener = createListenerMockFor(container); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - - Object itemId = container.addItem(); - - assertEquals(itemId, capturedEvent.getValue().getFirstItemId()); - } - - public void testItemAddedEvent_IndexOfAddedItem() { - IndexedContainer container = new IndexedContainer(); - ItemSetChangeListener addListener = createListenerMockFor(container); - container.addItem(); - Capture<ItemAddEvent> capturedEvent = captureAddEvent(addListener); - EasyMock.replay(addListener); - - container.addItemAt(1); - - assertEquals(1, capturedEvent.getValue().getFirstIndex()); - } - - public void testItemRemovedEvent() { - IndexedContainer container = new IndexedContainer(); - Object itemId = container.addItem(); - ItemSetChangeListener removeListener = createListenerMockFor(container); - removeListener.containerItemSetChange(EasyMock - .isA(ItemRemoveEvent.class)); - EasyMock.replay(removeListener); - - container.removeItem(itemId); - - EasyMock.verify(removeListener); - } - - public void testItemRemovedEvent_RemovedItem() { - IndexedContainer container = new IndexedContainer(); - Object itemId = container.addItem(); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeItem(itemId); - - assertEquals(itemId, capturedEvent.getValue().getFirstItemId()); - } - - public void testItemRemovedEvent_indexOfRemovedItem() { - IndexedContainer container = new IndexedContainer(); - container.addItem(); - Object secondItemId = container.addItem(); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeItem(secondItemId); - - assertEquals(1, capturedEvent.getValue().getFirstIndex()); - } - - public void testItemRemovedEvent_amountOfRemovedItems() { - IndexedContainer container = new IndexedContainer(); - container.addItem(); - container.addItem(); - ItemSetChangeListener removeListener = createListenerMockFor(container); - Capture<ItemRemoveEvent> capturedEvent = captureRemoveEvent(removeListener); - EasyMock.replay(removeListener); - - container.removeAllItems(); - - assertEquals(2, capturedEvent.getValue().getRemovedItemsCount()); - } - - private Capture<ItemAddEvent> captureAddEvent( - ItemSetChangeListener addListener) { - Capture<ItemAddEvent> capturedEvent = new Capture<ItemAddEvent>(); - addListener.containerItemSetChange(EasyMock.capture(capturedEvent)); - return capturedEvent; - } - - private Capture<ItemRemoveEvent> captureRemoveEvent( - ItemSetChangeListener removeListener) { - Capture<ItemRemoveEvent> capturedEvent = new Capture<ItemRemoveEvent>(); - removeListener.containerItemSetChange(EasyMock.capture(capturedEvent)); - return capturedEvent; - } - - private ItemSetChangeListener createListenerMockFor( - IndexedContainer container) { - ItemSetChangeListener listener = EasyMock - .createNiceMock(ItemSetChangeListener.class); - container.addItemSetChangeListener(listener); - return listener; - } - // Ticket 8028 public void testGetItemIdsRangeIndexOutOfBounds() { IndexedContainer ic = new IndexedContainer(); diff --git a/server/tests/src/com/vaadin/data/util/TransactionalPropertyWrapperTest.java b/server/tests/src/com/vaadin/data/util/TransactionalPropertyWrapperTest.java new file mode 100644 index 0000000000..5297cd807c --- /dev/null +++ b/server/tests/src/com/vaadin/data/util/TransactionalPropertyWrapperTest.java @@ -0,0 +1,116 @@ +/* + * 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.data.util; + +import static org.junit.Assert.assertTrue; + +import java.util.ArrayList; +import java.util.List; + +import org.junit.Test; + +import com.vaadin.data.fieldgroup.FieldGroup; +import com.vaadin.ui.TextField; + +/** + * Test verifying that TransactionalPropertyWrapper removes it's listener from + * wrapped Property + * + * @since 7.1.15 + * @author Vaadin Ltd + */ +public class TransactionalPropertyWrapperTest { + + @SuppressWarnings("serial") + public class TestingProperty<T extends Object> extends + ObjectProperty<Object> { + + private List<ValueChangeListener> listeners = new ArrayList<ValueChangeListener>(); + + public TestingProperty(Object value) { + super(value); + } + + @Override + public void addValueChangeListener(ValueChangeListener listener) { + super.addValueChangeListener(listener); + listeners.add(listener); + } + + @Override + public void removeValueChangeListener(ValueChangeListener listener) { + super.removeValueChangeListener(listener); + if (listeners.contains(listener)) { + listeners.remove(listener); + } + } + + public boolean hasListeners() { + return !listeners.isEmpty(); + } + } + + private final TextField nameField = new TextField("Name"); + private final TextField ageField = new TextField("Age"); + private final TextField unboundField = new TextField("No FieldGroup"); + private final TestingProperty<String> unboundProp = new TestingProperty<String>( + "Hello World"); + private final PropertysetItem item = new PropertysetItem(); + + @Test + public void fieldGroupBindAndUnbind() { + item.addItemProperty("name", new TestingProperty<String>( + "Just some text")); + item.addItemProperty("age", new TestingProperty<String>("42")); + + final FieldGroup binder = new FieldGroup(item); + binder.setBuffered(false); + + for (int i = 0; i < 2; ++i) { + binder.bind(nameField, "name"); + binder.bind(ageField, "age"); + unboundField.setPropertyDataSource(unboundProp); + + assertTrue("No listeners in Properties", fieldsHaveListeners(true)); + + binder.unbind(nameField); + binder.unbind(ageField); + unboundField.setPropertyDataSource(null); + + assertTrue("Listeners in Properties after unbinding", + fieldsHaveListeners(false)); + } + } + + /** + * Check that all listeners have same hasListeners() response + * + * @param expected + * expected response + * @return true if all are the same as expected. false if not + */ + private boolean fieldsHaveListeners(boolean expected) { + for (Object id : item.getItemPropertyIds()) { + TestingProperty<?> itemProperty = (TestingProperty<?>) item + .getItemProperty(id); + + if (itemProperty.hasListeners() != expected) { + return false; + } + } + return unboundProp.hasListeners() == expected; + } +} diff --git a/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java index fdd5b8a645..e5bc622e39 100644 --- a/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/AndOrFilterTest.java @@ -1,6 +1,6 @@ package com.vaadin.data.util.filter; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/filter/CompareFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/CompareFilterTest.java index b7ccd68429..732a541c89 100644 --- a/server/tests/src/com/vaadin/data/util/filter/CompareFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/CompareFilterTest.java @@ -3,7 +3,7 @@ package com.vaadin.data.util.filter; import java.math.BigDecimal; import java.util.Date; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/filter/IsNullFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/IsNullFilterTest.java index 6f90273de1..d3e959e069 100644 --- a/server/tests/src/com/vaadin/data/util/filter/IsNullFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/IsNullFilterTest.java @@ -1,6 +1,6 @@ package com.vaadin.data.util.filter; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/filter/LikeFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/LikeFilterTest.java index 15ad85e10d..0fcbd26b8e 100644 --- a/server/tests/src/com/vaadin/data/util/filter/LikeFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/LikeFilterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,7 +16,7 @@ package com.vaadin.data.util.filter; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Item; import com.vaadin.data.util.ObjectProperty; diff --git a/server/tests/src/com/vaadin/data/util/filter/NotFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/NotFilterTest.java index c3b666e6f7..966ffd3a6e 100644 --- a/server/tests/src/com/vaadin/data/util/filter/NotFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/NotFilterTest.java @@ -1,6 +1,6 @@ package com.vaadin.data.util.filter; -import junit.framework.Assert; +import org.junit.Assert; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/filter/SimpleStringFilterTest.java b/server/tests/src/com/vaadin/data/util/filter/SimpleStringFilterTest.java index bc63d57752..eb7dff6015 100644 --- a/server/tests/src/com/vaadin/data/util/filter/SimpleStringFilterTest.java +++ b/server/tests/src/com/vaadin/data/util/filter/SimpleStringFilterTest.java @@ -1,6 +1,6 @@ package com.vaadin.data.util.filter; -import junit.framework.Assert; +import org.junit.Assert; public class SimpleStringFilterTest extends AbstractFilterTest<SimpleStringFilter> { diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowIdTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowIdTest.java index 63716bb33b..248dc62d93 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowIdTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/ReadOnlyRowIdTest.java @@ -1,7 +1,6 @@ package com.vaadin.data.util.sqlcontainer; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; public class ReadOnlyRowIdTest { diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java index 1e96d59ed5..e03e970048 100755 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -151,4 +151,4 @@ public class SQLTestsConstants { } } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/UtilTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/UtilTest.java index 0187f9068e..a575d649f1 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/UtilTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/UtilTest.java @@ -1,7 +1,6 @@ package com.vaadin.data.util.sqlcontainer; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; public class UtilTest { diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPoolTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPoolTest.java index 65a995120e..1463a27217 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPoolTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/J2EEConnectionPoolTest.java @@ -7,9 +7,8 @@ import javax.naming.Context; import javax.naming.NamingException; import javax.sql.DataSource; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Test; public class J2EEConnectionPoolTest { diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java index 541ab8da5b..99ad420229 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/connection/SimpleJDBCConnectionPoolTest.java @@ -3,9 +3,8 @@ package com.vaadin.data.util.sqlcontainer.connection; import java.sql.Connection; import java.sql.SQLException; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java index da4cfe4522..16171f67bc 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/BetweenTest.java @@ -1,8 +1,7 @@ package com.vaadin.data.util.sqlcontainer.filters; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Test; import com.vaadin.data.Item; diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java index c8faa71e66..252acd81fc 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/filters/CompareTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java index f635b23ebd..596f28cf5e 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/QueryBuilderTest.java @@ -2,9 +2,8 @@ package com.vaadin.data.util.sqlcontainer.query; import java.util.ArrayList; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Test; import com.vaadin.data.Container.Filter; diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java index c275cd4363..f009fc505e 100644 --- a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java +++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/TableQueryTest.java @@ -734,4 +734,4 @@ public class TableQueryTest { statement.execute(SQLTestsConstants.dropSchema); } } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/server/ConnectorResourceHandlerTest.java b/server/tests/src/com/vaadin/server/ConnectorResourceHandlerTest.java index 828c35ced3..a5746065d6 100644 --- a/server/tests/src/com/vaadin/server/ConnectorResourceHandlerTest.java +++ b/server/tests/src/com/vaadin/server/ConnectorResourceHandlerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/DefaultDeploymentConfigurationTest.java b/server/tests/src/com/vaadin/server/DefaultDeploymentConfigurationTest.java index 45d9853537..7cbb73af17 100644 --- a/server/tests/src/com/vaadin/server/DefaultDeploymentConfigurationTest.java +++ b/server/tests/src/com/vaadin/server/DefaultDeploymentConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/JSONSerializerTest.java b/server/tests/src/com/vaadin/server/JSONSerializerTest.java index 81fd997c4a..8c1967acb3 100644 --- a/server/tests/src/com/vaadin/server/JSONSerializerTest.java +++ b/server/tests/src/com/vaadin/server/JSONSerializerTest.java @@ -1,7 +1,7 @@ package com.vaadin.server; /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/MockServletConfig.java b/server/tests/src/com/vaadin/server/MockServletConfig.java index cd1201c249..d9d0e4d773 100644 --- a/server/tests/src/com/vaadin/server/MockServletConfig.java +++ b/server/tests/src/com/vaadin/server/MockServletConfig.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/MockServletContext.java b/server/tests/src/com/vaadin/server/MockServletContext.java index 40d79190f6..031c83ae90 100644 --- a/server/tests/src/com/vaadin/server/MockServletContext.java +++ b/server/tests/src/com/vaadin/server/MockServletContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/MockVaadinSession.java b/server/tests/src/com/vaadin/server/MockVaadinSession.java index 1fb53cd368..660767e0d4 100644 --- a/server/tests/src/com/vaadin/server/MockVaadinSession.java +++ b/server/tests/src/com/vaadin/server/MockVaadinSession.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinGateInRequestTests.java b/server/tests/src/com/vaadin/server/VaadinGateInRequestTests.java index 017613661e..4478b4cf39 100644 --- a/server/tests/src/com/vaadin/server/VaadinGateInRequestTests.java +++ b/server/tests/src/com/vaadin/server/VaadinGateInRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinHttpAndPortletRequestTests.java b/server/tests/src/com/vaadin/server/VaadinHttpAndPortletRequestTests.java index 01d501c4fb..a87eb1870e 100644 --- a/server/tests/src/com/vaadin/server/VaadinHttpAndPortletRequestTests.java +++ b/server/tests/src/com/vaadin/server/VaadinHttpAndPortletRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinLiferayRequestTests.java b/server/tests/src/com/vaadin/server/VaadinLiferayRequestTests.java index 074941a556..8ccd649ea4 100644 --- a/server/tests/src/com/vaadin/server/VaadinLiferayRequestTests.java +++ b/server/tests/src/com/vaadin/server/VaadinLiferayRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -36,4 +36,4 @@ public class VaadinLiferayRequestTests extends return spy; } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java b/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java index 62befdc516..f7a69c2edb 100644 --- a/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java +++ b/server/tests/src/com/vaadin/server/VaadinPortletServiceTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,8 +20,15 @@ import static org.hamcrest.core.Is.is; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; +import java.util.concurrent.locks.ReentrantLock; + +import org.junit.Assert; import org.junit.Before; import org.junit.Test; +import org.mockito.Mockito; + +import com.vaadin.shared.ui.ui.UIConstants; +import com.vaadin.ui.UI; public class VaadinPortletServiceTests { @@ -188,4 +195,28 @@ public class VaadinPortletServiceTests { assertThat(widgetset, is("com.vaadin.portal.gwt.PortalDefaultWidgetSet")); } + + @Test + public void findUIDoesntThrowNPE() { + try { + ReentrantLock mockLock = Mockito.mock(ReentrantLock.class); + when(mockLock.isHeldByCurrentThread()).thenReturn(true); + + WrappedSession emptyWrappedSession = Mockito + .mock(WrappedSession.class); + when(emptyWrappedSession.getAttribute("null.lock")).thenReturn( + mockLock); + VaadinRequest requestWithUIIDSet = Mockito + .mock(VaadinRequest.class); + when(requestWithUIIDSet.getParameter(UIConstants.UI_ID_PARAMETER)) + .thenReturn("1"); + when(requestWithUIIDSet.getWrappedSession()).thenReturn( + emptyWrappedSession); + + UI ui = sut.findUI(requestWithUIIDSet); + Assert.assertNull("Unset session did not return null", ui); + } catch (NullPointerException e) { + Assert.fail("findUI threw a NullPointerException"); + } + } } diff --git a/server/tests/src/com/vaadin/server/VaadinPortletTests.java b/server/tests/src/com/vaadin/server/VaadinPortletTests.java index 93f8fd0778..f92aa0dcaa 100644 --- a/server/tests/src/com/vaadin/server/VaadinPortletTests.java +++ b/server/tests/src/com/vaadin/server/VaadinPortletTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinServiceTest.java b/server/tests/src/com/vaadin/server/VaadinServiceTest.java index 77eb155378..51325067d2 100644 --- a/server/tests/src/com/vaadin/server/VaadinServiceTest.java +++ b/server/tests/src/com/vaadin/server/VaadinServiceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java b/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java index 58b44dc3db..65698d2c44 100644 --- a/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java +++ b/server/tests/src/com/vaadin/server/VaadinServletConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,9 +24,8 @@ import java.util.Properties; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Test; import com.vaadin.annotations.VaadinServletConfiguration; diff --git a/server/tests/src/com/vaadin/server/VaadinServletTest.java b/server/tests/src/com/vaadin/server/VaadinServletTest.java index be21586be4..566c4ce70a 100644 --- a/server/tests/src/com/vaadin/server/VaadinServletTest.java +++ b/server/tests/src/com/vaadin/server/VaadinServletTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/server/VaadinSessionTest.java b/server/tests/src/com/vaadin/server/VaadinSessionTest.java index edc78ba8d7..b710ee483f 100644 --- a/server/tests/src/com/vaadin/server/VaadinSessionTest.java +++ b/server/tests/src/com/vaadin/server/VaadinSessionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,9 +23,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpSession; import javax.servlet.http.HttpSessionBindingEvent; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/server/VaadinWebSpherePortalRequestTests.java b/server/tests/src/com/vaadin/server/VaadinWebSpherePortalRequestTests.java index 0da85c7111..a1abfbd280 100644 --- a/server/tests/src/com/vaadin/server/VaadinWebSpherePortalRequestTests.java +++ b/server/tests/src/com/vaadin/server/VaadinWebSpherePortalRequestTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -36,4 +36,4 @@ public class VaadinWebSpherePortalRequestTests extends return spy; } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/server/communication/AtmospherePushConnectionTest.java b/server/tests/src/com/vaadin/server/communication/AtmospherePushConnectionTest.java new file mode 100644 index 0000000000..f9e12ce75f --- /dev/null +++ b/server/tests/src/com/vaadin/server/communication/AtmospherePushConnectionTest.java @@ -0,0 +1,56 @@ +/* + * 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.server.communication; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; + +import org.atmosphere.cpr.AtmosphereResource; +import org.easymock.EasyMock; +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.server.communication.AtmospherePushConnection.State; +import com.vaadin.ui.UI; + +/** + * @author Vaadin Ltd + */ +public class AtmospherePushConnectionTest { + @Test + public void testSerialization() throws Exception { + + UI ui = EasyMock.createNiceMock(UI.class); + AtmosphereResource resource = EasyMock + .createNiceMock(AtmosphereResource.class); + + AtmospherePushConnection connection = new AtmospherePushConnection(ui); + connection.connect(resource); + + Assert.assertEquals(State.CONNECTED, connection.getState()); + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + new ObjectOutputStream(baos).writeObject(connection); + + connection = (AtmospherePushConnection) new ObjectInputStream( + new ByteArrayInputStream(baos.toByteArray())).readObject(); + + Assert.assertEquals(State.DISCONNECTED, connection.getState()); + } +} diff --git a/server/tests/src/com/vaadin/server/communication/MetadataWriterTest.java b/server/tests/src/com/vaadin/server/communication/MetadataWriterTest.java new file mode 100644 index 0000000000..dee37ddc7f --- /dev/null +++ b/server/tests/src/com/vaadin/server/communication/MetadataWriterTest.java @@ -0,0 +1,95 @@ +/* + * 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.server.communication; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + +import java.io.StringWriter; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.mockito.Mockito; + +import com.vaadin.server.SystemMessages; +import com.vaadin.server.VaadinSession; +import com.vaadin.server.WrappedSession; +import com.vaadin.ui.UI; + +public class MetadataWriterTest { + + private UI ui; + private VaadinSession session; + private StringWriter writer; + private SystemMessages messages; + + @Before + public void setup() { + ui = Mockito.mock(UI.class); + session = Mockito.mock(VaadinSession.class); + Mockito.when(ui.getSession()).thenReturn(session); + writer = new StringWriter(); + messages = Mockito.mock(SystemMessages.class); + } + + private void disableSessionExpirationMessages(SystemMessages messages) { + when(messages.isSessionExpiredNotificationEnabled()).thenReturn(true); + when(messages.getSessionExpiredMessage()).thenReturn(null); + when(messages.getSessionExpiredCaption()).thenReturn(null); + } + + @Test + public void writeAsyncTag() throws Exception { + new MetadataWriter().write(ui, writer, false, true, messages); + Assert.assertEquals("{\"async\":true}", writer.getBuffer().toString()); + } + + @Test + public void writeRepaintTag() throws Exception { + new MetadataWriter().write(ui, writer, true, false, messages); + Assert.assertEquals("{\"repaintAll\":true}", writer.getBuffer() + .toString()); + } + + @Test + public void writeRepaintAndAsyncTag() throws Exception { + new MetadataWriter().write(ui, writer, true, true, messages); + Assert.assertEquals("{\"repaintAll\":true, \"async\":true}", writer + .getBuffer().toString()); + } + + @Test + public void writeRedirectWithExpiredSession() throws Exception { + disableSessionExpirationMessages(messages); + + new MetadataWriter().write(ui, writer, false, false, messages); + Assert.assertEquals("{}", writer.getBuffer().toString()); + } + + @Test + public void writeRedirectWithActiveSession() throws Exception { + WrappedSession wrappedSession = mock(WrappedSession.class); + when(session.getSession()).thenReturn(wrappedSession); + + disableSessionExpirationMessages(messages); + + new MetadataWriter().write(ui, writer, false, false, messages); + Assert.assertEquals( + "{\"timedRedirect\":{\"interval\":15,\"url\":\"\"}}", writer + .getBuffer().toString()); + } +} diff --git a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java index 306e2f0405..32c9dc6604 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java +++ b/server/tests/src/com/vaadin/tests/data/converter/ConverterFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestAnyEnumToStringConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestAnyEnumToStringConverter.java index e21382069f..64b06f651e 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/TestAnyEnumToStringConverter.java +++ b/server/tests/src/com/vaadin/tests/data/converter/TestAnyEnumToStringConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestSpecificEnumToStringConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestSpecificEnumToStringConverter.java index 8ce7b8eab8..75c742775f 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/TestSpecificEnumToStringConverter.java +++ b/server/tests/src/com/vaadin/tests/data/converter/TestSpecificEnumToStringConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java index 5db33691b6..b8e74c7572 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java +++ b/server/tests/src/com/vaadin/tests/data/converter/TestStringToBigDecimalConverter.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/data/converter/TestStringToLongConverter.java b/server/tests/src/com/vaadin/tests/data/converter/TestStringToLongConverter.java index 18e2ed06c0..0e95975c17 100644 --- a/server/tests/src/com/vaadin/tests/data/converter/TestStringToLongConverter.java +++ b/server/tests/src/com/vaadin/tests/data/converter/TestStringToLongConverter.java @@ -2,9 +2,10 @@ package com.vaadin.tests.data.converter; import java.util.Locale; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.ReverseConverter; import com.vaadin.data.util.converter.StringToLongConverter; @@ -51,7 +52,7 @@ public class TestStringToLongConverter extends TestCase { String.class, Locale.ENGLISH); Assert.assertEquals("9,223,372,036,854,775,807", str); str = reverseConverter.convertToModel(Long.MIN_VALUE, String.class, - null); + Locale.ENGLISH); Assert.assertEquals("-9,223,372,036,854,775,808", str); } diff --git a/server/tests/src/com/vaadin/tests/event/EventRouterTest.java b/server/tests/src/com/vaadin/tests/event/EventRouterTest.java index dbbeaf778e..aeb460c49e 100644 --- a/server/tests/src/com/vaadin/tests/event/EventRouterTest.java +++ b/server/tests/src/com/vaadin/tests/event/EventRouterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/TestAssertionsEnabled.java b/server/tests/src/com/vaadin/tests/server/TestAssertionsEnabled.java index f94cff391f..7e120cb9dd 100644 --- a/server/tests/src/com/vaadin/tests/server/TestAssertionsEnabled.java +++ b/server/tests/src/com/vaadin/tests/server/TestAssertionsEnabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/TestClientMethodSerialization.java b/server/tests/src/com/vaadin/tests/server/TestClientMethodSerialization.java index 1e0210dc63..41b71a37fa 100644 --- a/server/tests/src/com/vaadin/tests/server/TestClientMethodSerialization.java +++ b/server/tests/src/com/vaadin/tests/server/TestClientMethodSerialization.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/TestSerialization.java b/server/tests/src/com/vaadin/tests/server/TestSerialization.java index a52821a919..3c18035dab 100644 --- a/server/tests/src/com/vaadin/tests/server/TestSerialization.java +++ b/server/tests/src/com/vaadin/tests/server/TestSerialization.java @@ -136,4 +136,4 @@ public class TestSerialization extends TestCase { return dummyGetter; } } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/ComponentSizeParseTest.java b/server/tests/src/com/vaadin/tests/server/component/ComponentSizeParseTest.java index 11c0d10998..2083d1f473 100644 --- a/server/tests/src/com/vaadin/tests/server/component/ComponentSizeParseTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/ComponentSizeParseTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/AddParentAsChild.java b/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/AddParentAsChild.java new file mode 100644 index 0000000000..67e6d09adc --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/abstractcomponentcontainer/AddParentAsChild.java @@ -0,0 +1,64 @@ +/* + * 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.server.component.abstractcomponentcontainer; + +import java.util.Iterator; + +import org.easymock.EasyMock; +import org.junit.Test; + +import com.vaadin.ui.AbstractComponentContainer; +import com.vaadin.ui.Component; +import com.vaadin.ui.HasComponents; + +/** + * Tests for avoiding add parent as child for + * {@link AbstractComponentContainer#addComponent(Component)} + * + * @author Vaadin Ltd + */ +public class AddParentAsChild { + + @Test(expected = IllegalArgumentException.class) + public void testAddComponent() { + AbstractComponentContainer container = new ComponentContainer(); + HasComponents hasComponentsMock = EasyMock + .createMock(HasComponents.class); + container.setParent(hasComponentsMock); + + container.addComponent(hasComponentsMock); + } + + class ComponentContainer extends AbstractComponentContainer { + + @Override + public void replaceComponent(Component oldComponent, + Component newComponent) { + } + + @Override + public int getComponentCount() { + return 0; + } + + @Override + public Iterator<Component> iterator() { + return null; + } + + } + +} diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java index 85116dd152..beb32e7dba 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractfield/AbsFieldValueConversions.java @@ -2,9 +2,9 @@ package com.vaadin.tests.server.component.abstractfield; import java.util.Locale; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; import org.junit.Test; import com.vaadin.data.util.MethodProperty; diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/LayoutSettingsOnReplace.java b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/LayoutSettingsOnReplace.java new file mode 100644 index 0000000000..fd951f1692 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/LayoutSettingsOnReplace.java @@ -0,0 +1,85 @@ +/* + * 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.server.component.abstractorderedlayout; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.ui.AbstractComponent; +import com.vaadin.ui.AbstractOrderedLayout; +import com.vaadin.ui.Alignment; + +/** + * Tests for abstract layout settings which should be preserved on replace + * component + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class LayoutSettingsOnReplace { + + @Test + public void testExpandRatio() { + AbstractOrderedLayout layout = new AbstractOrderedLayout() { + }; + + AbstractComponent first = new AbstractComponent() { + }; + AbstractComponent second = new AbstractComponent() { + }; + + layout.addComponent(first); + layout.addComponent(second); + + int ratio = 2; + layout.setExpandRatio(first, ratio); + layout.setExpandRatio(second, 1); + + AbstractComponent replace = new AbstractComponent() { + }; + layout.replaceComponent(first, replace); + + Assert.assertEquals("Expand ratio for replaced component is not " + + "the same as for previous one", ratio, + layout.getExpandRatio(replace), 0.0001); + } + + @Test + public void testAlignment() { + AbstractOrderedLayout layout = new AbstractOrderedLayout() { + }; + + AbstractComponent first = new AbstractComponent() { + }; + AbstractComponent second = new AbstractComponent() { + }; + + layout.addComponent(first); + layout.addComponent(second); + + Alignment alignment = Alignment.BOTTOM_RIGHT; + layout.setComponentAlignment(first, alignment); + layout.setComponentAlignment(second, Alignment.MIDDLE_CENTER); + + AbstractComponent replace = new AbstractComponent() { + }; + layout.replaceComponent(first, replace); + + Assert.assertEquals("Alignment for replaced component is not " + + "the same as for previous one", alignment, + layout.getComponentAlignment(replace)); + } +} diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/SetParentAsContent.java b/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/SetParentAsContent.java new file mode 100644 index 0000000000..dae0e57d02 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/SetParentAsContent.java @@ -0,0 +1,45 @@ +/* + * 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.server.component.abstractsinglecomponentcontainer; + +import org.easymock.EasyMock; +import org.junit.Test; + +import com.vaadin.ui.AbstractSingleComponentContainer; +import com.vaadin.ui.Component; +import com.vaadin.ui.HasComponents; + +/** + * + * Tests for avoiding set parent as child for + * {@link AbstractSingleComponentContainer#setContent(Component)} + * + * @author Vaadin Ltd + */ +public class SetParentAsContent { + + @Test(expected = IllegalArgumentException.class) + public void testSetContent() { + AbstractSingleComponentContainer container = new AbstractSingleComponentContainer() { + }; + HasComponents hasComponentsMock = EasyMock + .createMock(HasComponents.class); + container.setParent(hasComponentsMock); + + container.setContent(hasComponentsMock); + } + +} diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/TestRemoveFromParentLocking.java b/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/TestRemoveFromParentLocking.java index 26443ead2b..fd4a1df766 100644 --- a/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/TestRemoveFromParentLocking.java +++ b/server/tests/src/com/vaadin/tests/server/component/abstractsinglecomponentcontainer/TestRemoveFromParentLocking.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/calendar/CalendarBasics.java b/server/tests/src/com/vaadin/tests/server/component/calendar/CalendarBasics.java index 5926cfa1ca..ab2bc7c8c0 100644 --- a/server/tests/src/com/vaadin/tests/server/component/calendar/CalendarBasics.java +++ b/server/tests/src/com/vaadin/tests/server/component/calendar/CalendarBasics.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/calendar/ContainerDataSource.java b/server/tests/src/com/vaadin/tests/server/component/calendar/ContainerDataSource.java index 2bc95e371c..030abc0eb2 100644 --- a/server/tests/src/com/vaadin/tests/server/component/calendar/ContainerDataSource.java +++ b/server/tests/src/com/vaadin/tests/server/component/calendar/ContainerDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -25,6 +25,7 @@ import org.junit.Test; import com.vaadin.data.Container.Indexed; import com.vaadin.data.Container.Sortable; import com.vaadin.data.Item; +import com.vaadin.data.Property; import com.vaadin.data.util.BeanItemContainer; import com.vaadin.data.util.IndexedContainer; import com.vaadin.ui.Calendar; @@ -327,6 +328,37 @@ public class ContainerDataSource extends TestCase { assertEquals(0, calendar.getEvents(start, end).size()); } + @Test + public void testStyleNamePropertyRetrieved() { + IndexedContainer ic = (IndexedContainer) createTestIndexedContainer(); + ic.addContainerProperty("testStyleName", String.class, ""); + for (int i = 0; i < 10; i++) { + Item item = ic.getItem(ic.getIdByIndex(i)); + @SuppressWarnings("unchecked") + Property<String> itemProperty = item + .getItemProperty("testStyleName"); + itemProperty.setValue("testStyle"); + } + + ContainerEventProvider provider = new ContainerEventProvider(ic); + provider.setCaptionProperty("testCaption"); + provider.setDescriptionProperty("testDescription"); + provider.setStartDateProperty("testStartDate"); + provider.setEndDateProperty("testEndDate"); + provider.setStyleNameProperty("testStyleName"); + + calendar.setEventProvider(provider); + java.util.Calendar cal = java.util.Calendar.getInstance(); + Date now = cal.getTime(); + cal.add(java.util.Calendar.DAY_OF_MONTH, 20); + Date then = cal.getTime(); + List<CalendarEvent> events = calendar.getEventProvider().getEvents(now, + then); + for (CalendarEvent ce : events) { + assertEquals("testStyle", ce.getStyleName()); + } + } + private static Indexed createTestBeanItemContainer() { BeanItemContainer<CalendarEvent> eventContainer = new BeanItemContainer<CalendarEvent>( CalendarEvent.class); diff --git a/server/tests/src/com/vaadin/tests/server/component/colorpicker/ColorConversions.java b/server/tests/src/com/vaadin/tests/server/component/colorpicker/ColorConversions.java new file mode 100644 index 0000000000..46d72a6ae6 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/colorpicker/ColorConversions.java @@ -0,0 +1,57 @@ +/* + * 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.server.component.colorpicker; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.vaadin.shared.ui.colorpicker.Color; + +public class ColorConversions { + + @Test + public void convertHSL2RGB() { + + int rgb = Color.HSLtoRGB(100, 50, 50); + Color c = new Color(rgb); + assertEquals(106, c.getRed()); + assertEquals(191, c.getGreen()); + assertEquals(64, c.getBlue()); + assertEquals("#6abf40", c.getCSS()); + + rgb = Color.HSLtoRGB(0, 50, 50); + c = new Color(rgb); + assertEquals(191, c.getRed()); + assertEquals(64, c.getGreen()); + assertEquals(64, c.getBlue()); + assertEquals("#bf4040", c.getCSS()); + + rgb = Color.HSLtoRGB(50, 0, 50); + c = new Color(rgb); + assertEquals(128, c.getRed()); + assertEquals(128, c.getGreen()); + assertEquals(128, c.getBlue()); + assertEquals("#808080", c.getCSS()); + + rgb = Color.HSLtoRGB(50, 100, 0); + c = new Color(rgb); + assertEquals(0, c.getRed(), 0); + assertEquals(0, c.getGreen(), 0); + assertEquals(0, c.getBlue(), 0); + assertEquals("#000000", c.getCSS()); + } +} diff --git a/server/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java b/server/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java index 21a48888d6..ee75d6ed59 100644 --- a/server/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java +++ b/server/tests/src/com/vaadin/tests/server/component/csslayout/CssLayoutListeners.java @@ -10,4 +10,4 @@ public class CssLayoutListeners extends AbstractListenerMethodsTest { testListenerAddGetRemove(CssLayout.class, LayoutClickEvent.class, LayoutClickListener.class); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldConverterTest.java b/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldConverterTest.java index 25ee0a38a9..f5467b2d18 100644 --- a/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldConverterTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/datefield/DateFieldConverterTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java index e571576990..ea34d8b04e 100644 --- a/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java +++ b/server/tests/src/com/vaadin/tests/server/component/fieldgroup/CaseInsensitiveBinding.java @@ -82,4 +82,4 @@ public class CaseInsensitiveBinding { assertTrue("This".equals(form.firstName.getValue())); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/gridlayout/DefaultAlignment.java b/server/tests/src/com/vaadin/tests/server/component/gridlayout/DefaultAlignment.java index 2faa65d1f2..244f1f9e45 100644 --- a/server/tests/src/com/vaadin/tests/server/component/gridlayout/DefaultAlignment.java +++ b/server/tests/src/com/vaadin/tests/server/component/gridlayout/DefaultAlignment.java @@ -1,7 +1,6 @@ package com.vaadin.tests.server.component.gridlayout; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java index 9d71db89a6..e6cecee1bf 100644 --- a/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java +++ b/server/tests/src/com/vaadin/tests/server/component/label/LabelConverters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/orderedlayout/DefaultAlignment.java b/server/tests/src/com/vaadin/tests/server/component/orderedlayout/DefaultAlignment.java index 701373aba0..9497a13c0a 100644 --- a/server/tests/src/com/vaadin/tests/server/component/orderedlayout/DefaultAlignment.java +++ b/server/tests/src/com/vaadin/tests/server/component/orderedlayout/DefaultAlignment.java @@ -1,7 +1,6 @@ package com.vaadin.tests.server.component.orderedlayout; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java b/server/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java index c7703303d3..2a1cc0deb0 100644 --- a/server/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java +++ b/server/tests/src/com/vaadin/tests/server/component/select/SelectListeners.java @@ -17,4 +17,4 @@ public class SelectListeners extends AbstractListenerMethodsTest { testListenerAddGetRemove(Select.class, BlurEvent.class, BlurListener.class); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java index d1dd87d923..f568da1392 100644 --- a/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java +++ b/server/tests/src/com/vaadin/tests/server/component/slider/SliderTest.java @@ -1,8 +1,9 @@ package com.vaadin.tests.server.component.slider; -import junit.framework.Assert; import junit.framework.TestCase; +import org.junit.Assert; + import com.vaadin.ui.Slider; import com.vaadin.ui.Slider.ValueOutOfBoundsException; @@ -11,9 +12,9 @@ public class SliderTest extends TestCase { public void testOutOfBounds() { Slider s = new Slider(0, 10); s.setValue(0.0); - Assert.assertEquals(0.0, s.getValue()); + Assert.assertEquals(0.0, s.getValue().doubleValue(), 0.001); s.setValue(10.0); - Assert.assertEquals(10.0, s.getValue()); + Assert.assertEquals(10.0, s.getValue().doubleValue(), 0.001); try { s.setValue(20.0); fail("Should throw out of bounds exception"); diff --git a/server/tests/src/com/vaadin/tests/server/component/table/CacheUpdateExceptionCauses.java b/server/tests/src/com/vaadin/tests/server/component/table/CacheUpdateExceptionCauses.java index 7a7b488bc0..beb5da0885 100644 --- a/server/tests/src/com/vaadin/tests/server/component/table/CacheUpdateExceptionCauses.java +++ b/server/tests/src/com/vaadin/tests/server/component/table/CacheUpdateExceptionCauses.java @@ -16,8 +16,7 @@ package com.vaadin.tests.server.component.table; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Test; import com.vaadin.ui.Table; diff --git a/server/tests/src/com/vaadin/tests/server/component/table/TableListeners.java b/server/tests/src/com/vaadin/tests/server/component/table/TableListeners.java index 6cc522f8c7..fbe5bb3146 100644 --- a/server/tests/src/com/vaadin/tests/server/component/table/TableListeners.java +++ b/server/tests/src/com/vaadin/tests/server/component/table/TableListeners.java @@ -38,4 +38,4 @@ public class TableListeners extends AbstractListenerMethodsTest { testListenerAddGetRemove(Table.class, ColumnReorderEvent.class, ColumnReorderListener.class); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/table/TablePropertyValueConverter.java b/server/tests/src/com/vaadin/tests/server/component/table/TablePropertyValueConverter.java new file mode 100644 index 0000000000..418ca333bc --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/table/TablePropertyValueConverter.java @@ -0,0 +1,380 @@ +/* + * 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.server.component.table; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map.Entry; +import java.util.Set; + +import junit.framework.TestCase; + +import org.junit.Test; + +import com.vaadin.data.Container; +import com.vaadin.data.Item; +import com.vaadin.data.Property; +import com.vaadin.data.util.IndexedContainer; +import com.vaadin.data.util.converter.Converter; +import com.vaadin.ui.Table; + +/** + * + * @since + * @author Vaadin Ltd + */ +public class TablePropertyValueConverter extends TestCase { + protected TestableTable table; + protected Collection<?> initialProperties; + + @Test + public void testRemovePropertyId() { + Collection<Object> converters = table.getCurrentConverters(); + assertTrue("Set of converters was empty at the start.", + converters.size() > 0); + + Object firstId = converters.iterator().next(); + + table.removeContainerProperty(firstId); + + Collection<Object> converters2 = table.getCurrentConverters(); + assertTrue("FirstId was not removed", !converters2.contains(firstId)); + + assertTrue("The number of removed converters was not one.", + converters.size() - converters2.size() == 1); + + for (Object originalId : converters) { + if (!originalId.equals(firstId)) { + assertTrue("The wrong converter was removed.", + converters2.contains(originalId)); + } + } + + } + + @Test + public void testSetContainer() { + table.setContainerDataSource(createContainer(new String[] { "col1", + "col3", "col4", "col5" })); + Collection<Object> converters = table.getCurrentConverters(); + assertTrue("There should only have been one converter left.", + converters.size() == 1); + Object onlyKey = converters.iterator().next(); + assertTrue("The incorrect key was left.", onlyKey.equals("col1")); + + } + + @Test + public void testSetContainerWithInexactButCompatibleTypes() { + TestableTable customTable = new TestableTable("Test table", + createContainer(new String[] { "col1", "col2", "col3" }, + new Class[] { String.class, BaseClass.class, + DerivedClass.class })); + customTable.setConverter("col1", new Converter<String, String>() { + private static final long serialVersionUID = 1L; + + @Override + public String convertToModel(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "model"; + } + + @Override + public String convertToPresentation(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "presentation"; + } + + @Override + public Class<String> getModelType() { + return String.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + + }); + customTable.setConverter("col2", new Converter<String, BaseClass>() { + private static final long serialVersionUID = 1L; + + @Override + public BaseClass convertToModel(String value, + Class<? extends BaseClass> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return new BaseClass("model"); + } + + @Override + public Class<BaseClass> getModelType() { + return BaseClass.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + + @Override + public String convertToPresentation(BaseClass value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return null; + } + }); + customTable.setConverter("col3", new Converter<String, DerivedClass>() { + private static final long serialVersionUID = 1L; + + @Override + public DerivedClass convertToModel(String value, + Class<? extends DerivedClass> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return new DerivedClass("derived" + 1001); + } + + @Override + public Class<DerivedClass> getModelType() { + return DerivedClass.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + + @Override + public String convertToPresentation(DerivedClass value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return null; + } + }); + customTable.setContainerDataSource(createContainer(new String[] { + "col1", "col2", "col3" }, new Class[] { DerivedClass.class, + DerivedClass.class, BaseClass.class })); + Set<Object> converters = customTable.getCurrentConverters(); + // TODO Test temporarily disabled as this feature + // is not yet implemented in Table + /* + * assertTrue("Incompatible types were not removed.", converters.size() + * <= 1); assertTrue("Even compatible types were removed", + * converters.size() == 1); assertTrue("Compatible type was missing.", + * converters.contains("col2")); + */ + } + + @Test + public void testPrimitiveTypeConverters() { + TestableTable customTable = new TestableTable("Test table", + createContainer(new String[] { "col1", "col2", "col3" }, + new Class[] { int.class, BaseClass.class, + DerivedClass.class })); + customTable.setConverter("col1", new Converter<String, Integer>() { + private static final long serialVersionUID = 1L; + + @Override + public Integer convertToModel(String value, + Class<? extends Integer> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return 11; + } + + @Override + public String convertToPresentation(Integer value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "presentation"; + } + + @Override + public Class<Integer> getModelType() { + return Integer.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + }); + Set<Object> converters = customTable.getCurrentConverters(); + assertTrue("Converter was not set.", converters.size() > 0); + } + + @Test + public void testInheritance() { + assertTrue("BaseClass isn't assignable from DerivedClass", + BaseClass.class.isAssignableFrom(DerivedClass.class)); + assertFalse("DerivedClass is assignable from BaseClass", + DerivedClass.class.isAssignableFrom(BaseClass.class)); + } + + @Override + public void setUp() { + table = new TestableTable("Test table", createContainer(new String[] { + "col1", "col2", "col3" })); + table.setConverter("col1", new Converter<String, String>() { + private static final long serialVersionUID = 1L; + + @Override + public String convertToModel(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "model"; + } + + @Override + public String convertToPresentation(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "presentation"; + } + + @Override + public Class<String> getModelType() { + return String.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + + }); + + table.setConverter("col2", new Converter<String, String>() { + private static final long serialVersionUID = 1L; + + @Override + public String convertToModel(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "model2"; + } + + @Override + public String convertToPresentation(String value, + Class<? extends String> targetType, Locale locale) + throws com.vaadin.data.util.converter.Converter.ConversionException { + return "presentation2"; + } + + @Override + public Class<String> getModelType() { + return String.class; + } + + @Override + public Class<String> getPresentationType() { + return String.class; + } + + }); + + initialProperties = table.getContainerPropertyIds(); + } + + private static Container createContainer(Object[] ids) { + Class[] types = new Class[ids.length]; + for (int i = 0; i < types.length; ++i) { + types[i] = String.class; + } + return createContainer(ids, types); + } + + private static Container createContainer(Object[] ids, Class[] types) { + IndexedContainer container = new IndexedContainer(); + if (ids.length > types.length) { + throw new IllegalArgumentException("Too few defined types"); + } + for (int i = 0; i < ids.length; ++i) { + container.addContainerProperty(ids[i], types[i], ""); + } + + for (int i = 0; i < 100; i++) { + Item item = container.addItem("item " + i); + for (int j = 0; j < ids.length; ++j) { + Property itemProperty = item.getItemProperty(ids[j]); + if (types[j] == String.class) { + itemProperty.setValue(ids[j].toString() + i); + } else if (types[j] == BaseClass.class) { + itemProperty.setValue(new BaseClass("base" + i)); + } else if (types[j] == DerivedClass.class) { + itemProperty.setValue(new DerivedClass("derived" + i)); + } else if (types[j] == int.class) { + // FIXME can't set values because the int is autoboxed into + // an Integer and not unboxed prior to set + + // itemProperty.setValue(i); + } else { + throw new IllegalArgumentException( + "Unhandled type in createContainer: " + types[j]); + } + } + } + + return container; + } + + private class TestableTable extends Table { + /** + * @param string + * @param createContainer + */ + public TestableTable(String string, Container container) { + super(string, container); + } + + Set<Object> getCurrentConverters() { + try { + Field f = Table.class + .getDeclaredField("propertyValueConverters"); + f.setAccessible(true); + HashMap<Object, Converter<String, Object>> pvc = (HashMap<Object, Converter<String, Object>>) f + .get(this); + Set<Object> currentConverters = new HashSet<Object>(); + for (Entry<Object, Converter<String, Object>> entry : pvc + .entrySet()) { + currentConverters.add(entry.getKey()); + } + return currentConverters; + + } catch (Exception e) { + fail("Unable to retrieve propertyValueConverters"); + return null; + } + } + } + + private static class BaseClass { + private String title; + + public BaseClass(String title) { + this.title = title; + } + } + + private static class DerivedClass extends BaseClass { + public DerivedClass(String title) { + super(title); + } + } +} diff --git a/server/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java b/server/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java index e14ebe739d..8d5b499264 100644 --- a/server/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java +++ b/server/tests/src/com/vaadin/tests/server/component/tree/TreeListeners.java @@ -24,4 +24,4 @@ public class TreeListeners extends AbstractListenerMethodsTest { testListenerAddGetRemove(Tree.class, CollapseEvent.class, CollapseListener.class); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/tests/server/component/window/WindowAttach.java b/server/tests/src/com/vaadin/tests/server/component/window/WindowAttach.java index f9c93d307b..586300f650 100644 --- a/server/tests/src/com/vaadin/tests/server/component/window/WindowAttach.java +++ b/server/tests/src/com/vaadin/tests/server/component/window/WindowAttach.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java b/server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java new file mode 100644 index 0000000000..b74896b7a1 --- /dev/null +++ b/server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java @@ -0,0 +1,53 @@ +/* + * 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.server.component.window; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; + +import com.vaadin.ui.Button; +import com.vaadin.ui.Label; +import com.vaadin.ui.Window; + +public class WindowTest { + + public Window window; + + @Before + public void setup() { + window = new Window(); + } + + @Test + public void testAssistiveDescription() { + Label l1 = new Label("label 1"); + Button b2 = new Button("button 2"); + window.setAssistiveDescription(l1, b2); + + Assert.assertEquals(2, window.getAssistiveDescription().length); + Assert.assertEquals(l1, window.getAssistiveDescription()[0]); + Assert.assertEquals(b2, window.getAssistiveDescription()[1]); + + // Modifying return value must not change actual value + window.getAssistiveDescription()[0] = null; + + Assert.assertEquals(2, window.getAssistiveDescription().length); + Assert.assertEquals(l1, window.getAssistiveDescription()[0]); + Assert.assertEquals(b2, window.getAssistiveDescription()[1]); + + } +} diff --git a/server/tests/src/com/vaadin/tests/server/components/TestTextFieldValueChange.java b/server/tests/src/com/vaadin/tests/server/components/TestTextFieldValueChange.java index de838e339c..7c47b94df4 100644 --- a/server/tests/src/com/vaadin/tests/server/components/TestTextFieldValueChange.java +++ b/server/tests/src/com/vaadin/tests/server/components/TestTextFieldValueChange.java @@ -3,9 +3,8 @@ package com.vaadin.tests.server.components; import java.util.HashMap; import java.util.Map; -import junit.framework.Assert; - import org.easymock.EasyMock; +import org.junit.Assert; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.ObjectProperty; diff --git a/server/tests/src/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java b/server/tests/src/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java index 89cb352b6f..bc067ddb88 100644 --- a/server/tests/src/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java +++ b/server/tests/src/com/vaadin/tests/server/navigator/ClassBasedViewProviderTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java b/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java index 5dc28757a7..ff6028648e 100644 --- a/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java +++ b/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java b/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java index 4be34707e4..85de106e23 100644 --- a/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java +++ b/server/tests/src/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/tests/util/TestUtil.java b/server/tests/src/com/vaadin/tests/util/TestUtil.java index e84f9dd8b9..88ed017f91 100644 --- a/server/tests/src/com/vaadin/tests/util/TestUtil.java +++ b/server/tests/src/com/vaadin/tests/util/TestUtil.java @@ -2,7 +2,7 @@ package com.vaadin.tests.util; import java.util.Iterator; -import junit.framework.Assert; +import org.junit.Assert; public class TestUtil { public static void assertArrays(Object[] actualObjects, diff --git a/server/tests/src/com/vaadin/tests/util/UniqueSerializableTest.java b/server/tests/src/com/vaadin/tests/util/UniqueSerializableTest.java index db9b5c02fa..abdc6c1a5c 100644 --- a/server/tests/src/com/vaadin/tests/util/UniqueSerializableTest.java +++ b/server/tests/src/com/vaadin/tests/util/UniqueSerializableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java b/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java index ff615e3d91..fa69fc46da 100644 --- a/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java +++ b/server/tests/src/com/vaadin/ui/AbsFieldDataSourceLocaleChange.java @@ -3,8 +3,7 @@ package com.vaadin.ui; import java.text.NumberFormat; import java.util.Locale; -import junit.framework.Assert; - +import org.junit.Assert; import org.junit.Before; import org.junit.Test; diff --git a/server/tests/src/com/vaadin/ui/AbstractSelectTest.java b/server/tests/src/com/vaadin/ui/AbstractSelectTest.java new file mode 100644 index 0000000000..83d66ee9d5 --- /dev/null +++ b/server/tests/src/com/vaadin/ui/AbstractSelectTest.java @@ -0,0 +1,76 @@ +/* + * 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.ui; + +import java.util.ArrayList; + +import org.junit.Assert; +import org.junit.Test; + +public class AbstractSelectTest { + + @Test + public void addItemsStrings() { + NativeSelect ns = new NativeSelect(); + ns.addItems("Foo", "bar", "baz"); + Assert.assertEquals(3, ns.size()); + Assert.assertArrayEquals(new Object[] { "Foo", "bar", "baz" }, ns + .getItemIds().toArray()); + } + + @Test + public void addItemsObjects() { + Object o1 = new Object(); + Object o2 = new Object(); + Object o3 = new Object(); + + NativeSelect ns = new NativeSelect(); + ns.addItems(o1, o2, o3); + Assert.assertEquals(3, ns.size()); + Assert.assertArrayEquals(new Object[] { o1, o2, o3 }, ns.getItemIds() + .toArray()); + } + + @Test + public void addItemsStringList() { + ArrayList<String> itemIds = new ArrayList<String>(); + itemIds.add("foo"); + itemIds.add("bar"); + itemIds.add("baz"); + NativeSelect ns = new NativeSelect(); + ns.addItems(itemIds); + Assert.assertEquals(3, ns.size()); + Assert.assertArrayEquals(new Object[] { "foo", "bar", "baz" }, ns + .getItemIds().toArray()); + } + + @Test + public void addItemsObjectList() { + Object o1 = new Object(); + Object o2 = new Object(); + Object o3 = new Object(); + ArrayList<Object> itemIds = new ArrayList<Object>(); + itemIds.add(o1); + itemIds.add(o2); + itemIds.add(o3); + NativeSelect ns = new NativeSelect(); + ns.addItems(itemIds); + Assert.assertEquals(3, ns.size()); + Assert.assertArrayEquals(new Object[] { o1, o2, o3 }, ns.getItemIds() + .toArray()); + + } +} diff --git a/server/tests/src/com/vaadin/ui/LabelDataSource.java b/server/tests/src/com/vaadin/ui/LabelDataSource.java index 21d3e56d57..b57e83df8e 100644 --- a/server/tests/src/com/vaadin/ui/LabelDataSource.java +++ b/server/tests/src/com/vaadin/ui/LabelDataSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/server/tests/src/com/vaadin/ui/UIInitReinitTest.java b/server/tests/src/com/vaadin/ui/UIInitRefreshTest.java index f8ec0e68c2..9e1fabc58f 100644 --- a/server/tests/src/com/vaadin/ui/UIInitReinitTest.java +++ b/server/tests/src/com/vaadin/ui/UIInitRefreshTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,10 +27,10 @@ import com.vaadin.server.Page.UriFragmentChangedEvent; import com.vaadin.server.Page.UriFragmentChangedListener; import com.vaadin.server.VaadinRequest; -public class UIInitReinitTest { +public class UIInitRefreshTest { private boolean initCalled; - private boolean reinitCalled; + private boolean refreshCalled; private boolean fragmentChangeCalled; private boolean browserWindowResizeCalled; @@ -52,8 +52,8 @@ public class UIInitReinitTest { } @Override - protected void reinit(VaadinRequest request) { - reinitCalled = true; + protected void refresh(VaadinRequest request) { + refreshCalled = true; Assert.assertEquals("bar", getPage().getUriFragment()); Assert.assertEquals(200, getPage().getBrowserWindowWidth()); @@ -75,11 +75,11 @@ public class UIInitReinitTest { Assert.assertEquals("bar", event.getUriFragment()); fragmentChangeCalled = true; } - }; + } @Before public void setUp() { - initCalled = reinitCalled = fragmentChangeCalled = browserWindowResizeCalled = false; + initCalled = refreshCalled = fragmentChangeCalled = browserWindowResizeCalled = false; } @Test @@ -107,9 +107,9 @@ public class UIInitReinitTest { Assert.assertFalse(fragmentChangeCalled); Assert.assertFalse(browserWindowResizeCalled); - ui.doReinit(reinitRequest); + ui.doRefresh(reinitRequest); - Assert.assertTrue(reinitCalled); + Assert.assertTrue(refreshCalled); Assert.assertTrue(fragmentChangeCalled); Assert.assertTrue(browserWindowResizeCalled); } diff --git a/server/tests/src/com/vaadin/util/ReflectToolsGetFieldValueByType.java b/server/tests/src/com/vaadin/util/ReflectToolsGetFieldValueByType.java index 540ffb852d..25f8ba7796 100644 --- a/server/tests/src/com/vaadin/util/ReflectToolsGetFieldValueByType.java +++ b/server/tests/src/com/vaadin/util/ReflectToolsGetFieldValueByType.java @@ -60,4 +60,4 @@ public class ReflectToolsGetFieldValueByType { } catch (Exception e) { } } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/util/ReflectToolsGetPrimitiveFieldValue.java b/server/tests/src/com/vaadin/util/ReflectToolsGetPrimitiveFieldValue.java index 1e1fafe31c..690f77d9a5 100644 --- a/server/tests/src/com/vaadin/util/ReflectToolsGetPrimitiveFieldValue.java +++ b/server/tests/src/com/vaadin/util/ReflectToolsGetPrimitiveFieldValue.java @@ -23,4 +23,4 @@ public class ReflectToolsGetPrimitiveFieldValue { } assertFalse(fieldValue instanceof Boolean); } -}
\ No newline at end of file +} diff --git a/server/tests/src/com/vaadin/util/TestCurrentInstance.java b/server/tests/src/com/vaadin/util/TestCurrentInstance.java index 09ef9514e5..666a0ef019 100644 --- a/server/tests/src/com/vaadin/util/TestCurrentInstance.java +++ b/server/tests/src/com/vaadin/util/TestCurrentInstance.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/AbstractComponentState.java b/shared/src/com/vaadin/shared/AbstractComponentState.java index 04d09e8579..816af978cf 100644 --- a/shared/src/com/vaadin/shared/AbstractComponentState.java +++ b/shared/src/com/vaadin/shared/AbstractComponentState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/AbstractFieldState.java b/shared/src/com/vaadin/shared/AbstractFieldState.java index 2f4c73266b..3e9fd811de 100644 --- a/shared/src/com/vaadin/shared/AbstractFieldState.java +++ b/shared/src/com/vaadin/shared/AbstractFieldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ApplicationConstants.java b/shared/src/com/vaadin/shared/ApplicationConstants.java index d54823ee60..9f723763f8 100644 --- a/shared/src/com/vaadin/shared/ApplicationConstants.java +++ b/shared/src/com/vaadin/shared/ApplicationConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ComponentConstants.java b/shared/src/com/vaadin/shared/ComponentConstants.java index b4081d02e2..dae1382256 100644 --- a/shared/src/com/vaadin/shared/ComponentConstants.java +++ b/shared/src/com/vaadin/shared/ComponentConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/Connector.java b/shared/src/com/vaadin/shared/Connector.java index 48b24c2580..c4a880f5ea 100644 --- a/shared/src/com/vaadin/shared/Connector.java +++ b/shared/src/com/vaadin/shared/Connector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/EventId.java b/shared/src/com/vaadin/shared/EventId.java index 7cf760b885..1c2ada1d87 100644 --- a/shared/src/com/vaadin/shared/EventId.java +++ b/shared/src/com/vaadin/shared/EventId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/JavaScriptConnectorState.java b/shared/src/com/vaadin/shared/JavaScriptConnectorState.java index e1b9604a37..12c9728628 100644 --- a/shared/src/com/vaadin/shared/JavaScriptConnectorState.java +++ b/shared/src/com/vaadin/shared/JavaScriptConnectorState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,4 +24,4 @@ public interface JavaScriptConnectorState extends Serializable { public Set<String> getCallbackNames(); public Map<String, Set<String>> getRpcInterfaces(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/JavaScriptExtensionState.java b/shared/src/com/vaadin/shared/JavaScriptExtensionState.java index 005302b52d..5050ffec10 100644 --- a/shared/src/com/vaadin/shared/JavaScriptExtensionState.java +++ b/shared/src/com/vaadin/shared/JavaScriptExtensionState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/JsonConstants.java b/shared/src/com/vaadin/shared/JsonConstants.java index 44aeac72e4..fd26d2ab74 100644 --- a/shared/src/com/vaadin/shared/JsonConstants.java +++ b/shared/src/com/vaadin/shared/JsonConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/MouseEventDetails.java b/shared/src/com/vaadin/shared/MouseEventDetails.java index bd57076117..3c06ee80f3 100644 --- a/shared/src/com/vaadin/shared/MouseEventDetails.java +++ b/shared/src/com/vaadin/shared/MouseEventDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/Position.java b/shared/src/com/vaadin/shared/Position.java index 3df42d65d8..9234c798d1 100755 --- a/shared/src/com/vaadin/shared/Position.java +++ b/shared/src/com/vaadin/shared/Position.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/VBrowserDetails.java b/shared/src/com/vaadin/shared/VBrowserDetails.java index a745a212b0..3680e4168e 100644 --- a/shared/src/com/vaadin/shared/VBrowserDetails.java +++ b/shared/src/com/vaadin/shared/VBrowserDetails.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/Version.java b/shared/src/com/vaadin/shared/Version.java index b78274dcff..a492229643 100644 --- a/shared/src/com/vaadin/shared/Version.java +++ b/shared/src/com/vaadin/shared/Version.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/annotations/Delayed.java b/shared/src/com/vaadin/shared/annotations/Delayed.java index 7dc60c20a1..f7e24de006 100644 --- a/shared/src/com/vaadin/shared/annotations/Delayed.java +++ b/shared/src/com/vaadin/shared/annotations/Delayed.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java index 9109162a31..ee5cf78a68 100644 --- a/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java +++ b/shared/src/com/vaadin/shared/annotations/DelegateToWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/ClientRpc.java b/shared/src/com/vaadin/shared/communication/ClientRpc.java index b74d24eb3d..e400c7de7c 100644 --- a/shared/src/com/vaadin/shared/communication/ClientRpc.java +++ b/shared/src/com/vaadin/shared/communication/ClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/FieldRpc.java b/shared/src/com/vaadin/shared/communication/FieldRpc.java index 50e8e80872..28ae8d39b6 100644 --- a/shared/src/com/vaadin/shared/communication/FieldRpc.java +++ b/shared/src/com/vaadin/shared/communication/FieldRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java b/shared/src/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java index 52dd0cbc17..4d21b5af7a 100644 --- a/shared/src/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java +++ b/shared/src/com/vaadin/shared/communication/LegacyChangeVariablesInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/MethodInvocation.java b/shared/src/com/vaadin/shared/communication/MethodInvocation.java index d5bf8324ef..a4370f37de 100644 --- a/shared/src/com/vaadin/shared/communication/MethodInvocation.java +++ b/shared/src/com/vaadin/shared/communication/MethodInvocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -112,4 +112,4 @@ public class MethodInvocation implements Serializable { return true; } -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/communication/PushConstants.java b/shared/src/com/vaadin/shared/communication/PushConstants.java index 4b4f247e5f..5b23cd7f6e 100644 --- a/shared/src/com/vaadin/shared/communication/PushConstants.java +++ b/shared/src/com/vaadin/shared/communication/PushConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/PushMode.java b/shared/src/com/vaadin/shared/communication/PushMode.java index 3fe8b4ea3e..7b0f968c77 100644 --- a/shared/src/com/vaadin/shared/communication/PushMode.java +++ b/shared/src/com/vaadin/shared/communication/PushMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/ServerRpc.java b/shared/src/com/vaadin/shared/communication/ServerRpc.java index 1ed9547061..e23b3758c6 100644 --- a/shared/src/com/vaadin/shared/communication/ServerRpc.java +++ b/shared/src/com/vaadin/shared/communication/ServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/SharedState.java b/shared/src/com/vaadin/shared/communication/SharedState.java index 57c3e801b5..e16fc51fae 100644 --- a/shared/src/com/vaadin/shared/communication/SharedState.java +++ b/shared/src/com/vaadin/shared/communication/SharedState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/communication/URLReference.java b/shared/src/com/vaadin/shared/communication/URLReference.java index 7b66dbd680..be767fb25c 100644 --- a/shared/src/com/vaadin/shared/communication/URLReference.java +++ b/shared/src/com/vaadin/shared/communication/URLReference.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -40,4 +40,4 @@ public class URLReference implements Serializable { public void setURL(String URL) { this.URL = URL; } -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/communication/UidlValue.java b/shared/src/com/vaadin/shared/communication/UidlValue.java index 5db6688bd3..04015213f9 100644 --- a/shared/src/com/vaadin/shared/communication/UidlValue.java +++ b/shared/src/com/vaadin/shared/communication/UidlValue.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/extension/javascriptmanager/ExecuteJavaScriptRpc.java b/shared/src/com/vaadin/shared/extension/javascriptmanager/ExecuteJavaScriptRpc.java index 711359841e..7a75bcbec1 100644 --- a/shared/src/com/vaadin/shared/extension/javascriptmanager/ExecuteJavaScriptRpc.java +++ b/shared/src/com/vaadin/shared/extension/javascriptmanager/ExecuteJavaScriptRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java b/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java index 5be7d84137..e5af6a04f8 100644 --- a/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java +++ b/shared/src/com/vaadin/shared/extension/javascriptmanager/JavaScriptManagerState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java index b373eac2fc..f5779de43d 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractEmbeddedState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java b/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java index 5a3d00ae89..49e5e1c36a 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,4 +19,4 @@ import com.vaadin.shared.AbstractComponentState; public class AbstractLayoutState extends AbstractComponentState { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java index bea12190ac..d2ef09810b 100644 --- a/shared/src/com/vaadin/shared/ui/AbstractMediaState.java +++ b/shared/src/com/vaadin/shared/ui/AbstractMediaState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/AlignmentInfo.java b/shared/src/com/vaadin/shared/ui/AlignmentInfo.java index 060bac3070..120552a43d 100644 --- a/shared/src/com/vaadin/shared/ui/AlignmentInfo.java +++ b/shared/src/com/vaadin/shared/ui/AlignmentInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/BorderStyle.java b/shared/src/com/vaadin/shared/ui/BorderStyle.java index 41ef2f09d8..ff5c7c7179 100755 --- a/shared/src/com/vaadin/shared/ui/BorderStyle.java +++ b/shared/src/com/vaadin/shared/ui/BorderStyle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/BrowserWindowOpenerState.java b/shared/src/com/vaadin/shared/ui/BrowserWindowOpenerState.java index 6f9164ba46..6196ea09ac 100644 --- a/shared/src/com/vaadin/shared/ui/BrowserWindowOpenerState.java +++ b/shared/src/com/vaadin/shared/ui/BrowserWindowOpenerState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ClickRpc.java b/shared/src/com/vaadin/shared/ui/ClickRpc.java index bda132229d..388ac14882 100644 --- a/shared/src/com/vaadin/shared/ui/ClickRpc.java +++ b/shared/src/com/vaadin/shared/ui/ClickRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,4 +27,4 @@ public interface ClickRpc extends ServerRpc { * Details about the mouse when the event took place */ public void click(MouseEventDetails mouseDetails); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java index 5be5721c50..894a1bbcbb 100644 --- a/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java +++ b/shared/src/com/vaadin/shared/ui/ComponentStateUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/Connect.java b/shared/src/com/vaadin/shared/ui/Connect.java index 17a8001b27..b0c20cec31 100644 --- a/shared/src/com/vaadin/shared/ui/Connect.java +++ b/shared/src/com/vaadin/shared/ui/Connect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/JavaScriptComponentState.java b/shared/src/com/vaadin/shared/ui/JavaScriptComponentState.java index 416854cc69..3208934146 100644 --- a/shared/src/com/vaadin/shared/ui/JavaScriptComponentState.java +++ b/shared/src/com/vaadin/shared/ui/JavaScriptComponentState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/LayoutClickRpc.java b/shared/src/com/vaadin/shared/ui/LayoutClickRpc.java index f51ec40c47..bd46bbda3d 100644 --- a/shared/src/com/vaadin/shared/ui/LayoutClickRpc.java +++ b/shared/src/com/vaadin/shared/ui/LayoutClickRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -31,4 +31,4 @@ public interface LayoutClickRpc extends ServerRpc { */ public void layoutClick(MouseEventDetails mouseDetails, Connector clickedConnector); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/MarginInfo.java b/shared/src/com/vaadin/shared/ui/MarginInfo.java index 97990100d2..3b1fece88a 100644 --- a/shared/src/com/vaadin/shared/ui/MarginInfo.java +++ b/shared/src/com/vaadin/shared/ui/MarginInfo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/MediaControl.java b/shared/src/com/vaadin/shared/ui/MediaControl.java index 243ec1c340..2311d57b16 100644 --- a/shared/src/com/vaadin/shared/ui/MediaControl.java +++ b/shared/src/com/vaadin/shared/ui/MediaControl.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -33,4 +33,4 @@ public interface MediaControl extends ClientRpc { * Pause playback of the media. */ public void pause(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/MultiSelectMode.java b/shared/src/com/vaadin/shared/ui/MultiSelectMode.java index e0a7858793..b628017a12 100644 --- a/shared/src/com/vaadin/shared/ui/MultiSelectMode.java +++ b/shared/src/com/vaadin/shared/ui/MultiSelectMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/Orientation.java b/shared/src/com/vaadin/shared/ui/Orientation.java index 78f0cf12e0..b370ba8109 100644 --- a/shared/src/com/vaadin/shared/ui/Orientation.java +++ b/shared/src/com/vaadin/shared/ui/Orientation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ShortCutConstants.java b/shared/src/com/vaadin/shared/ui/ShortCutConstants.java index eb493d1031..d7049c2a74 100644 --- a/shared/src/com/vaadin/shared/ui/ShortCutConstants.java +++ b/shared/src/com/vaadin/shared/ui/ShortCutConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/TabIndexState.java b/shared/src/com/vaadin/shared/ui/TabIndexState.java index 44013eeef2..eec61a0595 100644 --- a/shared/src/com/vaadin/shared/ui/TabIndexState.java +++ b/shared/src/com/vaadin/shared/ui/TabIndexState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutServerRpc.java b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutServerRpc.java index 9397f9e494..9ec88db2c2 100644 --- a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import com.vaadin.shared.ui.LayoutClickRpc; public interface AbsoluteLayoutServerRpc extends LayoutClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java index 9349c5c156..865d1420d5 100644 --- a/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/absolutelayout/AbsoluteLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,4 +27,4 @@ public class AbsoluteLayoutState extends AbstractLayoutState { // Maps each component to a position public Map<String, String> connectorToCssPosition = new HashMap<String, String>(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/accordion/AccordionState.java b/shared/src/com/vaadin/shared/ui/accordion/AccordionState.java index 67b20fc040..cbb7447a25 100644 --- a/shared/src/com/vaadin/shared/ui/accordion/AccordionState.java +++ b/shared/src/com/vaadin/shared/ui/accordion/AccordionState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/browserframe/BrowserFrameState.java b/shared/src/com/vaadin/shared/ui/browserframe/BrowserFrameState.java index 6a1728ce72..f8a5343cc9 100644 --- a/shared/src/com/vaadin/shared/ui/browserframe/BrowserFrameState.java +++ b/shared/src/com/vaadin/shared/ui/browserframe/BrowserFrameState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/button/ButtonServerRpc.java b/shared/src/com/vaadin/shared/ui/button/ButtonServerRpc.java index c88dbc5d03..d692fe5a6a 100644 --- a/shared/src/com/vaadin/shared/ui/button/ButtonServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/button/ButtonServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -37,4 +37,4 @@ public interface ButtonServerRpc extends ServerRpc { * result of a click. */ public void disableOnClick(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/button/ButtonState.java b/shared/src/com/vaadin/shared/ui/button/ButtonState.java index 7e1fd52ed7..a12136870c 100644 --- a/shared/src/com/vaadin/shared/ui/button/ButtonState.java +++ b/shared/src/com/vaadin/shared/ui/button/ButtonState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/button/NativeButtonState.java b/shared/src/com/vaadin/shared/ui/button/NativeButtonState.java index 7a2f970923..378b84832d 100644 --- a/shared/src/com/vaadin/shared/ui/button/NativeButtonState.java +++ b/shared/src/com/vaadin/shared/ui/button/NativeButtonState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java index c1ff8bdda5..bffcde11a0 100644 --- a/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java index 27f1cdd341..67a5fe11e2 100644 --- a/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java +++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarEventId.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java index 5257310cbf..7b7856fee9 100644 --- a/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java b/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java index fab5fd828e..de48f1a06a 100644 --- a/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java +++ b/shared/src/com/vaadin/shared/ui/calendar/CalendarState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java b/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java index 9b1c995642..75b3d6cf13 100644 --- a/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java +++ b/shared/src/com/vaadin/shared/ui/calendar/DateConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java index 549196afa6..0041da4dfa 100644 --- a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import com.vaadin.shared.communication.ServerRpc; public interface CheckBoxServerRpc extends ServerRpc { public void setChecked(boolean checked, MouseEventDetails mouseEventDetails); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java index 52e58ac2bd..10d3b46d93 100644 --- a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java +++ b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,4 +23,4 @@ public class CheckBoxState extends AbstractFieldState { } public boolean checked = false; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/Color.java b/shared/src/com/vaadin/shared/ui/colorpicker/Color.java index 3d0db2d124..8624327993 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/Color.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/Color.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -392,4 +392,62 @@ public class Color implements Serializable { return 0xff000000 | (red << 16) | (green << 8) | (blue << 0); } + + /** + * <p> + * Converts HSL's hue, saturation and lightness into an RGB value. + * + * @param hue + * the hue of the color. The unit of the value is degrees and + * should be between 0-360. + * @param saturation + * the saturation of the color. The unit of the value is + * percentages and should be between 0-100; + * @param lightness + * the lightness of the color. The unit of the value is + * percentages and should be between 0-100; + * + * @return the RGB value of corresponding color + */ + public static int HSLtoRGB(int hue, int saturation, int lightness) { + int red = 0; + int green = 0; + int blue = 0; + + float hueRatio = hue / 360f; + float saturationRatio = saturation / 100f; + float lightnessRatio = lightness / 100f; + + if (saturationRatio == 0) { + red = green = blue = (int) (lightnessRatio * 255.0f + 0.5f); + } else { + float p = lightnessRatio < 0.5f ? lightnessRatio + * (1f + saturationRatio) : lightnessRatio + saturationRatio + - lightnessRatio * saturationRatio; + float q = 2 * lightnessRatio - p; + + red = hslComponentToRgbComponent(p, q, hueRatio + (1f / 3f)); + green = hslComponentToRgbComponent(p, q, hueRatio); + blue = hslComponentToRgbComponent(p, q, hueRatio - (1f / 3f)); + } + return 0xff000000 | (red << 16) | (green << 8) | (blue << 0); + } + + private static int hslComponentToRgbComponent(float p, float q, float ratio) { + if (ratio < 0) { + ratio += 1; + } else if (ratio > 1) { + ratio -= 1; + } + + if (6 * ratio < 1f) { + return (int) ((q + (p - q) * 6f * ratio) * 255f + 0.5f); + } else if (2f * ratio < 1f) { + return (int) (p * 255f + 0.5f); + } else if (3f * ratio < 2f) { + return (int) ((q + (p - q) * ((2f / 3f) - ratio) * 6f) * 255f + 0.5f); + } + + return (int) (q * 255f + 0.5f); + } } diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientServerRpc.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientServerRpc.java index a82798848e..374a41a0fe 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientState.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientState.java index 06fa2795a5..8245ffeaac 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientState.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGradientState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridServerRpc.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridServerRpc.java index 7ba7659d51..ce5c4317b4 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridState.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridState.java index e7ad9b34ce..e3e90f5418 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridState.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerGridState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerServerRpc.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerServerRpc.java index 7403940a4b..f556625025 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerState.java b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerState.java index 5d93605b36..978b9a8417 100644 --- a/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerState.java +++ b/shared/src/com/vaadin/shared/ui/colorpicker/ColorPickerState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxConstants.java b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxConstants.java index c127d09cec..aeb04ba75f 100644 --- a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxConstants.java +++ b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxState.java b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxState.java index 5df8e74328..4925f98b4d 100644 --- a/shared/src/com/vaadin/shared/ui/combobox/ComboBoxState.java +++ b/shared/src/com/vaadin/shared/ui/combobox/ComboBoxState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/combobox/FilteringMode.java b/shared/src/com/vaadin/shared/ui/combobox/FilteringMode.java index 37f9b0f297..1c0b743cc6 100644 --- a/shared/src/com/vaadin/shared/ui/combobox/FilteringMode.java +++ b/shared/src/com/vaadin/shared/ui/combobox/FilteringMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutServerRpc.java b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutServerRpc.java index c3a6f9bbf1..1ff2f83d08 100644 --- a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import com.vaadin.shared.ui.LayoutClickRpc; public interface CssLayoutServerRpc extends LayoutClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java index 493c2c6d80..5fe61082d5 100644 --- a/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/csslayout/CssLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -26,4 +26,4 @@ public class CssLayoutState extends AbstractLayoutState { primaryStyleName = "v-csslayout"; } public Map<Connector, String> childCss = new HashMap<Connector, String>(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java b/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java index 820628a32f..04c7eed7e4 100644 --- a/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/customlayout/CustomLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -28,4 +28,4 @@ public class CustomLayoutState extends AbstractLayoutState { public Map<Connector, String> childLocations = new HashMap<Connector, String>(); public String templateContents; public String templateName; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/datefield/DateFieldConstants.java b/shared/src/com/vaadin/shared/ui/datefield/DateFieldConstants.java index bdc57f2bc2..48bc74c690 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/DateFieldConstants.java +++ b/shared/src/com/vaadin/shared/ui/datefield/DateFieldConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/datefield/InlineDateFieldState.java b/shared/src/com/vaadin/shared/ui/datefield/InlineDateFieldState.java index d56e0d27b3..b15d28f706 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/InlineDateFieldState.java +++ b/shared/src/com/vaadin/shared/ui/datefield/InlineDateFieldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/datefield/PopupDateFieldState.java b/shared/src/com/vaadin/shared/ui/datefield/PopupDateFieldState.java index 1c061b3ac3..07726f8af0 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/PopupDateFieldState.java +++ b/shared/src/com/vaadin/shared/ui/datefield/PopupDateFieldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/datefield/Resolution.java b/shared/src/com/vaadin/shared/ui/datefield/Resolution.java index 44ab39ba12..6d467e233c 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/Resolution.java +++ b/shared/src/com/vaadin/shared/ui/datefield/Resolution.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/datefield/TextualDateFieldState.java b/shared/src/com/vaadin/shared/ui/datefield/TextualDateFieldState.java index 11ad4cdb59..09bfb9c1a1 100644 --- a/shared/src/com/vaadin/shared/ui/datefield/TextualDateFieldState.java +++ b/shared/src/com/vaadin/shared/ui/datefield/TextualDateFieldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/dd/AcceptCriterion.java b/shared/src/com/vaadin/shared/ui/dd/AcceptCriterion.java index 55836fd05b..fa3ec107a2 100644 --- a/shared/src/com/vaadin/shared/ui/dd/AcceptCriterion.java +++ b/shared/src/com/vaadin/shared/ui/dd/AcceptCriterion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/dd/DragEventType.java b/shared/src/com/vaadin/shared/ui/dd/DragEventType.java index d0b12f9953..f894ed6219 100644 --- a/shared/src/com/vaadin/shared/ui/dd/DragEventType.java +++ b/shared/src/com/vaadin/shared/ui/dd/DragEventType.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.shared.ui.dd; public enum DragEventType { ENTER, LEAVE, OVER, DROP -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/dd/HorizontalDropLocation.java b/shared/src/com/vaadin/shared/ui/dd/HorizontalDropLocation.java index 4e4bd97ec1..064815695a 100644 --- a/shared/src/com/vaadin/shared/ui/dd/HorizontalDropLocation.java +++ b/shared/src/com/vaadin/shared/ui/dd/HorizontalDropLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/dd/VerticalDropLocation.java b/shared/src/com/vaadin/shared/ui/dd/VerticalDropLocation.java index 9b0a1986eb..d64a48946a 100644 --- a/shared/src/com/vaadin/shared/ui/dd/VerticalDropLocation.java +++ b/shared/src/com/vaadin/shared/ui/dd/VerticalDropLocation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperConstants.java b/shared/src/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperConstants.java index f0793fb39d..8dd8ef513e 100644 --- a/shared/src/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperConstants.java +++ b/shared/src/com/vaadin/shared/ui/draganddropwrapper/DragAndDropWrapperConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedConstants.java b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedConstants.java index 067466c825..6aadb43b05 100644 --- a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedConstants.java +++ b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedServerRpc.java b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedServerRpc.java index 7de7f9ad30..3b293ecdb2 100644 --- a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,4 +19,4 @@ import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.ui.ClickRpc; public interface EmbeddedServerRpc extends ClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedState.java b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedState.java index 83543d3084..9f12a917e5 100644 --- a/shared/src/com/vaadin/shared/ui/embedded/EmbeddedState.java +++ b/shared/src/com/vaadin/shared/ui/embedded/EmbeddedState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/flash/FlashState.java b/shared/src/com/vaadin/shared/ui/flash/FlashState.java index 7ee5a91a9e..d974650030 100644 --- a/shared/src/com/vaadin/shared/ui/flash/FlashState.java +++ b/shared/src/com/vaadin/shared/ui/flash/FlashState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/form/FormState.java b/shared/src/com/vaadin/shared/ui/form/FormState.java index 0ce6d74bb0..99ed11f8df 100644 --- a/shared/src/com/vaadin/shared/ui/form/FormState.java +++ b/shared/src/com/vaadin/shared/ui/form/FormState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,4 +24,4 @@ public class FormState extends AbstractFieldState { } public Connector layout; public Connector footer; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutServerRpc.java b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutServerRpc.java index fa19369fe4..70b49154ee 100644 --- a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import com.vaadin.shared.ui.LayoutClickRpc; public interface GridLayoutServerRpc extends LayoutClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java index b3e1c2a708..ad0f34c862 100644 --- a/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/gridlayout/GridLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -42,4 +42,4 @@ public class GridLayoutState extends AbstractLayoutState { public int row2; public int alignment = ALIGNMENT_DEFAULT.getBitMask(); } -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java index 149b7b112e..ec03c7fe47 100644 --- a/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/image/ImageServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/image/ImageState.java b/shared/src/com/vaadin/shared/ui/image/ImageState.java index 4481895801..b51913d168 100644 --- a/shared/src/com/vaadin/shared/ui/image/ImageState.java +++ b/shared/src/com/vaadin/shared/ui/image/ImageState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/label/ContentMode.java b/shared/src/com/vaadin/shared/ui/label/ContentMode.java index ed0c66bc62..37e821536d 100644 --- a/shared/src/com/vaadin/shared/ui/label/ContentMode.java +++ b/shared/src/com/vaadin/shared/ui/label/ContentMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,7 +27,7 @@ public enum ContentMode { TEXT, /** - * Content mode, where the label contains pre formatted text. In this mode + * Content mode, where the label contains preformatted text. In this mode * newlines are preserved when rendered on the screen. */ PREFORMATTED, @@ -39,18 +39,18 @@ public enum ContentMode { /** * Content mode, where the label contains well-formed or well-balanced XML. - * This is handled in the same way as {@link #XHTML}. + * This is handled in the same way as {@link #HTML}. * - * @deprecated Use {@link #XHTML} instead + * @deprecated Use {@link #HTML} instead */ @Deprecated XML, /** * Legacy content mode, where the label contains RAW output. This is handled - * in exactly the same way as {@link #XHTML}. + * in exactly the same way as {@link #HTML}. * - * @deprecated Use {@link #XHTML} instead + * @deprecated Use {@link #HTML} instead */ @Deprecated RAW; diff --git a/shared/src/com/vaadin/shared/ui/label/LabelState.java b/shared/src/com/vaadin/shared/ui/label/LabelState.java index a4ec39d7a2..8fd1d7c798 100644 --- a/shared/src/com/vaadin/shared/ui/label/LabelState.java +++ b/shared/src/com/vaadin/shared/ui/label/LabelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/link/LinkConstants.java b/shared/src/com/vaadin/shared/ui/link/LinkConstants.java index 3f4050f176..399e6b6148 100644 --- a/shared/src/com/vaadin/shared/ui/link/LinkConstants.java +++ b/shared/src/com/vaadin/shared/ui/link/LinkConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/link/LinkState.java b/shared/src/com/vaadin/shared/ui/link/LinkState.java index 33ede86378..2b1f73b90a 100644 --- a/shared/src/com/vaadin/shared/ui/link/LinkState.java +++ b/shared/src/com/vaadin/shared/ui/link/LinkState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/menubar/MenuBarConstants.java b/shared/src/com/vaadin/shared/ui/menubar/MenuBarConstants.java index 5e9971985d..b34bc13a23 100644 --- a/shared/src/com/vaadin/shared/ui/menubar/MenuBarConstants.java +++ b/shared/src/com/vaadin/shared/ui/menubar/MenuBarConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/menubar/MenuBarState.java b/shared/src/com/vaadin/shared/ui/menubar/MenuBarState.java index bf812dfbb0..6d6acebe18 100644 --- a/shared/src/com/vaadin/shared/ui/menubar/MenuBarState.java +++ b/shared/src/com/vaadin/shared/ui/menubar/MenuBarState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupConstants.java b/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupConstants.java index ff6f6fa241..5670b64b38 100644 --- a/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupConstants.java +++ b/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupState.java b/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupState.java index 6e8abad2ca..504e3dcdc8 100644 --- a/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupState.java +++ b/shared/src/com/vaadin/shared/ui/optiongroup/OptionGroupState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java index ceb3773215..76e5267bb8 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,4 +21,4 @@ import com.vaadin.shared.ui.LayoutClickRpc; public interface AbstractOrderedLayoutServerRpc extends LayoutClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java index 405f0af18d..c06b945ada 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/AbstractOrderedLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,4 +35,4 @@ public class AbstractOrderedLayoutState extends AbstractLayoutState { public float expandRatio = 0.0f; } -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/HorizontalLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/HorizontalLayoutState.java index cf3749755f..167e89f624 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/HorizontalLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/HorizontalLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/orderedlayout/VerticalLayoutState.java b/shared/src/com/vaadin/shared/ui/orderedlayout/VerticalLayoutState.java index e73dfff93e..4c83a8b1dd 100644 --- a/shared/src/com/vaadin/shared/ui/orderedlayout/VerticalLayoutState.java +++ b/shared/src/com/vaadin/shared/ui/orderedlayout/VerticalLayoutState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/panel/PanelServerRpc.java b/shared/src/com/vaadin/shared/ui/panel/PanelServerRpc.java index e9210b72a0..8bb98e8e5d 100644 --- a/shared/src/com/vaadin/shared/ui/panel/PanelServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/panel/PanelServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,4 +20,4 @@ import com.vaadin.shared.ui.ClickRpc; public interface PanelServerRpc extends ClickRpc, ServerRpc { -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/panel/PanelState.java b/shared/src/com/vaadin/shared/ui/panel/PanelState.java index 5e47343cee..6c0fcb683c 100644 --- a/shared/src/com/vaadin/shared/ui/panel/PanelState.java +++ b/shared/src/com/vaadin/shared/ui/panel/PanelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,4 +23,4 @@ public class PanelState extends AbstractComponentState { } public int tabIndex; public int scrollLeft, scrollTop; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java b/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java index fa61cfb349..af712b9e31 100644 --- a/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/popupview/PopupViewServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java b/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java index 1d83070fca..da49e47ae8 100644 --- a/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java +++ b/shared/src/com/vaadin/shared/ui/popupview/PopupViewState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressBarState.java b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressBarState.java index 1cc8d7d9ae..79ef766951 100644 --- a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressBarState.java +++ b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressBarState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -34,4 +34,4 @@ public class ProgressBarState extends AbstractFieldState { public boolean indeterminate = false; public Float state = 0.0f; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorServerRpc.java b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorServerRpc.java index 6163092e9e..dd437094c7 100644 --- a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorState.java b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorState.java index 2ca7627f4f..15d0a947d7 100644 --- a/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorState.java +++ b/shared/src/com/vaadin/shared/ui/progressindicator/ProgressIndicatorState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java index 959c275b4a..74ccaa4e15 100644 --- a/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java +++ b/shared/src/com/vaadin/shared/ui/slider/SliderOrientation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java index 631079f2ca..1938dc1de2 100644 --- a/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/slider/SliderServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/slider/SliderState.java b/shared/src/com/vaadin/shared/ui/slider/SliderState.java index 9a4ded1cdf..0e48a0c4e2 100644 --- a/shared/src/com/vaadin/shared/ui/slider/SliderState.java +++ b/shared/src/com/vaadin/shared/ui/slider/SliderState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelRpc.java b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelRpc.java index 831f43daba..7f1e9555d5 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelRpc.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -37,4 +37,4 @@ public interface AbstractSplitPanelRpc extends ServerRpc { */ public void splitterClick(MouseEventDetails mouseDetails); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java index 6977a095e2..2db292d71d 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/AbstractSplitPanelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,4 +35,4 @@ public class AbstractSplitPanelState extends AbstractComponentState { public boolean positionReversed = false; public boolean locked = false; } -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/HorizontalSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/HorizontalSplitPanelState.java index 736247a5c8..849cd89651 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/HorizontalSplitPanelState.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/HorizontalSplitPanelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/splitpanel/VerticalSplitPanelState.java b/shared/src/com/vaadin/shared/ui/splitpanel/VerticalSplitPanelState.java index 693d49fd18..cb06a2a076 100644 --- a/shared/src/com/vaadin/shared/ui/splitpanel/VerticalSplitPanelState.java +++ b/shared/src/com/vaadin/shared/ui/splitpanel/VerticalSplitPanelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/table/TableConstants.java b/shared/src/com/vaadin/shared/ui/table/TableConstants.java index caaac7ef14..fd1c61c772 100644 --- a/shared/src/com/vaadin/shared/ui/table/TableConstants.java +++ b/shared/src/com/vaadin/shared/ui/table/TableConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/table/TableState.java b/shared/src/com/vaadin/shared/ui/table/TableState.java index 9393d6b4e6..4a89a99685 100644 --- a/shared/src/com/vaadin/shared/ui/table/TableState.java +++ b/shared/src/com/vaadin/shared/ui/table/TableState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabState.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabState.java index 9620a61c9a..3c8c1d76d0 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabState.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -36,4 +36,4 @@ public class TabState implements Serializable { public String id; public String iconAltText; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java index b7f337a5a8..62cfd5cb81 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetBaseConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetClientRpc.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetClientRpc.java index 780e0f1ac5..5b1497dd3b 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetConstants.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetConstants.java index 74670da8b2..c99bf2eeb2 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetConstants.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java index 996525151c..a96c616ec6 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java index 77e9e15400..b96a1c9b79 100644 --- a/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java +++ b/shared/src/com/vaadin/shared/ui/tabsheet/TabsheetState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java index e34a1bcda9..380ee4c7fb 100644 --- a/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java +++ b/shared/src/com/vaadin/shared/ui/textarea/TextAreaState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java b/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java index fd0b6eed6d..084d02cd7b 100644 --- a/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java +++ b/shared/src/com/vaadin/shared/ui/textfield/AbstractTextFieldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/textfield/TextFieldConstants.java b/shared/src/com/vaadin/shared/ui/textfield/TextFieldConstants.java index 8476e6769a..242e53682b 100644 --- a/shared/src/com/vaadin/shared/ui/textfield/TextFieldConstants.java +++ b/shared/src/com/vaadin/shared/ui/textfield/TextFieldConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tree/TreeConstants.java b/shared/src/com/vaadin/shared/ui/tree/TreeConstants.java index a57ca31246..efeae9cb89 100644 --- a/shared/src/com/vaadin/shared/ui/tree/TreeConstants.java +++ b/shared/src/com/vaadin/shared/ui/tree/TreeConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/tree/TreeState.java b/shared/src/com/vaadin/shared/ui/tree/TreeState.java index e203f22ee4..9f237ce037 100644 --- a/shared/src/com/vaadin/shared/ui/tree/TreeState.java +++ b/shared/src/com/vaadin/shared/ui/tree/TreeState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/treetable/TreeTableConstants.java b/shared/src/com/vaadin/shared/ui/treetable/TreeTableConstants.java index 1a9e5f1f39..510c18d245 100644 --- a/shared/src/com/vaadin/shared/ui/treetable/TreeTableConstants.java +++ b/shared/src/com/vaadin/shared/ui/treetable/TreeTableConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/treetable/TreeTableState.java b/shared/src/com/vaadin/shared/ui/treetable/TreeTableState.java index d618d483ee..ecc7d0f4c4 100644 --- a/shared/src/com/vaadin/shared/ui/treetable/TreeTableState.java +++ b/shared/src/com/vaadin/shared/ui/treetable/TreeTableState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectConstants.java b/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectConstants.java index efde077a82..32422a38e5 100644 --- a/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectConstants.java +++ b/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java b/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java index b7ac8e5388..cccc2fb6ae 100644 --- a/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java +++ b/shared/src/com/vaadin/shared/ui/twincolselect/TwinColSelectState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/DebugWindowClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/DebugWindowClientRpc.java index 7e76a6a459..9a5d269a87 100644 --- a/shared/src/com/vaadin/shared/ui/ui/DebugWindowClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/DebugWindowClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/DebugWindowServerRpc.java b/shared/src/com/vaadin/shared/ui/ui/DebugWindowServerRpc.java index 76e7d23379..cb94a9b081 100644 --- a/shared/src/com/vaadin/shared/ui/ui/DebugWindowServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/DebugWindowServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java b/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java deleted file mode 100644 index 6c8c743d57..0000000000 --- a/shared/src/com/vaadin/shared/ui/ui/NotificationConfigurationBean.java +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.shared.ui.ui; - -import java.io.Serializable; - -/** - * Holds configuration information for a notification type. - * - * @author Vaadin Ltd - */ -public class NotificationConfigurationBean implements Serializable { - /** - * Available WAI-ARIA roles for a notification. - */ - public enum Role { - ALERT, STATUS - } - - private String prefix; - private String postfix; - private Role role = Role.ALERT; - - public NotificationConfigurationBean() { - } - - public NotificationConfigurationBean(String prefix, String postfix, - Role role) { - this.prefix = prefix; - this.postfix = postfix; - this.role = role; - } - - /** - * Returns the accessibility prefix, which is placed before the notification - * content. - * - * @return the prefix - */ - public String getAssistivePrefix() { - return prefix; - } - - /** - * Sets the accessibility prefix, which is placed before the notification - * content. - * - * @param pefix - * the prefix to set - */ - public void setAssistivePrefix(String prefix) { - this.prefix = prefix; - } - - /** - * Checks if an accessibility prefix is set. - * - * @return true when assistivePrefix is not null and has a length > 0, false - * otherwise - */ - public boolean hasAssistivePrefix() { - return prefix != null && !prefix.isEmpty(); - } - - /** - * Returns the accessibility postfix, which is placed after the notification - * content. - * - * @return the postfix - */ - public String getAssistivePostfix() { - return postfix; - } - - /** - * Sets the accessibility postfix, which is placed after the notification - * content. - * - * @param postfix - * the postfix to set - */ - public void setAssistivePostfix(String postfix) { - this.postfix = postfix; - } - - /** - * Checks if an accessibility postfix is set. - * - * @return true when postfix is not null and has a length > 0, false - * otherwise - */ - public boolean hasAssistivePostfix() { - return postfix != null && !postfix.isEmpty(); - } - - /** - * Returns the WAI-ARIA role that defines how an assistive device will - * inform the user about a notification. - * - * @return the role - */ - public Role getAssistiveRole() { - return role; - } - - /** - * Sets the WAI-ARIA role that defines how an assistive device will inform - * the user about a notification. - * - * Available roles are alert, alertdialog and status (@see <a - * href="http://www.w3.org/TR/2011/CR-wai-aria-20110118/roles">Roles - * Model</a>). - * - * @param role - * the role to set - */ - public void setAssistiveRole(Role role) { - this.role = role; - } -} diff --git a/shared/src/com/vaadin/shared/ui/ui/NotificationRole.java b/shared/src/com/vaadin/shared/ui/ui/NotificationRole.java new file mode 100644 index 0000000000..b6f6c6bb83 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/ui/NotificationRole.java @@ -0,0 +1,25 @@ +/* + * 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.shared.ui.ui; + +/** + * Available WAI-ARIA roles for a notification. + * + * @since 7.2 + */ +public enum NotificationRole { + ALERT, STATUS +} diff --git a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java index 76a3fbfdb6..a4c7d33ad1 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/PageState.java b/shared/src/com/vaadin/shared/ui/ui/PageState.java index 4d2768787f..b6dd5abb89 100644 --- a/shared/src/com/vaadin/shared/ui/ui/PageState.java +++ b/shared/src/com/vaadin/shared/ui/ui/PageState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,4 +35,4 @@ public class PageState implements Serializable { * Non-null if the title is set. Null means Vaadin does not touch the title. */ public String title = null; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/ui/ScrollClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/ScrollClientRpc.java index ff4218d79f..e32a27830d 100644 --- a/shared/src/com/vaadin/shared/ui/ui/ScrollClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/ScrollClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/Transport.java b/shared/src/com/vaadin/shared/ui/ui/Transport.java index ebc0ba3aea..6eafba185e 100644 --- a/shared/src/com/vaadin/shared/ui/ui/Transport.java +++ b/shared/src/com/vaadin/shared/ui/ui/Transport.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java index 3067b10e24..5026189d71 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -26,8 +26,11 @@ import com.vaadin.shared.communication.ClientRpc; public interface UIClientRpc extends ClientRpc { /** - * @since + * Informs the client that the UI has been closed + * * @param sessionExpired + * true if the ui was closed because the session expired, false + * otherwise */ void uiClosed(boolean sessionExpired); diff --git a/shared/src/com/vaadin/shared/ui/ui/UIConstants.java b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java index 880913f801..429360e05d 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIConstants.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java index 576ee83980..8227415e58 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -33,4 +33,4 @@ public interface UIServerRpc extends ClickRpc, ServerRpc { * should always be called to ensure the message is flushed right away. */ public void poll(); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/ui/UIState.java b/shared/src/com/vaadin/shared/ui/ui/UIState.java index d2e6f037e9..3c3785b7d5 100644 --- a/shared/src/com/vaadin/shared/ui/ui/UIState.java +++ b/shared/src/com/vaadin/shared/ui/ui/UIState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,17 +23,50 @@ import java.util.Map; import com.vaadin.shared.communication.PushMode; import com.vaadin.shared.ui.TabIndexState; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; public class UIState extends TabIndexState { public TooltipConfigurationState tooltipConfiguration = new TooltipConfigurationState(); public LoadingIndicatorConfigurationState loadingIndicatorConfiguration = new LoadingIndicatorConfigurationState(); - public NotificationConfigurationState notificationConfiguration = new NotificationConfigurationState(); public int pollInterval = -1; // Informing users of assistive devices, that the content of this container // is announced automatically and does not need to be navigated into public String overlayContainerLabel = "This content is announced automatically and does not need to be navigated into."; + public Map<String, NotificationTypeConfiguration> notificationConfigurations = new HashMap<String, NotificationTypeConfiguration>(); + { + notificationConfigurations.put("error", + new NotificationTypeConfiguration("Error: ", + " - close with ESC-key", NotificationRole.ALERT)); + notificationConfigurations.put("warning", + new NotificationTypeConfiguration("Warning: ", null, + NotificationRole.ALERT)); + notificationConfigurations.put("humanized", + new NotificationTypeConfiguration("Info: ", null, + NotificationRole.ALERT)); + notificationConfigurations.put("tray", + new NotificationTypeConfiguration("Status: ", null, + NotificationRole.STATUS)); + notificationConfigurations.put("assistive", + new NotificationTypeConfiguration("Note: ", null, + NotificationRole.STATUS)); + } + /** + * State related to the Page class. + */ + public PageState pageState = new PageState(); + /** + * State related to the LocaleService class. + */ + public LocaleServiceState localeServiceState = new LocaleServiceState(); + /** + * Configuration for the push channel + */ + public PushConfigurationState pushConfiguration = new PushConfigurationState(); + { + primaryStyleName = "v-ui"; + // Default is 1 for legacy reasons + tabIndex = 1; + } public static class LoadingIndicatorConfigurationState implements Serializable { @@ -50,19 +83,19 @@ public class UIState extends TabIndexState { public int maxWidth = 500; } - public static class NotificationConfigurationState implements Serializable { - public Map<String, NotificationConfigurationBean> setup = new HashMap<String, NotificationConfigurationBean>(); - { - setup.put("error", new NotificationConfigurationBean("Error: ", - " - close with ESC-key", Role.ALERT)); - setup.put("warning", new NotificationConfigurationBean("Warning: ", - null, Role.ALERT)); - setup.put("humanized", new NotificationConfigurationBean("Info: ", - null, Role.ALERT)); - setup.put("tray", new NotificationConfigurationBean("Status: ", - null, Role.STATUS)); - setup.put("assistive", new NotificationConfigurationBean("Note: ", - null, Role.STATUS)); + public static class NotificationTypeConfiguration implements Serializable { + public String prefix; + public String postfix; + public NotificationRole notificationRole = NotificationRole.ALERT; + + public NotificationTypeConfiguration() { + } + + public NotificationTypeConfiguration(String prefix, String postfix, + NotificationRole role) { + this.prefix = prefix; + this.postfix = postfix; + this.notificationRole = role; } } @@ -80,26 +113,6 @@ public class UIState extends TabIndexState { } } - /** - * State related to the Page class. - */ - public PageState pageState = new PageState(); - /** - * State related to the LocaleService class. - */ - public LocaleServiceState localeServiceState = new LocaleServiceState(); - - /** - * Configuration for the push channel - */ - public PushConfigurationState pushConfiguration = new PushConfigurationState(); - - { - primaryStyleName = "v-ui"; - // Default is 1 for legacy reasons - tabIndex = 1; - } - public static class LocaleServiceState implements Serializable { public List<LocaleData> localeData = new ArrayList<LocaleData>(); } diff --git a/shared/src/com/vaadin/shared/ui/upload/UploadClientRpc.java b/shared/src/com/vaadin/shared/ui/upload/UploadClientRpc.java index 1757ddb001..a5147147bc 100644 --- a/shared/src/com/vaadin/shared/ui/upload/UploadClientRpc.java +++ b/shared/src/com/vaadin/shared/ui/upload/UploadClientRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java b/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java index 79a6778da3..b576eb9114 100644 --- a/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/upload/UploadServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/video/VideoConstants.java b/shared/src/com/vaadin/shared/ui/video/VideoConstants.java index 88ea0c88c7..0a61b88afc 100644 --- a/shared/src/com/vaadin/shared/ui/video/VideoConstants.java +++ b/shared/src/com/vaadin/shared/ui/video/VideoConstants.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/video/VideoState.java b/shared/src/com/vaadin/shared/ui/video/VideoState.java index bddc669a18..91006f0f6a 100644 --- a/shared/src/com/vaadin/shared/ui/video/VideoState.java +++ b/shared/src/com/vaadin/shared/ui/video/VideoState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/window/WindowMode.java b/shared/src/com/vaadin/shared/ui/window/WindowMode.java index 04af77a086..e3438fe6a9 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowMode.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowMode.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/src/com/vaadin/shared/ui/window/WindowRole.java b/shared/src/com/vaadin/shared/ui/window/WindowRole.java new file mode 100644 index 0000000000..5114c04bc2 --- /dev/null +++ b/shared/src/com/vaadin/shared/ui/window/WindowRole.java @@ -0,0 +1,25 @@ +/* + * 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.shared.ui.window; + +/** + * Available WAI-ARIA roles for a window. + * + * @since 7.2 + */ +public enum WindowRole { + ALERTDIALOG, DIALOG +} diff --git a/shared/src/com/vaadin/shared/ui/window/WindowServerRpc.java b/shared/src/com/vaadin/shared/ui/window/WindowServerRpc.java index 1307b1e765..6c7191c54d 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowServerRpc.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowServerRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,4 +24,4 @@ public interface WindowServerRpc extends ClickRpc, ServerRpc { public void windowMoved(int x, int y); -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/ui/window/WindowState.java b/shared/src/com/vaadin/shared/ui/window/WindowState.java index e27bf87e88..fa73bea391 100644 --- a/shared/src/com/vaadin/shared/ui/window/WindowState.java +++ b/shared/src/com/vaadin/shared/ui/window/WindowState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,13 +23,6 @@ public class WindowState extends PanelState { primaryStyleName = "v-window"; } - /** - * Available WAI-ARIA roles for a window. - */ - public enum WindowRole { - ALERTDIALOG, DIALOG - } - public boolean modal = false; public boolean resizable = true; public boolean resizeLazy = false; @@ -46,4 +39,4 @@ public class WindowState extends PanelState { public boolean assistiveTabStop = false; public String assistiveTabStopTopText = "Top of dialog"; public String assistiveTabStopBottomText = "Bottom of Dialog"; -}
\ No newline at end of file +} diff --git a/shared/src/com/vaadin/shared/util/SharedUtil.java b/shared/src/com/vaadin/shared/util/SharedUtil.java index 449685705f..497a8cab01 100644 --- a/shared/src/com/vaadin/shared/util/SharedUtil.java +++ b/shared/src/com/vaadin/shared/util/SharedUtil.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/shared/tests/src/readme.txt b/shared/tests/src/readme.txt deleted file mode 100644 index 0cffbcdcbb..0000000000 --- a/shared/tests/src/readme.txt +++ /dev/null @@ -1 +0,0 @@ -Add tests here. A dummy so that Git creates the directory structure diff --git a/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java index 5e94fc1270..615fb719a8 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/RowHeightWithoutRows.java @@ -84,4 +84,4 @@ public class RowHeightWithoutRows extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(9203); } -}
\ No newline at end of file +} diff --git a/uitest/build.xml b/uitest/build.xml index 8479063ba0..84f44a2d72 100644 --- a/uitest/build.xml +++ b/uitest/build.xml @@ -17,7 +17,7 @@ </path> <target name="dependencies"> - <!-- This is copied from common.xml to be able to add server.test.source + <!-- This is copied from common.xml to be able to add server.test.source to the source path --> <ivy:resolve log="download-only" resolveid="common" conf="build, build-provided" /> @@ -161,7 +161,7 @@ <sequential> <!-- Server tests --> - <!-- Sleep before running integration tests so testbench 2 + <!-- Sleep before running integration tests so testbench 2 tests have time to compile and start --> <sleep minutes="4" /> <ant antfile="${uitest.dir}/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="false"> @@ -192,7 +192,7 @@ </target> <target name="test-server" depends="clean-testbench-errors"> - <property name="war.file" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> + <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> <parallel> <daemons> <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" /> @@ -206,7 +206,7 @@ </target> <target name="test-tb2" depends="clean-testbench-errors"> - <property name="war.file" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> + <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> <parallel> <daemons> <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" /> @@ -219,7 +219,7 @@ </target> <target name="test-tb3" depends="clean-testbench-errors"> - <property name="war.file" location="result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> + <property name="war.file" location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" /> <parallel> <daemons> <ant antfile="${uitest.dir}/vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" /> diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml index 77c5a94e26..c0d73580bb 100644 --- a/uitest/integration_tests.xml +++ b/uitest/integration_tests.xml @@ -114,7 +114,7 @@ <property name="server.report.dir" location="${report.dir}/integration-test-tb3/${server-name}" /> <!-- The junit task does not create the report dir... --> <mkdir dir="${server.report.dir}" /> - + <junit showoutput="no" printsummary="no" fork="yes"> <formatter type="xml" /> <classpath refid="classpath.tb3" /> @@ -123,6 +123,7 @@ <jvmarg value="-Ddeployment.url=${deployment.url}" /> <jvmarg value="-Dserver-name=${server-name}" /> <jvmarg value="-Djava.awt.headless=true" /> + <jvmarg value="-Ddemo.war=${demo.war}" /> <test name="${junit.test.suite}" todir="${server.report.dir}" /> </junit> </target> @@ -343,6 +344,20 @@ </antcall> </target> + <target name="integration-test-websphereportal8"> + <concat>##teamcity[testStarted name='websphereportal8' flowId='websphereportal8']</concat> + <antcall target="run-tb3-test" inheritall="true"> + <param name="junit.test.suite" value="com.vaadin.tests.integration.WebSpherePortalIntegrationTest" /> + <param name="server-name" value="websphereportal8" /> + + <!-- Fill out dummy values for params required by run-tb3-test target --> + <param name="test.integration.server" value="" /> + <param name="test.integration.user" value="" /> + <param name="test.integration.antfile" value="" /> + </antcall> + <concat>##teamcity[testFinished name='websphereportal8' flowId='websphereportal8']"</concat> + </target> + <target name="integration-test-weblogic10"> <antcall target="run-generic-integration-test"> <param name="startDelay" value="600" /> @@ -375,7 +390,7 @@ <antcall target="integration-test-test-GAE" /> </target> - <!-- Upload demo, clean error screenshots and test deployment on all + <!-- Upload demo, clean error screenshots and test deployment on all servers --> <target name="integration-test-all" unless="tests.integration.skip"> <property name="passphrase" value="${passphrase}" /> @@ -387,7 +402,7 @@ <parallel> <antcontrib:trycatch property="tried"> <try> - <!-- Still running GAE test from the old server which + <!-- Still running GAE test from the old server which requires its own lock --> <echo message="Getting lock" /> @@ -439,6 +454,7 @@ <antcall target="integration-test-tomcat8" /> <antcall target="integration-test-tomcat7apacheproxy" /> <antcall target="integration-test-websphere8" /> + <antcall target="integration-test-websphereportal8" /> </parallel> </target> @@ -468,11 +484,11 @@ </fileset> </scp> - <!-- trycatch probably not needed any more as it just fails with + <!-- trycatch probably not needed any more as it just fails with the original message and doesn't do anything in the finally block --> <antcontrib:trycatch property="error_message"> <try> - <!-- timeout in one hour (remote end should timeout in 55 + <!-- timeout in one hour (remote end should timeout in 55 minutes) --> <sshexec host="${target-host}" outputproperty="lock-output" timeout="3600000" username="${user}" keyfile="${sshkey.file}" trust="yes" command="chmod +x *.sh; ant -f deploy.xml get-lock" /> <antcall target="echo-prefix"> @@ -515,7 +531,7 @@ </antcontrib:else> </antcontrib:if> - <!-- Run theme tests in all browsers if there's a property + <!-- Run theme tests in all browsers if there's a property with the test files --> <antcontrib:if> <isset property="testfiles-theme" /> @@ -565,7 +581,7 @@ <target name="teamcity-escape"> <property name="returnTo" value="return" /> - <!-- Should also perform other escaping (\u0085, \u2028 and \u2029) + <!-- Should also perform other escaping (\u0085, \u2028 and \u2029) - see http://confluence.jetbrains.net/display/TCD65/Build+Script+Interaction+with+TeamCity --> <!-- Immutable properties -> needs to create a new one every time --> <antcontrib:propertyregex property="details-escaped1" input="${message}" regexp="['|\[\]]" replace="|\0" global="true" defaultValue="${message}" /> diff --git a/uitest/ivy.xml b/uitest/ivy.xml index 170ffd21cf..020543c53f 100644 --- a/uitest/ivy.xml +++ b/uitest/ivy.xml @@ -57,7 +57,9 @@ <!-- For compiling TestingWidgetSet --> <dependency org="com.vaadin" name="vaadin-client-compiler" - rev="${vaadin.version}" conf="build-provided-> build"></dependency> + rev="${vaadin.version}" conf="build-provided-> build"> + <exclude type="pom" /> + </dependency> <!-- Servlet 3.0 API --> <dependency org="javax.servlet" name="javax.servlet-api" @@ -81,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" @@ -91,7 +95,7 @@ <dependency org="org.hsqldb" name="hsqldb" rev="2.2.6" conf="build,ide -> default" /> <dependency org="com.vaadin" name="vaadin-testbench" - rev="3.1.3" conf="build-provided,ide -> default" /> + rev="4.0.0.alpha1" conf="build-provided,ide -> default" /> <!-- This should be removed once tests have been updated to use lang3 --> <dependency org="commons-lang" name="commons-lang" rev="2.6" conf="build,ide -> default" /> diff --git a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java index 47d3a19fde..a89ec4e587 100644 --- a/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/uitest/src/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java index ecaf4ded32..d94518ca9c 100644 --- a/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java +++ b/uitest/src/com/vaadin/launcher/DevelopmentServerLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,15 +17,20 @@ package com.vaadin.launcher; import java.io.File; +import java.io.FilenameFilter; import java.io.IOException; import java.io.OutputStream; import java.net.InetAddress; import java.net.ServerSocket; import java.net.Socket; +import java.net.URL; +import java.net.URLClassLoader; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Calendar; import java.util.EnumSet; import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -43,6 +48,8 @@ import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.nio.SelectChannelConnector; import org.eclipse.jetty.server.ssl.SslSocketConnector; +import org.eclipse.jetty.util.Scanner; +import org.eclipse.jetty.util.ssl.SslContextFactory; import org.eclipse.jetty.webapp.WebAppContext; import com.vaadin.launcher.util.BrowserLauncher; @@ -70,6 +77,7 @@ public class DevelopmentServerLauncher { assertAssertionsEnabled(); + // // Pass-through of arguments for Jetty final Map<String, String> serverArgs = parseArguments(args); if (!serverArgs.containsKey("shutdownPort")) { @@ -160,19 +168,18 @@ public class DevelopmentServerLauncher { if (serverArgs.containsKey("withssl")) { final SslSocketConnector sslConnector = new SslSocketConnector(); sslConnector.setPort(8444); - sslConnector.setTruststore(KEYSTORE); - sslConnector.setTrustPassword("password"); - sslConnector.setKeystore(KEYSTORE); - sslConnector.setKeyPassword("password"); - sslConnector.setPassword("password"); + SslContextFactory sslFact = sslConnector.getSslContextFactory(); + sslFact.setTrustStore(KEYSTORE); + sslFact.setTrustStorePassword("password"); + sslFact.setKeyStorePath(KEYSTORE); + sslFact.setKeyManagerPassword("password"); + sslFact.setKeyStorePassword("password"); server.setConnectors(new Connector[] { connector, sslConnector }); } else { server.setConnectors(new Connector[] { connector }); } final WebAppContext webappcontext = new WebAppContext(); - String path = DevelopmentServerLauncher.class.getPackage().getName() - .replace(".", File.separator); webappcontext.setContextPath(serverArgs.get("context")); webappcontext.setWar(serverArgs.get("webroot")); server.setHandler(webappcontext); @@ -198,6 +205,73 @@ public class DevelopmentServerLauncher { } } + // --autoreload=all --autoreload=WebContent/classes,other/path + // --scaninterval=1 + // Configure Jetty to auto-reload when a any class is compiled in + // any folder included in the list of folders passed as arguments + // or in the entire classpath if the keyworkd all is passed. + if (serverArgs.containsKey("autoreload")) { + int interval = 1; + if (serverArgs.containsKey("scaninterval")) { + interval = Integer.parseInt(serverArgs.get("scaninterval")); + } + + List<File> classFolders = new ArrayList<File>(); + String[] paths = serverArgs.get("autoreload").split(","); + if (paths.length == 1 && "all".equals(paths[0])) { + ClassLoader cl = server.getClass().getClassLoader(); + for (URL u : ((URLClassLoader) cl).getURLs()) { + File f = new File(u.getPath()); + if (f.isDirectory()) { + classFolders.add(f); + } + } + } else { + for (String p : paths) { + File f = new File(p); + if (f.isDirectory()) { + classFolders.add(f); + } + } + } + if (!classFolders.isEmpty()) { + System.out + .println("Enabling context auto-reload.\n Scan interval: " + + interval + " secs.\n Scanned folders: "); + for (File f : classFolders) { + System.out.println(" " + f.getAbsolutePath()); + webappcontext.setExtraClasspath(f.getAbsolutePath()); + } + System.out.println(""); + + Scanner scanner = new Scanner(); + scanner.setScanInterval(interval); + + scanner.setRecursive(true); + scanner.addListener(new Scanner.BulkListener() { + @Override + public void filesChanged(List<String> filenames) + throws Exception { + webappcontext.stop(); + server.stop(); + webappcontext.start(); + server.start(); + } + }); + scanner.setReportExistingFilesOnStartup(false); + scanner.setFilenameFilter(new FilenameFilter() { + @Override + public boolean accept(File folder, String name) { + return name.endsWith(".class"); + } + }); + + scanner.setScanDirs(classFolders); + scanner.start(); + server.getContainer().addBean(scanner); + } + } + try { server.start(); @@ -380,7 +454,6 @@ public class DevelopmentServerLauncher { public void destroy() { // TODO Auto-generated method stub } - } private static void dumpThreadStacks() { @@ -395,7 +468,6 @@ public class DevelopmentServerLauncher { } System.out.println(); } - } } diff --git a/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java b/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java index 101655501e..04c6a46e64 100644 --- a/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java +++ b/uitest/src/com/vaadin/launcher/util/BrowserLauncher.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/CustomLayoutDemo.java b/uitest/src/com/vaadin/tests/CustomLayoutDemo.java index 7474ec2f8a..7b9f3d9926 100644 --- a/uitest/src/com/vaadin/tests/CustomLayoutDemo.java +++ b/uitest/src/com/vaadin/tests/CustomLayoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/LayoutDemo.java b/uitest/src/com/vaadin/tests/LayoutDemo.java index e7a2526174..c62a9ea51b 100644 --- a/uitest/src/com/vaadin/tests/LayoutDemo.java +++ b/uitest/src/com/vaadin/tests/LayoutDemo.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/ModalWindow.java b/uitest/src/com/vaadin/tests/ModalWindow.java index 86e80d8c56..559fc5ca0e 100644 --- a/uitest/src/com/vaadin/tests/ModalWindow.java +++ b/uitest/src/com/vaadin/tests/ModalWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/NativeWindowing.java b/uitest/src/com/vaadin/tests/NativeWindowing.java index 3be6693c2d..b646655c35 100644 --- a/uitest/src/com/vaadin/tests/NativeWindowing.java +++ b/uitest/src/com/vaadin/tests/NativeWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java b/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java index 5d41e413de..1474afe28c 100644 --- a/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ b/uitest/src/com/vaadin/tests/OrderedLayoutSwapComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/Parameters.java b/uitest/src/com/vaadin/tests/Parameters.java index 6f3b15f386..7e71c4dc76 100644 --- a/uitest/src/com/vaadin/tests/Parameters.java +++ b/uitest/src/com/vaadin/tests/Parameters.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java index ce92e68a70..c58c73753f 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java index 236b369897..08f8bc4d7a 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java index 7616d2f017..a6f112cff0 100644 --- a/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java +++ b/uitest/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/RandomLayoutStress.java b/uitest/src/com/vaadin/tests/RandomLayoutStress.java index 37f65054de..e9f04a4c85 100644 --- a/uitest/src/com/vaadin/tests/RandomLayoutStress.java +++ b/uitest/src/com/vaadin/tests/RandomLayoutStress.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/StressComponentsInTable.java b/uitest/src/com/vaadin/tests/StressComponentsInTable.java index 5619273599..84c9d70299 100644 --- a/uitest/src/com/vaadin/tests/StressComponentsInTable.java +++ b/uitest/src/com/vaadin/tests/StressComponentsInTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TableChangingDatasource.java b/uitest/src/com/vaadin/tests/TableChangingDatasource.java index ddc9b89632..162c850fb5 100644 --- a/uitest/src/com/vaadin/tests/TableChangingDatasource.java +++ b/uitest/src/com/vaadin/tests/TableChangingDatasource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TableSelectTest.java b/uitest/src/com/vaadin/tests/TableSelectTest.java index 4583e40331..61c93d0eae 100644 --- a/uitest/src/com/vaadin/tests/TableSelectTest.java +++ b/uitest/src/com/vaadin/tests/TableSelectTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestBench.java b/uitest/src/com/vaadin/tests/TestBench.java index 0323899ee8..bd01fa2087 100644 --- a/uitest/src/com/vaadin/tests/TestBench.java +++ b/uitest/src/com/vaadin/tests/TestBench.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestCaptionWrapper.java b/uitest/src/com/vaadin/tests/TestCaptionWrapper.java index 67e6c3adc4..edd70ece4e 100644 --- a/uitest/src/com/vaadin/tests/TestCaptionWrapper.java +++ b/uitest/src/com/vaadin/tests/TestCaptionWrapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestDateField.java b/uitest/src/com/vaadin/tests/TestDateField.java index e09e874c6d..b5611b8246 100644 --- a/uitest/src/com/vaadin/tests/TestDateField.java +++ b/uitest/src/com/vaadin/tests/TestDateField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForAlignments.java b/uitest/src/com/vaadin/tests/TestForAlignments.java index dcc821b806..7927b7f0ee 100644 --- a/uitest/src/com/vaadin/tests/TestForAlignments.java +++ b/uitest/src/com/vaadin/tests/TestForAlignments.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java index 26d5e42134..d6c72ee8e9 100644 --- a/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java +++ b/uitest/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java b/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java index 918494fa12..705f2e1766 100644 --- a/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/uitest/src/com/vaadin/tests/TestForBasicApplicationLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java b/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java index c3f954a5ce..e07d00a04f 100644 --- a/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java +++ b/uitest/src/com/vaadin/tests/TestForChildComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForContainerFilterable.java b/uitest/src/com/vaadin/tests/TestForContainerFilterable.java index e00042a790..f5edc40c56 100644 --- a/uitest/src/com/vaadin/tests/TestForContainerFilterable.java +++ b/uitest/src/com/vaadin/tests/TestForContainerFilterable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index 9d87ec432d..ba7d59fb2b 100644 --- a/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/uitest/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java b/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java index 69d561cef3..a4f2dcd106 100644 --- a/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java +++ b/uitest/src/com/vaadin/tests/TestForMultipleStyleNames.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForNativeWindowing.java b/uitest/src/com/vaadin/tests/TestForNativeWindowing.java index c60a234ba1..a9faeb8f38 100644 --- a/uitest/src/com/vaadin/tests/TestForNativeWindowing.java +++ b/uitest/src/com/vaadin/tests/TestForNativeWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java b/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java index 7fedaf1412..b8d1c17241 100644 --- a/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java +++ b/uitest/src/com/vaadin/tests/TestForPreconfiguredComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForRichTextEditor.java b/uitest/src/com/vaadin/tests/TestForRichTextEditor.java index 44c59b3cdb..1963dfbf12 100644 --- a/uitest/src/com/vaadin/tests/TestForRichTextEditor.java +++ b/uitest/src/com/vaadin/tests/TestForRichTextEditor.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForStyledUpload.java b/uitest/src/com/vaadin/tests/TestForStyledUpload.java index 834da5e505..de79dba2f6 100644 --- a/uitest/src/com/vaadin/tests/TestForStyledUpload.java +++ b/uitest/src/com/vaadin/tests/TestForStyledUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForTabSheet.java b/uitest/src/com/vaadin/tests/TestForTabSheet.java index d180bd4be3..8d5fe71ed3 100644 --- a/uitest/src/com/vaadin/tests/TestForTabSheet.java +++ b/uitest/src/com/vaadin/tests/TestForTabSheet.java @@ -57,4 +57,4 @@ public class TestForTabSheet extends CustomComponent implements } } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index b63804cc97..cfd7f58866 100644 --- a/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/uitest/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForTrees.java b/uitest/src/com/vaadin/tests/TestForTrees.java index f67ce4fe6b..67f7faf44e 100644 --- a/uitest/src/com/vaadin/tests/TestForTrees.java +++ b/uitest/src/com/vaadin/tests/TestForTrees.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForUpload.java b/uitest/src/com/vaadin/tests/TestForUpload.java index 3c198ef4fd..0046457f30 100644 --- a/uitest/src/com/vaadin/tests/TestForUpload.java +++ b/uitest/src/com/vaadin/tests/TestForUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForWindowOpen.java b/uitest/src/com/vaadin/tests/TestForWindowOpen.java index 48d133aa91..5de80fd833 100644 --- a/uitest/src/com/vaadin/tests/TestForWindowOpen.java +++ b/uitest/src/com/vaadin/tests/TestForWindowOpen.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestForWindowing.java b/uitest/src/com/vaadin/tests/TestForWindowing.java index 986bef549a..02d1e21d5a 100644 --- a/uitest/src/com/vaadin/tests/TestForWindowing.java +++ b/uitest/src/com/vaadin/tests/TestForWindowing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestIFrames.java b/uitest/src/com/vaadin/tests/TestIFrames.java index 6a08501095..244ea10dfa 100644 --- a/uitest/src/com/vaadin/tests/TestIFrames.java +++ b/uitest/src/com/vaadin/tests/TestIFrames.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java b/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java index a793883ad6..84ea616e3f 100644 --- a/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java +++ b/uitest/src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java b/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java index ed04541da6..b8ade0d8b6 100644 --- a/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java +++ b/uitest/src/com/vaadin/tests/TestSetVisibleAndCaching.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java b/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java index e4ce16506e..90b9088f76 100644 --- a/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java +++ b/uitest/src/com/vaadin/tests/TestSizeableIncomponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TestSplitPanel.java b/uitest/src/com/vaadin/tests/TestSplitPanel.java index 574f49d82c..0266bcc108 100644 --- a/uitest/src/com/vaadin/tests/TestSplitPanel.java +++ b/uitest/src/com/vaadin/tests/TestSplitPanel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TreeFilesystem.java b/uitest/src/com/vaadin/tests/TreeFilesystem.java index 409cf882a7..238e7bf317 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystem.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystem.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java index d42bfc0ed9..55e57a7d92 100644 --- a/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java +++ b/uitest/src/com/vaadin/tests/TreeFilesystemContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java index 291e55a03f..833087029d 100644 --- a/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java +++ b/uitest/src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java b/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java index f1cf3955e1..85da6d671f 100644 --- a/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java +++ b/uitest/src/com/vaadin/tests/UsingObjectsInSelect.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java b/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java index aa35a793c7..84ea3a0def 100644 --- a/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java +++ b/uitest/src/com/vaadin/tests/VerifyAssertionsEnabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java index c2dc400d8b..53317bd581 100644 --- a/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyBrowserVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -47,6 +47,9 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { expectedUserAgent .put(Browser.CHROME.getDesiredCapabilities(), "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/33.0.1750.117 Safari/537.36"); + expectedUserAgent + .put(Browser.PHANTOMJS.getDesiredCapabilities(), + "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/534.34 (KHTML, like Gecko) PhantomJS/1.9.7 Safari/534.34"); } @@ -58,4 +61,4 @@ public class VerifyBrowserVersionTest extends MultiBrowserTest { Assert.assertEquals("Touch device? No", vaadinElementById("touchDevice").getText()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/VerifyJreVersion.java b/uitest/src/com/vaadin/tests/VerifyJreVersion.java index a41955f826..025a66f022 100644 --- a/uitest/src/com/vaadin/tests/VerifyJreVersion.java +++ b/uitest/src/com/vaadin/tests/VerifyJreVersion.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java b/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java index aba120ac0b..0203423787 100644 --- a/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java +++ b/uitest/src/com/vaadin/tests/VerifyJreVersionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java index 1d08ee5ede..8dfcf52b75 100644 --- a/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java +++ b/uitest/src/com/vaadin/tests/actions/ActionsOnInvisibleComponentsTest.java @@ -4,26 +4,22 @@ import java.util.List; import org.junit.Assert; import org.junit.Test; -import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.tb3.MultiBrowserTest; public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest { - private static final String LAST_INIT_LOG = "3. 'C' triggers a click on a visible and enabled button"; // This method should be removed once #12785 is fixed @Override public List<DesiredCapabilities> getBrowsersToTest() { List<DesiredCapabilities> browsers = super.getBrowsersToTest(); - // sendKeys does nothing on these browsers + // Send Keys does not function correctly on these browsers. + browsers.remove(Browser.CHROME.getDesiredCapabilities()); browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); browsers.remove(Browser.IE8.getDesiredCapabilities()); - browsers.remove(Browser.OPERA.getDesiredCapabilities()); - - // Causes 'cannot focus element' - browsers.remove(Browser.CHROME.getDesiredCapabilities()); return browsers; } @@ -40,7 +36,6 @@ public class ActionsOnInvisibleComponentsTest extends MultiBrowserTest { } private void invokeShortcut(CharSequence key) { - WebElement shortcutTarget = vaadinElementById("test-root"); - shortcutTarget.sendKeys(key); + new Actions(getDriver()).sendKeys(key).perform(); } } diff --git a/uitest/src/com/vaadin/tests/annotations/TestCategory.java b/uitest/src/com/vaadin/tests/annotations/TestCategory.java index c48df2bf8c..5ba6cc3faa 100644 --- a/uitest/src/com/vaadin/tests/annotations/TestCategory.java +++ b/uitest/src/com/vaadin/tests/annotations/TestCategory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java index 154c84b4f5..8cb670c0fb 100644 --- a/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java +++ b/uitest/src/com/vaadin/tests/application/DetachOldUIOnReload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java b/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java index a5a7e3f274..a09c4c845a 100644 --- a/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java +++ b/uitest/src/com/vaadin/tests/application/ErrorInUnloadEvent.java @@ -103,4 +103,4 @@ public class ErrorInUnloadEvent extends AbstractTestCase { protected Integer getTicketNumber() { return 6316; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java index 6e31862f24..e66e8b9752 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserve.java @@ -39,4 +39,4 @@ public class RefreshStatePreserve extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(8068); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java index 88b3a9b9f4..524091aff6 100644 --- a/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java +++ b/uitest/src/com/vaadin/tests/application/RefreshStatePreserveTitle.java @@ -27,4 +27,4 @@ public class RefreshStatePreserveTitle extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(11054); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java index e261da7570..7dbfa8cf40 100644 --- a/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/uitest/src/com/vaadin/tests/application/TerminalErrorNotification.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java index 0576fd2090..ddef40b2d0 100644 --- a/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java +++ b/uitest/src/com/vaadin/tests/application/VaadinSessionAttribute.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/application/calculator/Calc.java b/uitest/src/com/vaadin/tests/application/calculator/Calc.java index 7911556f4e..3059017faa 100644 --- a/uitest/src/com/vaadin/tests/application/calculator/Calc.java +++ b/uitest/src/com/vaadin/tests/application/calculator/Calc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java index c59039e81b..93e9464054 100644 --- a/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java +++ b/uitest/src/com/vaadin/tests/applicationcontext/ChangeSessionId.java @@ -67,4 +67,4 @@ public class ChangeSessionId extends AbstractTestCase { return 6094; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java index c9af2c000d..a7edd2c0d0 100644 --- a/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java +++ b/uitest/src/com/vaadin/tests/applicationcontext/UIRunSafelyThread.java @@ -21,4 +21,4 @@ public abstract class UIRunSafelyThread extends Thread { } protected abstract void runSafely(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java index 4b373c9526..3750fdd370 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/InitParamUIProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java index 9d1b052182..5a815fb40c 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/NoApplicationClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java b/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java index df46c92f56..8fc6d56161 100644 --- a/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java +++ b/uitest/src/com/vaadin/tests/applicationservlet/SessionExpiration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java b/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java index a031fb0c7a..a7920b5410 100644 --- a/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java +++ b/uitest/src/com/vaadin/tests/browserfeatures/WebkitScrollbarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptions.java b/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptions.java new file mode 100644 index 0000000000..c5dcba7e7b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptions.java @@ -0,0 +1,72 @@ +/* + * 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; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +/** + * Test to see if AbstractOrderedLayout displays captions correctly with + * expanding ratios. + * + * @author Vaadin Ltd + */ +public class AbstractOrderedLayoutWithCaptions extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + layout.setSizeFull(); + + TextField textField = new TextField("Input Text:"); + Label label1 = new Label("LABEL 1"); + Label label2 = new Label("LABEL 2"); + + layout.addComponent(textField); + + layout.addComponent(label1); + layout.setExpandRatio(label1, 1.0f); + + layout.addComponent(label2); + + Panel containingPanel = new Panel(layout); + containingPanel.setHeight("200px"); + addComponent(containingPanel); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test to see if AbstractOrderedLayout calculates captions correctly."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13741; + } +} diff --git a/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptionsTest.java b/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptionsTest.java new file mode 100644 index 0000000000..4f5c16218e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/AbstractOrderedLayoutWithCaptionsTest.java @@ -0,0 +1,61 @@ +/* + * 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; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.lessThanOrEqualTo; +import static org.hamcrest.core.Is.is; + +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if AbstractOrderedLayout displays captions correctly with + * expanding ratios. + * + * @author Vaadin Ltd + */ +public class AbstractOrderedLayoutWithCaptionsTest extends MultiBrowserTest { + + @Test + public void CaptionHeightMeasuredCorrectly() { + openTestURL(); + + WebElement div = getDriver().findElement( + By.cssSelector(".v-panel-content > div > div")); + String paddingTop = div.getCssValue("padding-top"); + Integer paddingHeight = Integer.parseInt(paddingTop.substring(0, + paddingTop.length() - 2)); + List<WebElement> children = getDriver().findElements( + By.cssSelector(".v-panel-content .v-slot")); + assertThat(children.size(), is(3)); + + Integer neededHeight = children.get(0).getSize().getHeight() + + children.get(2).getSize().getHeight(); + + if (BrowserUtil.isIE8(getDesiredCapabilities())) { + // IE8 Reports the first element height incorrectly. + --neededHeight; + } + assertThat(neededHeight, is(lessThanOrEqualTo(paddingHeight))); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java index cace7c3404..a74692b169 100644 --- a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java +++ b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java b/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java index 926af72a2f..c619ceb200 100644 --- a/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java +++ b/uitest/src/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java @@ -80,4 +80,4 @@ public class AddRemoveSetStyleNamesTest extends TestBase { return 8664; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java index dd95ff6842..853f2863ef 100644 --- a/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java +++ b/uitest/src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java @@ -83,4 +83,4 @@ public class CustomComponentwithUndefinedSize extends TestBase { return layout; } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java b/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java index 0279a92437..7c5f0c9282 100644 --- a/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java +++ b/uitest/src/com/vaadin/tests/components/DisableEnableCascadeStyles.java @@ -143,4 +143,4 @@ public class DisableEnableCascadeStyles extends TestBase { return 8708; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java b/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java index d0638be54c..ec33b8f0e3 100644 --- a/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java +++ b/uitest/src/com/vaadin/tests/components/HierarchicalContainerSorting.java @@ -106,4 +106,4 @@ public class HierarchicalContainerSorting extends TestBase { return 3095; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java b/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java index 6cf49151b3..bf84695c3b 100644 --- a/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java +++ b/uitest/src/com/vaadin/tests/components/SaneErrorsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/TooltipDelay.java b/uitest/src/com/vaadin/tests/components/TooltipDelay.java new file mode 100644 index 0000000000..06fec3b233 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/TooltipDelay.java @@ -0,0 +1,59 @@ +/* + * 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; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.ui.Button; + +/** + * Test to see if tooltip delay is working properly. + * + * @author Vaadin Ltd + */ +public class TooltipDelay extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest vaadinRequest) { + + Button button = new Button("Expand"); + button.setDescription("Expand"); + addComponent(button); + + getTooltipConfiguration().setOpenDelay(5000); + + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Tooltips should appear with a five second delay."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13695; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java b/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java index b6358b6c56..982ff8d71e 100644 --- a/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java +++ b/uitest/src/com/vaadin/tests/components/UnknownComponentConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java b/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java index 49a3c29e2d..49539fcae1 100644 --- a/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java +++ b/uitest/src/com/vaadin/tests/components/UnknownComponentConnectorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java index b8afc11e4b..8b76b0e4e1 100644 --- a/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java +++ b/uitest/src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutHideComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java index 4bfd724c99..777eb4b518 100644 --- a/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java b/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java index 98c0538cd8..5924ab7d32 100644 --- a/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java +++ b/uitest/src/com/vaadin/tests/components/abstractcomponent/RemSizeUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java b/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java index 161f9cd520..716c1d4348 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/FieldFocusOnClick.java @@ -29,4 +29,4 @@ public class FieldFocusOnClick extends AbstractTestUI { protected Integer getTicketNumber() { return 11854; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html deleted file mode 100644 index a7b8e24ae7..0000000000 --- a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html +++ /dev/null @@ -1,203 +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="http://artur-laptop.office.itmill.com:8888/" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.abstractfield.ShortcutAddAndRemove?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/domChild[0]</td> - <td>316,58</td> -</tr> -<!--Enter on background - should cause event--> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>1. Log button was clicked</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>102,51</td> -</tr> -<!--Enter in textfield - should cause event--> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>2. Log button was clicked</td> -</tr> -<!--Remove shortcut--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>110,62</td> -</tr> -<!--Enter in field - should not cause event--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>97,26</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>up</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>down</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>down</td> -</tr> -<tr> - <td>enterCharacter</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>row1</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>13</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>r</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>o</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>w</td> -</tr> -<tr> - <td>keyPress</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>2</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>2. Log button was clicked</td> -</tr> -<!-- Commented out because TestBench does not enter the text correctly using keyPress in any browser except Firefox --> -<!-- <tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>row1<br />row2</td> -</tr>--> -<!--Add shortcut again--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>85,46</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextArea[0]</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>3. Log button was clicked</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[2]/domChild[0]/domChild[0]</td> - <td>625,2</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>4. Log button was clicked</td> -</tr> -<!--Remove shortcut once more--> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]</td> - <td>631,52</td> -</tr> -<tr> - <td>pressSpecialKey</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td> - <td>enter</td> -</tr> -<tr> - <td>assertText</td> - <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td> - <td>4. Log button was clicked</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java index 309e297374..d6e8d72297 100644 --- a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java +++ b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java @@ -1,25 +1,22 @@ package com.vaadin.tests.components.abstractfield; import com.vaadin.event.ShortcutAction.KeyCode; -import com.vaadin.tests.components.TestBase; -import com.vaadin.tests.util.Log; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; -public class ShortcutAddAndRemove extends TestBase { +public class ShortcutAddAndRemove extends AbstractTestUIWithLog { - private Log log; - private TextArea textArea; + private TextField textField; @Override - protected void setup() { - log = new Log(4); - + protected void setup(VaadinRequest request) { final Button logButton = new Button("Log a row (enter shortcut)"); logButton.setClickShortcut(KeyCode.ENTER); - logButton.addListener(new ClickListener() { + logButton.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { log.log("Log button was clicked"); @@ -27,7 +24,7 @@ public class ShortcutAddAndRemove extends TestBase { }); final Button removeShortcut = new Button("Remove shortcut"); - removeShortcut.addListener(new ClickListener() { + removeShortcut.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { logButton.removeClickShortcut(); @@ -35,7 +32,7 @@ public class ShortcutAddAndRemove extends TestBase { } }); final Button addShortcut = new Button("Add shortcut"); - addShortcut.addListener(new ClickListener() { + addShortcut.addClickListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { logButton.setClickShortcut(KeyCode.ENTER); @@ -44,17 +41,17 @@ public class ShortcutAddAndRemove extends TestBase { }); addComponent(log); addComponent(logButton); - textArea = new TextArea("Enter key does not break lines ..."); - textArea.setRows(5); - textArea.setColumns(20); - addComponent(textArea); + textField = new TextField("Enter key is a shortcut..."); + textField.setWidth("20em"); + addComponent(textField); addComponent(removeShortcut); addComponent(addShortcut); } @Override - protected String getDescription() { + protected String getTestDescription() { + // TODO Auto-generated method stub return null; } diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java new file mode 100644 index 0000000000..edae0a24c2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemoveTest.java @@ -0,0 +1,84 @@ +/* + * 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.abstractfield; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.AbstractComponentElement; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ShortcutAddAndRemoveTest extends MultiBrowserTest { + + @Test + public void addAndRemoveShortcut() { + openTestURL(); + + VerticalLayoutElement mainLayout = $(VerticalLayoutElement.class) + .first(); + + TextFieldElement textField = $(TextFieldElement.class).first(); + // Enter in mainlayout -> should trigger shortcut + sendEnter(mainLayout); + assertLastLogRowIs("1. Log button was clicked"); + + // Enter in textfield -> should trigger shortcut + sendEnter(textField); + assertLastLogRowIs("2. Log button was clicked"); + + // Remove enter shortcut + removeEnterShortcut(); + + // Enter in field - should not trigger any shortcut anymore + sendEnter(textField); + assertLastLogRowIs("2. Log button was clicked"); + + // Add shortcut again + addEnterShortcut(); + sendEnter(textField); + assertLastLogRowIs("3. Log button was clicked"); + + sendEnter(mainLayout); + assertLastLogRowIs("4. Log button was clicked"); + + removeEnterShortcut(); + sendEnter(mainLayout); + assertLastLogRowIs("4. Log button was clicked"); + } + + private void removeEnterShortcut() { + $(ButtonElement.class).caption("Remove shortcut").first().click(); + } + + private void addEnterShortcut() { + $(ButtonElement.class).caption("Add shortcut").first().click(); + } + + private void assertLastLogRowIs(String expected) { + assertThat(getLogRow(0), is(expected)); + } + + private void sendEnter(AbstractComponentElement target) { + new Actions(getDriver()).click(target).sendKeys(Keys.ENTER).perform(); + } +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java index da0ad3685a..46fdbac797 100644 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTab.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java index 68aa61cc87..95b7a9c416 100644 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionAddTabTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html deleted file mode 100644 index 30414094c8..0000000000 --- a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContent.html +++ /dev/null @@ -1,57 +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="http://arturwin.office.itmill.com:8888/" /> -<title>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/AccordionTest?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::PID_Smenu#item0</td> - <td>45,2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[0]/VMenuBar[0]#item3</td> - <td>136,8</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[1]/VMenuBar[0]#item0</td> - <td>65,4</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[2]/VMenuBar[0]#item1</td> - <td>86,2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::Root/VOverlay[3]/VMenuBar[0]#item0</td> - <td>48,0</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runAccordionTest::PID_StestComponent/VAccordion$StackItem[0]/VNativeButton[0]</td> - <td>63,11</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>button-clicked</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java new file mode 100644 index 0000000000..b4f830d106 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionClipsContentTest.java @@ -0,0 +1,57 @@ +/* + * 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.accordion; + +import org.junit.Test; + +import com.vaadin.testbench.elements.NativeButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class AccordionClipsContentTest extends MultiBrowserTest { + @Override + protected Class<?> getUIClass() { + return AccordionTest.class; + } + + @Test + public void testAccordionClipsContent() throws Exception { + openTestURL(); + + /* + * MenuBarElement doesn't have any API, so this part is ugly until + * #13364 is fixed + */ + + // Component + vaadinElement("PID_Smenu#item0").click(); + // Component container features + clickAt("Root/VOverlay[0]/VMenuBar[0]#item3", 136, 8); + // Add component + clickAt("Root/VOverlay[1]/VMenuBar[0]#item0", 65, 4); + // NativeButton + clickAt("Root/VOverlay[2]/VMenuBar[0]#item1", 86, 2); + // autoxauto + vaadinElement("Root/VOverlay[3]/VMenuBar[0]#item0").click(); + + $(NativeButtonElement.class).first().click(); + + compareScreen("button-clicked"); + } + + private void clickAt(String vaadinLocator, int x, int y) { + testBenchElement(vaadinElement(vaadinLocator)).click(x, y); + } +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java new file mode 100644 index 0000000000..86e718596e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTab.java @@ -0,0 +1,78 @@ +/* + * 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.accordion; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Accordion; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Label; +import com.vaadin.ui.TabSheet.Tab; +import com.vaadin.ui.VerticalLayout; + +/** + * Test UI for Accordion: tabs should stay selectable after remove tab. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class AccordionRemoveTab extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Accordion tabs = new Accordion(); + addComponent(tabs); + tabs.setHeight(300, Unit.PIXELS); + final VerticalLayout one = new VerticalLayout(); + one.setCaption("One"); + one.addComponent(new Label("On first tab")); + tabs.addTab(one); + VerticalLayout two = new VerticalLayout(); + two.setCaption("Two"); + two.addComponent(new Label("On second tab")); + tabs.addTab(two); + + tabs.setSelectedTab(two); + + VerticalLayout l = new VerticalLayout(); + l.addComponent(new Label("On third tab")); + Tab last = tabs.addTab(l); + last.setCaption("Three"); + + Button remove = new Button("Remove First"); + remove.addClickListener(new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + tabs.removeComponent(tabs.iterator().next()); + } + }); + + addComponent(remove); + } + + @Override + protected String getTestDescription() { + return "Tabs should stay selectable after remove tab."; + } + + @Override + protected Integer getTicketNumber() { + return 11366; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java new file mode 100644 index 0000000000..f5651e0ada --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/accordion/AccordionRemoveTabTest.java @@ -0,0 +1,59 @@ +/* + * 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.accordion; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for Accordion: tabs should stay selectable after remove tab. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class AccordionRemoveTabTest extends MultiBrowserTest { + + @Test + public void testRemoveTab() { + openTestURL(); + + WebElement button = driver.findElement(By.className("v-button")); + button.click(); + + checkFirstItemHeight("On second tab"); + + button.click(); + + checkFirstItemHeight("On third tab"); + } + + private void checkFirstItemHeight(String text) { + WebElement firstItem = driver.findElement(By + .className("v-accordion-item-first")); + WebElement label = firstItem.findElement(By.className("v-label")); + Assert.assertEquals("Unexpected text in first item", text, + label.getText()); + int height = firstItem.getSize().getHeight(); + WebElement accordion = driver.findElement(By.className("v-accordion")); + Assert.assertTrue("First item in accordion has unexpected height", + height > accordion.getSize().getHeight() / 2); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonClick.java b/uitest/src/com/vaadin/tests/components/button/ButtonClick.java index 30692649c5..9b10473d0f 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonClick.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonClick.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java b/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java index 77b35092de..4ea02b20d0 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonClickTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java b/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java index 3d3d90728a..6031bff152 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonIOSDragTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java b/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java index 563342e240..cfec4d1100 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonTabIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java index 626ed1d250..25dd469903 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonToggleIcons.java @@ -35,4 +35,4 @@ public class ButtonToggleIcons extends UI { layout.addComponent(new Button("Toggle icon", iconToggleListener));
layout.addComponent(new NativeButton("Toggle icon", iconToggleListener));
}
-}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java b/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java index 8286398623..dd89d1b9a7 100644 --- a/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java +++ b/uitest/src/com/vaadin/tests/components/button/ButtonUpdateAltText.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java index 3a5d61d793..ec40ef4649 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSource.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java index 6fbe77040f..161f927681 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionEventSourceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java index 77225b2e4c..5b05d188bd 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarActionsMenuTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java index 7477fc84ce..56c4eacba1 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarDragAndDrop.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java b/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java index 29b8f62403..b4e759b20b 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java +++ b/uitest/src/com/vaadin/tests/components/calendar/CalendarTestEvent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java b/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java index 8b789098e6..04b00dd039 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java +++ b/uitest/src/com/vaadin/tests/components/calendar/HiddenFwdBackButtons.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java b/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java index 6e5718a652..2313ad891a 100644 --- a/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java +++ b/uitest/src/com/vaadin/tests/components/calendar/NotificationTestUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java index cc26cf8845..0513c9db4f 100644 --- a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java +++ b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRevertValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java new file mode 100644 index 0000000000..096b07546a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerInputFormatsTest.java @@ -0,0 +1,98 @@ +/* + * 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.colorpicker; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test legal color values according to + * http://www.w3schools.com/cssref/css_colors_legal.asp + */ +public class ColorPickerInputFormatsTest extends MultiBrowserTest { + + @Override + protected Class<?> getUIClass() { + return ColorPickerTestUI.class; + } + + @Test + public void testRGBValue() throws Exception { + openTestURL(); + + setColorpickerValue("rgb(100,100,100)"); + + assertEquals("#646464", getColorpickerValue()); + } + + @Test + public void testRGBAValue() { + openTestURL(); + + setColorpickerValue("rgba(100,100,100, 0.5)"); + + assertEquals("#646464", getColorpickerValue()); + } + + @Test + public void testHSLValue() { + openTestURL(); + + setColorpickerValue("hsl(120,100%,50%)"); + + assertEquals("#00ff00", getColorpickerValue()); + } + + @Test + public void testHSLAValue() { + openTestURL(); + + setColorpickerValue("hsla(120,100%,50%, 0.3)"); + + assertEquals("#00ff00", getColorpickerValue()); + } + + private void setColorpickerValue(String value) { + + // Open colorpicker + getDriver().findElement(By.id("colorpicker1")).click(); + + // Add RGB value + WebElement field = getDriver().findElement( + By.className("v-colorpicker-preview-textfield")); + + // Select all text + field.sendKeys(Keys.chord(Keys.CONTROL, "a")); + + // Replace with rgb value + field.sendKeys(value); + + // Submit + field.sendKeys(Keys.RETURN); + } + + private String getColorpickerValue() { + WebElement field = getDriver().findElement( + By.className("v-colorpicker-preview-textfield")); + return field.getAttribute("value"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html index 23c44d3cc0..48a4219c87 100644 --- a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.html @@ -4,16 +4,16 @@ <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>ColorPickerTest</title> +<title>ColorPickerTestUI</title> </head> <body> <table cellpadding="1" cellspacing="1" border="1"> <thead> -<tr><td rowspan="1" colspan="3">ColorPickerTest</td></tr> +<tr><td rowspan="1" colspan="3">ColorPickerTestUI</td></tr> </thead><tbody> <tr> <td>open</td> - <td>/run/com.vaadin.tests.components.colorpicker.ColorPickerTest?restartApplication</td> + <td>/run/com.vaadin.tests.components.colorpicker.ColorPickerTestUI?restartApplication</td> <td></td> </tr> @@ -25,17 +25,17 @@ </tr> <tr> <td>waitForElementPresent</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td></td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>190,87</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> @@ -47,12 +47,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>51,33</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -64,42 +64,42 @@ <!-- change foreground color with area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>10,15</td> </tr> <!-- expand history --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VButton[0]/domChild[0]</td> <td></td> </tr> <!-- choose from history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[3]</td> <td>9,9</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <!-- change background color with area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker6/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker6/domChild[1]</td> <td>12,24</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]</td> <td>9,12</td> </tr> <!-- choose from history --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -123,59 +123,59 @@ <!-- open and close using area button --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>11,17</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>11,17</td> </tr> <!-- open background (using area button) to display HSV effects --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker6/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker6/domChild[1]</td> <td>21,15</td> </tr> <!-- HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> <td>12,6</td> </tr> <!-- hue slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VSlider[0]/domChild[2]/domChild[0]</td> <td>136,0</td> </tr> <!-- saturation slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VSlider[0]/domChild[2]/domChild[0]</td> <td>100,0</td> </tr> <!-- value slider --> <tr> <td>dragAndDrop</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VSlider[0]/domChild[2]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VVerticalLayout[0]/VOrderedLayout$Slot[2]/VSlider[0]/domChild[2]/domChild[0]</td> <td>-60,0</td> </tr> <!-- Swatches tab (choose color) --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td> <td>43,8</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCustomComponent[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[11]/domChild[9]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VCustomComponent[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[11]/domChild[9]</td> <td>12,10</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -187,73 +187,73 @@ <!-- open foreground (using area button) to display checkbox effects --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Scolorpicker5/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Scolorpicker5/domChild[1]</td> <td>14,25</td> </tr> <!-- remove Swatches tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SswaBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SswaBox/domChild[0]</td> <td>9,6</td> </tr> <!-- remove css field --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_StxtBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_StxtBox/domChild[0]</td> <td>6,9</td> </tr> <!-- remove history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShisBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShisBox/domChild[0]</td> <td>6,7</td> </tr> <!-- remove RGB tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SrgbBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SrgbBox/domChild[0]</td> <td>6,7</td> </tr> <!-- return RGB tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SrgbBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SrgbBox/domChild[0]</td> <td>6,7</td> </tr> <!-- remove HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShsvBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShsvBox/domChild[0]</td> <td>6,9</td> </tr> <!-- return HSV tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShsvBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShsvBox/domChild[0]</td> <td>6,9</td> </tr> <!-- return css field --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_StxtBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_StxtBox/domChild[0]</td> <td>8,8</td> </tr> <!-- return history --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_ShisBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_ShisBox/domChild[0]</td> <td>6,8</td> </tr> <!-- return Swatches tab --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_SswaBox/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_SswaBox/domChild[0]</td> <td>4,8</td> </tr> <!-- close without choosing a new color --> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[1]/VButton[0]/domChild[0]</td> <td></td> </tr> @@ -265,12 +265,12 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>148,127</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -287,29 +287,29 @@ </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[6]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[6]</td> <td>10,7</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <!-- change color of the last shade area --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Sshadearea_16/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Sshadearea_16/domChild[1]</td> <td>10,-65</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/Slot[1]/VColorPickerGradient[0]#clicklayer</td> <td>36,93</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]/domChild[0]</td> <td></td> </tr> <tr> @@ -321,17 +321,17 @@ <!-- reset the color back to white --> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::PID_Sshadearea_16/domChild[1]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::PID_Sshadearea_16/domChild[1]</td> <td>19,-65</td> </tr> <tr> <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[4]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VVerticalLayout[0]/VOrderedLayout$Slot[0]/VCustomComponent[0]/VColorPickerGrid[0]/domChild[0]/domChild[1]/domChild[0]/domChild[4]</td> <td>6,7</td> </tr> <tr> <td>click</td> - <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTest::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> + <td>vaadin=runcomvaadintestscomponentscolorpickerColorPickerTestUI::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VOrderedLayout$Slot[3]/VHorizontalLayout[0]/VOrderedLayout$Slot[0]/VButton[0]/domChild[0]</td> <td></td> </tr> <tr> diff --git a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.java b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java index 0f7e639725..544cdafaf0 100644 --- a/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTest.java +++ b/uitest/src/com/vaadin/tests/components/colorpicker/ColorPickerTestUI.java @@ -1,3 +1,18 @@ +/* + * 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.colorpicker; import java.awt.Graphics; @@ -13,9 +28,10 @@ import javax.imageio.ImageIO; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.server.StreamResource; +import com.vaadin.server.VaadinRequest; import com.vaadin.shared.ui.colorpicker.Color; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.tests.components.TestBase; +import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractColorPicker; import com.vaadin.ui.Alignment; import com.vaadin.ui.CheckBox; @@ -30,10 +46,11 @@ import com.vaadin.ui.VerticalLayout; import com.vaadin.ui.components.colorpicker.ColorChangeEvent; import com.vaadin.ui.components.colorpicker.ColorChangeListener; -public class ColorPickerTest extends TestBase implements ColorChangeListener { +public class ColorPickerTestUI extends AbstractTestUI implements + ColorChangeListener { @Override - protected String getDescription() { + public String getTestDescription() { return "Vaadin 7 compatible ColorPicker"; } @@ -178,7 +195,7 @@ public class ColorPickerTest extends TestBase implements ColorChangeListener { } @Override - protected void setup() { + protected void setup(VaadinRequest request) { getLayout().setWidth("1000px"); getLayout().setHeight(null); getLayout().addStyleName("colorpicker-mainwindow-content"); diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html deleted file mode 100644 index 9248938b28..0000000000 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainText.html +++ /dev/null @@ -1,80 +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></title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3"></td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.combobox.ComboBoxes2?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>47,8</td> -</tr> -<tr> - <td>type</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<!--Open popup--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<!--Close poup--> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<!--Select a value--> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.combobox.ComboBoxes2?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item2</td> - <td>47,9</td> -</tr> -<tr> - <td>type</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[1]</td> - <td>14,10</td> -</tr> -<!--Entered value should remain in the text field even though the popup is opened--> -<tr> - <td>assertValue</td> - <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxes2::PID_StestComponent/domChild[0]</td> - <td>I</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java new file mode 100644 index 0000000000..a5efb44ec8 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxClosePopupRetainTextTest.java @@ -0,0 +1,60 @@ +/* + * 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.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ComboBoxClosePopupRetainTextTest extends MultiBrowserTest { + @Override + protected Class<?> getUIClass() { + return ComboBoxes2.class; + } + + @Test + public void testClosePopupRetainText() throws Exception { + openTestURL(); + + ComboBoxElement cb = $(ComboBoxElement.class).first(); + WebElement textbox = cb.findElement(By.vaadin("#textbox")); + textbox.sendKeys("I"); + cb.openPopup(); + cb.openPopup(); // openPopup() actually toggles + // The entered value should remain + assertEquals("I", textbox.getAttribute("value")); + } + + @Test + public void testClosePopupRetainText_selectingAValue() throws Exception { + openTestURL(); + ComboBoxElement cb = $(ComboBoxElement.class).first(); + cb.selectByText("Item 3"); + WebElement textbox = cb.findElement(By.vaadin("#textbox")); + textbox.clear(); + textbox.sendKeys("I"); + cb.openPopup(); + // Entered value should remain in the text field even though the popup + // is opened + assertEquals("I", textbox.getAttribute("value")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java index 20a62f2a33..ccbde5f2df 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCursorPositionReset.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java new file mode 100644 index 0000000000..8242eb9e57 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListener.java @@ -0,0 +1,65 @@ +/* + * 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.combobox; + +import com.vaadin.event.FieldEvents.FocusEvent; +import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; + +/** + * Test UI to verify that focus event actually update the ComboBox suggestion + * popup + * + * @author Vaadin Ltd + */ +public class ComboBoxItemAddingWithFocusListener extends AbstractTestUI { + + private ComboBox cBox; + + @Override + protected void setup(VaadinRequest request) { + cBox = new ComboBox(); + addComponent(cBox); + cBox.setImmediate(true); + cBox.addItem("Foo"); + cBox.addItem("Bar"); + cBox.addFocusListener(new FocusListener() { + + int x = 0; + + @Override + public void focus(FocusEvent event) { + cBox.addItem("Focus" + (x++)); + } + + }); + addComponent(new Button("Focus Target")); + } + + @Override + protected String getTestDescription() { + return "Item adding in focus listener causes popup to clear"; + } + + @Override + protected Integer getTicketNumber() { + return 13635; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java new file mode 100644 index 0000000000..66173db554 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxItemAddingWithFocusListenerTest.java @@ -0,0 +1,47 @@ +/* + * 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.combobox; + +import static org.junit.Assert.assertTrue; + +import org.junit.Test; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.TestBenchElement; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ComboBoxItemAddingWithFocusListenerTest extends MultiBrowserTest { + + @Test + public void testPopupViewContainsAddedItem() { + openTestURL(); + ComboBoxElement cBox = $(ComboBoxElement.class).first(); + ButtonElement focusTarget = $(ButtonElement.class).first(); + cBox.openPopup(); + int i = 0; + while (i < 3) { + assertTrue("No item added on focus", cBox.getPopupSuggestions() + .contains("Focus" + i++)); + focusTarget.focus(); + ((TestBenchElement) cBox.findElement(By.vaadin("#textbox"))) + .focus(); + } + assertTrue("No item added on focus", cBox.getPopupSuggestions() + .contains("Focus" + i)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java index 84355c4d89..d1adeaaf88 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxParentDisable.java @@ -78,4 +78,4 @@ public class ComboBoxParentDisable extends AbstractTestUIWithLog { protected Integer getTicketNumber() { return 10734; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java index 75010f0ea9..9f07d81cc9 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSQLContainerFilteredValueChange.java @@ -123,4 +123,4 @@ public class ComboBoxSQLContainerFilteredValueChange extends TestBase { connectionPool.releaseConnection(conn); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrows.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrows.java new file mode 100644 index 0000000000..d9ae7da050 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrows.java @@ -0,0 +1,72 @@ +/* + * 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.combobox; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.AbstractLayout; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.VerticalLayout; + +/** + * Test UI verifying navigating in combobox via arrow keys. + */ +public class ComboBoxScrollingWithArrows extends AbstractTestUI { + final String DESCRIPTION = "When positioned on last item in the page and press downArrow key - should open new page and set focus on the first item."; + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + VerticalLayout layout = new VerticalLayout(); + addComponent(layout); + addComboBox(layout); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return DESCRIPTION; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 11333; + } + + private void addComboBox(AbstractLayout layout) { + ComboBox box = new ComboBox(); + for (int i = 0; i < 100; i++) { + box.addItem("item " + i); + } + box.setPageLength(10); + box.setNullSelectionAllowed(false); + layout.addComponent(box); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrowsTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrowsTest.java new file mode 100644 index 0000000000..bc03593e3f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingWithArrowsTest.java @@ -0,0 +1,83 @@ +/* + * 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.combobox; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * When pressed down key, while positioned on the last item - should show next + * page and focus on the first item of the next page. + */ +public class ComboBoxScrollingWithArrowsTest extends MultiBrowserTest { + + @Before + public void openURL() { + openTestURL(); + } + + @Test + public void scrollDownArrowKeyTest() throws InterruptedException { + final int ITEMS_PER_PAGE = 10; + // Selenium is used instead of TestBench4, because there is no method to + // access the popup of the combobox + // The method ComboBoxElement.openPopup() opens the popup, but doesn't + // provide any way to access the popup and send keys to it. + // Ticket #13756 + WebElement dropDownComboBox = driver.findElement(By + .className("v-filterselect-input")); + // opens Lookup + dropDownComboBox.sendKeys(Keys.DOWN); + // go to the last item and then one more + for (int i = 0; i < ITEMS_PER_PAGE + 1; i++) { + dropDownComboBox.sendKeys(Keys.DOWN); + } + String expected = "item " + ITEMS_PER_PAGE;// item 10 + + List<WebElement> items = driver.findElements(By + .className("gwt-MenuItem-selected")); + String actual = items.get(0).getText(); + Assert.assertEquals(expected, actual); + } + + @Test + public void scrollUpArrowKeyTest() throws InterruptedException { + final int ITEMS_PER_PAGE = 10; + WebElement dropDownComboBox = driver.findElement(By + .className("v-filterselect-input")); + // opens Lookup + dropDownComboBox.sendKeys(Keys.DOWN); + // go to the last item and then one more + for (int i = 0; i < ITEMS_PER_PAGE + 1; i++) { + dropDownComboBox.sendKeys(Keys.DOWN); + } + // move to one item up + dropDownComboBox.sendKeys(Keys.UP); + String expected = "item " + (ITEMS_PER_PAGE - 1);// item 9 + List<WebElement> items = driver.findElements(By + .className("gwt-MenuItem-selected")); + String actual = items.get(0).getText(); + Assert.assertEquals(expected, actual); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java new file mode 100644 index 0000000000..a052a29bba --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowed.java @@ -0,0 +1,61 @@ +/* + * 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.combobox; + +import com.vaadin.data.Property; +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.ComboBox; +import com.vaadin.ui.Label; + +public class ComboBoxSetNullWhenNewItemsAllowed extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final ComboBox comboBox = new ComboBox("My ComboBox"); + comboBox.setImmediate(true); + comboBox.setNullSelectionAllowed(false); + comboBox.setNewItemsAllowed(true); + for (int i = 0; i < 10; i++) { + comboBox.addItem("Item " + i); + } + + final Label value = new Label("Selected: "); + + comboBox.addValueChangeListener(new Property.ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + if (comboBox.getValue() != null) { + comboBox.setValue(null); + value.setValue("Selected: " + (String) comboBox.getValue()); + } + } + }); + addComponent(comboBox); + addComponent(value); + } + + @Override + protected String getTestDescription() { + return "ComboBox should clear its value when setting to null with new items."; + } + + @Override + protected Integer getTicketNumber() { + return 13413; + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java new file mode 100644 index 0000000000..54d355ab0a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSetNullWhenNewItemsAllowedTest.java @@ -0,0 +1,54 @@ +/* + * 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.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.commands.TestBenchElementCommands; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * ComboBox should clear its value when setting to null with new items. + */ +public class ComboBoxSetNullWhenNewItemsAllowedTest extends MultiBrowserTest { + + @Test + public void testNewValueIsClearedAppropriately() + throws InterruptedException { + setDebug(true); + openTestURL(); + + WebElement element = $(ComboBoxElement.class).first().findElement( + By.vaadin("#textbox")); + ((TestBenchElementCommands) element).click(8, 7); + element.clear(); + element.sendKeys("New value"); + assertEquals("New value", element.getAttribute("value")); + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + new Actions(getDriver()).sendKeys(Keys.ENTER).perform(); + } else { + element.sendKeys(Keys.RETURN); + } + assertEquals("", element.getAttribute("value")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSlow.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSlow.java index 0336ff423b..13066854bf 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSlow.java +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxSlow.java @@ -1,12 +1,9 @@ package com.vaadin.tests.components.combobox; -import java.util.Map; - import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; -import com.vaadin.ui.ComboBox; public class ComboBoxSlow extends TestBase { @@ -22,19 +19,6 @@ public class ComboBoxSlow extends TestBase { return "The ComboBox artificially introduces a server delay to more easily spot problems"; } - public class SlowComboBox extends ComboBox { - @Override - public void changeVariables(Object source, Map<String, Object> variables) { - try { - Thread.sleep(1000); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - super.changeVariables(source, variables); - } - } - @Override protected void setup() { addComponent(log); @@ -44,11 +28,9 @@ public class ComboBoxSlow extends TestBase { cb.addItem("Item " + i); } cb.addListener(new ValueChangeListener() { - @Override public void valueChange(ValueChangeEvent event) { log.log("Value changed to " + cb.getValue()); - } }); addComponent(cb); diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxTabWhenFilter.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxTabWhenFilter.java new file mode 100644 index 0000000000..c37b29794c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxTabWhenFilter.java @@ -0,0 +1,68 @@ +/* + * 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.combobox; + +import com.vaadin.data.Container; +import com.vaadin.data.util.IndexedContainer; +import com.vaadin.server.VaadinRequest; +import com.vaadin.shared.ui.combobox.FilteringMode; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; + +/** + * A test case for typing in combo box input field fast plus then press TAB. + * When type fast and then press tab didn't add new item. Uses SlowComboBox, + * which has a delay in setVariables method + */ +public class ComboBoxTabWhenFilter extends AbstractTestUI { + public static final String DESCRIPTION = "Adding new item by typing fast plus then press TAB, very quickly, should add new item and change focus."; + + @Override + protected void setup(VaadinRequest request) { + final VerticalLayout layout = new VerticalLayout(); + layout.setMargin(true); + setContent(layout); + SlowComboBox comboBox = new SlowComboBox(); + comboBox.setNullSelectionAllowed(false); + comboBox.setImmediate(true); + Container container = createContainer(); + comboBox.setContainerDataSource(container); + comboBox.setNewItemsAllowed(true); + comboBox.setFilteringMode(FilteringMode.CONTAINS); + layout.addComponent(comboBox); + layout.addComponent(new TextField()); + } + + private IndexedContainer createContainer() { + IndexedContainer container = new IndexedContainer(); + for (int i = 0; i < 100000; ++i) { + container.addItem("Item " + i); + } + return container; + } + + @Override + protected String getTestDescription() { + return DESCRIPTION; + } + + @Override + protected Integer getTicketNumber() { + return 12325; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScroll.java b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScroll.java new file mode 100644 index 0000000000..735491d80a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScroll.java @@ -0,0 +1,56 @@ +/* + * 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.combobox; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Button; +import com.vaadin.ui.ComboBox; + +/** + * Test UI for issue #13488, where scrolling to the next page with pagelength 0 + * would break the rendering of any page except the first. + * + * @author Vaadin Ltd + */ +@SuppressWarnings("serial") +public class ComboboxPageLengthZeroScroll extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + ComboBox combobox = new ComboBox("New items enabled:"); + combobox.setPageLength(0); + + for (int i = 0; i++ < 10;) { + combobox.addItem("1 AMERICAN SAMOA " + i); + combobox.addItem("ANTIGUA AND BARBUDA " + i); + } + + getLayout().addComponent(combobox); + getLayout().addComponent(new Button("dummy")); + } + + @Override + protected String getTestDescription() { + return "Scrolling with pagelength == 0 previously resulted in broken style, should be fixed now"; + } + + @Override + protected Integer getTicketNumber() { + return 13488; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScrollTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScrollTest.java new file mode 100644 index 0000000000..9d863d2c0c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxPageLengthZeroScrollTest.java @@ -0,0 +1,63 @@ +/* + * 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.combobox; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test class for testing issue #13488 - changing pages with pagelength=0 breaks + * the style. + * + * @author Vaadin Ltd + */ + +public class ComboboxPageLengthZeroScrollTest extends MultiBrowserTest { + @Test + public void testComboboxPageLength() { + openTestURL(); + + WebElement comboBox = vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VFilterSelect[0]#textbox"); + + // navigate to the next page. keyboard navigation is the preferred + // method here since it's much easier to implement. + + Actions keyNavigation = new Actions(driver).moveToElement(comboBox) + .click(); + + for (int i = 0; i < 25; ++i) { + keyNavigation.sendKeys(Keys.ARROW_DOWN); + + } + keyNavigation.perform(); + + // The broken behavior always caused a v-shadow element to have + // height: 10px. Verify that this does no longer happen. + + String cssValue = driver.findElement(By.className("v-shadow")) + .getCssValue("height"); + + Assert.assertNotEquals("v-shadow height should not be 10px", "10px", + cssValue); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java b/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java new file mode 100644 index 0000000000..593f567c12 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidth.java @@ -0,0 +1,65 @@ +/* + * 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.combobox; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.ComboBox; + +/** + * Test UI for adding a stylename to a combobox with an undefined width. + * + * @author Vaadin Ltd + */ +public class ComboboxStyleChangeWidth extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + final ComboBox cbFoo = new ComboBox(); + cbFoo.setImmediate(true); + cbFoo.setSizeUndefined(); + cbFoo.addItem("A really long string that causes an inline width to be set"); + + Button btn = new Button("Click to break CB", + new Button.ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + cbFoo.addStyleName("foofoo"); + + } + }); + + addComponent(cbFoo); + addComponent(btn); + + } + + @Override + protected String getTestDescription() { + return "The computed inline width of an undefined-width ComboBox " + + "(with a sufficiently long option string) breaks when " + + "the component's stylename is changed after initial " + + "rendering."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(13444); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidthTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidthTest.java new file mode 100644 index 0000000000..034319ac70 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/ComboboxStyleChangeWidthTest.java @@ -0,0 +1,51 @@ +/* + * 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.combobox; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.ComboBoxElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that changing a stylename will not cause the width parameter to be + * removed from a combobox. + * + * @author Vaadin Ltd + */ + +public class ComboboxStyleChangeWidthTest extends MultiBrowserTest { + + @Test + public void testWidthRetained() { + openTestURL(); + + ComboBoxElement comboBox = $(ComboBoxElement.class).first(); + String oldStyle = comboBox.getAttribute("style"); + + ButtonElement button = $(ButtonElement.class).first(); + button.click(); + String newStyle = comboBox.getAttribute("style"); + + assertEquals("width has changed, should remain equal", oldStyle, + newStyle); + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java b/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java index dcd19f6b2a..02c212a3e1 100644 --- a/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java +++ b/uitest/src/com/vaadin/tests/components/combobox/EscapeClosesComboboxNotWindow.java @@ -40,4 +40,4 @@ public class EscapeClosesComboboxNotWindow extends UI { layout.addComponent(button); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/combobox/SlowComboBox.java b/uitest/src/com/vaadin/tests/components/combobox/SlowComboBox.java new file mode 100644 index 0000000000..c07d2d2d7c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/combobox/SlowComboBox.java @@ -0,0 +1,35 @@ +/* + * 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.combobox; + +import java.util.Map; + +import com.vaadin.ui.ComboBox; + +/** + * A combo box component with delay. Can be useful to use while testing UI. + */ +public class SlowComboBox extends ComboBox { + @Override + public void changeVariables(Object source, Map<String, Object> variables) { + try { + Thread.sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + } + super.changeVariables(source, variables); + } +} diff --git a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java index 4311ad1f08..9cebc58100 100644 --- a/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java +++ b/uitest/src/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java @@ -40,4 +40,4 @@ public class CustomComponentGrowingContent extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(7326); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/AddressField.java b/uitest/src/com/vaadin/tests/components/customfield/AddressField.java index 595a2e2cde..bc9f13c454 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/AddressField.java +++ b/uitest/src/com/vaadin/tests/components/customfield/AddressField.java @@ -94,4 +94,4 @@ public class AddressField extends CustomField<Address> { public Class<Address> getType() { return Address.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java b/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java index 409ecccca8..20c004c068 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java +++ b/uitest/src/com/vaadin/tests/components/customfield/BooleanField.java @@ -43,4 +43,4 @@ public class BooleanField extends CustomField { public Class<?> getType() { return Boolean.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java index a3e19513b0..b6f46cadd0 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSize.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java index c47ec0b792..a3f8f06976 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java +++ b/uitest/src/com/vaadin/tests/components/customfield/CustomFieldSizeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java b/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java index d305afde1d..2703e01a27 100644 --- a/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java +++ b/uitest/src/com/vaadin/tests/components/customfield/EmbeddedForm.java @@ -64,4 +64,4 @@ public class EmbeddedForm extends Form { return super.removeItemProperty(id); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java index c192b561cc..0832f5afeb 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java +++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabled.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -45,4 +45,4 @@ public class AriaDisabled extends AbstractTestUI { protected Integer getTicketNumber() { return 13463; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java index 823638ef0c..f37042396b 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/AriaDisabledTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java index ce9d021c79..fc3c8c97e8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEE.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java index 286da85f06..98094515e8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormatEEETest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java index 77637fb339..f51c75d57a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java +++ b/uitest/src/com/vaadin/tests/components/datefield/CustomDateFormats.java @@ -209,4 +209,4 @@ public class CustomDateFormats extends TestBase { protected Integer getTicketNumber() { return 5465; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java new file mode 100644 index 0000000000..b38f58e5cc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForward.java @@ -0,0 +1,39 @@ +/* + * 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.datefield; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.InlineDateField; + +public class DateFieldFastForward extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + addComponent(new InlineDateField()); + } + + @Override + protected String getTestDescription() { + return "Tests that right-click doesn't interfere with fast-forwarding (holding down left mouse button)."; + } + + @Override + protected Integer getTicketNumber() { + return 8012; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java new file mode 100644 index 0000000000..63d96e9bf9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldFastForwardTest.java @@ -0,0 +1,71 @@ +/* + * 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.datefield; + +import static org.junit.Assert.assertEquals; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.VerticalLayoutElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DateFieldFastForwardTest extends MultiBrowserTest { + + @Test + public void testFastForwardOnRightMouseClick() throws Exception { + openTestURL(); + String firstMonth = getSelectedMonth(); + WebElement nextMonthButton = driver.findElement(By + .className("v-button-nextmonth")); + + // Click and hold left mouse button to start fast forwarding. + new Actions(driver).clickAndHold(nextMonthButton).perform(); + sleep(1000); + + // Right click and release the left button. + + new Actions(driver).contextClick(nextMonthButton) + .release(nextMonthButton).perform(); + + // Now the fast forwarding should be ended, get the expected month. + String expectedMonth = getSelectedMonth(); + + // Make browser context menu disappear, since it will crash IE + $(VerticalLayoutElement.class).first().click(); + + Assert.assertFalse("Month did not change during fast forward", + firstMonth.equals(expectedMonth)); + + // Wait for a while. + Thread.sleep(1000); + + // Verify that we didn't fast forward any further after the left button + // was released. + String actualMonth = getSelectedMonth(); + assertEquals(expectedMonth, actualMonth); + } + + private String getSelectedMonth() { + return driver.findElement( + By.className("v-inline-datefield-calendarpanel-month")) + .getText(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html deleted file mode 100644 index ee19b52324..0000000000 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html +++ /dev/null @@ -1,66 +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="http://localhost:8888/" /> -<title>DateFieldReadOnly</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">DateFieldReadOnly</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.datefield.DateFieldReadOnly?restartApplication</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readonly</td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VPopupCalendar[0]/domChild[1]</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::Root/VOverlay[0]/VCalendarPanel[0]/VCalendarPanel$VTime[0]/ListBox[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readwrite-popup</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>focus</td> - <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldReadOnly::/VVerticalLayout[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>readonly</td> -</tr> -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java new file mode 100644 index 0000000000..96e17344ec --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldReadOnlyTest.java @@ -0,0 +1,43 @@ +package com.vaadin.tests.components.datefield; + + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.DateFieldElement; +import com.vaadin.tests.tb3.AbstractTB3Test; +import com.vaadin.tests.tb3.MultiBrowserTest; +import org.junit.Test; +import org.openqa.selenium.Keys; + +import java.io.IOException; + +public class DateFieldReadOnlyTest extends MultiBrowserTest { + + @Test + public void readOnlyDateFieldPopupShouldNotOpen() throws IOException, InterruptedException { + openTestURL(); + + compareScreen("readonly"); + toggleReadOnly(); + + openPopup(); + compareScreen("readwrite-popup"); + + closePopup(); + toggleReadOnly(); + compareScreen("readonly"); + } + + private void closePopup() { + findElement(By.className("v-datefield-calendarpanel")).sendKeys(Keys.RETURN); + } + + private void openPopup() { + //waiting for openPopup() in TB4 beta1: http://dev.vaadin.com/ticket/13766 + $(DateFieldElement.class).first().findElement(By.tagName("button")).click(); + } + + private void toggleReadOnly() { + $(ButtonElement.class).caption("Switch read-only").first().click(); + } +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java index 123fd167d0..5f659d389b 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DateFieldTestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,10 +19,10 @@ import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Dimension; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class DateFieldTestTest extends MultiBrowserTest { @@ -44,12 +44,8 @@ public class DateFieldTestTest extends MultiBrowserTest { } private void assertNoErrorNotification() { - try { - getDriver().findElement( - By.xpath("//div[contains(@class, 'v-Notification') ]")); - Assert.fail("Error notification shown!"); - } catch (NoSuchElementException e) { - // As expected + if (isElementPresent(NotificationElement.class)) { + Assert.fail("Notification was present"); } } @@ -122,4 +118,4 @@ public class DateFieldTestTest extends MultiBrowserTest { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java index c48d2383a7..49590a3cee 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopup.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,11 +19,6 @@ import com.vaadin.server.VaadinRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.DateField; -/** - * - * @since 7.1 - * @author Vaadin Ltd - */ public class DisabledDateFieldPopup extends AbstractTestUI { @Override diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java index dc287c19da..a57017746a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledDateFieldPopupTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,38 +15,44 @@ */ package com.vaadin.tests.components.datefield; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.tests.tb3.MultiBrowserTest; -/** - * - * @since 7.1 - * @author Vaadin Ltd - */ public class DisabledDateFieldPopupTest extends MultiBrowserTest { + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>(); + for (DesiredCapabilities browser : super.getBrowsersToTest()) { + if (BrowserUtil.isIE(browser)) { + browsers.add(browser); + } + } + return browsers; + } + @Test - public void testPopup() { + public void testPopup() throws IOException { openTestURL(); WebElement button = driver.findElement(By .className("v-datefield-button")); - button.click(); + new Actions(driver).moveToElement(button).click() + .sendKeys(Keys.ARROW_DOWN).perform(); Assert.assertFalse( - "Calendar popup should not be opened for disabled date field on mouse click", + "Calendar popup should not be opened for disabled date field", isElementPresent(By.className("v-datefield-popup"))); - - button.sendKeys(Keys.ARROW_DOWN); - - Assert.assertFalse("Calendar popup should not be opened for " - + "disabled date fild on down key", - isElementPresent(By.className("v-datefield-popup"))); - } } diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java new file mode 100644 index 0000000000..affc5d322c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateField.java @@ -0,0 +1,58 @@ +/* + * 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.datefield; + +import java.util.Calendar; +import java.util.Date; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DateField; +import com.vaadin.ui.InlineDateField; + +public class DisabledInlineDateField extends AbstractTestUI { + + private static final Date testDate; + static { + Calendar cal = Calendar.getInstance(); + cal.set(2014, 5, 5); + testDate = cal.getTime(); + } + + @Override + protected void setup(VaadinRequest request) { + DateField df = new InlineDateField("Disabled"); + df.setValue(testDate); + df.setEnabled(false); + addComponent(df); + + df = new InlineDateField("Read-only"); + df.setValue(testDate); + df.setReadOnly(true); + addComponent(df); + } + + @Override + protected String getTestDescription() { + return "Testing disabled and read-only modes of InlineDateField."; + } + + @Override + protected Integer getTicketNumber() { + return 10262; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java new file mode 100644 index 0000000000..2c50030461 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledInlineDateFieldTest.java @@ -0,0 +1,79 @@ +/* + * 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.datefield; + +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DisabledInlineDateFieldTest extends MultiBrowserTest { + + @Test + public void testDisabled() { + openTestURL(); + testNextMonthControls(".v-disabled"); + testDaySelection(".v-disabled"); + } + + @Test + public void testReadOnly() { + openTestURL(); + testNextMonthControls(".v-readonly"); + testDaySelection(".v-readonly"); + } + + private void testNextMonthControls(String cssClass) { + // Get the currently selected month. + String expectedMonth = getSelectedMonth(cssClass); + + // Attempt to click the next month button. + driver.findElement(By.cssSelector(cssClass + " .v-button-nextmonth")) + .click(); + + // Assert that we did not navigate to next month. + String actualMonth = getSelectedMonth(cssClass); + assertEquals(expectedMonth, actualMonth); + } + + private void testDaySelection(String cssClass) { + // We know that the first day element is not selected, because of the + // fixed date in the test. + WebElement nonSelectedDay = driver.findElement(By.cssSelector(cssClass + + " .v-inline-datefield-calendarpanel-day")); + + // Assert it is not selected before click. + assertFalse(nonSelectedDay.getAttribute("class").contains("selected")); + + // Click on the non-selected day. + nonSelectedDay.click(); + + // Assert that clicking did not select the day. + assertFalse(nonSelectedDay.getAttribute("class").contains("selected")); + } + + private String getSelectedMonth(String selectorPrefix) { + return driver.findElement( + By.cssSelector(selectorPrefix + + " .v-inline-datefield-calendarpanel-month")) + .getText(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java index cf09ff029d..49d88630a8 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,7 +35,6 @@ public class DisabledParentLayout extends AbstractTestUI { content.setMargin(true); final VerticalLayout pane = new VerticalLayout(); - pane.setEnabled(false); pane.addComponent(new DateField()); content.addComponent(pane); @@ -44,7 +43,7 @@ public class DisabledParentLayout extends AbstractTestUI { button.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { - pane.setEnabled(true); + pane.setEnabled(!pane.isEnabled()); } }); content.addComponent(button); diff --git a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java index 3ee4544693..76486bf340 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DisabledParentLayoutTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,17 +35,41 @@ public class DisabledParentLayoutTest extends MultiBrowserTest { WebElement button = driver.findElement(By.className("v-button")); button.click(); + WebElement textField = driver.findElement(By + .className("v-datefield-textfield")); + textField.click(); + + Assert.assertFalse( + "Date input text field shoud be disabled for disabled DateField", + textField.isEnabled()); + WebElement dataFieldButton = driver.findElement(By .className("v-datefield-button")); dataFieldButton.click(); - WebElement popup = driver - .findElement(By.className("v-datefield-popup")); + Assert.assertFalse( + "Disabled date popup is opened after click to its button", + isElementPresent(By.className("v-datefield-popup"))); + + button.click(); + + Assert.assertTrue( + "Date input text field shoud be enabled for enabled DateField", + textField.isEnabled()); + textField.click(); + String text = "text"; + textField.sendKeys(text); + + Assert.assertEquals("Unexpected text in date text field", text, + textField.getAttribute("value")); + + dataFieldButton.click(); Assert.assertFalse("Unexpected disabled element found", isElementPresent(By.className("v-disabled"))); - Assert.assertNotNull( - "Date popup is not opened after click to its button", popup); + Assert.assertTrue("Date popup is not opened after click to its button", + isElementPresent(By.className("v-datefield-popup"))); } + } diff --git a/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java index fb0fb2a546..31f97afabd 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java +++ b/uitest/src/com/vaadin/tests/components/datefield/DynamicallyChangeDateRange.java @@ -90,4 +90,4 @@ public class DynamicallyChangeDateRange extends AbstractTestUI { return 11940; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java b/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java index dab47ebdd9..b77b782d2a 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java +++ b/uitest/src/com/vaadin/tests/components/datefield/NarrowPopupDateFieldInTable.java @@ -31,4 +31,4 @@ public class NarrowPopupDateFieldInTable extends TestBase { return 6166; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java index f1422b28a3..0b8ffa52fa 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEsc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java index 834517e1bb..1366d38705 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupClosingWithEscTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java index f12a3dda58..86ce195609 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldLocaleTest.java @@ -50,4 +50,4 @@ public class PopupDateFieldLocaleTest extends AbstractTestUI { return 12135; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java index 5a6f6517bd..ede5510c72 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldPopup.java @@ -38,4 +38,4 @@ public class PopupDateFieldPopup extends TestBase { return 8391; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java index 1ba6409a6f..130ed8f3c5 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldTextEnabled.java @@ -41,4 +41,4 @@ public class PopupDateFieldTextEnabled extends TestBase { return 6790; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java index b875d86428..b6cc002872 100644 --- a/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/datefield/PopupDateFieldValueChangeEvents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java index adb5cd9e3a..b820ccf788 100644 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropBatchUpload.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java new file mode 100644 index 0000000000..2ce3a42957 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextArea.java @@ -0,0 +1,56 @@ +/* + * 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.draganddropwrapper; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DragAndDropWrapper; +import com.vaadin.ui.DragAndDropWrapper.DragStartMode; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.VerticalLayout; + +/** + * Test UI for text area: drag image should contain text-area text. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DragAndDropTextArea extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + VerticalLayout dndLayout = new VerticalLayout(); + + TextArea area = new TextArea(); + area.setValue("text"); + + dndLayout.addComponent(area); + DragAndDropWrapper wrapper = new DragAndDropWrapper(dndLayout); + wrapper.setDragStartMode(DragStartMode.WRAPPER); + addComponent(wrapper); + } + + @Override + protected String getTestDescription() { + return "Drag image for textarea should contain text-area text"; + } + + @Override + protected Integer getTicketNumber() { + return 13557; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java new file mode 100644 index 0000000000..c60eead918 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragAndDropTextAreaTest.java @@ -0,0 +1,61 @@ +/* + * 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.draganddropwrapper; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for drag image of text area which should contain text-area text. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class DragAndDropTextAreaTest extends MultiBrowserTest { + + @Test + public void testTextAreaDndImage() { + openTestURL(); + + WebElement wrapper = driver.findElement(By + .className("v-verticallayout")); + Actions actions = new Actions(driver); + actions.clickAndHold(wrapper); + actions.moveByOffset(50, 50); + actions.perform(); + + WebElement dragElement = driver.findElement(By + .className("v-drag-element")); + List<WebElement> children = dragElement.findElements(By.xpath(".//*")); + boolean found = false; + for (WebElement child : children) { + if ("text".equals(child.getAttribute("value"))) { + found = true; + } + } + + Assert.assertTrue( + "Text value is not found in the DnD image of text area", found); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html deleted file mode 100644 index 3e7a7cb0a7..0000000000 --- a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModes.html +++ /dev/null @@ -1,62 +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>DragStartModes</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">DragStartModes</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.draganddropwrapper.DragStartModes?restartApplication</td> - <td></td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelCOMPONENT</td> - <td>50,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>drag-mode-component</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::PID_SlabelWRAPPER</td> - <td>50,10</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>drag-mode-wrapper</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentsdraganddropwrapperDragStartModes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VLabel[0]</td> - <td>50,10</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java new file mode 100644 index 0000000000..25aef1b815 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/draganddropwrapper/DragStartModesTest.java @@ -0,0 +1,46 @@ +/* + * 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.draganddropwrapper; + +import java.io.IOException; + +import org.junit.Test; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class DragStartModesTest extends MultiBrowserTest { + + @Test + public void testDragStartModes() throws IOException { + openTestURL(); + WebElement dropTarget = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]"); + dragToTarget("COMPONENT", dropTarget); + dragToTarget("WRAPPER", dropTarget); + } + + private void dragToTarget(String dragMode, WebElement dropTarget) + throws IOException { + WebElement draggable = vaadinElementById("label" + dragMode); + new Actions(driver).moveToElement(draggable, 10, 10).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveToElement(dropTarget, 12, 10).perform(); + compareScreen("dragMode" + dragMode); + new Actions(driver).release().perform(); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java b/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java index ce9067df29..a7fd9956e3 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/CaptionEnableDisable.java @@ -58,4 +58,4 @@ public class CaptionEnableDisable extends AbstractTestUI { return 12062; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java index 3296906762..d3932c1df0 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java b/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java index 46b2f0148c..6b17c557da 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/FormLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java new file mode 100644 index 0000000000..8ca88fbcd3 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefix.java @@ -0,0 +1,47 @@ +/* + * 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.formlayout; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.FormLayout; + +/** + * Test UI for FormLayout: custom additional styles should be prefixed with + * "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefix extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + FormLayout layout = new FormLayout(); + layout.addStyleName("mystyle"); + addComponent(layout); + } + + @Override + protected String getTestDescription() { + return "Form layout should set v-formlayout style name instead of v-layout"; + } + + @Override + protected Integer getTicketNumber() { + return 13509; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java new file mode 100644 index 0000000000..c43dc0042e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/formlayout/StylePrefixTest.java @@ -0,0 +1,40 @@ +/* + * 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.formlayout; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for FormLayout style prefix: custom additional styles should be prefixed + * with "v-formlayout-", not "v-layout-". + * + * @author Vaadin Ltd + */ +public class StylePrefixTest extends MultiBrowserTest { + + @Test + public void testStylePrefix() { + openTestURL(); + + Assert.assertTrue("Custom style has unexpected prefix", + isElementPresent(By.className("v-formlayout-mystyle"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java index ce405a8eff..3978c49b09 100644 --- a/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java +++ b/uitest/src/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java @@ -42,4 +42,4 @@ public class TableInFormLayoutCausesScrolling extends AbstractTestCase { protected Integer getTicketNumber() { return 7309; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java new file mode 100644 index 0000000000..9bc29b5c82 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPosition.java @@ -0,0 +1,78 @@ +/* + * 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.gridlayout; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.GridLayout; +import com.vaadin.ui.Label; +import com.vaadin.ui.Panel; + +public class GridLayoutScrollPosition extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + + Panel panel = new Panel(); + setContent(panel); + + GridLayout gridLayout = new GridLayout(); + gridLayout.setWidth("500px"); + panel.setContent(gridLayout); + gridLayout.setColumns(1); + gridLayout.setRows(1); + + Label dummyLabel = new Label("Dummy"); + dummyLabel.setHeight("500px"); + gridLayout.addComponent(dummyLabel); + + final CheckBox visibilityToggleCheckBox = new CheckBox( + "Hide / Show toggleable components"); + visibilityToggleCheckBox.setId("visibility-toggle"); + visibilityToggleCheckBox.setHeight("2000px"); + visibilityToggleCheckBox.setImmediate(true); + visibilityToggleCheckBox.setValue(false); // Initially unchecked + gridLayout.addComponent(visibilityToggleCheckBox); + + final Label toggleableLabel = new Label("Toggleable Label"); + toggleableLabel.setHeight("2000px"); + toggleableLabel.setVisible(false); // Initially hidden + gridLayout.addComponent(toggleableLabel); + + visibilityToggleCheckBox + .addValueChangeListener(new ValueChangeListener() { + @Override + public void valueChange(ValueChangeEvent event) { + toggleableLabel.setVisible(visibilityToggleCheckBox + .getValue()); + } + }); + + } + + @Override + protected String getTestDescription() { + return "The UI scroll position should not be reset when visibility of GridLayout children is toggled"; + } + + @Override + protected Integer getTicketNumber() { + return 13386; + } +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java new file mode 100644 index 0000000000..961b08002b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutScrollPositionTest.java @@ -0,0 +1,48 @@ +/* + * 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.gridlayout; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebDriver; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class GridLayoutScrollPositionTest extends MultiBrowserTest { + + @Test + public void testToggleChildComponents() throws Exception { + + final int SCROLLTOP = 100; + + openTestURL(); + + WebDriver driver = getDriver(); + + WebElement ui = driver.findElement(By.className("v-ui")); + + testBenchElement(ui).scroll(SCROLLTOP); + + driver.findElement(By.id("visibility-toggle")) + .findElement(By.tagName("input")).click(); + + assertEquals("UI scroll position", String.valueOf(SCROLLTOP), + ui.getAttribute("scrollTop")); + } +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java index 8312b15ba7..6cc96332d5 100644 --- a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java +++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutWithNonIntegerWidth.java @@ -50,4 +50,4 @@ public class GridLayoutWithNonIntegerWidth extends AbstractTestUI { protected Integer getTicketNumber() { return 11775; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java b/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java index dc04e23f02..0ec8cd5030 100644 --- a/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java +++ b/uitest/src/com/vaadin/tests/components/gridlayout/LayoutAfterHidingError.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index b99f67b82e..5a64cb6a00 100644 --- a/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/uitest/src/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java index 9d0094b833..b9071ec44c 100644 --- a/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java +++ b/uitest/src/com/vaadin/tests/components/javascriptcomponent/JavaScriptResizeListener.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java b/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java index efad615510..7314ce4093 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelModesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,4 +27,4 @@ public class LabelModesTest extends MultiBrowserTest { compareScreen("labelmodes"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java index c1965ff92b..876d56208b 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelPropertySourceValue.java @@ -55,4 +55,4 @@ public class LabelPropertySourceValue extends AbstractTestUI { return 9618; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/label/LabelStyles.java b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java index 7c26ec1a2e..6de50b0cba 100644 --- a/uitest/src/com/vaadin/tests/components/label/LabelStyles.java +++ b/uitest/src/com/vaadin/tests/components/label/LabelStyles.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/link/LinkTest.java b/uitest/src/com/vaadin/tests/components/link/LinkTest.java index b18e51ed4c..6deea0fd96 100644 --- a/uitest/src/com/vaadin/tests/components/link/LinkTest.java +++ b/uitest/src/com/vaadin/tests/components/link/LinkTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/media/AudioTest.java b/uitest/src/com/vaadin/tests/components/media/AudioTest.java index 28d1a7716f..c77583096d 100644 --- a/uitest/src/com/vaadin/tests/components/media/AudioTest.java +++ b/uitest/src/com/vaadin/tests/components/media/AudioTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/media/Media.java b/uitest/src/com/vaadin/tests/components/media/Media.java index bd038a5d42..5ccf9eb72b 100644 --- a/uitest/src/com/vaadin/tests/components/media/Media.java +++ b/uitest/src/com/vaadin/tests/components/media/Media.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java b/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java index 2ea7a23333..2613634576 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java +++ b/uitest/src/com/vaadin/tests/components/menubar/MenuBarFocus.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java index 338219d848..764844751c 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java +++ b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java index f10e1551df..3e0053d0d1 100644 --- a/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java +++ b/uitest/src/com/vaadin/tests/components/menubar/SpaceMenuBarNavigationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java index fdeed316ba..d1a889dcf4 100644 --- a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndText.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java index 2cb294de77..37987171d2 100644 --- a/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java +++ b/uitest/src/com/vaadin/tests/components/nativebutton/NativeButtonIconAndTextTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java b/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java index e038c451d0..eb838c135e 100644 --- a/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java +++ b/uitest/src/com/vaadin/tests/components/nativeselect/NativeSelectsAndChromeKeyboardNavigationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java index 4050e4505e..b770435161 100644 --- a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java +++ b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPosition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java index 9f31719a10..dc43b9d19a 100644 --- a/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java +++ b/uitest/src/com/vaadin/tests/components/notification/MiddleNotificationPositionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java index 27af49a397..ecf704835f 100644 --- a/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/notification/NotificationsWaiAria.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.notification; import com.vaadin.data.Item; import com.vaadin.server.Page; -import com.vaadin.shared.ui.ui.NotificationConfigurationBean.Role; +import com.vaadin.shared.ui.ui.NotificationRole; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; @@ -11,8 +11,10 @@ import com.vaadin.ui.ComboBox; import com.vaadin.ui.NativeSelect; import com.vaadin.ui.Notification; import com.vaadin.ui.Notification.Type; +import com.vaadin.ui.NotificationConfiguration; import com.vaadin.ui.TextArea; import com.vaadin.ui.TextField; +import com.vaadin.ui.UI; public class NotificationsWaiAria extends TestBase { @@ -36,9 +38,9 @@ public class NotificationsWaiAria extends TestBase { " - closes automatically after 10 seconds"); addComponent(postfix); - role = new NativeSelect("Role"); - role.addItem(Role.ALERT); - role.addItem(Role.STATUS); + role = new NativeSelect("NotificationRole"); + role.addItem(NotificationRole.ALERT); + role.addItem(NotificationRole.STATUS); role.setValue(role.getItemIds().iterator().next()); addComponent(role); @@ -96,9 +98,12 @@ public class NotificationsWaiAria extends TestBase { Notification n = new Notification(tf.getValue(), typeValue); n.setHtmlContentAllowed(true); - n.setAssistivePrefixForType(typeValue, prefix.getValue()); - n.setAssistivePostfixForType(typeValue, postfix.getValue()); - n.setAssistiveRoleForType(typeValue, (Role) role.getValue()); + NotificationConfiguration notificationConf = UI.getCurrent() + .getNotificationConfiguration(); + notificationConf.setAssistivePrefix(typeValue, prefix.getValue()); + notificationConf.setAssistivePostfix(typeValue, postfix.getValue()); + notificationConf + .setAssistiveRole(typeValue, (NotificationRole) role.getValue()); n.show(Page.getCurrent()); } diff --git a/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java b/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java index 570a300cb3..bad9723539 100644 --- a/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java +++ b/uitest/src/com/vaadin/tests/components/optiongroup/OptionGroupRetainFocusKeyboardValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java new file mode 100644 index 0000000000..76258e574e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroup.java @@ -0,0 +1,64 @@ +/* + * 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.optiongroup; + +import java.util.Collections; + +import com.vaadin.data.Property; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.CheckBox; +import com.vaadin.ui.OptionGroup; + +/** + * Test UI for unset read-only flag of Option group with new items allowed. + * + * @author Vaadin Ltd + */ +public class ReadOnlyOptionGroup extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final OptionGroup optionGroup = new OptionGroup("test field", + Collections.singletonList("Option")); + optionGroup.setNewItemsAllowed(true); + + final CheckBox readOnlyCheckbox = new CheckBox("read-only"); + readOnlyCheckbox.setImmediate(true); + readOnlyCheckbox + .addValueChangeListener(new Property.ValueChangeListener() { + @Override + public void valueChange(Property.ValueChangeEvent event) { + optionGroup.setReadOnly(readOnlyCheckbox.getValue()); + } + }); + readOnlyCheckbox.setValue(Boolean.TRUE); + + addComponent(optionGroup); + addComponent(readOnlyCheckbox); + } + + @Override + protected String getTestDescription() { + return "Unset read-only state for Option group should not throw an exception"; + } + + @Override + protected Integer getTicketNumber() { + return 11772; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java new file mode 100644 index 0000000000..dfafe8fb40 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/optiongroup/ReadOnlyOptionGroupTest.java @@ -0,0 +1,50 @@ +/* + * 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.optiongroup; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for Option group (with new items allowed): unset read only state. + * + * @author Vaadin Ltd + */ +public class ReadOnlyOptionGroupTest extends MultiBrowserTest { + + @Test + public void testOptionGroup() { + setDebug(true); + openTestURL(); + + WebElement checkbox = driver.findElement(By.className("v-checkbox")); + WebElement checkboxInput = checkbox.findElement(By.tagName("input")); + checkboxInput.click(); + + Assert.assertFalse("There is a client side exception after unset " + + "readonly mode for option group", + isElementPresent(By.className("v-Notification-error"))); + + Assert.assertFalse("Radio button in option group is still disabled " + + "after unset reaonly", + isElementPresent(By.className("v-radiobutton-disabled"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java index ba5701e699..4f7a939ee5 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/BoxLayoutTest.java @@ -480,4 +480,4 @@ public class BoxLayoutTest extends AbstractTestUI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java index 142ca00ba7..0fbd0e5f69 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/CaptionLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -26,6 +26,7 @@ public class CaptionLeakTest extends MultiBrowserTest { public void testCaptionLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); // this should be present // 3 general non-connector elements, none accumulated on click @@ -54,6 +55,7 @@ public class CaptionLeakTest extends MultiBrowserTest { public void testNoCaptionLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); getDriver().findElement(By.xpath("//button[@title = 'Clear log']")) .click(); 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/ErrorIndicator.java b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java index 9964e1ee78..89490bd167 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -54,6 +54,9 @@ public class ErrorIndicator extends AbstractTestUI { horizontalLayout.addComponent(inHorizontal); layout.addComponent(horizontalLayout); + getTooltipConfiguration().setOpenDelay(0); + getTooltipConfiguration().setQuickOpenDelay(0); + getTooltipConfiguration().setCloseTimeout(1000); } /* 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..e784eb3b64 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/ErrorIndicatorTest.java @@ -0,0 +1,52 @@ +/* + * 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 org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.HasInputDevices; +import org.openqa.selenium.interactions.Mouse; +import org.openqa.selenium.interactions.internal.Coordinates; +import org.openqa.selenium.internal.Locatable; + +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ErrorIndicatorTest extends MultiBrowserTest { + + @Test + public void verifyTooltips() { + String tooltipText; + openTestURL(); + + showTooltip($(TextFieldElement.class).first()); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Vertical layout tooltip"); + + showTooltip($(TextFieldElement.class).get(1)); + tooltipText = driver.findElement(By.className("v-tooltip")).getText(); + assertEquals(tooltipText, "Horizontal layout tooltip"); + } + + private void showTooltip(WebElement element) { + Coordinates elementCoordinates = ((Locatable) element).getCoordinates(); + Mouse mouse = ((HasInputDevices) getDriver()).getMouse(); + mouse.mouseMove(elementCoordinates); + } +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java index 24ebf24688..ea78d9f30c 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutFullsizeContentWithErrorMsgTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -46,4 +46,4 @@ public class HorizontalLayoutFullsizeContentWithErrorMsgTest extends } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java index fd6ecf5422..d9ab760302 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/HorizontalLayoutTest.java @@ -11,4 +11,4 @@ public class HorizontalLayoutTest extends return HorizontalLayout.class; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java b/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java index 99896fcd81..ae26706d35 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/InsertComponentInHorizontalLayout.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java index e9b022eac2..59e2b0936a 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHover.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java index 24a27f343a..1cddbc28c3 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedLayoutCaptionHoverTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java b/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java index a1ac1df307..59447919ef 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/RelativeChildrenWithoutExpand.java @@ -52,4 +52,4 @@ public class RelativeChildrenWithoutExpand extends AbstractTestUI { protected Integer getTicketNumber() { return Integer.valueOf(10222); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java index 3a24cb7620..565c11c1f0 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/SpacingLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -26,6 +26,7 @@ public class SpacingLeakTest extends MultiBrowserTest { public void testSpacingLeak() throws Exception { setDebug(true); openTestURL(); + openDebugLogTab(); getDriver().findElement(By.id("addbutton")).click(); getDriver().findElement(By.xpath("//button[@title = 'Clear log']")) .click(); diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java index fcc9792a7d..15f964f110 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VaadinTunesLayout.java @@ -344,4 +344,4 @@ public class VaadinTunesLayout extends AbstractTestUI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java index 1e7d817094..d55765b5e4 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChanges.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java index 14c26a0e17..1afcabec1d 100644 --- a/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java +++ b/uitest/src/com/vaadin/tests/components/orderedlayout/VerticalLayoutFocusWithDOMChangesTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/page/PageTitle.java b/uitest/src/com/vaadin/tests/components/page/PageTitle.java index 38dcd4673c..3979ede8c8 100644 --- a/uitest/src/com/vaadin/tests/components/page/PageTitle.java +++ b/uitest/src/com/vaadin/tests/components/page/PageTitle.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java b/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java index 039f52be73..bc2e6f7ca1 100644 --- a/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java +++ b/uitest/src/com/vaadin/tests/components/page/PageTitleTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java index 1b621e3a4f..3f953bf73a 100644 --- a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java +++ b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContents.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java index 5bc505dbc8..039b054040 100644 --- a/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java +++ b/uitest/src/com/vaadin/tests/components/panel/PanelChangeContentsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java b/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java index 8981f52f12..2c4bac03b0 100644 --- a/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java +++ b/uitest/src/com/vaadin/tests/components/panel/WebkitScrollbarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html deleted file mode 100644 index 28af578bac..0000000000 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.html +++ /dev/null @@ -1,32 +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="http://localhost:8888/" /> -<title>PopupViewAndFragment</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">PopupViewAndFragment</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/PopupViewAndFragment?restartApplication#</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runPopupViewAndFragment::/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java index 1606b78604..8178cfdbe2 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragment.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java new file mode 100644 index 0000000000..510cc7c883 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewAndFragmentTest.java @@ -0,0 +1,33 @@ +/* + * 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 org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PopupViewAndFragmentTest extends MultiBrowserTest { + + @Test + public void changeFragmentAndOpenPopupView() throws Exception { + openTestURL(); + $(ButtonElement.class).first().click(); + // Wait for popup view to fully open + sleep(1000); + compareScreen("changedFragment"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java index 8cb9f01d93..2bf587ba97 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaption.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java index 9c59e2ca6e..f9b1692b85 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewCaptionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 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..0c6f0abf3c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewResizeWhileOpenTest.java @@ -0,0 +1,66 @@ +/* + * 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 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(); + + // Sanity check + assertShadowSize(); + + // Resize + $(ButtonElement.class).first().click(); + assertShadowSize(); + } + + private void assertShadowSize() { + Dimension shadowSize = findElement(By.className("v-shadow")).getSize(); + Dimension layoutSize = $(VerticalLayoutElement.class).id("content-vl") + .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/popupview/PopupViewWithExtension.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtension.java new file mode 100644 index 0000000000..04bbf6df0a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtension.java @@ -0,0 +1,55 @@ +/* + * 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.popupview; + +import com.vaadin.server.Responsive; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Label; +import com.vaadin.ui.PopupView; + +/** + * Test UI for popup view with extension: extension is a part of getChildren() + * collection but is not inside the getChildComponents() collection. Popup view + * should use getChildComponents() to avoid exception when extension is returned + * by getChildren(). + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PopupViewWithExtension extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Label label = new Label("label"); + PopupView view = new PopupView("small", label); + + Responsive.makeResponsive(view); + + addComponent(view); + } + + @Override + protected String getTestDescription() { + return "PopupView should use getChildComponents() in the connector, not getChildren()"; + } + + @Override + protected Integer getTicketNumber() { + return 13503; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java new file mode 100644 index 0000000000..4d11190ea9 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/popupview/PopupViewWithExtensionTest.java @@ -0,0 +1,47 @@ +/* + * 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.popupview; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Popup view with extension should not throw an exception. + * + * @since 7.2 + * @author Vaadin Ltd + */ +public class PopupViewWithExtensionTest extends MultiBrowserTest { + + @Test + public void testPopupView() { + setDebug(true); + openTestURL(); + + WebElement view = driver.findElement(By.className("v-popupview")); + view.click(); + + Assert.assertFalse( + "Popup view with extension should not throw an exception. " + + "(Error notification window is shown).", + isElementPresent(By.className("v-Notification-error"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java b/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java index fd83fc797c..979bafc688 100644 --- a/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java +++ b/uitest/src/com/vaadin/tests/components/popupview/ReopenPopupView.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java index 5afa874220..ce51184e7d 100644 --- a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressBarTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java index 93e8c6d8f2..5b3a931e5b 100644 --- a/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java +++ b/uitest/src/com/vaadin/tests/components/progressindicator/ProgressIndicatorTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java b/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java index 0df82688d1..2f58e35dc7 100644 --- a/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java +++ b/uitest/src/com/vaadin/tests/components/select/OptionGroupBaseSelects.java @@ -103,4 +103,4 @@ public class OptionGroupBaseSelects extends ComponentTestCase<HorizontalLayout> select.setImmediate(true); return select; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java b/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java index de068ed230..458bfda6fa 100644 --- a/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java +++ b/uitest/src/com/vaadin/tests/components/select/SelectItemCaptionRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java b/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java index bd1d175119..a15e0d95ae 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderDisable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java index 923d0f46ab..12d26b8f8f 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderDisableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -62,4 +62,4 @@ public class SliderDisableTest extends MultiBrowserTest { return handle.getCssValue("margin-left"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java b/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java index 21b56b7972..89f834a42f 100644 --- a/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java +++ b/uitest/src/com/vaadin/tests/components/slider/SliderUpdateFromValueChange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java index a1d0fcb42b..67ac15ce81 100644 --- a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java +++ b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java @@ -33,4 +33,4 @@ public class SplitPanelInModalWindow extends TestBase { return 4067; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java b/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java index 80b136d2ab..741c5f6cec 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java +++ b/uitest/src/com/vaadin/tests/components/table/AddNonRenderedRow.java @@ -46,4 +46,4 @@ public class AddNonRenderedRow extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8077); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java index 104380c96c..2d8a30cb12 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java +++ b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRange.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java index f6a503db72..897511e41a 100644 --- a/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java +++ b/uitest/src/com/vaadin/tests/components/table/AddSelectionToRemovedRangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java new file mode 100644 index 0000000000..6f9f1df89f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdates.java @@ -0,0 +1,117 @@ +/* + * 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.annotations.Push; +import com.vaadin.data.util.IndexedContainer; +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 VScrollTable handles Push updates correctly. + * + * @author Vaadin Ltd + */ +@Push +public class AsyncPushUpdates extends AbstractTestUI { + + public int clickCount = 0; + + public static final String VALUE_PROPERTY_ID = "value"; + + private final IndexedContainer container = createContainer(); + private final Table table = new Table(); + + @Override + public void setup(VaadinRequest request) { + table.setWidth("100%"); + table.setContainerDataSource(container); + + Button button = new Button("START"); + button.addClickListener(new Button.ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + ++clickCount; + + container.removeAllItems(); + for (int i = 0; i < 100; i++) { + container.getContainerProperty(container.addItem(), + VALUE_PROPERTY_ID).setValue("A" + i); + } + + Runnable generateNewRows = new Runnable() { + public int id = 0; + + @Override + public void run() { + getSession().lock(); + try { + Thread.sleep(500); + ++id; + container.removeAllItems(); + for (int i = 0; i < 11; i++) { + container.getContainerProperty( + container.addItem(), VALUE_PROPERTY_ID) + .setValue( + clickCount + " - " + id + " - " + + i); + } + + } catch (InterruptedException e) { + // NOOP + } finally { + getSession().unlock(); + } + } + }; + new Thread(generateNewRows).start(); + } + }); + addComponent(table); + addComponent(button); + } + + private static IndexedContainer createContainer() { + IndexedContainer container = new IndexedContainer(); + container.addContainerProperty(VALUE_PROPERTY_ID, String.class, ""); + return container; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Make sure there are no duplicates on the table."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13562; + } + +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java new file mode 100644 index 0000000000..b33204cc44 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/AsyncPushUpdatesTest.java @@ -0,0 +1,46 @@ +/* + * 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.NoSuchElementException; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if VScrollTable handles Push updates correctly. + * + * @author Vaadin Ltd + */ +public class AsyncPushUpdatesTest extends MultiBrowserTest { + + @Test(expected = NoSuchElementException.class) + public void InsertedRowsAreNotDuplicated() { + openTestURL(); + + WebElement button = $(ButtonElement.class).first(); + + button.click(); + + $(TableElement.class).first().getCell(12, 0); + Assert.fail("Duplicates are present."); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChange.html b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChange.html deleted file mode 100644 index 7c2374f322..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChange.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>ContainerSizeChange</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">ContainerSizeChange</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.table.ContainerSizeChange</td> - <td></td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableContainerSizeChange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentstableContainerSizeChange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>scroll</td> - <td>vaadin=runcomvaadintestscomponentstableContainerSizeChange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> - <td>945</td> -</tr> -<tr> - <td>pause</td> - <td>300</td> - <td></td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>scroll</td> - <td>vaadin=runcomvaadintestscomponentstableContainerSizeChange::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]</td> - <td>525</td> -</tr> -<tr> - <td>pause</td> - <td>300</td> - <td></td> -</tr> -<tr> - <td>waitForVaadin</td> - <td></td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td></td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java index 0f385176bf..12f28332f4 100644 --- a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java +++ b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeDuringTablePaint.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java new file mode 100644 index 0000000000..041b23749c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/ContainerSizeChangeTest.java @@ -0,0 +1,62 @@ +package com.vaadin.tests.components.table; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.IOException; + +import junit.framework.Assert; + +import org.junit.Rule; +import org.junit.Test; +import org.junit.rules.ExpectedException; +import org.openqa.selenium.NoSuchElementException; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class ContainerSizeChangeTest extends MultiBrowserTest { + + @Rule + public ExpectedException thrown = ExpectedException.none(); + + @Test + public void tableShouldLoadCorrectItems() throws IOException, + InterruptedException { + openTestURL(); + + ButtonElement decreaseSize = $(ButtonElement.class).caption( + "Decrease size").first(); + decreaseSize.click(); // decreasing container size from 50 to 40 + decreaseSize.click(); // decreasing container size from 40 to 30 + + TableElement table = $(TableElement.class).first(); + // TableElement scroll not working properly, so we need to do this. + // http://dev.vaadin.com/ticket/13826 + testBenchElement(table.findElement(By.className("v-scrollable"))) + .scroll(1000); + + // waitforvaadin not worky currently for table scroll, so we need to use + // thread sleep :( + Thread.sleep(1500); + + assertThatRowExists(table, 29); + assertRowDoesNotExist(table, 30); + } + + private void assertThatRowExists(TableElement table, int rowIndex) { + assertThat(table.getCell(rowIndex, 0).getText(), + is(String.format("a %s", rowIndex))); + } + + private void assertRowDoesNotExist(TableElement table, int rowIndex) { + // This is a really crappy way to workaround JUnit's limitation to + // provide a proper assert.throws method... + thrown.expect(NoSuchElementException.class); + table.getCell(rowIndex, 0); + + Assert.fail(String.format("Row %s should not exists.", rowIndex)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java new file mode 100644 index 0000000000..255a798594 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/CtrlShiftMultiselectTest.java @@ -0,0 +1,80 @@ +/* + * 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.table; + +import java.io.IOException; +import java.util.List; + +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class CtrlShiftMultiselectTest extends MultiBrowserTest { + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + // Shift + click doesn't select all rows correctly on these browsers + browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + + return browsers; + } + + @Override + protected DesiredCapabilities getDesiredCapabilities() { + DesiredCapabilities cap = new DesiredCapabilities( + super.getDesiredCapabilities()); + cap.setCapability("requireWindowFocus", true); + return cap; + } + + @Test + public void testSelectionRangeDragging() throws IOException { + openTestURL(); + clickRow(3); + new Actions(driver).keyDown(Keys.SHIFT).perform(); + clickRow(8); + new Actions(driver).keyUp(Keys.SHIFT).perform(); + dragRows(5, 700, 0); + compareScreen("draggedMultipleRows"); + new Actions(driver).release().perform(); + } + + private void clickRow(int index) { + List<WebElement> rows = getAllRows(); + rows.get(index).click(); + } + + private void dragRows(int dragIdx, int xOffset, int yOffset) { + List<WebElement> rows = getAllRows(); + new Actions(driver).moveToElement(rows.get(dragIdx)).clickAndHold() + .moveByOffset(5, 0).perform(); + new Actions(driver).moveByOffset(xOffset - 5, yOffset).perform(); + + } + + private List<WebElement> getAllRows() { + WebElement table = vaadinElement("/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]"); + return table.findElements(By.cssSelector(".v-table-table tr")); + + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java b/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java new file mode 100644 index 0000000000..baac7ce057 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/DndEmptyTable.java @@ -0,0 +1,71 @@ +/* + * 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.event.dd.DragAndDropEvent; +import com.vaadin.event.dd.DropHandler; +import com.vaadin.event.dd.acceptcriteria.AcceptAll; +import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.DragAndDropWrapper; +import com.vaadin.ui.DragAndDropWrapper.DragStartMode; +import com.vaadin.ui.Label; +import com.vaadin.ui.Table; + +/** + * Test UI for empty table: empty table (without any data) throws client side + * exception if it's a target for DnD. + * + * @since + * @author Vaadin Ltd + */ +public class DndEmptyTable extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + Label source = new Label("label"); + DragAndDropWrapper wrapper = new DragAndDropWrapper(source); + wrapper.setDragStartMode(DragStartMode.WRAPPER); + addComponent(wrapper); + + Table target = new Table(); + target.setWidth(100, Unit.PERCENTAGE); + addComponent(target); + target.setDropHandler(new DropHandler() { + + @Override + public AcceptCriterion getAcceptCriterion() { + return AcceptAll.get(); + } + + @Override + public void drop(DragAndDropEvent event) { + } + }); + } + + @Override + protected String getTestDescription() { + return "Drag and drop into empty table should not throws client side exception."; + } + + @Override + protected Integer getTicketNumber() { + return 13655; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java new file mode 100644 index 0000000000..4c682637b1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/DndEmptyTableTest.java @@ -0,0 +1,49 @@ +/* + * 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 org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test for empty table as a DnD target: it should not throws client side + * exception. + * + * @since + * @author Vaadin Ltd + */ +public class DndEmptyTableTest extends MultiBrowserTest { + + @Test + public void testDndEmptyTable() { + setDebug(true); + openTestURL(); + + WebElement source = driver.findElement(By.className("v-ddwrapper")); + WebElement target = driver.findElement(By.className("v-table-body")); + Actions actions = new Actions(driver); + actions.clickAndHold(source).moveToElement(target).release(); + + Assert.assertFalse(isElementPresent(By + .className("v-Notification-error"))); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java b/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java index 5db294088a..fa8ab8f0f5 100644 --- a/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java +++ b/uitest/src/com/vaadin/tests/components/table/EditableModeChange.java @@ -97,4 +97,4 @@ public class EditableModeChange extends TestBase { protected Integer getTicketNumber() { return 5427; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java b/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java index b5c8aa0296..7686549709 100644 --- a/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java +++ b/uitest/src/com/vaadin/tests/components/table/EditableTableFocus.java @@ -32,4 +32,4 @@ public class EditableTableFocus extends TestBase { protected Integer getTicketNumber() { return 7965; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyTable.java b/uitest/src/com/vaadin/tests/components/table/EmptyTable.java index d6c30efa5a..ad9c70444d 100644 --- a/uitest/src/com/vaadin/tests/components/table/EmptyTable.java +++ b/uitest/src/com/vaadin/tests/components/table/EmptyTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java b/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java index 229dc23b9a..2332815ed6 100644 --- a/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java +++ b/uitest/src/com/vaadin/tests/components/table/EmptyTableTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,9 +17,8 @@ package com.vaadin.tests.components.table; import org.junit.Assert; import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; +import com.vaadin.testbench.elements.NotificationElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class EmptyTableTest extends MultiBrowserTest { @@ -33,12 +32,9 @@ public class EmptyTableTest extends MultiBrowserTest { } private void ensureNoErrors() { - try { - getDriver().findElement(By.className("v-Notification")); - } catch (NoSuchElementException e) { - return; + if (isElementPresent(NotificationElement.class)) { + Assert.fail("Error notification was shown!"); } - Assert.fail("Error notification was shown!"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java b/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java index 73dd7b1f81..1602f1bae5 100644 --- a/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java +++ b/uitest/src/com/vaadin/tests/components/table/ExpandingContainerVisibleRowRaceConditionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java b/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java index 174c166320..22d6846dea 100644 --- a/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java +++ b/uitest/src/com/vaadin/tests/components/table/FixedHeightTable.java @@ -36,4 +36,4 @@ public class FixedHeightTable extends TestBase { protected Integer getTicketNumber() { return 3814; } -}
\ No newline at end of file +} 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/components/table/HiddenComponentCells.java b/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java index 32046932cc..fa88325429 100644 --- a/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java +++ b/uitest/src/com/vaadin/tests/components/table/HiddenComponentCells.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java b/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java index b7379b4f2c..87ff6d9d7b 100644 --- a/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java +++ b/uitest/src/com/vaadin/tests/components/table/LastColumnNegative.java @@ -77,4 +77,4 @@ public class LastColumnNegative extends TestBase { return 8411; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java new file mode 100644 index 0000000000..e783951d86 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignment.java @@ -0,0 +1,90 @@ +/* + * 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.table; + +import com.vaadin.annotations.Theme; +import com.vaadin.data.util.BeanItemContainer; +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.Button.ClickListener; +import com.vaadin.ui.Table; +import com.vaadin.ui.Table.Align; + +/** + * Test UI for issue #13399 : Left alignment should not be set explicitly + * instead of relying on default behavior + * + * @author Vaadin Ltd + */ +@Theme("tests-table") +public class LeftColumnAlignment extends AbstractTestUI { + + @Override + protected void setup(VaadinRequest request) { + final Table table = new Table(); + + BeanItemContainer<Bean> container = new BeanItemContainer<Bean>( + Bean.class); + Bean bean = new Bean(); + bean.setName("property"); + container.addBean(bean); + table.setContainerDataSource(container); + + table.setFooterVisible(true); + + table.setWidth(100, Unit.PIXELS); + + table.setColumnAlignment("name", Align.RIGHT); + + addComponent(table); + + Button button = new Button("Align to Left"); + button.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + table.setColumnAlignment("name", Align.LEFT); + } + }); + addComponent(button); + } + + @Override + protected String getTestDescription() { + return "Left alignment should not be set explicitly instead of relying on default behavior"; + } + + @Override + protected Integer getTicketNumber() { + return 13399; + } + + public static class Bean { + private String name; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java new file mode 100644 index 0000000000..3d613fd726 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/LeftColumnAlignmentTest.java @@ -0,0 +1,58 @@ +/* + * 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.table; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.WebElement; + +import com.vaadin.testbench.By; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test class for issue #13399 : Left alignment should not be set explicitly + * instead of relying on default behavior + * + * @author Vaadin Ltd + */ +public class LeftColumnAlignmentTest extends MultiBrowserTest { + + @Test + public void testLeftColumnAlignment() throws Exception { + openTestURL(); + + // Do align columns to the left + WebElement webElement = driver.findElement(By.className("v-button")); + webElement.click(); + + Assert.assertTrue("Table caption is not aligned to the left", + isElementPresent(By + .className("v-table-caption-container-align-left"))); + + WebElement footer = driver.findElement(By + .className("v-table-footer-container")); + + Assert.assertEquals("Table footer is not aligned to the left", "left", + footer.getCssValue("text-align")); + + WebElement cell = driver.findElement(By + .className("v-table-cell-wrapper")); + + Assert.assertEquals("Table cell is not aligned to the left", "left", + cell.getCssValue("text-align")); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java b/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java index 12ae4a3c4d..9c063fd42e 100644 --- a/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java +++ b/uitest/src/com/vaadin/tests/components/table/MultiSelectWithRemovedRow.java @@ -90,4 +90,4 @@ public class MultiSelectWithRemovedRow extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8584); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java b/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java index 837af06d9e..808b05e233 100644 --- a/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java +++ b/uitest/src/com/vaadin/tests/components/table/OddEvenRowStyling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java b/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java index 3e233c69c2..809cb67226 100644 --- a/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java +++ b/uitest/src/com/vaadin/tests/components/table/RefreshRenderedCellsOnlyIfAttached.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java b/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java index 8f56965ddb..cb9dc57d09 100644 --- a/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java +++ b/uitest/src/com/vaadin/tests/components/table/RemoveItemOnClick.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java index 6007ea2984..6cc6a68a7d 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRows.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java index cf6a92c283..0fc09adf40 100644 --- a/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/SelectAllRowsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -47,10 +47,11 @@ public class SelectAllRowsTest extends MultiBrowserTest { @Override public List<DesiredCapabilities> getBrowsersToTest() { - // Pressing Shift modifier key does not work with Firefox + // Pressing Shift modifier key does not work with Firefox and PhantomJS ArrayList<DesiredCapabilities> browsers = new ArrayList<DesiredCapabilities>( super.getBrowsersToTest()); browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); return browsers; } diff --git a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html b/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html deleted file mode 100644 index 1e911699d1..0000000000 --- a/uitest/src/com/vaadin/tests/components/table/SelectionRangeDragging.html +++ /dev/null @@ -1,52 +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>New Test</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">New Test</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.table.CtrlShiftMultiselect?restartApplication</td> - <td></td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[5]/domChild[1]/domChild[0]</td> - <td>112,12</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[10]/domChild[1]/domChild[0]</td> - <td>82,16:shift</td> -</tr> -<tr> - <td>drag</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[1]/domChild[0]</td> - <td>87,1</td> -</tr> -<tr> - <td>mouseMoveAt</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>700,210</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>multiple-rows-dragged</td> -</tr> -<tr> - <td>drop</td> - <td>vaadin=runcomvaadintestscomponentstableCtrlShiftMultiselect::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[0]</td> - <td>700,210</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java index aebb494247..22e60406a6 100644 --- a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java +++ b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java @@ -53,4 +53,4 @@ public class SetCurrentPageFirstItemId extends TestBase { protected Integer getTicketNumber() { return 7607; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java index 574f1d1862..5e1c4cca66 100644 --- a/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java +++ b/uitest/src/com/vaadin/tests/components/table/SetCurrentPageFirstItemIndex.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java index ecd2e3e9df..0dc8584169 100644 --- a/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java +++ b/uitest/src/com/vaadin/tests/components/table/SortLabelsInTable.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java b/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java index 039b02e801..eb5beec6bd 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java +++ b/uitest/src/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java @@ -154,4 +154,4 @@ public class TableAndBrowserContextMenu extends TestBase implements public void handleAction(Action action, Object sender, Object target) { getMainWindow().showNotification("Action: " + action.getCaption()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java index a37cf48579..6fa86543cb 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java +++ b/uitest/src/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java @@ -85,4 +85,4 @@ public class TableClickValueChangeInteraction extends TestBase { result.addComponent(valueChangeLabel); return result; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java b/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java index fa10ab344c..ccf521c500 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java +++ b/uitest/src/com/vaadin/tests/components/table/TableExtraScrollbars.java @@ -58,4 +58,4 @@ public class TableExtraScrollbars extends AbstractTestCase { protected Integer getTicketNumber() { return 4489; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java index 95d5ea59d5..3f3255f525 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java +++ b/uitest/src/com/vaadin/tests/components/table/TableFirstRowFlicker.java @@ -85,4 +85,4 @@ public class TableFirstRowFlicker extends LegacyApplication { return cont; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java index 20170efa13..8f6e6c685f 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java +++ b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java index 5075e22f1b..30bddc2666 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableMoveFocusWithSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java b/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java index 55089ff56b..e56f686218 100644 --- a/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java +++ b/uitest/src/com/vaadin/tests/components/table/TablePageLengthCalculation.java @@ -47,4 +47,4 @@ public class TablePageLengthCalculation extends TestBase { protected Integer getTicketNumber() { return 4374; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java index ab0198f39c..c21a38a0ac 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java +++ b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCalls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java index 68c8dc9884..968b742aa9 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableRemovedQuicklySendsInvalidRpcCallsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java b/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java index bfbc4f82c1..7e75e8a32d 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollOnFocus.java @@ -47,4 +47,4 @@ public class TableScrollOnFocus extends TestBase { protected Integer getTicketNumber() { return 6774; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java new file mode 100644 index 0000000000..0e2e1b76e1 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelect.java @@ -0,0 +1,89 @@ +/* + * 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.table; + +import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Table; +import com.vaadin.ui.TextField; +import com.vaadin.ui.VerticalLayout; +import com.vaadin.ui.Window; + +/** + * Test to see if Table appears to scroll up under an obscure set of conditions + * (Scrolled down, set to expand, selecting updates a TextField that precedes + * the Table in a VerticalLayout.) (#10106) + * + * @author Vaadin Ltd + */ +public class TableScrollUpOnSelect extends AbstractTestUI { + public TextField text = null; + + @Override + protected void setup(VaadinRequest request) { + text = new TextField(); + text.setImmediate(true); + + final Table table = new Table(null); + table.addContainerProperty("value", Integer.class, 0); + for (int i = 0; i < 50; ++i) { + table.addItem(new Object[] { i }, i); + } + table.setSizeFull(); + table.setSelectable(true); + table.setImmediate(true); + table.setEditable(false); + + final VerticalLayout layout = new VerticalLayout(); + + table.addValueChangeListener(new ValueChangeListener() { + + @Override + public void valueChange(ValueChangeEvent event) { + if (table.getValue() != null) { + text.setValue(table.getValue().toString()); + } + } + + }); + + table.setCurrentPageFirstItemIndex(49); + + layout.setSizeFull(); + layout.addComponent(text); + layout.addComponent(table); + layout.setExpandRatio(table, 1.0f); + Window window = new Window(); + window.setHeight("600px"); + window.setWidth("400px"); + window.setModal(true); + window.setContent(layout); + getUI().addWindow(window); + } + + @Override + protected String getTestDescription() { + return "Table scrolls up when selecting a row"; + } + + @Override + protected Integer getTicketNumber() { + return 13358; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java new file mode 100644 index 0000000000..b2fde31b93 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollUpOnSelectTest.java @@ -0,0 +1,59 @@ +/* + * 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.WebDriver; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; + +import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Test to see if Table appears to scroll up under an obscure set of conditions + * (Scrolled down, set to expand, selecting updates a TextField that precedes + * the Table in a VerticalLayout.) (#10106) + * + * @author Vaadin Ltd + */ +public class TableScrollUpOnSelectTest extends MultiBrowserTest { + + @Test + public void TestThatSelectingDoesntScroll() { + openTestURL(); + + // WebElement table = driver.findElement(By.vaadin("//Table")); + WebElement row = $(TableElement.class).first().getCell(49, 0); + final WebElement scrollPositionDisplay = getDriver().findElement( + By.className("v-table-scrollposition")); + waitUntilNot(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return scrollPositionDisplay.isDisplayed(); + } + }, 10); + + int rowLocation = row.getLocation().getY(); + row.click(); + int newRowLocation = row.getLocation().getY(); + + Assert.assertTrue("Table has scrolled.", rowLocation == newRowLocation); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java index 764207ff13..61f8952041 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainer.java @@ -96,4 +96,4 @@ public class TableScrollingWithSQLContainer extends UI { e.printStackTrace(); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java index 97c780e0e8..01f75f7875 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableScrollingWithSQLContainerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java index f84f83718d..da37d1f2d2 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -66,4 +66,4 @@ public class TableSizeInTabsheet extends AbstractTestUI { return 12687; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java index 29fc5a2e52..a984ed81e5 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSizeInTabsheetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableSorting.java b/uitest/src/com/vaadin/tests/components/table/TableSorting.java index 6417e8e853..85819784c0 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSorting.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSorting.java @@ -65,4 +65,4 @@ public class TableSorting extends TestBase { protected Integer getTicketNumber() { return 4537; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java new file mode 100644 index 0000000000..93fe8d7d9e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicator.java @@ -0,0 +1,129 @@ +/* + * 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 java.util.Random; + +import com.vaadin.data.Container; +import com.vaadin.data.util.BeanItemContainer; +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.Button.ClickListener; +import com.vaadin.ui.Table; + +/** + * Test if the table sorting indicators update correctly when the table is + * sorted serverside + * + * @author Vaadin Ltd + */ +public class TableSortingIndicator 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("Test table", buildContainer()); + table.setSizeFull(); + addComponent(table); + Button sortButton = new Button("Sort", new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + table.sort(new Object[] { "val1" }, new boolean[] { false }); + } + }); + addComponent(sortButton); + } + + private Container buildContainer() { + BeanItemContainer<TestBean> container = new BeanItemContainer<TestBean>( + TestBean.class); + for (int i = 0; i < 100; ++i) { + TestBean item = new TestBean(); + item.setVal1(i); + item.setVal2(randomWord()); + item.setVal3(randomWord()); + container.addBean(item); + } + return container; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "The table should have visible sorting indicators."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 8978; + } + + public class TestBean { + private Integer val1; + private String val2; + private String val3; + + public Integer getVal1() { + return val1; + } + + public void setVal1(Integer val1) { + this.val1 = val1; + } + + public String getVal2() { + return val2; + } + + public void setVal2(String val2) { + this.val2 = val2; + } + + public String getVal3() { + return val3; + } + + public void setVal3(String val3) { + this.val3 = val3; + } + } + + private String randomWord() { + Random rng = new Random(); + char[] word = new char[3 + rng.nextInt(10)]; + for (int i = 0; i < word.length; ++i) { + word[i] = (char) ('a' + rng.nextInt(26)); + } + return new String(word); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java new file mode 100644 index 0000000000..8453f5d67f --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableSortingIndicatorTest.java @@ -0,0 +1,70 @@ +/* + * 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 com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TableElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests if the sort indicator is visible after the table has been sorted from + * the serverside. + * + * @author Vaadin Ltd + */ +public class TableSortingIndicatorTest extends MultiBrowserTest { + private static final String TABLE_HEADER_DESC_INDICATOR = "v-table-header-cell-desc"; + private static final String TABLE_HEADER_ASC_INDICATOR = "v-table-header-cell-asc"; + + @Test + public void testTableSortingIndicatorIsVisibleAfterServersideSort() { + openTestURL(); + + ButtonElement button = $(ButtonElement.class).caption("Sort").first(); + TableElement table = $(TableElement.class).first(); + + Assert.assertFalse("Descending indicator was prematurely visible", + getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR)); + Assert.assertFalse("Ascending indicator was prematurely visible", + getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR)); + + button.click(); + Assert.assertTrue("Indicator did not become visible", + getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR)); + Assert.assertFalse("Ascending sort indicator was wrongly visible", + getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR)); + + table.getHeaderCell(0).click(); + Assert.assertFalse("Table sort indicator didn't change", + getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR)); + Assert.assertTrue("Ascending sort indicator didn't become visible", + getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR)); + + button.click(); + Assert.assertTrue( + "Descending sort indicator didn't appear on the second serverside sort.", + getHeaderClasses(table).contains(TABLE_HEADER_DESC_INDICATOR)); + Assert.assertFalse("Ascending sort indicator didn't disappear", + getHeaderClasses(table).contains(TABLE_HEADER_ASC_INDICATOR)); + } + + private String getHeaderClasses(TableElement table) { + return table.getHeaderCell(0).getAttribute("class"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java index 5191b1b86e..0b40af94a2 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableSqlContainer.java @@ -139,4 +139,4 @@ public class TableSqlContainer extends AbstractTestUI { return 11224; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java b/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java index 22cdf7f312..f89d2d2934 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java +++ b/uitest/src/com/vaadin/tests/components/table/TableToggleVisibility.java @@ -168,4 +168,4 @@ public class TableToggleVisibility extends AbstractTestCase { return 6494; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java new file mode 100644 index 0000000000..79a85cd49b --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemove.java @@ -0,0 +1,92 @@ +/* + * 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.Button.ClickListener; +import com.vaadin.ui.Table; + +/** + * Test whether adding the first item to a table calculates the table width + * correctly + * + * @author Vaadin Ltd + */ +public class TableWidthItemRemove 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("My table"); + table.addContainerProperty("firstName", String.class, null); + table.addContainerProperty("lastName", String.class, null); + table.addContainerProperty("year", Integer.class, null); + table.setColumnWidth("firstName", 200); + table.setColumnWidth("lastName", 100); + table.setColumnWidth("year", 50); + + Button cleanButton = new Button("Clean"); + cleanButton.addClickListener(new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.removeAllItems(); + } + }); + addComponent(cleanButton); + + Button populateButton = new Button("Populate"); + populateButton.addClickListener(new ClickListener() { + @Override + public void buttonClick(ClickEvent event) { + table.addItem( + new Object[] { "John", "Doe", new Integer(1980) }, + Math.random() * 1000); + } + }); + addComponent(populateButton); + + addComponent(table); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "The table should retain the correct width on item remove and add."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return 13592; + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java new file mode 100644 index 0000000000..f96641be4c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWidthItemRemoveTest.java @@ -0,0 +1,46 @@ +/* + * 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.tests.tb3.MultiBrowserTest; + +/** + * Test whether adding the first item to a table calculates the table width + * correctly + * + * @author Vaadin Ltd + */ +public class TableWidthItemRemoveTest extends MultiBrowserTest { + @Test + public void testWidthResizeOnItemAdd() { + openTestURL(); + + WebElement populateButton = driver.findElement(By + .vaadin("//Button[caption=\"Populate\"]")); + WebElement table = driver.findElement(By + .vaadin("//Table[caption=\"My table\"]")); + int original_width = table.getSize().getWidth(); + populateButton.click(); + Assert.assertTrue("Width changed on item add.", original_width == table + .getSize().getWidth()); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java index efa1b1bdab..c571329d14 100644 --- a/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java +++ b/uitest/src/com/vaadin/tests/components/table/TableWithBrokenGeneratorAndContainer.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java b/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java new file mode 100644 index 0000000000..fdd5c2901a --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWithPolling.java @@ -0,0 +1,60 @@ +/* + * 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.table; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.ui.Table; + +public class TableWithPolling extends AbstractTestUI { + + @Override + protected String getTestDescription() { + return "Polling shouldn't affect table column resizing in any way."; + } + + @Override + protected Integer getTicketNumber() { + return 13432; + } + + @Override + protected void setup(VaadinRequest request) { + + Table table = new Table("This is my Table"); + + table.addContainerProperty("First Name", String.class, null); + table.addContainerProperty("Last Name", String.class, null); + table.addContainerProperty("Year", Integer.class, null); + + table.addItem(new Object[] { "Nicolaus", "Copernicus", + new Integer(1473) }, new Integer(1)); + table.addItem(new Object[] { "Tycho", "Brahe", new Integer(1546) }, + new Integer(2)); + table.addItem(new Object[] { "Giordano", "Bruno", new Integer(1548) }, + new Integer(3)); + table.addItem(new Object[] { "Galileo", "Galilei", new Integer(1564) }, + new Integer(4)); + table.addItem(new Object[] { "Johannes", "Kepler", new Integer(1571) }, + new Integer(5)); + table.addItem(new Object[] { "Isaac", "Newton", new Integer(1643) }, + new Integer(6)); + + addComponent(table); + + setPollInterval(1000); + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java b/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java new file mode 100644 index 0000000000..6aae1e27fc --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/table/TableWithPollingTest.java @@ -0,0 +1,65 @@ +/* + * 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.table; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TableWithPollingTest extends MultiBrowserTest { + + @Test + public void testColumnResizing() throws Exception { + openTestURL(); + + WebElement headerCell = driver.findElement(By + .xpath("(//td[contains(@class, 'v-table-header-cell')])[1]")); + WebElement bodyCell = driver.findElement(By + .xpath("(//td[contains(@class, 'v-table-cell-content')])[1]")); + WebElement resizer = driver.findElement(By + .xpath("(//div[contains(@class, 'v-table-resizer')])[1]")); + + final int offset = 50; + final int headerCellWidth = headerCell.getSize().width; + final int bodyCellWidth = bodyCell.getSize().width; + + new Actions(driver).clickAndHold(resizer).moveByOffset(offset, 0) + .perform(); + sleep(2000); + new Actions(driver).release().perform(); + + Assert.assertEquals(headerCellWidth + offset, + headerCell.getSize().width); + Assert.assertEquals(bodyCellWidth + offset, bodyCell.getSize().width); + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + // Selenium has issues with drag-and-drop on IE8 making it impossible to + // drag a target as small as the table resizer. So we'll just have to + // ignore IE8 completely. + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + browsers.remove(Browser.IE8.getDesiredCapabilities()); + return browsers; + } +} diff --git a/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java b/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java index c820dc08d5..60e7db5c0d 100644 --- a/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java +++ b/uitest/src/com/vaadin/tests/components/table/WideSelectableTable.java @@ -42,4 +42,4 @@ public class WideSelectableTable extends TestBase { protected Integer getTicketNumber() { return 6788; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java index dabc9c8e0b..cebb00c11b 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/EmptyTabSheetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -27,4 +27,4 @@ public class EmptyTabSheetTest extends MultiBrowserTest { compareScreen("empty"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java index 31a59aaed6..dd0d8fb44f 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/PreventTabChangeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -59,4 +59,4 @@ public class PreventTabChangeTest extends MultiBrowserTest { .vaadin("//TabSheet#tabpanel")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java b/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java index de250539ff..12da99b7f4 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/ScrollbarsInNestedTabsheets.java @@ -55,4 +55,4 @@ public class ScrollbarsInNestedTabsheets extends TestBase { return 8625; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java index 01bce334db..accd77ae0e 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidth.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java index f09a68d576..a30a155c01 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabBarWidthTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java index 02482b7049..c4af98eb3f 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltip.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -39,6 +39,9 @@ public class TabSheetErrorTooltip extends AbstractTestUI { t.setDescription("This tab has both an error and a description"); setContent(tabSheet); + getTooltipConfiguration().setOpenDelay(0); + getTooltipConfiguration().setQuickOpenDelay(0); + getTooltipConfiguration().setCloseTimeout(1000); } private Tab addTab() { diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java index f6ce33121c..5462ed2532 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetErrorTooltipTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,8 +24,11 @@ import org.junit.Assert; import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.HasInputDevices; +import org.openqa.selenium.interactions.Mouse; +import org.openqa.selenium.interactions.internal.Coordinates; +import org.openqa.selenium.internal.Locatable; -import com.vaadin.testbench.commands.TestBenchElementCommands; import com.vaadin.tests.tb3.MultiBrowserTest; public class TabSheetErrorTooltipTest extends MultiBrowserTest { @@ -63,8 +66,10 @@ public class TabSheetErrorTooltipTest extends MultiBrowserTest { } private void showTooltip(int index) { - TestBenchElementCommands element = testBenchElement(getTab(index)); - element.showTooltip(); + Coordinates elementCoordinates = ((Locatable) getTab(index)) + .getCoordinates(); + Mouse mouse = ((HasInputDevices) getDriver()).getMouse(); + mouse.mouseMove(elementCoordinates); } private WebElement getTab(int index) { diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java index 81648c1b52..12ae03080b 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusedTabTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,10 +18,13 @@ package com.vaadin.tests.components.tabsheet; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; +import java.util.List; + import org.junit.Test; import org.openqa.selenium.Keys; import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; import com.vaadin.testbench.By; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -29,6 +32,15 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class TabSheetFocusedTabTest extends MultiBrowserTest { @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + // PhantomJS doesn't send Focus / Blur events when clicking or + // navigating with keyboard + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); + return browsers; + } + + @Override protected Class<?> getUIClass() { return TabsheetScrolling.class; } @@ -41,7 +53,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest { assertTrue(isFocused(getTab(1))); - new Actions(getDriver()).sendKeys(Keys.RIGHT).perform(); + new Actions(getDriver()).sendKeys(Keys.ARROW_RIGHT).perform(); assertFalse(isFocused(getTab(1))); assertTrue(isFocused(getTab(3))); @@ -65,6 +77,7 @@ public class TabSheetFocusedTabTest extends MultiBrowserTest { } private boolean isFocused(WebElement tab) { + return tab.getAttribute("class").contains("v-tabsheet-tabitem-focus"); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java index b6b5431c1f..941073d617 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java index 77ddc94567..62948bed06 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetFocusingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java index c0b30ff68d..779ab6b614 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetHotKeysWithModifiers.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index ccdc4ecb38..c5e01969a1 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java @@ -46,7 +46,7 @@ public class TabSheetIcons extends TestBase { for (Component c : tab) { tabsheet.addTab(c); - tabsheet.getTab(c).setIconAltText( + tabsheet.getTab(c).setIconAlternateText( "iconalt" + tabsheet.getComponentCount()); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java index 54a5ed4857..c14203e765 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java @@ -49,4 +49,4 @@ public class TabSheetTabStyleNames extends TestBase { protected Integer getTicketNumber() { return 5880; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java index a2c75d6e79..5c76effefd 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java @@ -25,4 +25,4 @@ public class TabSheetTabTheming extends TestBase { protected Integer getTicketNumber() { return 6781; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java index ae5adea45e..42d65f66c9 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabSheetWithTabIds.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java index b55f1057b5..1da42bb1ce 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetScrollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,6 +22,7 @@ import org.openqa.selenium.WebElement; import org.openqa.selenium.interactions.Actions; import com.vaadin.testbench.By; +import com.vaadin.testbench.elements.ButtonElement; import com.vaadin.tests.tb3.MultiBrowserTest; public class TabsheetScrollingTest extends MultiBrowserTest { @@ -38,19 +39,11 @@ public class TabsheetScrollingTest extends MultiBrowserTest { } private WebElement getTab(int index) { - return getDriver().findElement( - By.vaadin("/VVerticalLayout[0]/Slot[1]" - + "/VVerticalLayout[0]/Slot[0]/VTabsheet[0]" - + "/domChild[0]/domChild[0]/domChild[0]" - + "/domChild[0]/domChild[" + index + "]")); - + return getDriver().findElement(By.vaadin("//TabSheet#tab[1]")); } private String getHideButtonText() { - WebElement buttonCaption = getDriver().findElement( - By.vaadin("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]" - + "/Slot[0]/VTabsheet[0]/VTabsheetPanel[0]" - + "/VButton[0]/domChild[0]/domChild[0]")); + ButtonElement buttonCaption = $(ButtonElement.class).first(); return buttonCaption.getText(); } diff --git a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java index 5271f467dc..bbbd4ca7e4 100644 --- a/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java +++ b/uitest/src/com/vaadin/tests/components/tabsheet/TabsheetShouldUpdateHeight.java @@ -57,4 +57,4 @@ public class TabsheetShouldUpdateHeight extends TestBase { protected Integer getTicketNumber() { return 9275; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java index 26716846fc..ac51b5fc87 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediate.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java index 4b522a1f37..4d750d183f 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java +++ b/uitest/src/com/vaadin/tests/components/textfield/AutomaticImmediateTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java index 18d8679c2f..c7e449c314 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java +++ b/uitest/src/com/vaadin/tests/components/textfield/BigDecimalTextField.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java b/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java index 58bc4c5383..24feab5cab 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java @@ -57,4 +57,4 @@ public class MultipleTextChangeEvents extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8035); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java index b38dd36284..531392b84a 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents.java @@ -126,4 +126,4 @@ public class TextChangeEvents extends TestBase { } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java index 538589808d..d64dbb42d6 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEvents2.java @@ -184,4 +184,4 @@ public class TextChangeEvents2 extends TestBase { return 2387; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java index 1a49729b6f..331c8d2efc 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java @@ -30,4 +30,4 @@ public class TextChangeEventsEternalLoop extends TestBase { return 6376; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java index 2a9df42ba1..c125d8da86 100644 --- a/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java +++ b/uitest/src/com/vaadin/tests/components/textfield/TextFieldTruncatesUnderscoresInModalDialogs.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java index 06b8af1ec6..f3e47d0996 100644 --- a/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java +++ b/uitest/src/com/vaadin/tests/components/tree/SimpleTree.java @@ -132,4 +132,4 @@ public class SimpleTree extends TestBase implements Action.Handler { public void handleAction(Action action, Object sender, Object target) { System.out.println("Action: " + action.getCaption()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java b/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java index 13edf9e37f..6df69c850b 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeFiltering.java @@ -131,4 +131,4 @@ public class TreeFiltering extends TestBase { return 4192; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java index 7182e3b4d1..bb7c0350f2 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java b/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java index 76ab1b3fdb..b8715ed505 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeScrollingOnRightClickTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java b/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java index 99618c0e5d..a1576ffed1 100644 --- a/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java +++ b/uitest/src/com/vaadin/tests/components/tree/TreeWithIcons.java @@ -66,4 +66,4 @@ public class TreeWithIcons extends TestBase { return 3529; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java b/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java index f6b32aa4a9..d048f0a4f4 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java +++ b/uitest/src/com/vaadin/tests/components/treetable/AddNodesOnExpand.java @@ -55,4 +55,4 @@ public class AddNodesOnExpand extends TestBase { protected Integer getTicketNumber() { return Integer.valueOf(8041); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java index 4cf17aef48..3d40bc47cf 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java +++ b/uitest/src/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java @@ -90,4 +90,4 @@ public class ChangeDataSourcePageLengthZero extends TestBase { protected Integer getTicketNumber() { return 7908; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java b/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java index 6dc5417d28..e089237b54 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java +++ b/uitest/src/com/vaadin/tests/components/treetable/DynamicallyModified.java @@ -124,4 +124,4 @@ public class DynamicallyModified extends TestBase implements } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java b/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java index d34522073d..4372341161 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java +++ b/uitest/src/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java index 85a69702a4..de33d26051 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java @@ -257,4 +257,4 @@ public class TreeTableCacheOnPartialUpdates extends TestBase { // TODO Auto-generated method stub return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java b/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java index 3ed5da1833..7f4aa7f671 100644 --- a/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java +++ b/uitest/src/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java index f27ef5d789..4bab0e5237 100644 --- a/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentIncludedInCustomWidgetsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java index ec8add75e0..429bcc0afc 100644 --- a/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/ComponentMissingFromDefaultWidgetsetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java b/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java index b0127e3a75..cba2adb5db 100644 --- a/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java +++ b/uitest/src/com/vaadin/tests/components/ui/CurrentUiRetained.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java b/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java index 3542806a92..a960e9cc46 100644 --- a/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java +++ b/uitest/src/com/vaadin/tests/components/ui/CustomUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java b/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java index 8f3e08335f..007a49e0e2 100644 --- a/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/MultiFileUploadTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java index 0e5ddaab87..c5861147a5 100644 --- a/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/PollListenerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java b/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java index 96c02a2460..40ec51cf1f 100644 --- a/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java +++ b/uitest/src/com/vaadin/tests/components/ui/RpcInvocationHandlerToString.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java new file mode 100644 index 0000000000..0d38de5923 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagation.java @@ -0,0 +1,107 @@ +/* + * 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.ui; + +import com.vaadin.event.ShortcutAction.KeyCode; +import com.vaadin.event.ShortcutAction.ModifierKey; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.FormLayout; +import com.vaadin.ui.TextArea; +import com.vaadin.ui.TextField; + +/** + * UI test for TextArea behavior when ENTER has been assigned as a keyboard + * shortcut. + * + * @author Vaadin Ltd + */ +public class TextAreaEventPropagation extends AbstractTestUIWithLog { + + @Override + protected void setup(VaadinRequest request) { + + FormLayout form = new FormLayout(); + TextArea textArea = new TextArea("Text input"); + TextField textField = new TextField("Text field input"); + + Button enterButton = new Button("Enter"); + enterButton.setClickShortcut(KeyCode.ENTER); + enterButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + + log("Enter button pressed"); + } + }); + + Button shiftEnterButton = new Button("Shift-Enter"); + shiftEnterButton.setClickShortcut(KeyCode.ENTER, ModifierKey.SHIFT); + shiftEnterButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + + log("Shift-Enter button pressed"); + } + }); + + Button ctrlEnterButton = new Button("Ctrl-Enter"); + ctrlEnterButton.setClickShortcut(KeyCode.ENTER, ModifierKey.CTRL); + ctrlEnterButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + + log("Ctrl-Enter button pressed"); + } + }); + + Button escapeButton = new Button("Escape"); + escapeButton.setClickShortcut(KeyCode.ESCAPE); + escapeButton.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + log("Escape button pressed"); + } + }); + + form.addComponent(textArea); + form.addComponent(textField); + form.addComponent(enterButton); + form.addComponent(escapeButton); + form.addComponent(shiftEnterButton); + form.addComponent(ctrlEnterButton); + addComponent(form); + + } + + @Override + protected String getTestDescription() { + return "Enter as s shortcut in a TextArea should not trigger shortcuts as enter is handled internally. Enter + modifier key should trigger shortcut."; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(12424); + } + +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationModifierKeysTest.java b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationModifierKeysTest.java new file mode 100644 index 0000000000..fca312ba7e --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationModifierKeysTest.java @@ -0,0 +1,87 @@ +/* + * 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.ui; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; +import org.openqa.selenium.remote.DesiredCapabilities; + +import com.vaadin.testbench.elements.TextAreaElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class TextAreaEventPropagationModifierKeysTest extends MultiBrowserTest { + @Test + public void textAreaShiftEnterEventPropagation() + throws InterruptedException { + openTestURL(); + + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.keyDown(Keys.SHIFT); + builder.sendKeys(Keys.ENTER); + builder.keyUp(Keys.SHIFT); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + // Should have triggered shortcut + Assert.assertEquals("1. Shift-Enter button pressed", getLogRow(0)); + } + + @Test + public void textAreaCtrlEnterEventPropagation() throws InterruptedException { + openTestURL(); + + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.keyDown(Keys.CONTROL); + builder.sendKeys(Keys.ENTER); + builder.keyUp(Keys.CONTROL); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + // Should have triggered shortcut + Assert.assertEquals("1. Ctrl-Enter button pressed", getLogRow(0)); + } + + @Override + public List<DesiredCapabilities> getBrowsersToTest() { + List<DesiredCapabilities> browsers = super.getBrowsersToTest(); + // Can't handle ctrl + browsers.remove(Browser.IE8.getDesiredCapabilities()); + browsers.remove(Browser.FIREFOX.getDesiredCapabilities()); + + // Can't handle shift or ctrl + browsers.remove(Browser.IE9.getDesiredCapabilities()); + browsers.remove(Browser.IE10.getDesiredCapabilities()); + browsers.remove(Browser.IE11.getDesiredCapabilities()); + return browsers; + + } + + @Override + protected Class<?> getUIClass() { + return TextAreaEventPropagation.class; + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java new file mode 100644 index 0000000000..5de903e8d4 --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/TextAreaEventPropagationTest.java @@ -0,0 +1,97 @@ +/* + * 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.ui; + +import static org.junit.Assert.assertEquals; + +import org.junit.Test; +import org.openqa.selenium.Keys; +import org.openqa.selenium.WebElement; +import org.openqa.selenium.interactions.Actions; + +import com.vaadin.testbench.elements.TextAreaElement; +import com.vaadin.testbench.elements.TextFieldElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +/** + * Tests that the TextArea widget correctly stops ENTER events from propagating. + * + * @author Vaadin Ltd + */ +public class TextAreaEventPropagationTest extends MultiBrowserTest { + + @Test + public void textAreaEnterEventPropagation() throws InterruptedException { + openTestURL(); + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.sendKeys(Keys.ENTER); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + // Should not have triggered shortcut + assertEquals(" ", getLogRow(0)); + } + + @Test + public void testTextAreaEscapeEventPropagation() + throws InterruptedException { + openTestURL(); + WebElement textArea = $(TextAreaElement.class).first(); + Actions builder = new Actions(driver); + builder.click(textArea); + builder.sendKeys(textArea, "first line asdf"); + builder.sendKeys(Keys.ESCAPE); + builder.sendKeys(textArea, "second line jkl;"); + builder.perform(); + + assertEquals("1. Escape button pressed", getLogRow(0)); + } + + @Test + public void testTextFieldEscapeEventPropagation() { + openTestURL(); + WebElement textField = $(TextFieldElement.class).first(); + Actions builder2 = new Actions(driver); + builder2.click(textField); + + builder2.sendKeys("third line"); + builder2.sendKeys(Keys.ENTER); + builder2.sendKeys(Keys.ESCAPE); + + builder2.perform(); + + assertEquals("1. Enter button pressed", getLogRow(1)); + assertEquals("2. Escape button pressed", getLogRow(0)); + } + + @Test + public void testTextFieldEnterEventPropagation() { + openTestURL(); + WebElement textField = $(TextFieldElement.class).first(); + Actions builder2 = new Actions(driver); + builder2.click(textField); + + builder2.sendKeys("third line"); + builder2.sendKeys(Keys.ENTER); + + builder2.perform(); + + assertEquals("1. Enter button pressed", getLogRow(0)); + } +} diff --git a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java index 2c649c9ca8..cb62ccdb19 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java +++ b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivity.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -23,22 +23,50 @@ 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.Label; public class TimeoutRedirectResetsOnActivity extends AbstractTestUI { + private int maxActiveInterval = 15; + private int timeoutOverhead = 15; + @Override protected void setup(VaadinRequest request) { - setupTimout(request); + setupTimeout(request); + + Label startedLabel = new Label(); + startedLabel.setValue(String.valueOf(System.currentTimeMillis())); + startedLabel.setId("startedTime"); + + Label originalLabel = new Label(); + originalLabel.setId("originalExpireTime"); + originalLabel.setValue(String.valueOf(getExpireTime())); - addComponent(new Button("clicky", new Button.ClickListener() { + final Label expiresLabel = new Label(); + expiresLabel.setId("actualExpireTime"); + + Button button = new Button("Reset", new Button.ClickListener() { @Override public void buttonClick(ClickEvent event) { - // NOOP + expiresLabel.setValue(String.valueOf(getExpireTime())); } - })); + + }); + button.setId("reset"); + + addComponent(button); + + addComponent(startedLabel); + addComponent(originalLabel); + addComponent(expiresLabel); + } + + private long getExpireTime() { + return System.currentTimeMillis() + + (maxActiveInterval + timeoutOverhead) * 1000; } - private void setupTimout(VaadinRequest request) { + private void setupTimeout(VaadinRequest request) { request.getService().setSystemMessagesProvider( new SystemMessagesProvider() { @Override @@ -57,7 +85,7 @@ public class TimeoutRedirectResetsOnActivity extends AbstractTestUI { * implementation details in * com.vaadin.server.communication.MetadataWriter */ - getSession().getSession().setMaxInactiveInterval(10); + getSession().getSession().setMaxInactiveInterval(maxActiveInterval); } @Override diff --git a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java index 272bacb8d5..b5440b8f76 100644 --- a/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/TimeoutRedirectResetsOnActivityTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,71 +15,64 @@ */ package com.vaadin.tests.components.ui; -import static org.junit.Assert.assertTrue; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.CoreMatchers.not; +import static org.hamcrest.MatcherAssert.assertThat; +import org.junit.Ignore; +import org.junit.Rule; import org.junit.Test; -import org.openqa.selenium.By; -import org.openqa.selenium.NoSuchElementException; import org.openqa.selenium.WebElement; import com.vaadin.tests.tb3.MultiBrowserTest; +import com.vaadin.tests.tb3.RetryOnFail; public class TimeoutRedirectResetsOnActivityTest extends MultiBrowserTest { + + @Rule + // Timing issues are really hard to resolve in a way that this test would be + // 100% reliable on all browsers. Hence we shall allow one retry. + public RetryOnFail retry = new RetryOnFail(); + + private int waitBeforeActivity = 4000; + private int communicationOverhead = 2000; + + private static int i = 0; + @Test + @Ignore("The test modifies the system messages, which are global and the changes will affect other tests") public void verifyRedirectWorks() throws Exception { setDebug(true); openTestURL(); - long startTime = System.currentTimeMillis(); - while (System.currentTimeMillis() - startTime < 30000) { - clickTheButton(); - Thread.sleep(1000); - } + long startedTime = getTime("startedTime"); + long originalExpireTime = getTime("originalExpireTime"); - assertTrue("button disappeared before timeout", buttonIsStillThere()); + Thread.sleep(waitBeforeActivity); + hitButton("reset"); - Thread.sleep(30000); - assertTrue("no redirection occurred within 30 seconds", - !buttonIsStillThere()); - } + Thread.sleep(200); - private boolean buttonIsStillThere() { - try { - return getButton() != null; - } catch (NoSuchElementException e) { - return false; - } - } + long actualExpireTime = getTime("actualExpireTime"); + + Thread.sleep(originalExpireTime - startedTime - waitBeforeActivity); + + assertThat(driver.getCurrentUrl(), is(getTestUrl())); + + testBench().disableWaitForVaadin(); + Thread.sleep(actualExpireTime - originalExpireTime + + communicationOverhead); - private void clickTheButton() { - getButton().click(); + assertThat(driver.getCurrentUrl(), is(not(getTestUrl()))); } - private WebElement getButton() { - /* - * For some reason, the vaadinElement() method doesn't work when tests - * are run outside of "/run/" and "/run-push/" contexts. The given error - * message says that the generated Vaadin path doesn't match any - * elements, but when that selector is put into the recorder, the - * recorder finds it. - * - * XPath works fine. - */ - /*- - return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]"); - */ - return getDriver().findElement( - By.xpath("//div[contains(@class,'v-button')]")); + private long getTime(String id) { + WebElement element = vaadinElementById(id); + return Long.parseLong(element.getText()); } @Override - protected String getDeploymentPath() { - /* - * AbstractTB3Test assumes only /run/ and /run-push/ contexts, so this - * method needs some overriding. - */ - return "/12446/" - + TimeoutRedirectResetsOnActivity.class.getCanonicalName() - + "?restartApplication&debug"; + protected String getTestUrl() { + return super.getTestUrl() + "?restartApplication"; } } diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccess.java b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java index d036827159..648e3aff8b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccess.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccess.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java b/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java index 1cd4be576b..7fb5f9cd9d 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccessExceptionHandling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java index 9db2c2f0d3..39d6c12bfc 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIAccessTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -201,4 +201,4 @@ public class UIAccessTest extends MultiBrowserTest { private WebElement getCurrentInstanceWhenPushingButton() { return vaadinElement("/VVerticalLayout[0]/Slot[2]/VVerticalLayout[0]/Slot[7]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java b/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java index dc88865621..7d5bbe156b 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIInitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/UIPolling.java b/uitest/src/com/vaadin/tests/components/ui/UIPolling.java index 48671191ca..7d9f09892c 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIPolling.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/ui/UIReinit.java b/uitest/src/com/vaadin/tests/components/ui/UIRefresh.java index bef7a5a6d1..9fcc1eedde 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIReinit.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIRefresh.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,7 +22,7 @@ import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; @PreserveOnRefresh -public class UIReinit extends AbstractTestUI { +public class UIRefresh extends AbstractTestUI { public static final String REINIT_ID = "reinit"; @@ -31,7 +31,7 @@ public class UIReinit extends AbstractTestUI { } @Override - protected void reinit(VaadinRequest request) { + protected void refresh(VaadinRequest request) { Label l = new Label("Reinit!"); l.setId(REINIT_ID); addComponent(l); diff --git a/uitest/src/com/vaadin/tests/components/ui/UIReinitTest.java b/uitest/src/com/vaadin/tests/components/ui/UIRefreshTest.java index 82132d3c65..7d701f4ae0 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UIReinitTest.java +++ b/uitest/src/com/vaadin/tests/components/ui/UIRefreshTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -22,18 +22,18 @@ import org.junit.Test; import com.vaadin.testbench.By; import com.vaadin.tests.tb3.MultiBrowserTest; -public class UIReinitTest extends MultiBrowserTest { +public class UIRefreshTest extends MultiBrowserTest { @Test - public void testUIReinit() { + public void testUIRefresh() { openTestURL(); Assert.assertFalse(reinitLabelExists()); - // Reload the page; UI.reinit should be invoked + // Reload the page; UI.refresh should be invoked openTestURL(); Assert.assertTrue(reinitLabelExists()); } private boolean reinitLabelExists() { - return !getDriver().findElements(By.id(UIReinit.REINIT_ID)).isEmpty(); + return !getDriver().findElements(By.id(UIRefresh.REINIT_ID)).isEmpty(); } } diff --git a/uitest/src/com/vaadin/tests/components/ui/UISerialization.java b/uitest/src/com/vaadin/tests/components/ui/UISerialization.java index 90021a0bf4..cbd317b027 100644 --- a/uitest/src/com/vaadin/tests/components/ui/UISerialization.java +++ b/uitest/src/com/vaadin/tests/components/ui/UISerialization.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java index c304293170..ecde5760c9 100644 --- a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java +++ b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelection.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java index 1b30c4080a..30dbefc06b 100644 --- a/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/upload/UploadNoSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java index b568b4d46a..849d756ca9 100644 --- a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java +++ b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpened.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java index 8104640987..f59c4bd762 100644 --- a/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java +++ b/uitest/src/com/vaadin/tests/components/window/BackspaceKeyWithModalOpenedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java new file mode 100644 index 0000000000..4e07c591ae --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindow.java @@ -0,0 +1,135 @@ +/* + * 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.window; + +import com.vaadin.data.Item; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUIWithLog; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.HorizontalLayout; +import com.vaadin.ui.TreeTable; +import com.vaadin.ui.UI; +import com.vaadin.ui.Window; + +@SuppressWarnings("serial") +public class CloseModalSubWindow extends AbstractTestUIWithLog { + + public static final String SUB_WINDOW = "sub-win"; + public static final String TREE_TABLE = "treetable"; + public static final String DELETE_BUTTON = "del-btn"; + public static final String CONFIRM_BUTTON = "confirm-btn"; + + private ConfirmWindow win; + + private TreeTable table; + + @Override + protected String getTestDescription() { + return "Lists a dozen items in a TreeTable with a Delete Button in each row. " + + "Delete button will open an sub-window allowing user to either confirm delete operation or cancel. " + + "Confirming should close the sub-window at the same time as the item is removed from the TreeTable."; + } + + @Override + protected Integer getTicketNumber() { + return 13188; + } + + @SuppressWarnings("unchecked") + @Override + protected void setup(VaadinRequest request) { + table = new TreeTable(); + table.setId(TREE_TABLE); + table.addContainerProperty("column", String.class, null); + table.addContainerProperty("delete", Button.class, null); + + for (int i = 0; i < 10; i++) { + Item item = table.addItem(i); + item.getItemProperty("column").setValue("" + i); + + Button b = new Button("Delete", deleteClickListener); + b.setId(DELETE_BUTTON + i); + b.setData(i); + item.getItemProperty("delete").setValue(b); + } + + table.setSortEnabled(false); + table.setColumnReorderingAllowed(false); + table.setEditable(true); + table.setPageLength(0); + + addComponent(table); + + } + + private void deleteItem(Object itemId) { + table.removeItem(itemId); + } + + private ClickListener deleteClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + win = new ConfirmWindow(event.getButton().getData()); + log("Modal sub-window opened"); + } + }; + + private ClickListener confirmClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + deleteItem(event.getButton().getData()); + win.close(); + log("Modal sub-window closed"); + } + }; + + private ClickListener cancelClickListener = new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + win.close(); + log("Modal sub-window closed"); + } + }; + + /** Modal confirmation sub-window. */ + class ConfirmWindow extends Window { + + public ConfirmWindow(Object itemId) { + setModal(true); + setWidth("300px"); + setHeight("200px"); + setId(SUB_WINDOW); + + Button ok = new Button("Confirm Delete", confirmClickListener); + ok.setId(CONFIRM_BUTTON); + ok.setData(itemId); + Button cancel = new Button("Cancel", cancelClickListener); + + HorizontalLayout l = new HorizontalLayout(); + l.addComponent(ok); + l.addComponent(cancel); + + setContent(l); + + UI.getCurrent().addWindow(this); + } + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java new file mode 100644 index 0000000000..aec0a7c9df --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/CloseModalSubWindowTest.java @@ -0,0 +1,75 @@ +/* + * 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.window; + +import java.util.List; + +import org.junit.Assert; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class CloseModalSubWindowTest extends MultiBrowserTest { + + @Test + public void testCloseModalSubWindow() throws Exception { + + openTestURL(); + + // assert that there's a button with a 'del-btn0' id + List<WebElement> buttons = getDriver().findElements( + By.id(CloseModalSubWindow.DELETE_BUTTON + "0")); + int deleteButtonCount = buttons.size(); + Assert.assertEquals(1, deleteButtonCount); + + // assert that there's no sub-windows open + List<WebElement> subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(0, subWindows.size()); + + // click the first delete button + getFirstDeteleButton(0).click(); + + // assert that there's ONE sub-window open + subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(1, subWindows.size()); + + WebElement confirm = getDriver().findElement( + By.id(CloseModalSubWindow.CONFIRM_BUTTON)); + + // click the confirm button in the sub-window + confirm.click(); + + // assert that there's no sub-windows open + subWindows = getDriver().findElements( + By.id(CloseModalSubWindow.SUB_WINDOW)); + Assert.assertEquals(0, subWindows.size()); + + // assert that there's no button with 'del-btn0' id anymore + buttons = getDriver().findElements( + By.id(CloseModalSubWindow.DELETE_BUTTON + "0")); + Assert.assertEquals(0, buttons.size()); + } + + private WebElement getFirstDeteleButton(int index) { + WebElement button = getDriver().findElement( + By.id(CloseModalSubWindow.DELETE_BUTTON + index)); + return button; + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java index 6347ff9a76..b952df0ed9 100644 --- a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java +++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java index 665e175f2c..e65a24e907 100644 --- a/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java +++ b/uitest/src/com/vaadin/tests/components/window/ComboboxScrollableWindowTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java index 39989926e7..c7379f666b 100644 --- a/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java +++ b/uitest/src/com/vaadin/tests/components/window/ExtraWindowShownWaiAria.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.window; import com.vaadin.server.ThemeResource; import com.vaadin.server.VaadinRequest; -import com.vaadin.shared.ui.window.WindowState.WindowRole; +import com.vaadin.shared.ui.window.WindowRole; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java b/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java index 2c6d3c942f..3713facaf0 100644 --- a/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java +++ b/uitest/src/com/vaadin/tests/components/window/ModalWindowNativeSelect.java @@ -29,4 +29,4 @@ public class ModalWindowNativeSelect extends TestBase { return 4261; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTop.java b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java index 4fd748183a..a5a4eb6df3 100644 --- a/uitest/src/com/vaadin/tests/components/window/MoveToTop.java +++ b/uitest/src/com/vaadin/tests/components/window/MoveToTop.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java index 26d7a06531..1700100ae7 100644 --- a/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java +++ b/uitest/src/com/vaadin/tests/components/window/MoveToTopTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java b/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java index 5a0e4d1370..99aa15b47d 100644 --- a/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java +++ b/uitest/src/com/vaadin/tests/components/window/RepaintWindowContents.java @@ -55,4 +55,4 @@ public class RepaintWindowContents extends AbstractTestUI { return 8832; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java index 2f1c0ff685..403795b676 100644 --- a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java +++ b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpened.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java index b6474519b0..9a3ccb3b31 100644 --- a/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java +++ b/uitest/src/com/vaadin/tests/components/window/ScrollingBodyElementWithModalOpenedTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html deleted file mode 100644 index 2c3f651e41..0000000000 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.html +++ /dev/null @@ -1,52 +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>SubWindowWithUndefinedHeight</title> -</head> -<body> -<table cellpadding="1" cellspacing="1" border="1"> -<thead> -<tr><td rowspan="1" colspan="3">SubWindowWithUndefinedHeight</td></tr> -</thead><tbody> -<tr> - <td>open</td> - <td>/run/com.vaadin.tests.components.window.SubWindowWithUndefinedHeight?restartApplication</td> - <td></td> -</tr> -<tr> - <td>click</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]</td> - <td></td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>initial-tab1</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]</td> - <td>17,13</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>select-tab2</td> -</tr> -<tr> - <td>mouseClick</td> - <td>vaadin=runcomvaadintestscomponentswindowSubWindowWithUndefinedHeight::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td> - <td>8,9</td> -</tr> -<tr> - <td>screenCapture</td> - <td></td> - <td>select-tab1</td> -</tr> - -</tbody></table> -</body> -</html> diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.java b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.java new file mode 100644 index 0000000000..ec86f62a7c --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowWithUndefinedHeightTest.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.window; + +import java.io.IOException; + +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.testbench.elements.TabSheetElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class SubWindowWithUndefinedHeightTest extends MultiBrowserTest { + + @Test + public void testUndefinedWindowSizeUpdate() throws IOException { + openTestURL(); + + $(ButtonElement.class).caption("click me").first().click(); + compareScreen("initial-tab1"); + + $(TabSheetElement.class).first().openTab("tab 2"); + compareScreen("select-tab2"); + + $(TabSheetElement.class).first().openTab("Tab 1"); + compareScreen("select-tab1"); + } +} diff --git a/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java b/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java index 2e0873956c..335590437d 100644 --- a/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java +++ b/uitest/src/com/vaadin/tests/components/window/SubWindowsTextSelectionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java index 02ec0c047b..cd2cc7d060 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindow.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -41,6 +41,9 @@ public class TooltipInWindow extends AbstractTestUI { TextField tf = new TextField("TextField with a tooltip"); tf.setDescription("My tooltip"); tf.setId(id); + getTooltipConfiguration().setOpenDelay(0); + getTooltipConfiguration().setQuickOpenDelay(0); + getTooltipConfiguration().setCloseTimeout(1000); return tf; } diff --git a/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java index 0e11041e3b..06fb659d4a 100644 --- a/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java +++ b/uitest/src/com/vaadin/tests/components/window/TooltipInWindowTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -35,7 +35,7 @@ import com.vaadin.tests.tb3.MultiBrowserTest; public class TooltipInWindowTest extends MultiBrowserTest { @Test - public void testTooltipsInSubWindow() throws Exception { + public void testTooltipsInSubWindow() throws InterruptedException { openTestURL(); WebElement textfield = vaadinElementById("tf1"); @@ -46,31 +46,32 @@ public class TooltipInWindowTest extends MultiBrowserTest { // Show tooltip mouse.mouseMove(textfieldCoordinates, 10, 10); - sleep(1000); + sleep(100); ensureVisibleTooltipPositionedCorrectly(); assertEquals("My tooltip", getTooltipElement().getText()); // Hide tooltip mouse.mouseMove(textfieldCoordinates, -100, -100); - sleep(1000); + sleep(2000); ensureHiddenTooltipPositionedCorrectly(); assertEquals("", getTooltipElement().getText()); // Show tooltip again mouse.mouseMove(textfieldCoordinates, 10, 10); - sleep(1000); + sleep(100); ensureVisibleTooltipPositionedCorrectly(); assertEquals("My tooltip", getTooltipElement().getText()); // Hide tooltip mouse.mouseMove(textfieldCoordinates, -100, -100); - sleep(1000); + sleep(2000); ensureHiddenTooltipPositionedCorrectly(); assertEquals("", getTooltipElement().getText()); + } private WebElement getTooltipElement() { diff --git a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java index 720f751cef..0915b93c26 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java index 8378c8cf7b..ab247be25b 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowInUiWithNoContentTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java b/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java index e0bc0d9471..63aebebdad 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowMoveListener.java @@ -64,4 +64,4 @@ public class WindowMoveListener extends AbstractTestUI { return 12885; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java index 3ea3b719c0..5502bf0495 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowMoveListenerTest.java @@ -47,4 +47,4 @@ public class WindowMoveListenerTest extends MultiBrowserTest { window.getLocation().y); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/components/window/WindowThemes.java b/uitest/src/com/vaadin/tests/components/window/WindowThemes.java index 2b39916db8..788adc7902 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowThemes.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowThemes.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java b/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java index 38254cf6f3..dc2dfca4f0 100644 --- a/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java +++ b/uitest/src/com/vaadin/tests/components/window/WindowZIndexTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java b/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java index 0afaf2c15f..c9d4a07c22 100644 --- a/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java +++ b/uitest/src/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java @@ -143,4 +143,4 @@ public class FileSystemContainerInTreeTable extends TestBase { return 7837; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java index 2edf7df5f0..321f2ac98f 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java @@ -24,4 +24,4 @@ public class ComboBoxUpdateProblem extends LegacyApplication { getMainWindow().addComponent(combo); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java index 7e95a41742..93bd265eda 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/DatabaseHelper.java @@ -123,4 +123,4 @@ class DatabaseHelper { public SQLContainer getLargeContainer() { return largeContainer; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java index ebf68fce9a..d099b92fb3 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java @@ -143,4 +143,4 @@ public class MassInsertMemoryLeakTestApp extends LegacyApplication { return pool; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java index 8d4f1c5842..89893a453e 100644 --- a/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java +++ b/uitest/src/com/vaadin/tests/containers/sqlcontainer/SqlcontainertableApplication.java @@ -44,4 +44,4 @@ public class SqlcontainertableApplication extends LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java b/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java index bc7268a53a..66179692b4 100644 --- a/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java +++ b/uitest/src/com/vaadin/tests/dd/MyDragSourceConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java b/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java index a3f7f8757a..5bbb397502 100644 --- a/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java +++ b/uitest/src/com/vaadin/tests/dd/MyDropTargetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java index 6f55e050c0..88b0386c97 100644 --- a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java +++ b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayouts.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java index 43c9737963..d4f027a2c8 100644 --- a/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java +++ b/uitest/src/com/vaadin/tests/debug/HierarchyAfterAnalyzeLayoutsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/BasicExtension.java b/uitest/src/com/vaadin/tests/extensions/BasicExtension.java index 7c4485b23e..a9615ff5d7 100644 --- a/uitest/src/com/vaadin/tests/extensions/BasicExtension.java +++ b/uitest/src/com/vaadin/tests/extensions/BasicExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,4 +24,4 @@ public class BasicExtension extends AbstractExtension { public void extend(AbstractClientConnector target) { super.extend(target); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java index 226641ac51..c56cfb10ab 100644 --- a/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/BasicExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java index 16e3df6b30..34711a4b92 100644 --- a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index 05321fcf4b..021d2dfa30 100644 --- a/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java index 7b74a7c668..b89e16d755 100644 --- a/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/uitest/src/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java b/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java index c69c2b4d30..f61d3b8bdd 100644 --- a/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java +++ b/uitest/src/com/vaadin/tests/extensions/LayoutMemoryUsageIE8Extension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java b/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java index 417821f1ea..f534215e18 100644 --- a/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java +++ b/uitest/src/com/vaadin/tests/extensions/ResponsiveUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java index 9b86350ebc..f7cbd9477c 100644 --- a/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java +++ b/uitest/src/com/vaadin/tests/extensions/ResponsiveUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -76,6 +76,9 @@ public class ResponsiveUITest extends MultiBrowserTest { assertEquals("-200px", $(".v-csslayout-grid.first").getAttribute("width-range")); + moveSplitter(-100); + assertEquals("0-100px", + $(".v-csslayout-grid.second").getAttribute("width-range")); } private void moveSplitter(int xOffset) { diff --git a/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index c6eaee7cc3..d3e0edf04c 100644 --- a/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/uitest/src/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIcons.java b/uitest/src/com/vaadin/tests/fonticon/FontIcons.java index 5511acf3bf..e9d2b91e95 100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIcons.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIcons.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -57,11 +57,6 @@ import com.vaadin.ui.TwinColSelect; import com.vaadin.ui.Upload; import com.vaadin.ui.VerticalLayout; -/** - * - * @since - * @author Vaadin Ltd - */ public class FontIcons extends AbstractTestUI { @Override @@ -105,7 +100,7 @@ public class FontIcons extends AbstractTestUI { Notification n = new Notification("Hey there!"); n.setIcon(icon); n.setPosition(Position.BOTTOM_CENTER); - n.setDelayMsec(-1); + n.setDelayMsec(300000); n.show(Page.getCurrent()); // grid of compoents diff --git a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java index af54b73ae3..61a38bf552 100644 --- a/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java +++ b/uitest/src/com/vaadin/tests/fonticon/FontIconsTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -21,11 +21,6 @@ import org.junit.Test; import com.vaadin.tests.tb3.MultiBrowserTest; -/** - * - * @since - * @author Vaadin Ltd - */ public class FontIconsTest extends MultiBrowserTest { @Test diff --git a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java index 0266a9d892..073975a509 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java index f736a126a5..941e988c5c 100644 --- a/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/AbstractServletIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/integration/JSPIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java index c5d6a65d87..13503966ec 100644 --- a/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java +++ b/uitest/src/com/vaadin/tests/integration/JSPIntegrationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ProxyTest.java b/uitest/src/com/vaadin/tests/integration/ProxyTest.java index 5b2eaa829c..887eae315d 100644 --- a/uitest/src/com/vaadin/tests/integration/ProxyTest.java +++ b/uitest/src/com/vaadin/tests/integration/ProxyTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java index d6def8d69c..4c3e1beaa5 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java index 5f50cdb95d..2afc33cf82 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationDefaultPushUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationDefaultPushUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java index f96000f1ce..0bcac5575d 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java index 70ca890b31..92307dbbaf 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationLongPollingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationLongPollingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java index 0d92fb1bb8..5d5801f0db 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java index 36a946bfa3..1f42b10e66 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationStreamingUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationStreamingUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java index 25ffdac4a2..bebe01578a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -17,4 +17,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java index d7c525f202..18e275618a 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java index f2e7a6f2d0..d4fc3aef17 100644 --- a/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java +++ b/uitest/src/com/vaadin/tests/integration/ServletIntegrationWebsocketUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,4 +18,4 @@ package com.vaadin.tests.integration; public class ServletIntegrationWebsocketUITest extends AbstractServletIntegrationTest { // Uses the test method declared in the super class -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java new file mode 100644 index 0000000000..c8207efe9d --- /dev/null +++ b/uitest/src/com/vaadin/tests/integration/WebSpherePortalIntegrationTest.java @@ -0,0 +1,163 @@ +/* + * 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.integration; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +import java.io.BufferedReader; +import java.io.File; +import java.io.IOException; +import java.io.InputStreamReader; + +import org.junit.AfterClass; +import org.junit.BeforeClass; +import org.junit.Test; +import org.openqa.selenium.By; +import org.openqa.selenium.support.ui.ExpectedConditions; +import org.openqa.selenium.support.ui.WebDriverWait; + +import com.jcraft.jsch.ChannelExec; +import com.jcraft.jsch.ChannelSftp; +import com.jcraft.jsch.JSch; +import com.jcraft.jsch.JSchException; +import com.jcraft.jsch.Session; +import com.jcraft.jsch.SftpException; +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class WebSpherePortalIntegrationTest extends PrivateTB3Configuration { + + @BeforeClass + public static void deployPortlet() throws JSchException, SftpException { + Session session = openSession(); + + uploadDemoApplication(session); + + sendCommand(session, "ant -f deploy.xml get-lock startup-and-deploy"); + + session.disconnect(); + } + + private static void uploadDemoApplication(Session session) + throws JSchException, SftpException { + ChannelSftp sftpChannel = (ChannelSftp) session.openChannel("sftp"); + sftpChannel.connect(); + + String applicationPath = System.getProperty("demo.war"); + if (new File(applicationPath).exists()) { + sftpChannel.put(applicationPath, "demo.war"); + sftpChannel.disconnect(); + } else { + sftpChannel.disconnect(); + throw new AssertionError("Demo application not found at " + + applicationPath); + } + } + + private static void sendCommand(Session session, String command) + throws JSchException { + ChannelExec channel = (ChannelExec) session.openChannel("exec"); + channel.setCommand(command); + BufferedReader in; + try { + in = new BufferedReader(new InputStreamReader( + channel.getInputStream())); + + channel.connect(); + + String msg = null; + + while ((msg = in.readLine()) != null) { + System.out.println(msg); + } + } catch (IOException e) { + e.printStackTrace(); + } + + channel.disconnect(); + } + + private static Session openSession() throws JSchException { + JSch jsch = new JSch(); + Session session = jsch.getSession("integration", + "websphereportal8.devnet.vaadin.com", 22); + jsch.addIdentity("~/.ssh/id_dsa"); + session.setConfig("StrictHostKeyChecking", "no"); + + session.connect(); + return session; + } + + @AfterClass + public static void teardown() throws JSchException { + Session session = openSession(); + + sendCommand(session, "ant -f deploy.xml release-lock"); + + session.disconnect(); + } + + @Override + protected java.lang.String getTestUrl() { + return "http://websphereportal8.devnet.vaadin.com:10039/wps/portal"; + } + + @Override + public void setup() throws Exception { + super.setup(); + + openTestURL(); + + if (!isLoggedIn()) { + login(); + } + + waitUntilPortletIsLoaded(); + } + + private void waitUntilPortletIsLoaded() { + WebDriverWait wait = new WebDriverWait(driver, 15); + wait.until(ExpectedConditions.visibilityOfElementLocated(By + .className("v-app"))); + } + + private boolean isLoggedIn() { + return driver.findElements(By.linkText("Log Out")).size() == 1; + } + + private void login() { + driver.findElement(By.linkText("Log In")).click(); + driver.findElement(By.id("userID")).sendKeys("test"); + driver.findElement(By.id("password")).sendKeys("testtest"); + + hitButton("login.button.login"); + } + + @Test + public void portletHasExpectedLayout() throws IOException { + compareScreen("initial"); + } + + @Test + public void viewModeIsSetToEdit() throws IOException { + driver.findElement(By.linkText("Edit")).click(); + + assertThat(driver.findElement(By.tagName("input")).isEnabled(), + is(true)); + + } + +} diff --git a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java index 2b7fc273ad..739779a3e0 100644 --- a/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java +++ b/uitest/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java @@ -56,4 +56,4 @@ public class HiddenHorizontalLayout extends TestBase { vl.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java index 7da9e46653..504ee8b41b 100644 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java +++ b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeak.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java index c9bd64c881..bfe38b8865 100644 --- a/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java +++ b/uitest/src/com/vaadin/tests/layouts/IE8MeasuredSizeMemoryLeakTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java index f6ee26e86f..3697ab1c26 100644 --- a/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java +++ b/uitest/src/com/vaadin/tests/layouts/MarginWithExpandRatio.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java index 9e0380a1f6..3d4b20d5d9 100644 --- a/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ b/uitest/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java @@ -1207,4 +1207,4 @@ public class OrderedLayoutBasics extends TestBase { return ol; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java index fe2dd6cea8..77f0d6cdda 100644 --- a/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java +++ b/uitest/src/com/vaadin/tests/layouts/VerticalLayoutSlotExpansionAndAlignment.java @@ -41,4 +41,4 @@ public class VerticalLayoutSlotExpansionAndAlignment extends UI { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java index 0544be326a..5d8a6e0e7a 100644 --- a/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java +++ b/uitest/src/com/vaadin/tests/layouts/layouttester/LayoutTesterApplicationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java index 78d0af6283..e268aed7b6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java +++ b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/Broadcaster.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java index 68b5925f48..0d63df5e95 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/broadcastingmessages/BroadcasterUI.java @@ -56,4 +56,4 @@ public class BroadcasterUI extends UI implements BroadcastListener { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java b/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java index 361567b088..dbe1cbb717 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v70/CookieMonsterUI.java @@ -89,4 +89,4 @@ public class CookieMonsterUI extends UI { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java index a2723beab3..0cb4492929 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java index 0e5bf337d8..a0e4a5851b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java index 48ccd217ca..952cf8c681 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,6 +19,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.annotations.PreserveOnRefresh; import com.vaadin.server.VaadinRequest; import com.vaadin.ui.CssLayout; +import com.vaadin.ui.Label; import com.vaadin.ui.TextField; import com.vaadin.ui.UI; @@ -34,10 +35,20 @@ import com.vaadin.ui.UI; public class CreatingPreserveState extends UI { private static int instanceCounter = 0; + private final CssLayout content = new CssLayout(); + @Override public void init(VaadinRequest request) { TextField tf = new TextField("Instance #" + (++instanceCounter)); tf.setImmediate(true); - setContent(new CssLayout(tf)); + + content.addComponent(tf); + setContent(content); + } + + @Override + protected void refresh(VaadinRequest request) { + content.addComponent(new Label("UI was refreshed @" + + System.currentTimeMillis())); } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java index b25bee1b33..408995867c 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index 724fa54f48..213e23982b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index 29bedb40fb..f4eed8ddd6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -70,4 +70,4 @@ public class DynamicImageUI extends AbstractTestUI { protected Integer getTicketNumber() { return null; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index 7ab7558b23..b744a8de5c 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java index 8fe12b81ad..4ef080afc2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java index 9fc7a0cfa6..39aef56a1e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java index 5653719395..fb84a4068b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index eddc22c66c..4d95d9cc48 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java index 7b01809648..18a27b85b2 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java index e6025cf5b8..6512754683 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java index 590a2d5d40..f291dfe1a9 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -44,4 +44,4 @@ public class MyComponentUI extends UI { setContent(component); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java index 17d2fc3f93..8a73e90496 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java index 7818ac4f99..6a0aee9670 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java @@ -49,4 +49,4 @@ public class MyPickerWidget extends ComplexPanel { getElement().getStyle().setPaddingRight(width, Unit.PX); button.getElement().getStyle().setMarginRight(-width, Unit.PX); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java index 7f800023c0..b22d3dfc1a 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java index d17a2dd447..148e7f22ea 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java index b414f40f43..8c14ba8bd7 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java @@ -46,4 +46,4 @@ public class WidgetContainer extends AbstractComponentContainer { public Iterator<Component> iterator() { return children.iterator(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java index d81e6b4c59..c534a4845f 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java @@ -47,4 +47,4 @@ public class WidgetcontainerUI extends UI { layout.addComponent(button); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java index 1c050e1a7b..338fb20893 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Analytics.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -18,13 +18,13 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.annotations.JavaScript; import com.vaadin.server.AbstractJavaScriptExtension; -import com.vaadin.server.ClientConnector; import com.vaadin.ui.UI; @JavaScript("analytics_connector.js") public class Analytics extends AbstractJavaScriptExtension { - public Analytics(String account) { + public Analytics(UI ui, String account) { + extend(ui); pushCommand("_setAccount", account); } @@ -37,13 +37,4 @@ public class Analytics extends AbstractJavaScriptExtension { // varargs argument instead of as the full varargs argument array. callFunction("pushCommand", (Object) commandAndArguments); } - - protected void extend(UI uI) { - super.extend(uI); - } - - @Override - protected Class<? extends ClientConnector> getSupportedParentType() { - return UI.class; - } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java index d7f83460fb..b12f5829fc 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -25,8 +25,7 @@ public class AnalyticsUI extends UI { @Override protected void init(VaadinRequest request) { - final Analytics analytics = new Analytics("UA-33036133-12"); - analytics.extend(this); + final Analytics analytics = new Analytics(this, "UA-33036133-12"); setContent(new Button("Track pageview", new Button.ClickListener() { @Override diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java index df549b6a4a..4165e63951 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarning.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,7 +20,12 @@ import com.vaadin.server.AbstractExtension; import com.vaadin.ui.PasswordField; public class CapsLockWarning extends AbstractExtension { - public void extend(PasswordField field) { - super.extend(field); + protected CapsLockWarning(PasswordField field) { + // Non-public constructor to discourage direct instantiation + extend(field); + } + + public static CapsLockWarning warnFor(PasswordField field) { + return new CapsLockWarning(field); } } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java index 6d2c344c60..19a7da7114 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/CapsLockWarningUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -28,7 +28,7 @@ public class CapsLockWarningUI extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { PasswordField field = new PasswordField("Enter your password"); - new CapsLockWarning().extend(field); + CapsLockWarning.warnFor(field); addComponent(field); } diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java index 8379ebd34f..002e3478bf 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java index c43c518cdf..7b37166eab 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java index a672c76c8a..1bc282de19 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java index 9942d8ef87..d233a54d86 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java index dde6b48ce6..f4aca81ffa 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Flot.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java index 67d2ce5708..99c4fdd91b 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java index d348a9e002..f6449b1997 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java index a6aacf3d62..54cb65db05 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/FlotState.java @@ -7,4 +7,4 @@ import com.vaadin.shared.ui.JavaScriptComponentState; public class FlotState extends JavaScriptComponentState { public List<List<List<Double>>> series = new ArrayList<List<List<Double>>>(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java index f9d79a518e..8f1eda6816 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/JSAPIUI.java @@ -44,4 +44,4 @@ public class JSAPIUI extends UI { new ExternalResource( "javascript:(function(){com.example.api.notify(prompt('Message'),2);})();"))); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java index c3ef7b5d39..5c5037d5ad 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButton.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java index de92a2cd27..fb6a4dc83a 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -24,4 +24,4 @@ public class RedButtonUI extends UI { protected void init(VaadinRequest request) { setContent(new RedButton("My red button")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java index 62ce727531..6878fc1bc6 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/Refresher.java @@ -29,13 +29,14 @@ public class Refresher extends AbstractExtension { } - public Refresher() { + public Refresher(UI ui) { registerRpc(new RefresherRpc() { @Override public void refresh() { fireEvent(new RefreshEvent(Refresher.this)); } }); + extend(ui); } @Override @@ -67,8 +68,4 @@ public class Refresher extends AbstractExtension { super.removeListener(RefreshEvent.class, listener, RefreshListener.METHOD); } - - public void extend(UI target) { - super.extend(target); - } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java index 0b2fad21aa..e9243ac0cb 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7a3/RefresherTestUI.java @@ -30,8 +30,7 @@ public class RefresherTestUI extends AbstractTestUI { @Override protected void setup(VaadinRequest request) { - final Refresher refresher = new Refresher(); - refresher.extend(this); + final Refresher refresher = new Refresher(this); refresher.setInterval(1000); refresher.addRefreshListener(new RefreshListener() { @Override diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java index 7b75001f13..696137c3b1 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/Addition.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java index 3cf7ebb8c0..280be5982e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/CapsLockWarningWithRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java b/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java index 7f6984816f..03310ab9e8 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b1/ReducingRoundTrips.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java index 59708f2bc7..a2ff67f6d9 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/CountView.java @@ -19,4 +19,4 @@ public class CountView extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java index d37a39345f..3764b7622e 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainView.java @@ -59,4 +59,4 @@ public class MainView extends Panel implements View { public void enter(ViewChangeEvent event) { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java index 861fd9f8a4..e638770346 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MainViewEarlierExample.java @@ -58,4 +58,4 @@ public class MainViewEarlierExample extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java index e8612888e9..30e86a2be7 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/MessageView.java @@ -26,4 +26,4 @@ public class MessageView extends Panel implements View { } } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java index 0b7ad16657..fa212780f5 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SassyUI.java @@ -25,4 +25,4 @@ public class SassyUI extends UI { setContent(layout); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java index 68eb91fcc5..21fb479bc0 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SecretView.java @@ -13,4 +13,4 @@ public class SecretView extends MessageView implements View { ((Layout) getContent()).addComponent(new Label("Some private stuff.")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java index 74c4e68b93..be8ea9e533 100644 --- a/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java +++ b/uitest/src/com/vaadin/tests/minitutorials/v7b9/SettingsView.java @@ -131,4 +131,4 @@ public class SettingsView extends Panel implements View { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BarInUIDL.java b/uitest/src/com/vaadin/tests/push/BarInUIDL.java index bc05f7c306..b380edcb75 100644 --- a/uitest/src/com/vaadin/tests/push/BarInUIDL.java +++ b/uitest/src/com/vaadin/tests/push/BarInUIDL.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java b/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java index cd716dcaa3..4013494c49 100644 --- a/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java +++ b/uitest/src/com/vaadin/tests/push/BarInUIDLTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -44,4 +44,4 @@ public class BarInUIDLTest extends MultiBrowserTest { private WebElement getButton() { return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[0]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPush.java b/uitest/src/com/vaadin/tests/push/BasicPush.java index 8e8f418c5f..ffc5395c2c 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPush.java +++ b/uitest/src/com/vaadin/tests/push/BasicPush.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java index bbb7895f20..8b6f634aae 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java index b526a11d38..b404747c80 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,4 +16,4 @@ package com.vaadin.tests.push; public class BasicPushLongPollingTest extends BasicPushTest { -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java b/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java index f9dc78dd43..c906c5f6e1 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java b/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java index 67730f72c8..ceb0b28c76 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -16,4 +16,4 @@ package com.vaadin.tests.push; public class BasicPushStreamingTest extends BasicPushTest { -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushTest.java b/uitest/src/com/vaadin/tests/push/BasicPushTest.java index 670876e0f4..fd34a1f192 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,9 +15,10 @@ */ package com.vaadin.tests.push; -import org.junit.Assert; import org.junit.Test; +import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; +import org.openqa.selenium.support.ui.ExpectedCondition; import com.vaadin.tests.annotations.TestCategory; import com.vaadin.tests.tb3.AbstractTB3Test; @@ -26,49 +27,28 @@ import com.vaadin.tests.tb3.MultiBrowserTest; @TestCategory("push") public abstract class BasicPushTest extends MultiBrowserTest { + @Override + public void setup() throws Exception { + super.setup(); + } + @Test public void testPush() throws InterruptedException { openTestURL(); - // Test client initiated push - Assert.assertEquals(0, getClientCounter()); getIncrementButton().click(); - Assert.assertEquals("Client counter not incremented by button click", - 1, getClientCounter()); + testBench().disableWaitForVaadin(); + + waitUntilClientCounterChanges(1); + getIncrementButton().click(); getIncrementButton().click(); getIncrementButton().click(); - Assert.assertEquals("Four clicks should have incremented counter to 4", - 4, getClientCounter()); + waitUntilClientCounterChanges(4); // Test server initiated push getServerCounterStartButton().click(); - try { - Assert.assertEquals(0, getServerCounter()); - sleep(3000); - int serverCounter = getServerCounter(); - if (serverCounter < 1) { - // No push has happened - Assert.fail("No push has occured within 3s"); - } - sleep(3000); - if (getServerCounter() <= serverCounter) { - // No push has happened - Assert.fail("Only one push took place within 6s"); - - } - } finally { - // Avoid triggering push assertions - getServerCounterStopButton().click(); - } - } - - private int getServerCounter() { - return getServerCounter(this); - } - - private int getClientCounter() { - return getClientCounter(this); + waitUntilServerCounterChanges(); } public static int getClientCounter(AbstractTB3Test t) { @@ -81,10 +61,6 @@ public abstract class BasicPushTest extends MultiBrowserTest { return getIncrementButton(this); } - private WebElement getServerCounterStopButton() { - return getServerCounterStopButton(this); - } - private WebElement getServerCounterStartButton() { return getServerCounterStartButton(this); } @@ -107,4 +83,25 @@ public abstract class BasicPushTest extends MultiBrowserTest { return t.vaadinElementById(BasicPush.INCREMENT_BUTTON_ID); } -}
\ No newline at end of file + private void waitUntilClientCounterChanges(final int expectedValue) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getClientCounter(BasicPushTest.this) == expectedValue; + } + }, 10); + } + + private void waitUntilServerCounterChanges() { + final int counter = BasicPushTest.getServerCounter(this); + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getServerCounter(BasicPushTest.this) > counter; + } + }, 10); + } + +} diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java index 465caf0165..84c0b19ce8 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java index dd0a147d99..093ee348b8 100644 --- a/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/BasicPushWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -26,4 +26,4 @@ public class BasicPushWebsocketTest extends BasicPushTest { public List<DesiredCapabilities> getBrowsersToTest() { return WebsocketTest.getWebsocketBrowsers(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java b/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java index 2e14f9459b..03b34655a1 100644 --- a/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java +++ b/uitest/src/com/vaadin/tests/push/EnableDisablePushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -71,4 +71,4 @@ public class EnableDisablePushTest extends MultiBrowserTest { return vaadinElement("/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[4]/VButton[0]"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java index d90394d3b5..815b85ecc4 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTime.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java index 7c0899c481..3080b96ec4 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java index eb28634dfa..13f601da7a 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java index 3e9582740d..04a9c68e32 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java index 17837cb2d3..4af6179e81 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java index a1ce4b9d8f..06ddc07abb 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java index 8346d49234..f73e7b728c 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java index 23d773c7da..c0b188bbab 100644 --- a/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ExtremelyLongPushTimeWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java index 5a90c4333d..143960f1b2 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java index f9a0a722e5..c5a909385f 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java index 95a916f72d..4b142500f7 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java index 3fd9c616fb..644dbd7580 100644 --- a/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/IdlePushChannelWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushConfiguration.java b/uitest/src/com/vaadin/tests/push/PushConfiguration.java index a7ba4e43ba..5e56a5f361 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfiguration.java +++ b/uitest/src/com/vaadin/tests/push/PushConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java index c0503d5240..ac58deea56 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -55,4 +55,4 @@ public class PushConfigurationLongPollingTest extends PushConfigurationTest { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java index 46fcc5f44b..8dc960c9ac 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -38,6 +38,8 @@ public class PushConfigurationStreamingTest extends PushConfigurationTest { @Test public void testStreaming() throws InterruptedException { + openDebugLogTab(); + new Select(getTransportSelect()).selectByVisibleText("STREAMING"); new Select(getPushModeSelect()).selectByVisibleText("AUTOMATIC"); @@ -54,4 +56,4 @@ public class PushConfigurationStreamingTest extends PushConfigurationTest { assertThat(driver.getPageSource(), containsString("Push connection established using streaming")); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java index 20399fc67e..bb5b420259 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -84,4 +84,4 @@ abstract class PushConfigurationTest extends MultiBrowserTest { } }); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java b/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java index c8308e72f1..c9a813fac0 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurationWebSocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -33,6 +33,7 @@ public class PushConfigurationWebSocketTest extends PushConfigurationTest { List<DesiredCapabilities> browsers = super.getBrowsersToTest(); browsers.remove(Browser.IE8.getDesiredCapabilities()); browsers.remove(Browser.IE9.getDesiredCapabilities()); + browsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); return browsers; } diff --git a/uitest/src/com/vaadin/tests/push/PushConfigurator.java b/uitest/src/com/vaadin/tests/push/PushConfigurator.java index 6dbe130b73..5a45ab7206 100644 --- a/uitest/src/com/vaadin/tests/push/PushConfigurator.java +++ b/uitest/src/com/vaadin/tests/push/PushConfigurator.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java b/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java index 8dbf91f9ee..1f6e181c89 100644 --- a/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushErrorHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -20,6 +20,7 @@ import org.junit.Test; import org.openqa.selenium.By; import org.openqa.selenium.WebElement; +import com.vaadin.testbench.elements.LabelElement; import com.vaadin.tests.annotations.TestCategory; import com.vaadin.tests.tb3.MultiBrowserTest; @@ -31,11 +32,15 @@ public class PushErrorHandlingTest extends MultiBrowserTest { setPush(true); openTestURL(); vaadinElementById("npeButton").click(); + int idx = 1; + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + // PhantomJS sends an extra event when page gets loaded. + // This results as an extra error label. + ++idx; + } Assert.assertEquals( "An error! Unable to invoke method click in com.vaadin.shared.ui.button.ButtonServerRpc", - vaadinElement( - "/VVerticalLayout[0]/Slot[1]/VVerticalLayout[0]/Slot[2]/VLabel[0]") - .getText()); + $(LabelElement.class).get(idx).getText()); WebElement table = vaadinElementById("testtable"); WebElement row = table.findElement(By diff --git a/uitest/src/com/vaadin/tests/push/PushFromInit.java b/uitest/src/com/vaadin/tests/push/PushFromInit.java index 0afaa866f7..63af3d9ec7 100644 --- a/uitest/src/com/vaadin/tests/push/PushFromInit.java +++ b/uitest/src/com/vaadin/tests/push/PushFromInit.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushFromInitTest.java b/uitest/src/com/vaadin/tests/push/PushFromInitTest.java index 15453fc054..a285d91e92 100644 --- a/uitest/src/com/vaadin/tests/push/PushFromInitTest.java +++ b/uitest/src/com/vaadin/tests/push/PushFromInitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -37,4 +37,4 @@ public class PushFromInitTest extends MultiBrowserTest { }); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/PushLargeData.java b/uitest/src/com/vaadin/tests/push/PushLargeData.java index f43348b5eb..f9625b80be 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeData.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeData.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java index 52a647115a..c2fdb5ae95 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPolling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java index 34150ea5af..00ee6bae25 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java b/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java index 7706aa90c6..ef300ab222 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java index 14dc5208ef..26fa512ab2 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java index 4115a825d1..a893d7f1ef 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocket.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java index cc8668a729..57fb8c33b0 100644 --- a/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/PushLargeDataWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java new file mode 100644 index 0000000000..8834a05069 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefresh.java @@ -0,0 +1,48 @@ +package com.vaadin.tests.push; + +import com.vaadin.annotations.PreserveOnRefresh; +import com.vaadin.annotations.Push; +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; +import com.vaadin.tests.util.Log; +import com.vaadin.ui.Button; +import com.vaadin.ui.Button.ClickEvent; +import com.vaadin.ui.Button.ClickListener; +import com.vaadin.ui.Label; + +@PreserveOnRefresh +@Push +public class PushWithPreserveOnRefresh extends AbstractTestUI { + + private Log log = new Log(5); + private int times = 0; + + @Override + protected void setup(VaadinRequest request) { + // Internal parameter sent by vaadinBootstrap.js, + addComponent(new Label("window.name: " + request.getParameter("v-wn"))); + addComponent(new Label("UI id: " + getUIId())); + addComponent(log); + + Button b = new Button("click me"); + b.addClickListener(new ClickListener() { + + @Override + public void buttonClick(ClickEvent event) { + log.log("Button has been clicked " + (++times) + " times"); + } + }); + + addComponent(b); + } + + @Override + protected String getTestDescription() { + return "Refreshing the browser window should preserve the state and push should continue to work"; + } + + @Override + protected Integer getTicketNumber() { + return Integer.valueOf(13620); + } +} diff --git a/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java new file mode 100644 index 0000000000..3c532b2e55 --- /dev/null +++ b/uitest/src/com/vaadin/tests/push/PushWithPreserveOnRefreshTest.java @@ -0,0 +1,38 @@ +/* + * 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.push; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.testbench.elements.ButtonElement; +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class PushWithPreserveOnRefreshTest extends MultiBrowserTest { + + @Test + public void ensurePushWorksAfterRefresh() { + openTestURL(); + $(ButtonElement.class).first().click(); + $(ButtonElement.class).first().click(); + Assert.assertEquals("2. Button has been clicked 2 times", getLogRow(0)); + openTestURL(); + Assert.assertEquals("2. Button has been clicked 2 times", getLogRow(0)); + $(ButtonElement.class).first().click(); + Assert.assertEquals("3. Button has been clicked 3 times", getLogRow(0)); + + } +} diff --git a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java index 6d0c0c53b0..8a4593d70d 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectLongPollingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,6 +15,7 @@ */ package com.vaadin.tests.push; + public class ReconnectLongPollingTest extends ReconnectTest { @Override diff --git a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java index ebacf5be37..fe63764e78 100755 --- a/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectStreamingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,6 +15,7 @@ */ package com.vaadin.tests.push; + public class ReconnectStreamingTest extends ReconnectTest { @Override diff --git a/uitest/src/com/vaadin/tests/push/ReconnectTest.java b/uitest/src/com/vaadin/tests/push/ReconnectTest.java index 5938ab1ff5..5ad2e7a127 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -15,115 +15,103 @@ */ package com.vaadin.tests.push; -import org.junit.Assert; import org.junit.Test; +import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.ui.ExpectedCondition; +import com.jcraft.jsch.JSchException; import com.vaadin.tests.tb3.MultiBrowserTestWithProxy; public abstract class ReconnectTest extends MultiBrowserTestWithProxy { - @Test - public void testShortDisconnect() throws Exception { + @Override + public void setup() throws Exception { + super.setup(); + setDebug(true); openTestURL(); + openDebugLogTab(); + startTimer(); waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); + + testBench().disableWaitForVaadin(); } @Test - public void testUserActionWhileDisconnectedWithDelay() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); + public void messageIsQueuedOnDisconnect() throws JSchException { disconnectProxy(); - Assert.assertEquals(0, getClientCounter()); - getIncrementClientCounterButton().click(); - // No change while disconnected - Assert.assertEquals(0, getClientCounter()); - // Firefox sends extra onopen calls after a while, which breaks - // everything - Thread.sleep(10000); - connectProxy(); - waitUntilServerCounterChanges(); - // The change should have appeared when reconnected - Assert.assertEquals(1, getClientCounter()); + + clickButtonAndWaitForTwoReconnectAttempts(); + + connectAndVerifyConnectionEstablished(); + waitUntilClientCounterChanges(1); } @Test - public void testUserActionWhileDisconnected() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); + public void messageIsNotSentBeforeConnectionIsEstablished() + throws JSchException, InterruptedException { disconnectProxy(); - Assert.assertEquals(0, getClientCounter()); - getIncrementClientCounterButton().click(); - // No change while disconnected - Assert.assertEquals(0, getClientCounter()); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - // The change should have appeared when reconnected - Assert.assertEquals(1, getClientCounter()); - // IE has problems with another reconnect - disconnectProxy(); + waitForNextReconnectionAttempt(); + clickButtonAndWaitForTwoReconnectAttempts(); + + connectAndVerifyConnectionEstablished(); + waitUntilClientCounterChanges(1); + } + + private void clickButtonAndWaitForTwoReconnectAttempts() { + clickClientButton(); + + // Reconnection attempt is where pending messages can + // falsely be sent to server. + waitForNextReconnectionAttempt(); + + // Waiting for the second reconnection attempt makes sure that the + // first attempt has been completed or aborted. + waitForNextReconnectionAttempt(); + } + + private void clickClientButton() { getIncrementClientCounterButton().click(); - Assert.assertEquals(1, getClientCounter()); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - Assert.assertEquals(2, getClientCounter()); } - @Test - public void testLongDisconnect() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(12000); - connectProxy(); - waitUntilServerCounterChanges(); + private void waitForNextReconnectionAttempt() { + clearDebugMessages(); + waitForDebugMessage("Reopening push connection"); } - @Test - public void testReallyLongDisconnect() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - disconnectProxy(); - Thread.sleep(120000); - connectProxy(); - waitUntilServerCounterChanges(); + private void clearDebugMessages() { + driver.findElement( + By.xpath("//button[@class='v-debugwindow-button' and @title='Clear log']")) + .click(); } - @Test - public void testMultipleDisconnects() throws Exception { - setDebug(true); - openTestURL(); - startTimer(); - waitUntilServerCounterChanges(); - for (int i = 0; i < 5; i++) { - disconnectProxy(); - Thread.sleep(1000); - connectProxy(); - waitUntilServerCounterChanges(); - } + private boolean hasDebugMessage(String message) { + return getDebugMessage(message) != null; + } + + private WebElement getDebugMessage(String message) { + return driver.findElement(By.xpath(String.format( + "//span[@class='v-debugwindow-message' and text()='%s']", + message))); + } + + private void waitForDebugMessage(final String expectedMessage) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return hasDebugMessage(expectedMessage); + } + }, 30); } - private int getClientCounter() { - return BasicPushTest.getClientCounter(this); + private void connectAndVerifyConnectionEstablished() throws JSchException { + connectProxy(); + waitUntilServerCounterChanges(); } private WebElement getIncrementClientCounterButton() { @@ -141,6 +129,16 @@ public abstract class ReconnectTest extends MultiBrowserTestWithProxy { }, 30); } + private void waitUntilClientCounterChanges(final int expectedValue) { + waitUntil(new ExpectedCondition<Boolean>() { + + @Override + public Boolean apply(WebDriver input) { + return BasicPushTest.getClientCounter(ReconnectTest.this) == expectedValue; + } + }, 5); + } + private void startTimer() { BasicPushTest.getServerCounterStartButton(this).click(); } diff --git a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java index 57fe0a040d..efaf5d493e 100644 --- a/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java +++ b/uitest/src/com/vaadin/tests/push/ReconnectWebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/RoundTripTest.java b/uitest/src/com/vaadin/tests/push/RoundTripTest.java index ee0bf6dcb1..4e192db7f8 100644 --- a/uitest/src/com/vaadin/tests/push/RoundTripTest.java +++ b/uitest/src/com/vaadin/tests/push/RoundTripTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java b/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java index 5a3460a290..74d089374c 100644 --- a/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java +++ b/uitest/src/com/vaadin/tests/push/StreamingReconnectWhilePushing.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/TablePushStreaming.java b/uitest/src/com/vaadin/tests/push/TablePushStreaming.java index de824eef3a..04aad63813 100644 --- a/uitest/src/com/vaadin/tests/push/TablePushStreaming.java +++ b/uitest/src/com/vaadin/tests/push/TablePushStreaming.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/TogglePush.java b/uitest/src/com/vaadin/tests/push/TogglePush.java index 6ec8903d65..e662545134 100644 --- a/uitest/src/com/vaadin/tests/push/TogglePush.java +++ b/uitest/src/com/vaadin/tests/push/TogglePush.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/TogglePushTest.java b/uitest/src/com/vaadin/tests/push/TogglePushTest.java index 49110c79dc..3ca12fdd84 100644 --- a/uitest/src/com/vaadin/tests/push/TogglePushTest.java +++ b/uitest/src/com/vaadin/tests/push/TogglePushTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -111,4 +111,4 @@ public class TogglePushTest extends MultiBrowserTest { .getText(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java index 23702564f9..6e2784f21d 100644 --- a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java +++ b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java index 4aab0f867a..b4af11b864 100644 --- a/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java +++ b/uitest/src/com/vaadin/tests/push/TrackMessageSizeUITest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -29,4 +29,4 @@ public class TrackMessageSizeUITest extends MultiBrowserTest { Assert.assertEquals("1. All tests run", vaadinElementById("Log_row_0") .getText()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java b/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java new file mode 100644 index 0000000000..1f2c4d37f2 --- /dev/null +++ b/uitest/src/com/vaadin/tests/requesthandlers/UnsupportedBrowserHandlerUserAgents.java @@ -0,0 +1,76 @@ +/* + * 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.requesthandlers; + +import java.net.HttpURLConnection; +import java.net.URL; + +import org.apache.commons.io.IOUtils; +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.tests.tb3.PrivateTB3Configuration; + +public class UnsupportedBrowserHandlerUserAgents { + /* + * This test doesn't use testbench, but it's still in the uitest source + * folder since it should be run with the testing server deployed. + */ + + @Test + public void ie7NotSupported() { + String response = requestWithUserAgent("Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 5.2; WOW64; .NET CLR 2.0.50727)"); + Assert.assertTrue("IE7 should not be supported", + response.contains("your browser is not supported")); + } + + @Test + public void ie9Supported() { + String response = requestWithUserAgent("Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 7.1; Trident/5.0)"); + Assert.assertFalse("IE9 should be supported", + response.contains("your browser is not supported")); + } + + @Test + public void unknownSupported() { + String response = requestWithUserAgent("Very strange user agent, like wat"); + Assert.assertFalse("Unkonwn user agent should be supported", + response.contains("your browser is not supported")); + } + + private String requestWithUserAgent(String userAgent) { + try { + String url = "http://" + + PrivateTB3Configuration.getConfiguredDeploymentHostname() + + ":" + + PrivateTB3Configuration.getConfiguredDeploymentPort() + + "/run/" + + com.vaadin.tests.components.ui.UIInitTest.class.getName() + + "/"; + + HttpURLConnection connection = (HttpURLConnection) new URL(url) + .openConnection(); + connection.setRequestProperty("User-Agent", userAgent); + + String response = IOUtils.toString(connection.getInputStream()); + connection.disconnect(); + + return response; + } catch (Exception e) { + throw new RuntimeException(e); + } + } +} diff --git a/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java b/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java new file mode 100644 index 0000000000..b6e409d4ba --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/CachingJavaScriptComponent.java @@ -0,0 +1,26 @@ +/* + * 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.resources; + +import com.vaadin.annotations.JavaScript; +import com.vaadin.ui.AbstractJavaScriptComponent; + +@JavaScript({ "cachingtest.js" }) +public class CachingJavaScriptComponent extends AbstractJavaScriptComponent { + public CachingJavaScriptComponent() { + + } +} diff --git a/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java b/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java new file mode 100644 index 0000000000..a2828032c7 --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/PublishedFileHandlerCaching.java @@ -0,0 +1,77 @@ +/* + * 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.resources; + +import com.vaadin.server.VaadinRequest; +import com.vaadin.tests.components.AbstractTestUI; + +/** + * This class tests the caching behavior of PublishedFileHandler. + * + * Previously PublishedFileHandler did not include cache headers in it's + * responses. Unfortunately there isn't a good way to automate this test, so + * manual testing is required at this time. To test the caching behavior run + * this file as a java application on the development server debug + * configuration, and access it through the url + * http://localhost:8888/run/com.vaadin + * .tests.resources.PublishedFileHandlerCaching?restartApplication + * + * On loading the page you'll need to examine the network traffic (e.g. with + * FireBug), keeping an eye on the GET requests for cachingtest.js and it's + * cache headers. + * + * @since + * @author Vaadin Ltd + */ +public class PublishedFileHandlerCaching extends AbstractTestUI { + + /** + * generated serialVersionUID + */ + private static final long serialVersionUID = 2275457343547688505L; + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server. + * VaadinRequest) + */ + @Override + protected void setup(VaadinRequest request) { + addComponent(new CachingJavaScriptComponent()); + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTestDescription() + */ + @Override + protected String getTestDescription() { + return "Test that PublishedFileHandler includes appropriate cache headers."; + } + + /* + * (non-Javadoc) + * + * @see com.vaadin.tests.components.AbstractTestUI#getTicketNumber() + */ + @Override + protected Integer getTicketNumber() { + return new Integer(13574); + } + +} diff --git a/uitest/src/com/vaadin/tests/resources/cachingtest.js b/uitest/src/com/vaadin/tests/resources/cachingtest.js new file mode 100644 index 0000000000..f948e680ad --- /dev/null +++ b/uitest/src/com/vaadin/tests/resources/cachingtest.js @@ -0,0 +1,6 @@ +/** + * Used for testing cache header behavior. + */ + +function com_vaadin_tests_resources_CachingJavaScriptComponent() { +}
\ No newline at end of file diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java b/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java index 860b5501cc..96f003d6c5 100644 --- a/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java +++ b/uitest/src/com/vaadin/tests/serialization/DelegateToWidgetTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java index e1cb287226..b01a6b243a 100644 --- a/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java +++ b/uitest/src/com/vaadin/tests/serialization/DelegateWithoutStateClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java index dca96a46ea..7f599f2c0a 100644 --- a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java +++ b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandling.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java index a6ff0c4459..9c21ec1de4 100644 --- a/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java +++ b/uitest/src/com/vaadin/tests/serialization/GenericWidgetHandlingTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java index f46fb0d5d9..fa3578c41d 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerNamespaceTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java index d4849ce667..1c18fb1912 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/serialization/SerializerTestTest.java b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java index d093a30ea7..5ca1e9ce6a 100644 --- a/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java +++ b/uitest/src/com/vaadin/tests/serialization/SerializerTestTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java index ba5c81e846..3745d60fd8 100644 --- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -126,9 +126,13 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } else { capabilities = getDesiredCapabilities(); - WebDriver dr = TestBench.createDriver(new RemoteWebDriver(new URL( - getHubURL()), capabilities)); - setDriver(dr); + if (System.getProperty("useLocalWebDriver") != null) { + setupLocalDriver(capabilities); + } else { + WebDriver dr = TestBench.createDriver(new RemoteWebDriver( + new URL(getHubURL()), capabilities)); + setDriver(dr); + } } int w = SCREENSHOT_WIDTH; @@ -765,6 +769,21 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } /** + * Gets the capabilities for PhantomJS of the given version + * + * @param version + * the major version + * @return an object describing the capabilities required for running a + * test on the given PhantomJS version + */ + public static DesiredCapabilities phantomJS(int version) { + DesiredCapabilities c = DesiredCapabilities.phantomjs(); + c.setPlatform(Platform.XP); + c.setVersion("" + version); + return c; + } + + /** * Checks if the given capabilities refer to Internet Explorer 8 * * @param capabilities @@ -821,6 +840,15 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } /** + * @param capabilities + * The capabilities to check + * @return true if the capabilities refer to PhantomJS, false otherwise + */ + public static boolean isPhantomJS(DesiredCapabilities capabilities) { + return BrowserType.PHANTOMJS.equals(capabilities.getBrowserName()); + } + + /** * Returns a human readable identifier of the given browser. Used for * test naming and screenshots * @@ -839,6 +867,8 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { return "Safari"; } else if (isOpera(capabilities)) { return "Opera"; + } else if (isPhantomJS(capabilities)) { + return "PhantomJS"; } return capabilities.getBrowserName(); @@ -930,10 +960,18 @@ public abstract class AbstractTB3Test extends TestBenchTestCase { } public void hitButton(String id) { - WebDriverBackedSelenium selenium = new WebDriverBackedSelenium(driver, - driver.getCurrentUrl()); + if (BrowserUtil.isPhantomJS(getDesiredCapabilities())) { + driver.findElement(By.id(id)).click(); + } else { + WebDriverBackedSelenium selenium = new WebDriverBackedSelenium( + driver, driver.getCurrentUrl()); + + selenium.keyPress("id=" + id, "\\13"); + } + } - selenium.keyPress("id=" + id, "\\13"); + protected void openDebugLogTab() { + findElement(By.xpath("//button[@title='Debug message log']")).click(); } } diff --git a/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java b/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java index bd9027bec2..b7cc8284d1 100644 --- a/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java +++ b/uitest/src/com/vaadin/tests/tb3/AllTB3Tests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java index 5208838028..dd061646be 100644 --- a/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java +++ b/uitest/src/com/vaadin/tests/tb3/ExcludeFromSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java index fa55b82390..74073af217 100644 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -44,7 +44,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { FIREFOX(BrowserUtil.firefox(24)), CHROME(BrowserUtil.chrome(33)), SAFARI( BrowserUtil.safari(7)), IE8(BrowserUtil.ie(8)), IE9(BrowserUtil .ie(9)), IE10(BrowserUtil.ie(10)), IE11(BrowserUtil.ie(11)), OPERA( - BrowserUtil.opera(17)); + BrowserUtil.opera(17)), PHANTOMJS(BrowserUtil.phantomJS(1)); private DesiredCapabilities desiredCapabilities; private Browser(DesiredCapabilities desiredCapabilities) { @@ -66,6 +66,7 @@ public abstract class MultiBrowserTest extends PrivateTB3Configuration { // Uncomment once we have the capability to run on Safari 6 // allBrowsers.add(SAFARI); allBrowsers.add(Browser.CHROME.getDesiredCapabilities()); + allBrowsers.add(Browser.PHANTOMJS.getDesiredCapabilities()); // Re-enable this when it is possible to run on a modern Opera version // allBrowsers.add(Browser.OPERA.getDesiredCapabilities()); } diff --git a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java index d600b5fef2..921fa080cd 100755 --- a/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java +++ b/uitest/src/com/vaadin/tests/tb3/MultiBrowserTestWithProxy.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -19,7 +19,6 @@ import java.io.File; import java.util.concurrent.atomic.AtomicInteger; import org.junit.After; -import org.junit.Before; import com.jcraft.jsch.JSch; import com.jcraft.jsch.JSchException; @@ -38,8 +37,9 @@ public abstract class MultiBrowserTestWithProxy extends MultiBrowserTest { System.getProperty("sshkey.file"), sshDir + "id_rsa", sshDir + "id_dsa", sshDir + "id_rsa2" }; - @Before - public void setupInitialProxy() throws JSchException { + @Override + public void setup() throws Exception { + super.setup(); connectProxy(); } diff --git a/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java b/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java index 912d7d010e..ef9ee382d0 100644 --- a/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java +++ b/uitest/src/com/vaadin/tests/tb3/ParallelScheduler.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java index a00ff7ab4d..305caf1cb5 100644 --- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java +++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java @@ -29,6 +29,7 @@ import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.firefox.FirefoxBinary; import org.openqa.selenium.firefox.FirefoxDriver; +import org.openqa.selenium.phantomjs.PhantomJSDriver; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.safari.SafariDriver; @@ -44,9 +45,8 @@ import com.vaadin.testbench.TestBench; public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { private static final String HOSTNAME_PROPERTY = "com.vaadin.testbench.deployment.hostname"; private static final String PORT_PROPERTY = "com.vaadin.testbench.deployment.port"; - private final Properties properties = new Properties(); - - public PrivateTB3Configuration() { + private static final Properties properties = new Properties(); + static { File file = new File("work", "eclipse-run-selected-test.properties"); if (file.exists()) { try { @@ -57,7 +57,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { } } - private String getProperty(String name) { + private static String getProperty(String name) { String property = properties.getProperty(name); if (property == null) { property = System.getProperty(name); @@ -86,6 +86,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { if (getClass().getAnnotation(RunLocally.class) != null) { return "localhost"; } + return getConfiguredDeploymentHostname(); + } + + /** + * Gets the hostname that tests are configured to use. + * + * @return the host name configuration value + */ + public static String getConfiguredDeploymentHostname() { String hostName = getProperty(HOSTNAME_PROPERTY); if (hostName == null || "".equals(hostName)) { @@ -97,6 +106,15 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { @Override protected int getDeploymentPort() { + return getConfiguredDeploymentPort(); + } + + /** + * Gets the port that tests are configured to use. + * + * @return the port configuration value + */ + public static int getConfiguredDeploymentPort() { String portString = getProperty(PORT_PROPERTY); int port = 8888; @@ -115,7 +133,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { * @throws RuntimeException * if there was an error or no IP was found */ - private String findAutoHostname() { + private static String findAutoHostname() { try { Enumeration<NetworkInterface> interfaces = NetworkInterface .getNetworkInterfaces(); @@ -167,6 +185,8 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test { driver = new ChromeDriver(); } else if (BrowserUtil.isSafari(desiredCapabilities)) { driver = new SafariDriver(); + } else if (BrowserUtil.isPhantomJS(desiredCapabilities)) { + driver = new PhantomJSDriver(); } else { throw new RuntimeException( "Not implemented support for running locally on " diff --git a/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java new file mode 100644 index 0000000000..9c12147314 --- /dev/null +++ b/uitest/src/com/vaadin/tests/tb3/RetryOnFail.java @@ -0,0 +1,65 @@ +/* + * 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.tb3; + +import org.junit.rules.TestRule; +import org.junit.runner.Description; +import org.junit.runners.model.Statement; + +/** + * <strong>ALWAYS</strong> declare the reason for using this test rule in a + * test. + * + * <p> + * Violators and abusers of this rule will be punished. + * </p> + * + * @since 7.1.14 + * @author Vaadin Ltd + */ +public class RetryOnFail implements TestRule { + private int retryCount = 1; + + @Override + public Statement apply(Statement base, Description description) { + return statement(base, description); + } + + private Statement statement(final Statement base, + final Description description) { + return new Statement() { + @Override + public void evaluate() throws Throwable { + Throwable caughtThrowable = null; + + for (int i = 0; i <= retryCount; i++) { + try { + base.evaluate(); + return; + } catch (Throwable t) { + caughtThrowable = t; + System.err.println(String.format( + "%s: run %s/%s failed.", + description.getDisplayName(), i + 1, + retryCount + 1)); + System.err.println(t.getMessage()); + } + } + throw caughtThrowable; + } + }; + } +} diff --git a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java index 9e2aa4cb78..1782e0042e 100644 --- a/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java +++ b/uitest/src/com/vaadin/tests/tb3/ScreenshotTB3Test.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -107,7 +107,7 @@ public abstract class ScreenshotTB3Test extends AbstractTB3Test { for (File referenceFile : referenceFiles) { if (testBench(driver).compareScreen(referenceFile)) { // There might be failure files because of retries in TestBench. - deleteFailureFiles(referenceFile); + deleteFailureFiles(getErrorFileFromReference(referenceFile)); break; } else { failedReferenceFiles.add(referenceFile); diff --git a/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java b/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java index c511b99e6e..294d012be5 100644 --- a/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java +++ b/uitest/src/com/vaadin/tests/tb3/ServletIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java index 8b536858e5..69880008ff 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3Runner.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3Runner.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -52,14 +52,22 @@ public class TB3Runner extends BlockJUnit4ClassRunner { /** * This is the total limit of actual JUnit test instances run in parallel */ - private static final int MAX_CONCURRENT_TESTS = 50; + private static final int MAX_CONCURRENT_TESTS; /** * This is static so it is shared by all tests running concurrently on the * same machine and thus can limit the number of threads in use. */ - private static final ExecutorService service = Executors - .newFixedThreadPool(MAX_CONCURRENT_TESTS); + private static final ExecutorService service; + + static { + if (System.getProperty("useLocalWebDriver") != null) { + MAX_CONCURRENT_TESTS = 10; + } else { + MAX_CONCURRENT_TESTS = 50; + } + service = Executors.newFixedThreadPool(MAX_CONCURRENT_TESTS); + } public TB3Runner(Class<?> klass) throws InitializationError { super(klass); diff --git a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java index 60bdb53083..703d01c122 100644 --- a/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java +++ b/uitest/src/com/vaadin/tests/tb3/TB3TestSuite.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -249,4 +249,4 @@ public class TB3TestSuite extends Suite { return true; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java b/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java index 9f9bb07a13..615cd8d5b7 100644 --- a/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java +++ b/uitest/src/com/vaadin/tests/tb3/TestNameSuffix.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java index 69a06a561a..778c8b9113 100644 --- a/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java +++ b/uitest/src/com/vaadin/tests/tb3/WebsocketTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -41,6 +41,7 @@ public abstract class WebsocketTest extends PrivateTB3Configuration { websocketBrowsers.addAll(MultiBrowserTest.getAllBrowsers()); websocketBrowsers.remove(Browser.IE8.getDesiredCapabilities()); websocketBrowsers.remove(Browser.IE9.getDesiredCapabilities()); + websocketBrowsers.remove(Browser.PHANTOMJS.getDesiredCapabilities()); } /** diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java index 229ad8ee1f..019e84daf3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1225.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1225.java @@ -66,4 +66,4 @@ public class Ticket1225 extends LegacyApplication { mainWin.setContent(sp); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java index 3fc900bf3e..04c1645d98 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1365.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1365.java @@ -45,4 +45,4 @@ public class Ticket1365 extends com.vaadin.server.LegacyApplication implements f.focus(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java index 75441d9ae9..b2816480fc 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1368.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1368.java @@ -34,4 +34,4 @@ public class Ticket1368 extends LegacyApplication { mainWin.addComponent(addColumn); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java index c530db7aec..9c8f400e1d 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1435.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1435.java @@ -233,4 +233,4 @@ public class Ticket1435 extends LegacyApplication { return panel; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java index 2fd9de1752..c786d8aab8 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1444.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1444.java @@ -28,4 +28,4 @@ public class Ticket1444 extends LegacyApplication { mainWin.addComponent(ol); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java index 522fbe7670..005beab7c4 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java @@ -85,4 +85,4 @@ public class Ticket1465ModalNotification extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java index 7ac34dcd2e..288a9ef7d2 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java @@ -128,4 +128,4 @@ public class Ticket1506_TestContainer2 implements Container { public boolean removeAllItems() throws UnsupportedOperationException { throw new UnsupportedOperationException("Not implemented"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java index 776a4aefff..c603e996ca 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1519.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1519.java @@ -22,4 +22,4 @@ public class Ticket1519 extends LegacyApplication { mainWin.addComponent(ts); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java index 05e336f4a1..45ff15e456 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1589.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1589.java @@ -97,4 +97,4 @@ class MyDynamicResource implements RequestHandler { return false; } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java index 7c574afcc9..a890c08ddb 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1598.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1598.java @@ -130,4 +130,4 @@ public class Ticket1598 extends LegacyApplication { main.addComponent(menuBar); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket161.java b/uitest/src/com/vaadin/tests/tickets/Ticket161.java index dda769d2d4..988128f4af 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket161.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket161.java @@ -45,4 +45,4 @@ public class Ticket161 extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java index b111bab2ee..c227bcc3d8 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1632.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1632.java @@ -62,4 +62,4 @@ public class Ticket1632 extends LegacyApplication { mainWin.addComponent(b); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java index c893bc1e34..33515bad87 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1737.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1737.java @@ -50,4 +50,4 @@ public class Ticket1737 extends LegacyApplication { el.addComponent(em); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java index 2c6018eb1c..60ea9528d3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1806.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1806.java @@ -44,4 +44,4 @@ public class Ticket1806 extends com.vaadin.server.LegacyApplication { } })); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java index ce08350977..60078daacd 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java @@ -94,4 +94,4 @@ public class Ticket1834PanelScrolling extends main.addComponent(p); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java index 3e4a7e2267..5c6f45de87 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1857.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1857.java @@ -112,4 +112,4 @@ public class Ticket1857 extends LegacyApplication implements Handler { getMainWindow().showNotification("Removing row number:" + target); ((Table) sender).removeItem(target); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java index 4cce9188b7..8bbd8a8350 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1868.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1868.java @@ -21,4 +21,4 @@ public class Ticket1868 extends com.vaadin.server.LegacyApplication { getMainWindow().addComponent(p); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java index d9c8a34592..939fe05e58 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1923.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1923.java @@ -85,4 +85,4 @@ public class Ticket1923 extends com.vaadin.server.LegacyApplication { main.addComponent(ol); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java index 2a510cb7d1..98c55329da 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1953.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1953.java @@ -111,4 +111,4 @@ public class Ticket1953 extends LegacyApplication { main.addComponent(grid); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java index 0548feafe0..73746fb07d 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1969.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1969.java @@ -107,4 +107,4 @@ public class Ticket1969 extends com.vaadin.server.LegacyApplication { main.addComponent(ts); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java index 427d635547..c4e7dbfcd7 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1973.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1973.java @@ -49,4 +49,4 @@ public class Ticket1973 extends com.vaadin.server.LegacyApplication { item.getItemProperty("layout").setValue(layout); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java index e1a9a47948..02175ea5d1 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket1991.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket1991.java @@ -25,4 +25,4 @@ public class Ticket1991 extends com.vaadin.server.LegacyApplication { main.addComponent(t); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java index 4dc69ec470..64881c046a 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2009.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2009.java @@ -134,4 +134,4 @@ public class Ticket2009 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java index c7c705df12..e7af6a7c55 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2037.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2037.java @@ -46,4 +46,4 @@ public class Ticket2037 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java index 45268e8947..5113c2e9c3 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2040.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2040.java @@ -84,4 +84,4 @@ public class Ticket2040 extends com.vaadin.server.LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java index 1c20d945d3..0402b4cbd5 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2062.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2062.java @@ -38,4 +38,4 @@ public class Ticket2062 extends LegacyApplication { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java index 272470d5b6..bc182181e4 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2126.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2126.java @@ -60,4 +60,4 @@ public class Ticket2126 extends com.vaadin.server.LegacyApplication { main.addComponent(table); main.addComponent(refreshTable); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java index ef32f70de4..717ced35cb 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2287.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2287.java @@ -30,4 +30,4 @@ public class Ticket2287 extends Ticket2292 { main.addComponent(l); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java index 90bf5b1ae8..259c9597b1 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2289.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2289.java @@ -98,4 +98,4 @@ class MyTab extends CustomComponent { setCompositionRoot(ol); ol.addComponent(new Label(text)); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java index eb8f47fde3..b4a3d02efa 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2297.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2297.java @@ -38,4 +38,4 @@ public class Ticket2297 extends Ticket2292 { e.printStackTrace(); } } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java index d93194aee9..352b4f9a35 100644 --- a/uitest/src/com/vaadin/tests/tickets/Ticket2901.java +++ b/uitest/src/com/vaadin/tests/tickets/Ticket2901.java @@ -31,4 +31,4 @@ public class Ticket2901 extends LegacyApplication { mainWin.setContent(sp); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LargeContainer.java b/uitest/src/com/vaadin/tests/util/LargeContainer.java index 3c18899493..a6430ec0c2 100644 --- a/uitest/src/com/vaadin/tests/util/LargeContainer.java +++ b/uitest/src/com/vaadin/tests/util/LargeContainer.java @@ -245,4 +245,4 @@ public class LargeContainer extends AbstractContainer implements throw new UnsupportedOperationException("Not supported"); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LogPrintWriter.java b/uitest/src/com/vaadin/tests/util/LogPrintWriter.java index 1f07a9c7ae..1ec6f02ac9 100644 --- a/uitest/src/com/vaadin/tests/util/LogPrintWriter.java +++ b/uitest/src/com/vaadin/tests/util/LogPrintWriter.java @@ -31,4 +31,4 @@ public class LogPrintWriter extends PrintWriter { return result.toString(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/LoremIpsum.java b/uitest/src/com/vaadin/tests/util/LoremIpsum.java index c3eec32fd5..38938fddee 100644 --- a/uitest/src/com/vaadin/tests/util/LoremIpsum.java +++ b/uitest/src/com/vaadin/tests/util/LoremIpsum.java @@ -19,4 +19,4 @@ public class LoremIpsum { public static String get() { return LOREM; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/Person.java b/uitest/src/com/vaadin/tests/util/Person.java index 72f6b7d20d..eca7b0bed8 100644 --- a/uitest/src/com/vaadin/tests/util/Person.java +++ b/uitest/src/com/vaadin/tests/util/Person.java @@ -93,4 +93,4 @@ public class Person implements Serializable { return address; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/PortableRandom.java b/uitest/src/com/vaadin/tests/util/PortableRandom.java index b66bdfdcaf..44c3201cf4 100644 --- a/uitest/src/com/vaadin/tests/util/PortableRandom.java +++ b/uitest/src/com/vaadin/tests/util/PortableRandom.java @@ -49,4 +49,4 @@ public class PortableRandom { return next(1) != 0; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/RangeCollection.java b/uitest/src/com/vaadin/tests/util/RangeCollection.java index 302619c5b9..cfc4c61fd2 100644 --- a/uitest/src/com/vaadin/tests/util/RangeCollection.java +++ b/uitest/src/com/vaadin/tests/util/RangeCollection.java @@ -48,4 +48,4 @@ public class RangeCollection extends AbstractCollection<Integer> { return size; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/util/SampleDirectory.java b/uitest/src/com/vaadin/tests/util/SampleDirectory.java index 791f53cc2c..a4829334a5 100644 --- a/uitest/src/com/vaadin/tests/util/SampleDirectory.java +++ b/uitest/src/com/vaadin/tests/util/SampleDirectory.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 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/vaadincontext/BootstrapModifyUI.java b/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java index 42130ee306..3849268bf7 100644 --- a/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java +++ b/uitest/src/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java b/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java index 3904ef2272..1c04c57526 100644 --- a/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java +++ b/uitest/src/com/vaadin/tests/widgetset/TestingWidgetSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java index 999ebc3d3f..6bd2abec60 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java index fb28e94bfa..f4d226bb03 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java index 91b4f19d92..c922259fae 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ClientRpcClassWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java b/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java index e1fed18a22..0d6a1292e2 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/ComplexTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java index ddf6763f1b..b43da8e27e 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java index 217d906137..d905daeea6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/CustomUIConnectorRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java index 32fb847ee3..f25a33225c 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java index 79505df1f4..c188e655ba 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java index 8b71e2bdec..498180cb96 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java index f3594967a9..0808abf09a 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DelegateWithoutStateClassConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java index d059426ac0..43400ada60 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/DummyLabelConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java index bf191d1e87..142fdd2e52 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java index a05bedfa27..35d071a6df 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java index 79dce8de9f..4b1f6c4c7a 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/GenericWidgetState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java index 96eff3e795..7f8468b215 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/LabelState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java index c92e688520..718706da97 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/LayoutMemoryUsageIE8ExtensionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java index cff6848e6f..5fdec05970 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java index 94972d92f4..b22b3fc4b8 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java index 24c981e0c2..60a3fb1448 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/RoundTripTesterRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java index 01ec6cc4bb..0ef4b664ac 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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 fb5b6a1980..6b4c4e7ac1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SerializerTestRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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/client/SimpleTestBean.java b/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java index 00761a2fed..51d172ee21 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/SimpleTestBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -47,4 +47,4 @@ public class SimpleTestBean implements Serializable { // Implement hash code to get consistent HashSet.toString return value; } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java index c0f7443b2e..dce7fc04cf 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/VExtendedTextArea.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java index 203a137f1b..95e286e4de 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java index 89d906f050..f825115ec8 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java index 55e11fea4c..eb869dedbc 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java index eddca38198..dca007c2ee 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java index cf02f50a78..c1b6aef830 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java index 2cc7400b1a..6b12e7d3c6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java index f85d67da4b..fc7eadced1 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java @@ -6,4 +6,4 @@ public interface MyComponentClientRpc extends ClientRpc { public void alert(String message); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java index 4745457c1f..36c54c8ee6 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java @@ -4,8 +4,8 @@ import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.user.client.Window; import com.vaadin.client.MouseEventDetailsBuilder; +import com.vaadin.client.annotations.OnStateChange; import com.vaadin.client.communication.RpcProxy; -import com.vaadin.client.communication.StateChangeEvent; import com.vaadin.client.ui.AbstractComponentConnector; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.Connect; @@ -42,12 +42,9 @@ public class MyComponentConnector extends AbstractComponentConnector { return (MyComponentState) super.getState(); } - @Override - public void onStateChanged(StateChangeEvent stateChangeEvent) { - super.onStateChanged(stateChangeEvent); - - final String text = getState().text; - getWidget().setText(text); + @OnStateChange("text") + void updateText() { + getWidget().setText(getState().text); } @Override @@ -55,4 +52,4 @@ public class MyComponentConnector extends AbstractComponentConnector { return (MyComponentWidget) super.getWidget(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java index 5571ffb701..d8d8ec8827 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java @@ -7,4 +7,4 @@ public interface MyComponentServerRpc extends ServerRpc { public void clicked(MouseEventDetails mouseDetails); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java index a7a6b987fb..df7e8c08ee 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java @@ -6,4 +6,4 @@ public class MyComponentState extends AbstractComponentState { public String text; -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java index ebc4cdbdb3..ba27fee6a3 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java index 6841617be5..df3dd5b753 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java index 6ec0a6da7c..2a305a8469 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java @@ -9,4 +9,4 @@ public class VWidgetContainer extends VerticalPanel { public VWidgetContainer() { setStyleName(CLASSNAME); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java index 62686dfded..88911e245d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java @@ -30,4 +30,4 @@ public class WidgetContainerConnector extends @Override public void updateCaption(ComponentConnector connector) { } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java index 044c5a18f6..3ac0db54fa 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/CapsLockWarningConnector.java @@ -37,4 +37,4 @@ public class CapsLockWarningConnector extends AbstractExtensionConnector { private boolean isCapsLockOn(KeyPressEvent e) { return e.isShiftKeyDown() ^ Character.isUpperCase(e.getCharCode()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java index b077d5b42d..bee8eaed41 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherConnector.java @@ -41,4 +41,4 @@ public class RefresherConnector extends AbstractExtensionConnector { public RefresherState getState() { return (RefresherState) super.getState(); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java index df9c9733f7..77fe7f78b5 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherRpc.java @@ -4,4 +4,4 @@ import com.vaadin.shared.communication.ServerRpc; public interface RefresherRpc extends ServerRpc { public void refresh(); -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java index 13e8d8bc1d..8ba705559d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7a3/RefresherState.java @@ -4,4 +4,4 @@ import com.vaadin.shared.communication.SharedState; public class RefresherState extends SharedState { public int interval; -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java index 2949feed07..cf73f2a00d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningRpc.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java index c587f53968..2f1d31a9d7 100644 --- a/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java +++ b/uitest/src/com/vaadin/tests/widgetset/client/minitutorials/v7b1/CapsLockWarningWithRpcConnector.java @@ -43,4 +43,4 @@ public class CapsLockWarningWithRpcConnector extends AbstractExtensionConnector private boolean isCapsLockOn(KeyPressEvent e) { return e.isShiftKeyDown() ^ Character.isUpperCase(e.getCharCode()); } -}
\ No newline at end of file +} diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java index cbc46b26f5..b5136b926e 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java index 135f112fe4..5b03634755 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java index 16c5ba4b61..7ff8291494 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/ClientRpcClassTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java index 2f7f0e737f..808b3bb9b7 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DelegateToWidgetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java index 13839dcc64..2af7efa8a4 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DelegateWithoutStateClassComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java b/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java index fd22725cef..881cbcc7c5 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/DummyLabel.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java index 2be59ee96b..32320f0158 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/GenericWidgetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java b/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java index 1a4e409653..37a33cc693 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java b/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java index c8e561e665..ab123be70d 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/RoundTripTester.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 diff --git a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java index 577cdde5a1..5fc5c19497 100644 --- a/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java +++ b/uitest/src/com/vaadin/tests/widgetset/server/SerializerTestExtension.java @@ -1,5 +1,5 @@ /* - * Copyright 2000-2013 Vaadin Ltd. + * 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 @@ -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) { |