summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--WebContent/VAADIN/themes/base/grid/grid.scss18
-rw-r--r--WebContent/VAADIN/themes/chameleon/components/selects/selects.scss1
-rw-r--r--WebContent/VAADIN/themes/runo/grid/grid.scss2
-rw-r--r--WebContent/VAADIN/themes/valo/components/_checkbox.scss20
-rw-r--r--WebContent/VAADIN/themes/valo/components/_grid.scss14
-rw-r--r--WebContent/license.html2
-rw-r--r--WebContent/licenses/google-app-engine-terms-of-service.txt613
-rw-r--r--WebContent/licenses/google-cloud-platform-terms-of-service.txt235
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java3
-rw-r--r--client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java2
-rw-r--r--client-compiler/src/com/vaadin/tools/CvalChecker.java4
-rw-r--r--client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java2
-rw-r--r--client/src/com/vaadin/client/LayoutManager.java156
-rw-r--r--client/src/com/vaadin/client/MeasuredSize.java34
-rw-r--r--client/src/com/vaadin/client/WidgetUtil.java94
-rw-r--r--client/src/com/vaadin/client/communication/JsonEncoder.java4
-rw-r--r--client/src/com/vaadin/client/connectors/GridConnector.java2
-rw-r--r--client/src/com/vaadin/client/ui/VAbstractSplitPanel.java8
-rw-r--r--client/src/com/vaadin/client/ui/VGridLayout.java12
-rw-r--r--client/src/com/vaadin/client/ui/VSlider.java9
-rw-r--r--client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java3
-rw-r--r--client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java6
-rw-r--r--client/src/com/vaadin/client/ui/slider/SliderConnector.java1
-rw-r--r--client/src/com/vaadin/client/ui/table/TableConnector.java46
-rw-r--r--client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java5
-rw-r--r--client/src/com/vaadin/client/widget/grid/AutoScroller.java61
-rw-r--r--client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java127
-rw-r--r--client/src/com/vaadin/client/widgets/Escalator.java46
-rw-r--r--client/src/com/vaadin/client/widgets/Grid.java171
-rw-r--r--push/build.xml2
-rw-r--r--push/ivy.xml2
-rw-r--r--scripts/BuildArchetypes.py69
-rw-r--r--scripts/BuildDemos.py41
-rw-r--r--scripts/BuildHelpers.py160
-rw-r--r--scripts/ValidateVaadinDownload.py66
-rw-r--r--server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java18
-rw-r--r--server/src/com/vaadin/navigator/Navigator.java8
-rw-r--r--server/src/com/vaadin/server/ComponentSizeValidator.java41
-rw-r--r--server/src/com/vaadin/server/ConnectorResourceHandler.java36
-rw-r--r--server/src/com/vaadin/server/Constants.java2
-rw-r--r--server/src/com/vaadin/server/DownloadStream.java38
-rw-r--r--server/src/com/vaadin/server/FileDownloader.java14
-rw-r--r--server/src/com/vaadin/server/GAEVaadinServlet.java2
-rw-r--r--server/src/com/vaadin/server/ServerRpcManager.java12
-rw-r--r--server/src/com/vaadin/ui/AbstractComponent.java28
-rw-r--r--server/src/com/vaadin/ui/AbstractLayout.java91
-rw-r--r--server/src/com/vaadin/ui/AbstractOrderedLayout.java51
-rw-r--r--server/src/com/vaadin/ui/AbstractTextField.java33
-rw-r--r--server/src/com/vaadin/ui/ComboBox.java7
-rw-r--r--server/src/com/vaadin/ui/Grid.java86
-rw-r--r--server/src/com/vaadin/ui/GridLayout.java22
-rw-r--r--server/src/com/vaadin/ui/Table.java20
-rw-r--r--server/src/com/vaadin/ui/UI.java3
-rw-r--r--server/src/com/vaadin/ui/Window.java15
-rw-r--r--server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java98
-rw-r--r--server/tests/src/com/vaadin/server/DownloadStreamTest.java39
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/AbstractLayoutDeclarativeMarginTest.java104
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java72
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java48
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java16
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java54
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/grid/GridEditorTest.java8
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java10
-rw-r--r--server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java7
-rw-r--r--server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java17
-rw-r--r--server/tests/src/com/vaadin/tests/util/MockUI.java46
-rw-r--r--server/tests/src/com/vaadin/ui/GridLayoutExpandRatioTest.java113
-rw-r--r--server/tests/src/com/vaadin/ui/LabelDataSourceTest.java14
-rw-r--r--shared/src/com/vaadin/shared/ui/MarginInfo.java6
-rw-r--r--shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java2
-rw-r--r--shared/src/com/vaadin/shared/ui/grid/GridColumnState.java3
-rw-r--r--shared/src/com/vaadin/shared/ui/ui/Transport.java13
-rw-r--r--uitest/eclipse-run-selected-test.properties8
-rw-r--r--uitest/integration_tests.xml2
-rw-r--r--uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeat.java36
-rw-r--r--uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeatTest.java53
-rw-r--r--uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java6
-rw-r--r--uitest/src/com/vaadin/tests/components/FileDownloaderUI.java (renamed from uitest/src/com/vaadin/tests/components/FileDownloaderTest.java)37
-rw-r--r--uitest/src/com/vaadin/tests/components/FileDownloaderUITest.java36
-rw-r--r--uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentStyleNameTest.java115
-rw-r--r--uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java62
-rw-r--r--uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java53
-rw-r--r--uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRpcCount.java10
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcutTest.java37
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java74
-rw-r--r--uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java44
-rw-r--r--uitest/src/com/vaadin/tests/components/embedded/åäö-日本語.pdfbin0 -> 22522 bytes
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/BeanRenderer.java25
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/CustomRenderer.java15
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/CustomRendererTest.java7
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java51
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java57
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java56
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java42
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java36
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java78
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java90
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java96
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java67
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java12
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java88
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java5
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java10
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java25
-rw-r--r--uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java34
-rw-r--r--uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignment.java66
-rw-r--r--uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignmentTest.java31
-rw-r--r--uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayouts.java87
-rw-r--r--uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayoutsTest.java57
-rw-r--r--uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java43
-rw-r--r--uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java44
-rw-r--r--uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleName.java59
-rw-r--r--uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleNameTest.java63
-rw-r--r--uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrder.java119
-rw-r--r--uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrderTest.java72
-rw-r--r--uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewport.java2
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableRequiredIndicator.java73
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableRequiredIndicatorTest.java39
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibility.java96
-rw-r--r--uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibilityTest.java77
-rw-r--r--uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java32
-rw-r--r--uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java24
-rw-r--r--uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java54
-rw-r--r--uitest/src/com/vaadin/tests/serialization/EncodeResultDisplayTest.java44
-rw-r--r--uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java27
-rw-r--r--uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java24
-rw-r--r--uitest/src/com/vaadin/tests/tb3/SingleBrowserTestPhantomJS2.java1
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java5
-rw-r--r--uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java2
-rw-r--r--uitest/src/com/vaadin/tests/util/WidgetUtilTest.java97
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/EncoderResultDisplayConnector.java76
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/ScrollableGridLayoutConnector.java36
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestComponentState.java7
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestConnector.java43
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestWidget.java140
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/client/grid/PojoRendererConnector.java39
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/server/ScrollableGridLayout.java34
-rw-r--r--uitest/src/com/vaadin/tests/widgetset/server/WidgetUtilUI.java45
-rw-r--r--uitest/tb2/com/vaadin/tests/components/FileDownloaderTest.html36
-rw-r--r--uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.html59
-rw-r--r--widgets/build.xml9
141 files changed, 5050 insertions, 1317 deletions
diff --git a/WebContent/VAADIN/themes/base/grid/grid.scss b/WebContent/VAADIN/themes/base/grid/grid.scss
index ede4ccca0d..1653032703 100644
--- a/WebContent/VAADIN/themes/base/grid/grid.scss
+++ b/WebContent/VAADIN/themes/base/grid/grid.scss
@@ -125,7 +125,7 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co
border-radius: 0;
}
- &.opened {
+ &.open {
.#{$primaryStyleName}-sidebar-button {
width: 100%;
@@ -137,11 +137,11 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co
}
}
- .v-ie &.opened .#{$primaryStyleName}-sidebar-button {
+ .v-ie &.open .#{$primaryStyleName}-sidebar-button {
vertical-align: middle;
}
- .v-ie8 &.opened .#{$primaryStyleName}-sidebar-button:after {
+ .v-ie8 &.open .#{$primaryStyleName}-sidebar-button:after {
display: inline;
}
@@ -366,6 +366,18 @@ $v-grid-details-border-bottom-stripe: 1px solid darken($v-grid-row-background-co
min-height: 100%;
max-height: 100%;
}
+
+ .v-datefield-button {
+ .v-ie8 & {
+ margin-left: -30px;
+ }
+ }
+
+ .v-filterselect-button {
+ .v-ie8 & {
+ margin-left: -27px;
+ }
+ }
.v-select,
.v-select-select {
diff --git a/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss b/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss
index 767daa7f42..fc51e8a779 100644
--- a/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss
+++ b/WebContent/VAADIN/themes/chameleon/components/selects/selects.scss
@@ -73,6 +73,7 @@ $select-button-negative-width : -16px;
.#{$primaryStyleName}-search .#{$primaryStyleName}-button {
width: 0;
overflow: hidden;
+ margin-right: 0;
}
.#{$primaryStyleName}-prompt .#{$primaryStyleName}-input {
diff --git a/WebContent/VAADIN/themes/runo/grid/grid.scss b/WebContent/VAADIN/themes/runo/grid/grid.scss
index 71ec6e06e0..aca9821c53 100644
--- a/WebContent/VAADIN/themes/runo/grid/grid.scss
+++ b/WebContent/VAADIN/themes/runo/grid/grid.scss
@@ -30,7 +30,7 @@
// Sidebar
.#{$primaryStyleName}-sidebar.v-contextmenu {
- &.opened {
+ &.open {
.#{$primaryStyleName}-sidebar-button {
&:after {
font-size: 22px;
diff --git a/WebContent/VAADIN/themes/valo/components/_checkbox.scss b/WebContent/VAADIN/themes/valo/components/_checkbox.scss
index 7283c4cbbf..1be12d3533 100644
--- a/WebContent/VAADIN/themes/valo/components/_checkbox.scss
+++ b/WebContent/VAADIN/themes/valo/components/_checkbox.scss
@@ -144,4 +144,24 @@
}
}
+ &.v-readonly {
+ > label,
+ > .v-icon {
+ cursor: default;
+ }
+
+ > label > .v-icon {
+ cursor: default;
+ }
+
+ :root & > input:active ~ label:after {
+ background: transparent;
+ }
+
+ :root & > input ~ label:after {
+ @include opacity($v-disabled-opacity);
+ }
+ }
+
+
}
diff --git a/WebContent/VAADIN/themes/valo/components/_grid.scss b/WebContent/VAADIN/themes/valo/components/_grid.scss
index c07d330410..27d421b9f2 100644
--- a/WebContent/VAADIN/themes/valo/components/_grid.scss
+++ b/WebContent/VAADIN/themes/valo/components/_grid.scss
@@ -146,6 +146,18 @@ $v-grid-details-border-bottom-stripe: $v-grid-cell-horizontal-border !default;
@include box-shadow(none);
}
}
+
+ .v-datefield-button {
+ .v-ie8 & {
+ margin-left: 0px;
+ }
+ }
+
+ .v-filterselect-button {
+ .v-ie8 & {
+ margin-left: 0px;
+ }
+ }
.v-textfield-focus,
.v-datefield .v-textfield-focus,
@@ -190,7 +202,7 @@ $v-grid-details-border-bottom-stripe: $v-grid-cell-horizontal-border !default;
// Sidebar
.#{$primary-stylename}-sidebar.v-contextmenu {
- &.opened {
+ &.open {
.#{$primary-stylename}-sidebar-button:after {
font-size: 20px;
}
diff --git a/WebContent/license.html b/WebContent/license.html
index 48be15b98d..fe37813e57 100644
--- a/WebContent/license.html
+++ b/WebContent/license.html
@@ -76,7 +76,7 @@
<tr>
<td>Google AppEngine API*</td>
- <td><a href="licenses/google-app-engine-terms-of-service.txt">Google App Engine Terms of Service</a></td>
+ <td><a href="licenses/google-cloud-platform-terms-of-service.txt">Google Cloud Platform Terms of Service</a></td>
</tr>
<tr>
diff --git a/WebContent/licenses/google-app-engine-terms-of-service.txt b/WebContent/licenses/google-app-engine-terms-of-service.txt
deleted file mode 100644
index daaa8c2189..0000000000
--- a/WebContent/licenses/google-app-engine-terms-of-service.txt
+++ /dev/null
@@ -1,613 +0,0 @@
-Google App Engine Terms of Service
-Your Agreement with Google
-
-This License Agreement for Google App Engine (the "Agreement") is made and
-entered into by and between Google Inc., a Delaware corporation, with offices at
-1600 Amphitheatre Parkway, Mountain View 94043 ("Google") and the business
-entity agreeing to these terms ("Customer"). This Agreement is effective as of
-the date Customer clicks the "I Accept" button below (the "Effective Date"). If
-you are accepting on behalf of Customer, you represent and warrant that: (i) if
-you have full legal authority to bind Customer to this Agreement; (ii) you have
-read and understand this Agreement; and (iii) you agree, on behalf of Customer,
-to this Agreement. If you do not have the legal authority to bind Customer,
-please do not click the "I Accept" button below. This Agreement governs
-Customer's access to and use of the Service.
-1. Licenses.
-
-1.1 From Google to Customer. Subject to this Agreement, Google grants to
-Customer a worldwide, non-sublicensable, non-transferable, non-exclusive,
-terminable, limited license to (a) use the Service, (b) integrate the Service
-into any Application and provide the Service, solely as integrated into the
-Application, to users of the Application and (c) use any Software provided by
-Google as part of the Service.
-
-1.2 From Customer to Google. By submitting, posting, generating or displaying
-any Application and/or Customer Data on or through the Service, Customer gives
-Google a worldwide, non-sublicensable, non-transferable, non-exclusive,
-terminable, limited license to reproduce, adapt, modify, translate, publish,
-publicly perform, publicly display and distribute any Application and/or
-including Customer Data for the sole purpose of enabling Google to provide
-Customer with the Service in accordance with the Agreement.
-Provision of the Service.
-
-2.1 Console. Google will provide the Service to Customer. As part of receiving
-the Service, Customer will have access to the Admin Console, through which
-Customer may administer the Service.
-
-2.2 Facilities and Data Transfer. All facilities used to store and process an
-Application and Customer Data will adhere to reasonable security standards no
-less protective than the security standards at facilities where Google processes
-and stores its own information of a similar type. Google has implemented at
-least industry standard systems and procedures to ensure the security and
-confidentiality of an Application and Customer Data, protect against anticipated
-threats or hazards to the security or integrity of an Application and Customer
-Data, and protect against unauthorized access to or use of an Application and
-Customer Content. Google may process and store an Application and Customer Data
-in the United States or any other country in which Google or its agents maintain
-facilities. By using the Service, Customer consents to this processing and
-storage of an Application and Customer Data. The parties agree that Google is
-merely a data processor.
-
-2.3 Data Storage Selection.
-
- Data Storage. Customer may select via the Service whether the Core App
-Engine End User Data will be stored permanently, at rest, in either the United
-States or the European Union, and Google will store it accordingly ("App Engine
-Data Location Setting"). If no selection is made, Core App Engine End User Data
-will be stored permanently, at rest, in the United States.
- Transient Storage. Core App Engine End User Data may be stored transiently
-or cached in any country in which Google or its agents maintain facilities
-before reaching permanent storage.
- Limitations. No App Engine Data Location Setting will apply to Core App
-Engine End User Data copied in another location or used with other Google
-products and services (including any other Google Cloud Platform services). If
-so, the Core App Engine End User Data will be processed and stored pursuant to
-Section 2.2 of this Agreement.
-
-2.4 Accounts. Customer must have an Account to use the Service, and is
-responsible for the information it provides to create the Account, the security
-of its passwords for the Account, and for any use of its Account. If Customer
-becomes aware of any unauthorized use of its password or its Account, Customer
-will notify Google as promptly as possible.
-
-2.5 Privacy Policies. The Service is subject to Google's Privacy Policy. Changes
-to the Privacy Policy will be made as stated in the applicable policy. In
-addition, Google is enrolled in the U.S. Department of Commerce Safe Harbor
-Program and will remain enrolled in this program or another replacement program
-(or will adopt a compliance solution which achieves compliance with the terms of
-Article 25 of Directive 95/46/EC) throughout the Term of the Agreement.
-
-2.6 New Applications. Google may make new applications, tools, features or
-functionality available from time to time through the Service, the use of which
-may be contingent upon Customer's agreement to additional terms.
-
-2.7 Modifications.
-
- To the Service. Subject to Section 9.4 (Termination for Convenience), Google
-may make commercially reasonable Updates to the Service from time to time. If
-Google makes a material change to the Service, Google will inform Customer,
-provided that Customer has subscribed with Google to be informed about such
-change.
- To the Agreement. Google may make changes to this Agreement, including
-pricing from time to time. Unless otherwise noted by Google, material changes to
-the Agreement will become effective 90 days after they are posted, except if the
-changes apply to new functionality in which case they will be effective
-immediately. If Customer does not agree to the revised Agreement, please stop
-using the Service. Google will post any modification to this Agreement to the
-Terms URL.
-
-3. Payment Terms.
-
-3.1 Free Quota. The Service is provided to Customer without charge up to the Fee
-Threshold.
-
-3.2 Online Billing. Google will issue an electronic bill to Customer for all
-charges accrued above the Fee Threshold. Fees are solely based on Google's
-measurements of Customer's use of the Service, may include monthly fees, and
-Google's determination is final. For use above the Fee Threshold, Customer shall
-be responsible for all Fees up to the amount set in the Account and shall pay
-all Fees in U.S. Dollars or in such other currency as agreed to in writing by
-the parties. Customer shall pay all Fees in accordance with the payment terms in
-the Service FAQ.
-
-3.3 Delinquent Payments. Late payments may bear interest at the rate of 1.5% per
-month (or the highest rate permitted by law, if less). Google reserves the right
-to suspend your Account for any late payments.
-
-3.4 Taxes. Customer is responsible for any Taxes, and Customer will pay Google
-for the Services without any reduction for Taxes. If Google is obligated to
-collect or pay Taxes, the Taxes will be invoiced to Customer, unless Customer
-provides Google with a timely and valid tax exemption certificate authorized by
-the appropriate taxing authority. In some states the sales tax is due on the
-total purchase price at the time of sale and must be invoiced and collected at
-the time of the sale. If Customer is required by law to withhold any Taxes from
-its payments to Google, Customer must provide Google with an official tax
-receipt or other appropriate documentation to support such withholding payments.
-
-3.5 Invoice Disputes & Refunds. To the fullest extent permitted by law, Customer
-waives all claims relating to Fees unless claimed within sixty days after
-charged (this does not affect any Customer rights with its credit card issuer).
-Refunds (if any) are at the discretion of Google and will only be in the form of
-credit for the Service. Nothing in this Agreement obligates Google to extend
-credit to any party.
-4. Customer Obligations.
-
-4.1 Compliance. Customer is solely responsible for its Applications and Customer
-Data, and for making sure its Applications or Customer Data comply with the
-Acceptable Use Policy. Google reserves the right to review the Application or
-Customer Data to ensure Customer's compliance with the Acceptable Use Policy.
-Customer is responsible for ensuring all End Users comply with Customer's
-obligations under the Agreement.
-
-4.2 Privacy. Customer will protect the privacy and legal rights of its End Users
-under all applicable laws and regulations, which includes a legally adequate
-privacy notice communicated from Customer. Customer may have the ability to
-access, monitor, use, or disclose Customer Data submitted by End Users through
-the Service. Customer will obtain and maintain any required consents from End
-Users to allow Customer's access, monitoring, use and disclosure of Customer
-Data. Further, Customer will notify its End Users that any Customer Data
-provided as part of the Service will be made available to a third party as part
-of Google providing the Service.
-
-4.3 Restrictions. Customer will not, and will not allow third parties under its
-control to: (a) copy, modify, create a derivative work of, reverse engineer,
-decompile, translate, disassemble, or otherwise attempt to extract the source
-code of the Service or any component thereof (subject to Section 4.4 below); (b)
-use the Service for High Risk Activities; (c) sublicense, resell, or distribute
-the Service or any component thereof separate from any integrated Application;
-(d) use the Service to create, train, or improve (directly or indirectly) a
-substantially similar product or service, including any other machine
-translation engine; (e) create multiple Applications or Accounts to simulate or
-act as a single Application or Account (respectively) or otherwise access the
-Service in a manner intended to avoid incurring Fees; (f) use the Service to
-operate or enable any telecommunications service or in connection with any
-Application that allows End Users to place calls to or to receive calls from any
-public
-switched telephone network; or (g) process or store any Customer Data that is
-subject to the International Traffic in Arms Regulations maintained by the
-Department of State. Customer acknowledges that the Service is not HIPAA
-compliant and Customer is solely responsible for any applicable compliance with
-HIPAA.
-
-4.4 Open Source Components. Open source software licenses for components of the
-Service released under an open source license constitute separate written
-agreements. Open source software is listed in the Documentation. To the limited
-extent the open source software licenses expressly supersede this Agreement, the
-open source license instead governs Customer's agreement with Google for the
-specific included open source components of the Service, or use of the Service
-(as may be applicable).
-
-4.5 Documentation. Google may provide Documentation for Customer's use of the
-Service. The Documentation may specify restrictions (e.g. attribution of HTML
-restrictions) on how the Applications may be built or the Service may be used
-and Customer agrees to comply with any such restrictions specified.
-
-4.6 DMCA Policy. Google provides information to help copyright holders manage
-their intellectual property online, but Google cannot determine whether
-something is being used legally or not without their input. Google responds to
-notices of alleged copyright infringement and terminates accounts of repeat
-infringers according to the process set out in the U.S. Digital Millennium
-Copyright Act. If Customer thinks somebody is violating Customer's or its End
-Users' copyrights and wants to notify Google, Customer can find information
-about submitting notices, and Google's policy about responding to notices at
-http://www.google.com/dmca.html.
-
-4.7 Application and No Multiple Accounts, Bills. Any Application must have
-material value independent from the Services. Google has no obligation to
-provide multiple bills or Accounts to Customer under the Agreement.
-5. Suspension and Removals.
-
-5.1 Suspension/Removals. If Customer becomes aware that any Application or an
-End User's use of an Application, or Customer Data violates the Acceptable Use
-Policy, Customer will immediately suspend the Application, remove the applicable
-Customer Data, or suspend access to an End User (as may be applicable). If
-Customer fails to suspend or remove as noted in the prior sentence, Google may
-specifically request that Customer do so. If Customer fails to comply with
-Google's request to do so within twenty-four hours, then Google may suspend
-Google accounts of the applicable End Users, disable the Application, and/or
-disable the Account (as may be applicable) until such violation is corrected.
-
-5.2 Emergency Security Issues. Despite the foregoing, if there is an Emergency
-Security Issue, then Google may automatically suspend the offending End User
-account, Application or the Account. Suspension will be to the minimum extent
-required, and of the minimum duration, to prevent or terminate the Emergency
-Security Issue. If Google suspends an End User account or the Application or
-Account, for any reason, without prior notice to Customer, at Customer's
-request, Google will provide Customer the reason for the suspension as soon as
-is reasonably possible.
-6. Intellectual Property Rights; Brand Features.
-
-6.1 Intellectual Property Rights. Except as expressly set forth herein, this
-Agreement does not grant either party any rights, implied or otherwise, to the
-other's content or any of the other's intellectual property. As between the
-parties, Customer owns all Intellectual Property Rights in any Application and
-Customer Content, and Google owns all Intellectual Property Rights in the
-Service.
-
-6.2 Brand Features Limitation. If Customer wants to display Google Brand
-Features in connection with its use of the Service, Customer must obtain written
-permission from Google through process specified in the Trademark Guidelines.
-For the sole purpose of providing the Service, Customer permits Google to
-display any Brand Features that may appear in its Application. Any use of a
-party's Brand Features will inure to the benefit of the party holding
-Intellectual Property Rights to those Brand Features. A party may revoke the
-other party's right to use its Brand Features pursuant to this Agreement with
-written notice to the other and a reasonable period to stop the use.
-7. Technical Support Service
-
-7.1 By Customer. Customer is responsible for technical support of its
-Application.
-
-7.2 Deprecation Policy.
-
-Google will announce if we intend to discontinue or make backwards incompatible
-changes to this API or Service. We will use commercially reasonable efforts to
-continue to operate that Service without these changes until the later of: (i)
-one year after the announcement or (ii) April 20, 2015, unless (as Google
-determines in its reasonable good faith judgment):
-
- required by law or third party relationship (including if there is a change
-in applicable law or relationship), or
- doing so could create a security risk or substantial economic or material
-technical burden.
-
-This Deprecation Policy doesn't apply to versions, features, and functionality
-labeled as "experimental."
-8. Confidential Information.
-
-8.1 Obligations. The recipient of the other party's Confidential Information
-will not disclose the Confidential Information, except to Affiliates, employees,
-agents, or professional advisors who need to know it and who have agreed in
-writing (or in the case of professional advisors are otherwise bound) to keep it
-confidential. The recipient will ensure that those people and entities use the
-Confidential Information only to exercise rights and fulfill obligations under
-this Agreement, while using reasonable care to keep it confidential. The
-recipient may also disclose Confidential Information when required by law after
-giving reasonable notice to the discloser if allowed by law. The recipient may
-also disclose Confidential Information to the extent required by applicable
-Legal Process; provided that the recipient uses commercially reasonable efforts
-to: (i) promptly notify the other party of such disclosure before disclosing;
-and (ii) comply with the other party's reasonable requests regarding its efforts
-to
-oppose the disclosure. Notwithstanding the foregoing, subsections (i) and (ii)
-above will not apply if the recipient determines that complying with (i) and
-(ii) could: (a) result in a violation of Legal Process; (b) obstruct a
-governmental investigation; and/or (c) lead to death or serious physical harm to
-an individual. As between the parties, Customer is responsible for responding to
-all third party requests concerning its use and its End Users' use of the
-Services.
-9. Term and Termination.
-
-9.1 Agreement Term. The license granted in this Agreement will remain in effect,
-unless terminated earlier as set forth in this Agreement.
-
-9.2 Termination for Breach. Either party may terminate this Agreement for breach
-if: (i) the other party is in material breach of the Agreement and fails to cure
-that breach within thirty days after receipt of written notice; (ii) the other
-party ceases its business operations or becomes subject to insolvency
-proceedings and the proceedings are not dismissed within ninety days; or (iii)
-the other party is in material breach of this Agreement more than two times
-notwithstanding any cure of such breaches.
-
-9.3 Termination for Inactivity. Google reserves the right to terminate the
-Service for inactivity, if, for a period exceeding ninety days, Customer (a) has
-failed to access the Admin Console, (b) an Application has not served any
-requests, and (c) no electronic bills are being generated.
-
-9.4 Termination for Convenience. Customer may stop using the Service at any
-time. Customer may terminate this Agreement for convenience at any time on prior
-written notice and upon termination, must cease use of the Service. Google may
-terminate this Agreement for its convenience at any time without liability to
-Customer. Subject to Section 7.2, Google may discontinue the Service or any
-portion or feature for any reason at any time without liability to Customer.
-
-9.5 Effects of Termination. If the Agreement expires or is terminated, then: (i)
-the rights granted by one party to the other will immediately cease; (ii) all
-Fees (including Taxes) owed by Customer to Google are immediately due upon
-receipt of the final electronic bill; (iii) Customer will delete the Software,
-any Application and any Customer Data; and (iv) upon request, each party will
-use commercially reasonable efforts to return or destroy all Confidential
-Information of the other party.
-10. Publicity.
-
-Customer is permitted to state publicly that it is a customer of the Service,
-consistent with the Trademark Guidelines. Customer agrees that Google may
-include Customer's name or Brand Features in a list of Google customers, online
-or promotional materials. Customer also agrees that Google may verbally
-reference Customer as a customer of the Google products or services that are the
-subject of this Agreement. This section is subject to the "Brand Features
-Limitation" section of the Agreement. For clarification, neither party needs to
-seek approval from the other if the party is repeating a public statement that
-is substantially similar to a public statement that has been previously
-approved.
-11. Representations.
-
-Each party represents that: (a) it has full power and authority to enter into
-the Agreement; and (b) it will comply with all laws and regulations applicable
-to its provision, or use, of the Service, as applicable. Google warrants it will
-provide the Service in accordance with the applicable SLA.
-12. Disclaimer.
-
-EXCEPT AS EXPRESSLY PROVIDED FOR HEREIN, TO THE MAXIMUM EXTENT PERMITTED BY
-APPLICABLE LAW, GOOGLE DOES NOT MAKE ANY OTHER WARRANTY OF ANY KIND, WHETHER
-EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING WITHOUT LIMITATION
-WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR USE AND NONINFRINGEMENT.
-GOOGLE IS NOT RESPONSIBLE OR LIABLE FOR THE DELETION OF OR FAILURE TO STORE ANY
-CONTENT AND OTHER COMMUNICATIONS MAINTAINED OR TRANSMITTED THROUGH USE OF THE
-SERVICE. CUSTOMER IS SOLELY RESPONSIBLE FOR SECURING AND BACKING UP ITS
-APPLICATION AND CUSTOMER CONTENT. GOOGLE DOES NOT WARRANT THAT THE OPERATION OF
-THE SOFTWARE OR THE SERVICE WILL BE ERROR-FREE OR UNINTERRUPTED. NEITHER THE
-SOFTWARE NOR THE SERVICE ARE DESIGNED, MANUFACTURED, OR INTENDED FOR HIGH RISK
-ACTIVITIES.
-13. Limitation of Liability.
-
-13.1 Limitation on Indirect Liability. TO THE MAXIMUM EXTEND PERMITTED BY
-APPLICABLE LAW, NEITHER PARTY, NOR GOOGLE'S SUPPLIERS, WILL BE LIABLE UNDER THIS
-AGREEMENT FOR LOST REVENUES OR INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL,
-EXEMPLARY, OR PUNITIVE DAMAGES, EVEN IF THE PARTY KNEW OR SHOULD HAVE KNOWN THAT
-SUCH DAMAGES WERE POSSIBLE AND EVEN IF DIRECT DAMAGES DO NOT SATISFY A REMEDY.
-
-13.2 Limitation on Amount of Liability. TO THE MAXIMUM EXTENT PERMITTED BY
-APPLICABLE LAW, NEITHER PARTY, NOR GOOGLE'S SUPPLIER'S, MAY BE HELD LIABLE UNDER
-THIS AGREEMENT FOR MORE THAN THE AMOUNT PAID BY CUSTOMER TO GOOGLE DURING THE
-TWELVE MONTHS PRIOR TO THE EVENT GIVING RISE TO LIABILITY.
-
-13.3 Exceptions to Limitations. These limitations of liability do not apply to
-breaches of confidentiality obligations, violations of a party's Intellectual
-Property Rights by the other party, or indemnification obligations.
-14. Indemnification.
-
-14.1 By Customer. Customer will indemnify, defend, and hold harmless Google from
-and against all liabilities, damages, and costs (including settlement costs and
-reasonable attorneys' fees) arising out of a third party claim: (i) regarding
-any Application or Customer Content; (ii) that Customer Brand Features infringe
-or misappropriate any patent, copyright, trade secret or trademark of a third
-party; or (iii) regarding Customer's, or its End Users', use of the Service in
-violation of the Acceptable Use Policy.
-
-14.2 By Google. Google will indemnify, defend, and hold harmless Customer from
-and against all liabilities, damages, and costs (including settlement costs and
-reasonable attorneys' fees) arising out of a third party claim that Google's
-technology used to provide the Service (excluding any open source software) or
-any Google Brand Feature infringes or misappropriates any patent, copyright,
-trade secret or trademark of such third party. Notwithstanding the foregoing, in
-no event shall Google have any obligations or liability under this Section
-arising from: (i) use of any Service or Google Brand Features in a modified form
-or in combination with materials not furnished by Google, and (ii) any Customer
-Content.
-
-14.3 Possible Infringement.
-
- Repair, Replace, or Modify. If Google reasonably believes the Service
-infringes a third party's Intellectual Property Rights, then Google will: (a)
-obtain the right for Customer, at Google's expense, to continue using the
-Service; (b) provide a non-infringing functionally equivalent replacement; or
-(c) modify the Service so that it no longer infringes.
- Suspension or Termination. If Google does not believe the foregoing options
-are commercially reasonable, then Google may suspend or terminate Customer's use
-of the impacted Service.
-
-14.4 General. As a condition to indemnification for a claim, the party seeking
-indemnification must promptly notify the other party of the claim in writing and
-cooperate with the other party in defending the claim. The indemnifying party
-has full control and authority over the defense, except that: (a) any settlement
-requiring the party seeking indemnification to admit liability or to pay any
-money will require that party's prior written consent, such consent not to be
-unreasonably withheld or delayed; and (b) the other party may join in the
-defense with its own counsel at its own expense. Notwithstanding the foregoing,
-if the indemnified party settles without the prior written consent of the
-indemnifying party, the indemnifying party has no obligation of contribution.
-THE INDEMNITIES ABOVE ARE THE ONLY REMEDY UNDER THIS AGREEMENT FOR VIOLATION OF
-A THIRD PARTY'S INTELLECTUAL PROPERTY RIGHTS.
-15. Government Purposes (applicable to United States government customers only).
-
-The Service was developed solely at private expense and is commercial computer
-software and related documentation within the meaning of the applicable civilian
-and military Federal acquisition regulations and any supplements thereto. If the
-user of the Service is an agency, department, employee, or other entity of the
-United States Government, under FAR 12.212 and DFARS 227.7202, the use,
-duplication, reproduction, release, modification, disclosure, or transfer of the
-Service, including technical data or manuals, is governed by the terms and
-conditions contained in this Agreement, which is Google's standard commercial
-license agreement.
-16. Miscellaneous.
-
-16.1 Notices. All notices must be in writing and addressed to the other party's
-legal department and primary point of contact. The email address for notices
-being sent to Google's Legal Department is legal-notices@google.com. Notice will
-be treated as given: (a) on receipt as verified by written automated receipt or
-by electronic log (as applicable).
-
-16.2 Assignment. Neither party may assign any part of this Agreement without the
-written consent of the other, except to an Affiliate where: (a) the assignee has
-agreed in writing to be bound by the terms of this Agreement; (b) the assigning
-party remains liable for obligations under the Agreement if the assignee
-defaults on them; and (c) the assigning party has notified the other party of
-the assignment. Any other attempt to assign is void.
-
-16.3 Change of Control. If a party experiences a change of Control (for example,
-through a stock purchase or sale, merger, or other form of corporate
-transaction): (a) that party will give written notice to the other party within
-thirty days after the change of Control; and (b) the other party may immediately
-terminate this Agreement any time between the change of Control and thirty days
-after it receives that written notice.
-
-16.4 Force Majeure. Neither party will be liable for failure or delay in
-performance to the extent caused by circumstances beyond its reasonable control.
-
-16.5 No Agency. This Agreement does not create any agency, partnership or joint
-venture between the parties.
-
-16.6 No Waiver. Neither party will be treated as having waived any rights by not
-exercising (or delaying the exercise of) any rights under this Agreement.
-
-16.7 Severability. If any term (or part of a term) of this Agreement is invalid,
-illegal or unenforceable, the rest of the Agreement will remain in effect.
-
-16.8 No Third-Party Beneficiaries. This Agreement does not confer any benefits
-on any third party unless it expressly states that it does.
-
-16.9 Equitable Relief. Nothing in this Agreement will limit either party's
-ability to seek equitable relief.
-
-16.10 Governing Law.
-
- For City, County, and State Government Entities. If Customer is a city,
-county or state government entity, then the parties agree to remain silent
-regarding governing law and venue.
- For Federal Government Entities. If Customer is a federal government entity
-then the following applies: ALL CLAIMS ARISING OUT OF OR RELATING TO THIS
-AGREEMENT OR THE SERVICE WILL BE GOVERNED BY THE LAWS OF THE UNITED STATES OF
-AMERICA, EXCLUDING ITS CONFLICT OF LAWS RULES. SOLELY TO THE EXTENT PERMITTED BY
-FEDERAL LAW: (I) THE LAWS OF THE STATE OF CALIFORNIA (EXCLUDING CALIFORNIA'S
-CONFLICT OF LAWS RULES) WILL APPLY IN THE ABSENCE OF APPLICABLE FEDERAL LAW; AND
-(II) FOR ALL CLAIMS ARISING OUT OF OR RELATING TO THIS AGREEMENT OR THE SERVICE,
-THE PARTIES CONSENT TO PERSONAL JURISDICTION IN, AND THE EXCLUSIVE VENUE OF, THE
-COURTS IN SANTA CLARA COUNTY, CALIFORNIA.
- For All Other Entities. If Customer is any entity not set forth in Section
-16.10(a) or (b) then the following applies: ALL CLAIMS ARISING OUT OF OR
-RELATING TO THIS AGREEMENT OR THE SERVICE WILL BE GOVERNED BY CALIFORNIA LAW,
-EXCLUDING THAT STATE'S CONFLICT OF LAWS RULES, AND WILL BE LITIGATED EXCLUSIVELY
-IN THE FEDERAL OR STATE COURTS OF SANTA CLARA COUNTY, CALIFORNIA, USA;THE
-PARTIES CONSENT TO PERSONAL JURISDICTION IN THOSE COURTS.
-
-16.11 Amendments. Any amendment must be in writing, signed by both parties, and
-expressly state that it is amending this Agreement.
-
-16.12 Survival. The following Sections will survive expiration or termination of
-this Agreement: 6.1 (Intellectual Property Rights), 8 (Confidential
-Information), 9.5 (Effects of Termination), 13 (Limitation of Liability), 14
-(Indemnification) and 16 (Miscellaneous).
-
-16.13 Entire Agreement. This Agreement supersedes all other agreements between
-the parties relating to its subject matter. In entering into this Agreement,
-neither party has relied on, and neither party will have any right remedy based
-on, any statement, representation or warranty (whether made negligently or
-innocently), except those expressly set out in this Agreement. The terms located
-at a URL referenced in this Agreement and the Documentation are hereby
-incorporated by this reference. After the Effective Date, Google may provide
-Customer with an updated URL in place of any URL in this Agreement.
-
-16.14 Interpretation of Conflicting Terms. If there is a conflict among the
-documents that make up this Agreement, the documents will control in the
-following order: the Agreement, and the terms located at any URL.
-
-16.15 Counterparts. The parties may execute this Agreement in counterparts,
-including facsimile, PDF and other electronic copies, which taken together will
-constitute one instrument.
-
-16.16 Definitions.
-
- "Acceptable Use Policy" means the acceptable use policy set forth here:
-http://developers.google.com/cloud/terms/aup.
- "Account" means Customer's Google account (either gmail.com address or an
-Email address provided under the
- "Google Apps" product line); subject to those terms of service, as may be
-applicable.
- "Admin Console" means the online tool provided by Google to Customer for
-administering the Service.
- "Affiliate" means any entity that directly or indirectly controls, is
-controlled by, or is under common control with a party.
- "Application(s)" means any web application Customer creates using the
-Service, including any source code written by Customer to be used with the
-Service.
- "Brand Features" means the trade names, trademarks, service marks, logos,
-domain names, and other distinctive brand features of each party, respectively,
-as secured by such party from time to time.
- "Confidential Information" means information that one party (or an
-Affiliate) discloses to the other party under this Agreement, and which is
-marked as confidential or would normally under the circumstances be considered
-confidential information. It does not include information that the recipient
-already rightfully knew, that becomes public through no fault of the recipient,
-that was independently developed by the recipient, or that was lawfully given to
-the recipient by a third party. Customer Data is considered Customer's
-Confidential Information.
- "Control" means control of greater than fifty percent of the voting rights
-or equity interests of a party.
- "Core App Engine End User Data" means content provided through the use of an
-Application running on Google App Engine, by those End Users who are not acting
-as Developer End Users (and information related to those End Users stored by the
-Application), but excluding authentication information for those End Users'
-Google accounts.
- "Customer Data" means content provided, transmitted or displayed via the
-Service by Customer, or its End Users; but excluding any data provided as part
-of the Account.
- "Documentation" means the Google documentation in the form generally made
-available by Google to its customers for use with the Service, as may be found
-here: https://developers.google.com/appengine/docs or such other URL as Google
-may provide.
- "Emergency Security Issue" means either: (a) Customer's or its End User's
-use of the Service in violation of the Acceptable Use Policy, which could
-disrupt: (i) the Service; (ii) other Customers' or its End Users' use of the
-Service; or (iii) the Google network or servers used to provide the Service; or
-(b) unauthorized third party access to the Service.
- "End Users" means the individuals Customer permits to use the Application.
- "Export Control Laws" means all applicable export and re-export control laws
-and regulations, including the Export Administration Regulations ("EAR")
-maintained by the U.S. Department of Commerce, trade and economic sanctions
-maintained by the Treasury Department's Office of Foreign Assets Control, and
-the International Traffic in Arms Regulations ("ITAR") maintained by the
-Department of State.
- "Fee Threshold" means the threshold (as may be updated from time to time),
-which is more fully described here:
-https://developers.google.com/appengine/docs/quotas.
- "Fees" means the applicable fees for the Service and any applicable Taxes as
-set forth here: https://developers.google.com/appengine/docs/billing.
- "High Risk Activities" means uses such as the operation of nuclear
-facilities, air traffic control, or life support systems, where the use or
-failure of the Service could lead to death, personal injury, or environmental
-damage.
- "HIPAA" means the Health Insurance Portability and Accountability Act of
-1996 as it may be amended from time to time, and any regulations issued
-thereunder.
- "Intellectual Property Rights" means current and future worldwide rights
-under patent law, copyright law, trade secret law, trademark law, moral rights
-law, and other similar rights.
- "Legal Process" means a request for disclosure of data made pursuant to law,
-governmental regulation, court order, subpoena, warrant, governmental regulatory
-or agency request, or other valid legal authority, legal procedure, or similar
-process.
- "Privacy Policy" means Google's privacy policy located at:
-https://www.google.com/privacypolicy.html or such other URL as Google may
-provide.
- "Protected Health Information" means the definition on 45 CFR 160.103,
-limited to the information created or received by a business associate from on
-or behalf of a covered entity.
- "Service" means the Google App Engine Service as more fully described here:
-https://developers.google.com/appengine/ or such other URL as Google may
-provide. The APIs provided under the Service are listed here:
-https://developers.google.com/appengine/appengine_services or such other URL as
-Google may provide.
- "Service FAQ" means those FAQs more fully described here:
-https://developers.google.com/appengine/kb or such other URL as Google may
-provide.
- “Service Level Agreement” or “SLA” means the service level agreement then in
-effect for the Service available at the following URL:
-https://developers.google.com/appengine/sla or such other URL as Google may
-provide.
- "Software" means any downloadable tools, software development kits or other
-such proprietary computer software provided by Google in connection with the
-Service, which may be downloaded by Customer, and any updates Google may make to
-such Software from time to time.
- "Taxes" means any duties, customs fees, or taxes (other than Google's income
-tax) associated with the purchase of the Service, including any related
-penalties or interest.
- "Terms URL" means the following URL:
-https://developers.google.com/appengine/terms or such other URL as Google may
-provide.
- "Third Party Request" means a request from a third party for records
-relating to an End User's use of the Services. Third Party Requests can be a
-lawful search warrant, court order, subpoena, other valid legal order, or
-written consent from the End User permitting the disclosure.
- "Trademark Guidelines" means Google's Guidelines for Third Party Use of
-Google Brand Features, located at the following URL:
-http://www.google.com/permissions/guidelines.html or such other URL as Google
-may provide.
- "Updates" means the periodic software updates provided by Google to Customer
-from time to time. Updates are designed to improve, enhance and further develop
-the Service and may take the form of bug fixes, enhanced functions, new software
-modules and completely new versions.
- "Updates" means the periodic software updates provided by Google to Customer
-from time to time. Updates are designed to improve, enhance and further develop
-the Service and may take the form of bug fixes, enhanced functions, new software
-modules and completely new versions.
diff --git a/WebContent/licenses/google-cloud-platform-terms-of-service.txt b/WebContent/licenses/google-cloud-platform-terms-of-service.txt
new file mode 100644
index 0000000000..f8ad5bc2ba
--- /dev/null
+++ b/WebContent/licenses/google-cloud-platform-terms-of-service.txt
@@ -0,0 +1,235 @@
+Google Cloud Platform Terms of Service
+
+Last modified: May 20, 2015
+ \
+If you are accessing the Google Cloud Platform Services as a customer of a Google Cloud Platform reseller, the terms below do not apply to you, and your agreement with your reseller governs your use of the Google Cloud Platform Services.
+Google Cloud Platform License Agreement
+
+This Google Cloud Platform License Agreement (the "Agreement") is made and entered into by and between Google and the entity agreeing to these terms ("Customer"). "Google" means either (i) Google Ireland Limited, with offices at Gordon House, Barrow Street, Dublin 4, Ireland, if Customer's billing address is in any country within Europe, the Middle East, or Africa ("EMEA"), (ii) Google Asia Pacific Pte. Ltd., with offices at 8 Marina View Asia Square 1 #30-01 Singapore 018960, if Customer's billing address is in any country within the Asia Pacific region ("APAC"), or (iii) Google Inc., with offices at 1600 Amphitheatre Parkway, Mountain View, California 94043, if Customer's billing address is in any country in the world other than those in EMEA and APAC.
+
+This Agreement is effective as of the date Customer clicks to accept the Agreement (the "Effective Date"). If you are accepting on behalf of Customer, you represent and warrant that: (i) you have full legal authority to bind Customer to this Agreement; (ii) you have read and understand this Agreement; and (iii) you agree, on behalf of Customer, to this Agreement. If you do not have the legal authority to bind Customer, please do not click to accept. This Agreement governs Customer's access to and use of the Service. For an offline variant of this Agreement, you may contact Google for more information.
+
+ 1. Provision of the Services.
+
+ 1.1 Services Use. Subject to this Agreement, during the Term, Customer may: (a) use the Services, (b) integrate the Services into any Application that has material value independent of the Services and provide the Services, solely as integrated into that Application, to End Users, and (c) use any Software provided by Google as part of the Services. Customer may not sublicense or transfer these rights except as permitted under the Assignment section of the Agreement.
+
+ 1.2 Console. Google will provide the Services to Customer. As part of receiving the Services, Customer will have access to the Admin Console, through which Customer may administer the Services.
+
+ 1.3 Facilities and Data Transfer. All facilities used to store and process an Application and Customer Data will adhere to reasonable security standards no less protective than the security standards at facilities where Google processes and stores its own information of a similar type. Google has implemented at least industry standard systems and procedures to (i) ensure the security and confidentiality of an Application and Customer Data, (ii) protect against anticipated threats or hazards to the security or integrity of an Application and Customer Data, and (iii) protect against unauthorized access to or use of an Application and Customer Data. Except as set forth in the Service Specific Terms, Google may process and store an Application and Customer Data in the United States or any other country in which Google or its agents maintain facilities. By using the Services, Customer consents to this processing and storage of an Application and Customer Data. Under this Agreement, Google is merely a data processor.
+
+ 1.4 Accounts. Customer must have an Account and a Token (if applicable) to use the Services, and is responsible for the information it provides to create the Account, the security of the Token and its passwords for the Account, and for any use of its Account and the Token. If Customer becomes aware of any unauthorized use of its password, its Account or the Token, Customer will notify Google as promptly as possible. Google has no obligation to provide Customer multiple Tokens or Accounts.
+
+ 1.5 Safe Harbor. Google is enrolled in the U.S. Department of Commerce Safe Harbor Program and will remain enrolled in this program or another replacement program (or will adopt a compliance solution which achieves compliance with the terms of Article 25 of Directive 95/46/EC) throughout the Term.
+
+ 1.6 New Applications and Services. Google may: (i) make new applications, tools, features or functionality available from time to time through the Services and (ii) add new services to the "Services" definition from time to time (by adding them at the URL set forth under that definition), the use of which may be contingent upon Customers agreement to additional terms.
+
+ 1.7 Modifications.
+
+ a. To the Services. Google may make commercially reasonable Updates to the Services from time to time. If Google makes a material change to the Services, Google will inform Customer, provided that Customer has subscribed with Google to be informed about such change.
+
+ b. To the Agreement. Google may make changes to this Agreement, including pricing (and any linked documents) from time to time. Unless otherwise noted by Google, material changes to the Agreement will become effective 30 days after they are posted, except if the changes apply to new functionality in which case they will be effective immediately. If Customer does not agree to the revised Agreement, please stop using the Services. Google will post any modification to this Agreement to the Terms URL.
+
+ 1.8 Service Specific Terms and Data Processing and Security Terms. The Service Specific Terms and Data Processing and Security Terms are incorporated by this reference into the Agreement.
+
+ 2. Payment Terms.
+
+ 2.1 Free Quota. Certain Services are provided to Customer without charge up to the Fee Threshold, as applicable.
+
+ 2.2 Online Billing. Google will issue an electronic bill to Customer for all charges accrued above the Fee Threshold based on (i) Customers use of the Services during the previous month (including, if any, the relevant Fee for TSS set forth in the Fees definition below); (ii) any Reserved Units selected; (iii) any Committed Purchases selected; and/or (iv) any Package Purchases selected. For use above the Fee Threshold, Customer will be responsible for all Fees up to the amount set in the Account and will pay all Fees in the currency set forth in the invoice. Customer will pay all Fees in accordance with the payment terms applicable to the Fees. Google's measurement of Customers use of the Services is final. Google has no obligation to provide multiple bills.
+
+ 2.3 Taxes. Customer is responsible for any Taxes, and Customer will pay Google for the Services without any reduction for Taxes. If Google is obligated to collect or pay Taxes, the Taxes will be invoiced to Customer, unless Customer provides Google with a timely and valid tax exemption certificate authorized by the appropriate taxing authority. In some states the sales tax is due on the total purchase price at the time of sale and must be invoiced and collected at the time of the sale. If Customer is required by law to withhold any Taxes from its payments to Google, Customer must provide Google with an official tax receipt or other appropriate documentation to support such withholding.
+
+ 2.4 Invoice Disputes & Refunds. To the fullest extent permitted by law, Customer waives all claims relating to Fees unless claimed within sixty days after charged (this does not affect any Customer rights with its credit card issuer). Refunds (if any) are at the discretion of Google and will only be in the form of credit for the Services. Nothing in this Agreement obligates Google to extend credit to any party.
+
+ 2.5 Delinquent Payments. Late payments may bear interest at the rate of 1.5% per month (or the highest rate permitted by law, if less). Google reserves the right to suspend Customers Account, for any late payments.
+
+ 3. Customer Obligations.
+
+ 3.1 Compliance. Customer is solely responsible for its Applications, Projects, and Customer Data and for making sure its Applications, Projects, and Customer Data comply with the AUP. Google reserves the right to review the Application, Project, and Customer Data for compliance with the AUP. Customer is responsible for ensuring all End Users comply with Customers obligations under the AUP, the Service Specific Terms, and the restrictions in Sections 3.3 and 3.5 below.
+
+ 3.2 Privacy. Customer will protect the privacy and legal rights of its End Users under all applicable laws and regulations, which includes a legally adequate privacy notice communicated from Customer. Customer may have the ability to access, monitor, use, or disclose Customer Data submitted by End Users through the Services. Customer will obtain and maintain any required consents from End Users to allow Customers access, monitoring, use and disclosure of Customer Data. Further, Customer will notify its End Users that any Customer Data provided as part of the Services will be made available to a third party (i.e. Google) as part of Google providing the Services.
+
+ 3.3 Restrictions. Customer will not, and will not allow third parties under its control to: (a) copy, modify, create a derivative work of, reverse engineer, decompile, translate, disassemble, or otherwise attempt to extract any or all of the source code of the Services (subject to Section 3.4 below and except to the extent such restriction is expressly prohibited by applicable law); (b) use the Services for High Risk Activities; (c) sublicense, resell, or distribute any or all of the Services separate from any integrated Application; (d) create multiple Applications, Accounts, or Projects to simulate or act as a single Application, Account, or Project (respectively) or otherwise access the Services in a manner intended to avoid incurring Fees; (e) unless otherwise set forth in the Service Specific Terms, use the Services to operate or enable any telecommunications service or in connection with any Application that allows End Users to place calls or to receive calls from any public switched telephone network; or (f) process or store any Customer Data that is subject to the International Traffic in Arms Regulations maintained by the Department of State. Unless otherwise specified in writing by Google, Google does not intend uses of the Services to create obligations under HIPAA, and makes no representations that the Services satisfy HIPAA requirements. If Customer is (or becomes) a Covered Entity or Business Associate, as defined in HIPAA, Customer will not use the Services for any purpose or in any manner involving Protected Health Information (as defined in HIPAA) unless Customer has received prior written consent to such use from Google.
+
+ 3.4 Third Party Components. Third party components (which may include open source software) of the Services may be subject to separate license agreements. To the limited extent a third party license expressly supersedes this Agreement, that third party license governs Customers use of that third party component.
+
+ 3.5 Documentation. Google may provide Documentation for Customers use of the Services. The Documentation may specify restrictions (e.g. attribution or HTML restrictions) on how the Applications may be built or the Services may be used and Customer will comply with any such restrictions specified.
+
+ 3.6 DMCA Policy. Google provides information to help copyright holders manage their intellectual property online, but Google cannot determine whether something is being used legally or not without their input. Google responds to notices of alleged copyright infringement and terminates accounts of repeat infringers according to the process set out in the U.S. Digital Millennium Copyright Act. If Customer thinks somebody is violating Customers or its End Users copyrights and wants to notify Google, Customer can find information about submitting notices, and Google's policy about responding to notices at http://www.google.com/dmca.html.
+
+ 4. Suspension and Removals.
+
+ 4.1 Suspension/Removals. If Customer becomes aware that any Application, Project (including an End Users use of a Project), or Customer Data violates the AUP, Customer will immediately suspend the Application or Project (if applicable), remove the applicable Customer Data or suspend access to an End User (as may be applicable). If Customer fails to suspend or remove as noted in the prior sentence, Google may specifically request that Customer do so. If Customer fails to comply with Googles request to do so within twenty-four hours, then Google may suspend Google accounts of the applicable End Users, disable the Project or Application, and/or disable the Account (as may be applicable) until such violation is corrected.
+
+ 4.2 Emergency Security Issues. Despite the foregoing, if there is an Emergency Security Issue, then Google may automatically suspend the offending, Application, Project, or End User Account. Suspension will be to the minimum extent required, and of the minimum duration, to prevent or resolve the Emergency Security Issue. If Google suspends an End User account, Application, Project, or the Customer Account, for any reason, without prior notice to Customer, at Customers request, Google will provide Customer the reason for the suspension as soon as is reasonably possible.
+
+ 5. Intellectual Property Rights; Use of Customer Data; Feedback.
+
+ 5.1 Intellectual Property Rights. Except as expressly set forth in this Agreement, this Agreement does not grant either party any rights, implied or otherwise, to the others content or any of the others intellectual property. As between the parties, Customer owns all Intellectual Property Rights in Customer Data and the Application or Project (if applicable), and Google owns all Intellectual Property Rights in the Services and Software.
+
+ 5.2 Use of Customer Data. Google may use Customer Data and Applications only to provide the Services to Customer and its End Users and to help secure and improve the Services. For instance, this may include identifying and fixing problems in the Services, enhancing the Services to better protect against attacks and abuse, and making suggestions aimed at improving performance or reducing cost.
+
+ 5.3 Customer Feedback. If Customer provides Google Feedback about the Services, then Google may use that information without obligation to Customer, and Customer hereby irrevocably assigns to Google all right, title, and interest in that Feedback.
+
+ 6. Technical Support Services
+
+ 6.1 By Customer. Customer is responsible for technical support of its Applications and Projects.
+
+ 6.2 By Google. Subject to payment of applicable support Fees, Google will provide TSS to Customer during the Term in accordance with the TSS Guidelines. Certain TSS levels include a minimum recurring Fee as described in the "Fees" definition below. If Customer downgrades its TSS level during any calendar month, Google may continue to provide TSS at the same level and TSS Fees before the downgrade for the remainder of that month.
+
+ 7. Deprecation of Services
+
+ 7.1 Discontinuance of Services. Subject to Section 7.2, Google may discontinue any Services or any portion or feature for any reason at any time without liability to Customer.
+
+ 7.2 Deprecation Policy. Google will announce if it intends to discontinue or make backwards incompatible changes to the Services specified at the URL in the next sentence. Google will use commercially reasonable efforts to continue to operate those Services versions and features identified at https://cloud.google.com/terms/deprecation without these changes for at least one year after that announcement, unless (as Google determines in its reasonable good faith judgment):
+
+ (i) required by law or third party relationship (including if there is a change in applicable law or relationship), or
+
+ (ii) doing so could create a security risk or substantial economic or material technical burden.
+
+ The above policy is the "Deprecation Policy."
+
+ 8. Confidential Information.
+
+ 8.1 Obligations. The recipient will not disclose the Confidential Information, except to Affiliates, employees, agents or professional advisors who need to know it and who have agreed in writing (or in the case of professional advisors are otherwise bound) to keep it confidential. The recipient will ensure that those people and entities use the received Confidential Information only to exercise rights and fulfill obligations under this Agreement, while using reasonable care to keep it confidential.
+
+ 8.2 Required Disclosure. Notwithstanding any provision to the contrary in this Agreement, the recipient may also disclose Confidential Information to the extent required by applicable Legal Process; provided that the recipient uses commercially reasonable efforts to: (i) promptly notify the other party of such disclosure before disclosing; and (ii) comply with the other partys reasonable requests regarding its efforts to oppose the disclosure. Notwithstanding the foregoing, subsections (i) and (ii) above will not apply if the recipient determines that complying with (i) and (ii) could: (a) result in a violation of Legal Process; (b) obstruct a governmental investigation; and/or (c) lead to death or serious physical harm to an individual. As between the parties, Customer is responsible for responding to all third party requests concerning its use and its End Users use of the Services.
+
+ 9. Term and Termination.
+
+ 9.1 Agreement Term. The Term of this Agreement will begin on the Effective Date and continue until the Agreement is terminated as set forth in Section 9 of this Agreement.
+
+ 9.2 Termination for Breach. Either party may terminate this Agreement for breach if: (i) the other party is in material breach of the Agreement and fails to cure that breach within thirty days after receipt of written notice; (ii) the other party ceases its business operations or becomes subject to insolvency proceedings and the proceedings are not dismissed within ninety days; or (iii) the other party is in material breach of this Agreement more than two times notwithstanding any cure of such breaches. In addition, Google may terminate any, all, or any portion of the Services or Projects, if Customer meets any of the conditions in Section 9.2(i), (ii), and/or (iii).
+
+ 9.3 Termination for Inactivity. Google reserves the right to terminate the Services for inactivity, if, for a period exceeding 180 days, Customer: (a) has failed to access the Admin Console; (b) a Project has no active virtual machine or storage resources or an Application has not served any requests; and (c) no electronic bills are being generated.
+
+ 9.4 Termination for Convenience. Customer may stop using the Services at any time. Customer may terminate this Agreement for its convenience at any time on prior written notice and upon termination, must cease use of the applicable Services. Google may terminate this Agreement for its convenience at any time without liability to Customer.
+
+ 9.5 Effect of Termination. If the Agreement is terminated, then: (i) the rights granted by one party to the other will immediately cease; (ii) all Fees owed by Customer to Google are immediately due upon receipt of the final electronic bill; (iii) Customer will delete the Software, any Application, Instance, Project, and any Customer Data; and (iv) upon request, each party will use commercially reasonable efforts to return or destroy all Confidential Information of the other party.
+
+ 10. Publicity. Customer is permitted to state publicly that it is a customer of the Services, consistent with the Trademark Guidelines. If Customer wants to display Google Brand Features in connection with its use of the Services, Customer must obtain written permission from Google through the process specified in the Trademark Guidelines. Google may include Customers name or Brand Features in a list of Google customers, online or in promotional materials. Google may also verbally reference Customer as a customer of the Services. Neither party needs approval if it is repeating a public statement that is substantially similar to a previously-approved public statement. Any use of a partys Brand Features will inure to the benefit of the party holding Intellectual Property Rights to those Brand Features. A party may revoke the other partys right to use its Brand Features under this Section with written notice to the other party and a reasonable period to stop the use.
+
+ 11. Representations and Warranties. Each party represents and warrants that: (a) it has full power and authority to enter into the Agreement; and (b) it will comply with all laws and regulations applicable to its provision, or use, of the Services, as applicable. Google warrants that it will provide the Services in accordance with the applicable SLA (if any).
+
+ 12. Disclaimer. EXCEPT AS EXPRESSLY PROVIDED FOR IN THIS AGREEMENT, TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, GOOGLE AND ITS SUPPLIERS DO NOT MAKE ANY OTHER WARRANTY OF ANY KIND, WHETHER EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, INCLUDING WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR USE AND NONINFRINGEMENT. GOOGLE AND ITS SUPPLIERS ARE NOT RESPONSIBLE OR LIABLE FOR THE DELETION OF OR FAILURE TO STORE ANY CUSTOMER DATA AND OTHER COMMUNICATIONS MAINTAINED OR TRANSMITTED THROUGH USE OF THE SERVICES. CUSTOMER IS SOLELY RESPONSIBLE FOR SECURING AND BACKING UP ITS APPLICATION, PROJECT, AND CUSTOMER DATA. NEITHER GOOGLE NOR ITS SUPPLIERS, WARRANTS THAT THE OPERATION OF THE SOFTWARE OR THE SERVICES WILL BE ERROR-FREE OR UNINTERRUPTED. NEITHER THE SOFTWARE NOR THE SERVICES ARE DESIGNED, MANUFACTURED, OR INTENDED FOR HIGH RISK ACTIVITIES.
+
+ 13. Limitation of Liability.
+
+ 13.1 Limitation on Indirect Liability. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NEITHER PARTY, NOR GOOGLES SUPPLIERS, WILL BE LIABLE UNDER THIS AGREEMENT FOR LOST REVENUES OR INDIRECT, SPECIAL, INCIDENTAL, CONSEQUENTIAL, EXEMPLARY, OR PUNITIVE DAMAGES, EVEN IF THE PARTY KNEW OR SHOULD HAVE KNOWN THAT SUCH DAMAGES WERE POSSIBLE AND EVEN IF DIRECT DAMAGES DO NOT SATISFY A REMEDY.
+
+ 13.2 Limitation on Amount of Liability. TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, NEITHER PARTY, NOR GOOGLES SUPPLIERS, MAY BE HELD LIABLE UNDER THIS AGREEMENT FOR MORE THAN THE AMOUNT PAID BY CUSTOMER TO GOOGLE UNDER THIS AGREEMENT DURING THE TWELVE MONTHS PRIOR TO THE EVENT GIVING RISE TO LIABILITY.
+
+ 13.3 Exceptions to Limitations. These limitations of liability do not apply to breaches of confidentiality obligations, violations of a partys Intellectual Property Rights by the other party, or indemnification obligations.
+
+ 14. Indemnification.
+
+ 14.1 By Customer. Unless prohibited by applicable law, Customer will defend and indemnify Google and its Affiliates against Indemnified Liabilities in any Third-Party Legal Proceeding to the extent arising from: (i) any Application, Project, Instance, Customer Data or Customer Brand Features; or (ii) Customers, or its End Users, use of the Services in violation of the AUP.
+
+ 14.2 By Google. Google will defend and indemnify Customer and its Affiliates against Indemnified Liabilities in any Third-Party Legal Proceeding to the extent arising solely from an Allegation that use of (a) Googles technology used to provide the Services (excluding any open source software) or (b) any Google Brand Feature infringes or misappropriates the third partys patent, copyright, trade secret, or trademark.
+
+ 14.3 Exclusions. This Section 14 will not apply to the extent the underlying Allegation arises from:
+
+ a. the indemnified partys breach of this Agreement;
+
+ b. modifications to the indemnifying partys technology or Brand Features by anyone other than the indemnifying party;
+
+ c. combination of the indemnifying partys technology or Brand Features with materials not provided by the indemnifying party; or
+
+ d. use of non-current or unsupported versions of the Services or Brand Features;
+
+ 14.4 Conditions. Sections 14.1 and 14.2 will apply only to the extent:
+
+ a. The indemnified party has promptly notified the indemnifying party in writing of any Allegation(s) that preceded the Third-Party Legal Proceeding and cooperates reasonably with the indemnifying party to resolve the Allegation(s) and Third-Party Legal Proceeding. If breach of this Section 14.4(a) prejudices the defense of the Third-Party Legal Proceeding, the indemnifying partys obligations under Section 14.1 or 14.2 (as applicable) will be reduced in proportion to the prejudice.
+
+ b. The indemnified party tenders sole control of the indemnified portion of the Third-Party Legal Proceeding to the indemnifying party, subject to the following: (i) the indemnified party may appoint its own non-controlling counsel, at its own expense; and (ii) any settlement requiring the indemnified party to admit liability, pay money, or take (or refrain from taking) any action, will require the indemnified partys prior written consent, not to be unreasonably withheld, conditioned, or delayed.
+
+ 14.5 Remedies.
+
+ a. If Google reasonably believes the Services might infringe a third partys Intellectual Property Rights, then Google may, at its sole option and expense: (a) procure the right for Customer to continue using the Services; (b) modify the Services to make them non-infringing without materially reducing their functionality; or (c) replace the Services with a non-infringing, functionally equivalent alternative.
+
+ b. If Google does not believe the remedies in Section 14.5(a) are commercially reasonable, then Google may suspend or terminate Customers use of the impacted Services.
+
+ 14.6 Sole Rights and Obligations. Without affecting either partys termination rights, this Section 14 states the parties only rights and obligations under this Agreement for any third party's Intellectual Property Rights Allegations and Third-Party Legal Proceedings.
+
+ 15. U.S. Federal Agency Users. The Services were developed solely at private expense and are commercial computer software and related documentation within the meaning of the applicable Federal Acquisition Regulations and their agency supplements.
+
+ 16. Miscellaneous.
+
+ 16.1 Notices. All notices must be in writing and addressed to the other partys legal department and primary point of contact. The email address for notices being sent to Googles Legal Department is legal-notices@google.com. Notice will be treated as given on receipt as verified by written or automated receipt or by electronic log (as applicable).
+
+ 16.2 Assignment. Neither party may assign any part of this Agreement without the written consent of the other, except to an Affiliate where: (a) the assignee has agreed in writing to be bound by the terms of this Agreement; (b) the assigning party remains liable for obligations under the Agreement if the assignee defaults on them; and (c) the assigning party has notified the other party of the assignment. Any other attempt to assign is void.
+
+ 16.3 Change of Control. If a party experiences a change of Control (for example, through a stock purchase or sale, merger, or other form of corporate transaction): (a) that party will give written notice to the other party within thirty days after the change of Control; and (b) the other party may immediately terminate this Agreement any time between the change of Control and thirty days after it receives that written notice.
+
+ 16.4 Force Majeure. Neither party will be liable for failure or delay in performance to the extent caused by circumstances beyond its reasonable control.
+
+ 16.5 No Agency. This Agreement does not create any agency, partnership or joint venture between the parties.
+
+ 16.6 No Waiver. Neither party will be treated as having waived any rights by not exercising (or delaying the exercise of) any rights under this Agreement.
+
+ 16.7 Severability. If any term (or part of a term) of this Agreement is invalid, illegal, or unenforceable, the rest of the Agreement will remain in effect.
+
+ 16.8 No Third-Party Beneficiaries. This Agreement does not confer any benefits on any third party unless it expressly states that it does.
+
+ 16.9 Equitable Relief. Nothing in this Agreement will limit either partys ability to seek equitable relief.
+
+ 16.10 U.S. Governing Law.
+
+ a. For U.S. City, County, and State Government Entities. If Customer is a U.S. city, county or state government entity, then the Agreement will be silent regarding governing law and venue.
+
+ b. For U.S. Federal Government Entities. If Customer is a U.S. federal government entity then the following applies: ALL CLAIMS ARISING OUT OF OR RELATING TO THIS AGREEMENT OR THE SERVICES WILL BE GOVERNED BY THE LAWS OF THE UNITED STATES OF AMERICA, EXCLUDING ITS CONFLICT OF LAWS RULES. SOLELY TO THE EXTENT PERMITTED BY FEDERAL LAW: (I) THE LAWS OF THE STATE OF CALIFORNIA (EXCLUDING CALIFORNIAS CONFLICT OF LAWS RULES) WILL APPLY IN THE ABSENCE OF APPLICABLE FEDERAL LAW; AND (II) FOR ALL CLAIMS ARISING OUT OF OR RELATING TO THIS AGREEMENT OR THE SERVICES, THE PARTIES CONSENT TO PERSONAL JURISDICTION IN, AND THE EXCLUSIVE VENUE OF, THE COURTS IN SANTA CLARA COUNTY, CALIFORNIA.
+
+ c. For All Other Entities. If Customer is any entity not set forth in Section 16.10(a) or (b) then the following applies: ALL CLAIMS ARISING OUT OF OR RELATING TO THIS AGREEMENT OR THE SERVICES WILL BE GOVERNED BY CALIFORNIA LAW, EXCLUDING THAT STATES CONFLICT OF LAWS RULES, AND WILL BE LITIGATED EXCLUSIVELY IN THE FEDERAL OR STATE COURTS OF SANTA CLARA COUNTY, CALIFORNIA, USA; THE PARTIES CONSENT TO PERSONAL JURISDICTION IN THOSE COURTS.
+
+ 16.11 Amendments. Except as set forth in Section 1.7(b), any amendment must be in writing, signed by both parties, and expressly state that it is amending this Agreement.
+
+ 16.12 Survival. The following Sections will survive expiration or termination of this Agreement: 5, 8, 9.5, 13, 14, and 16.
+
+ 16.13 Entire Agreement. This Agreement sets out all terms agreed between the parties and supersedes all other agreements between the parties relating to its subject matter. In entering into this Agreement, neither party has relied on, and neither party will have any right or remedy based on, any statement, representation or warranty (whether made negligently or innocently), except those expressly set out in this Agreement. The terms located at a URL referenced in this Agreement and the Documentation are incorporated by reference into the Agreement. After the Effective Date, Google may provide an updated URL in place of any URL in this Agreement.
+
+ 16.14 Conflicting Terms. If there is a conflict between the documents that make up this Agreement, the documents will control in the following order: the Agreement, and the terms at any URL.
+
+ 16.15 Definitions.
+ "Account" means Customers Google Cloud Platform account.
+ "Admin Console" means the online console(s) and/or tool(s) provided by Google to Customer for administering the Services.
+ "Affiliate" means any entity that directly or indirectly Controls, is Controlled by, or is under common Control with a party.
+ "Allegation" means an unaffiliated third partys allegation.
+ "Application(s)" means any web or other application Customer creates using the Services, including any source code written by Customer to be used with the Services, or hosted in an Instance.
+ "AUP" means the acceptable use policy set forth here for the Services: http://cloud.google.com/terms/aup
+ "Brand Features" means the trade names, trademarks, service marks, logos, domain names, and other distinctive brand features of each party, respectively, as secured by such party from time to time.
+ "Committed Purchase(s)" have the meaning set forth in the Service Specific Terms.
+ "Confidential Information" means information that one party (or an Affiliate) discloses to the other party under this Agreement, and which is marked as confidential or would normally under the circumstances be considered confidential information. It does not include information that is independently developed by the recipient, is rightfully given to the recipient by a third party without confidentiality obligations, or becomes public through no fault of the recipient. Customer Data is considered Customers Confidential Information.
+ "Control" means control of greater than fifty percent of the voting rights or equity interests of a party.
+ "Customer Data" means content provided, transmitted, or displayed via the Services by Customer or its End Users; but excluding any data provided when Customer creates its general Google account (either under a gmail.com address or an email address provided under the "Google Apps" product line).
+ "Data Processing and Security Terms" means the terms set forth at: https://cloud.google.com/terms/data-processing-terms.
+ "Documentation" means the Google documentation (as may be updated from time to time) in the form generally made available by Google to its customers for use with the Services including the following: (a) Google App Engine, set forth here: https://cloud.google.com/appengine/; (b) Google Cloud SQL, set forth here: https://cloud.google.com/sql; (c) Google Cloud Storage, set forth here: https://cloud.google.com/storage; (d) Google Prediction API, set forth here: https://cloud.google.com/prediction; (e) Google BigQuery Service, set forth here: https://cloud.google.com/bigquery/; (f) Google Compute Engine, set forth here: https://cloud.google.com/compute/; and (g) Google Cloud Datastore, set forth here: https://cloud.google.com/datastore/.
+ "Emergency Security Issue" means either: (a) Customers or its End Users use of the Services in violation of the AUP, which could disrupt: (i) the Services; (ii) other Customers or its End Users use of the Services; or (iii) the Google network or servers used to provide the Services; or (b) unauthorized third party access to the Services.
+ "End Users" means the individuals Customer permits to use the Services, Application, or Project.
+ "Fee Threshold" means the threshold (as may be updated from time to time), as applicable for certain Services, as set forth here: https://cloud.google.com/pricing/.
+ Feedback means feedback or suggestions about the Services provided to Google by Customer.
+ "Fees" means the applicable fees for each Service and any applicable Taxes. The Fees for each Service are set forth here: https://cloud.google.com/pricing/.
+ "High Risk Activities" means uses such as the operation of nuclear facilities, air traffic control, or life support systems, where the use or failure of the Services could lead to death, personal injury, or environmental damage.
+ "HIPAA" means the Health Insurance Portability and Accountability Act of 1996 as it may be amended from time to time, and any regulations issued under it.
+ "Indemnified Liabilities" means any (i) settlement amounts approved by the indemnifying party; and (ii) damages and costs finally awarded against the indemnified party and its Affiliates by a court of competent jurisdiction.
+ "Instance" means a virtual machine instance, configured and managed by Customer, which runs on the Services. Instances are more fully described in the Documentation.
+ "Intellectual Property Rights" means current and future worldwide rights under patent, copyright, trade secret, trademark, and moral rights laws, and other similar rights.
+ "Legal Process" means a data disclosure request made under law, governmental regulation, court order, subpoena, warrant, governmental regulatory or agency request, or other valid legal authority, legal procedure, or similar process.
+ "Package Purchase" has the meaning set forth in the Service Specific Terms.
+ "Project" means a grouping of computing, storage, and API resources for Customer, and via which Customer may use the Services. Projects are more fully described in the Documentation.
+ "Reserved Capacity Units" have the meaning set forth in the Service Specific Terms.
+ "Reserved Unit Term" has the meaning set forth in the Service Specific Terms.
+ "Reserved Units" have the meaning set forth in the Service Specific Terms.
+ "Services" means the, services as set forth here: https://cloud.google.com/services (including any associated application programming interfaces); and TSS, but the Services do not include Google Translate API.
+ "Service Specific Terms" means the terms specific to one or more Services set forth here: https://cloud.google.com/terms/service-terms, except the terms relating to (a) Google Translate API; and (b) Fees for Google Cloud Datastore set forth at that Service Specific Terms URL do not apply.
+ "SLA" means the Service Level Agreement as applicable to: (a) Google App Engine set forth here: https://cloud.google.com/appengine/sla; (b) Google Cloud Storage set forth here: https://cloud.google.com/storage/sla; (c) Google Prediction API set forth here: https://cloud.google.com/prediction/sla; (d) Google BigQuery Service set forth here https://cloud.google.com/bigquery/sla; (e) Google Cloud SQL set forth here: https://cloud.google.com/sql/sla; (f) Google Compute Engine set forth here: https://cloud.google.com/compute/sla; (g) VPN set forth here: https://cloud.google.com/vpn/sla; (h) Google Cloud DNS set forth here: https://cloud.google.com/dns/sla; and (i) Google Cloud Datastore set forth here: https://cloud.google.com/datastore/sla.
+ "Software" means any downloadable tools, software development kits or other such proprietary computer software provided by Google in connection with the Services, which may be downloaded by Customer, and any updates Google may make to such Software from time to time.
+ "Taxes" means any duties, customs fees, or taxes (other than Googles income tax) associated with the purchase of the Services, including any related penalties or interest.
+ "Term" has the meaning set forth in Section 9 of this Agreement.
+ "Terms URL" means the following URL set forth here: https://cloud.google.com/terms/.
+ "Third-Party Legal Proceeding" means any formal legal proceeding filed by an unaffiliated third party before a court or government tribunal (including any appellate proceeding).
+ "Token" means an alphanumeric key that is uniquely associated with Customers Account.
+ "Trademark Guidelines" means Googles Guidelines for Third Party Use of Google Brand Features, located at: http://www.google.com/permissions/guidelines.html.
+ "TSS" means the technical support service provided by Google to the administrators under the TSS Guidelines.
+ "TSS Guidelines" means Googles technical support services guidelines then in effect for the Services. TSS Guidelines are at the following URL: http://support.google.com/enterprise/terms (under Google Cloud Platform Services).
+ "Updates" means the periodic software updates provided by Google to Customer from time to time. Updates are designed to improve, enhance and further develop the Services and may take the form of bug fixes, enhanced functions, new software modules and completely new versions.
+
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 405925a920..fedc86fbf6 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/ConnectorBundle.java
@@ -48,6 +48,7 @@ import com.vaadin.client.ui.UnknownComponentConnector;
import com.vaadin.shared.communication.ClientRpc;
import com.vaadin.shared.communication.ServerRpc;
import com.vaadin.shared.ui.Connect;
+
import elemental.json.JsonValue;
public class ConnectorBundle {
@@ -579,7 +580,7 @@ public class ConnectorBundle {
frameworkHandledTypes.add(Set.class);
frameworkHandledTypes.add(Byte.class);
frameworkHandledTypes.add(Character.class);
-
+ frameworkHandledTypes.add(Void.class);
}
private boolean serializationHandledByFramework(JType setterType) {
diff --git a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java
index b0b947e3bf..12e67988eb 100644
--- a/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java
+++ b/client-compiler/src/com/vaadin/server/widgetsetutils/metadata/RendererVisitor.java
@@ -80,6 +80,8 @@ public class RendererVisitor extends TypeVisitor {
JType presentationType = getPresentationType(type, logger);
bundle.setPresentationType(type, presentationType);
+ bundle.setNeedsSerialize(presentationType);
+
logger.log(Type.DEBUG, "Presentation type of " + type + " is "
+ presentationType);
}
diff --git a/client-compiler/src/com/vaadin/tools/CvalChecker.java b/client-compiler/src/com/vaadin/tools/CvalChecker.java
index 645667be94..9217781695 100644
--- a/client-compiler/src/com/vaadin/tools/CvalChecker.java
+++ b/client-compiler/src/com/vaadin/tools/CvalChecker.java
@@ -243,7 +243,9 @@ public final class CvalChecker {
String msg = "";
int majorVers = computeMajorVersion(version);
- if (info != null && info.getMessage() != null) {
+ if (info != null && !info.isValidVersion(majorVers)) {
+ msg = getErrorMessage("invalid", title, majorVers);
+ } else if (info != null && info.getMessage() != null) {
msg = info.getMessage().replace("\\n", "\n");
} else if (info != null && info.isLicenseExpired()) {
String type = "evaluation".equals(info.getType()) ? "Evaluation license"
diff --git a/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java b/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java
index fb4799ae12..6da455b2f6 100644
--- a/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java
+++ b/client-compiler/tests/src/com/vaadin/tools/CvalCheckerTest.java
@@ -26,6 +26,7 @@ import static com.vaadin.tools.CvalChecker.deleteCache;
import static com.vaadin.tools.CvalChecker.parseJson;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
import java.io.ByteArrayOutputStream;
import java.io.File;
@@ -198,6 +199,7 @@ public class CvalCheckerTest {
Assert.fail();
} catch (InvalidCvalException expected) {
assertEquals(productNameCval, expected.name);
+ assertTrue(expected.getMessage().contains("is not valid"));
}
Assert.assertFalse(cacheExists(productNameCval));
diff --git a/client/src/com/vaadin/client/LayoutManager.java b/client/src/com/vaadin/client/LayoutManager.java
index 3f189bcea8..102e618f5e 100644
--- a/client/src/com/vaadin/client/LayoutManager.java
+++ b/client/src/com/vaadin/client/LayoutManager.java
@@ -946,7 +946,7 @@ public class LayoutManager {
* given element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -954,6 +954,9 @@ public class LayoutManager {
*
* -1 is returned if the element has not been measured. If 0 is returned, it
* might indicate that the element is not attached to the DOM.
+ * <p>
+ * The value returned by this method is always rounded up. To get the exact
+ * outer width, use {@link #getOuterHeightDouble(Element)}
*
* @param element
* the element to get the measured size for
@@ -962,6 +965,31 @@ public class LayoutManager {
*/
public final int getOuterHeight(Element element) {
assert needsMeasure(element) : "Getting measurement for element that is not measured";
+ return (int) Math.ceil(getMeasuredSize(element, nullSize)
+ .getOuterHeight());
+ }
+
+ /**
+ * Gets the outer height (including margins, paddings and borders) of the
+ * given element, provided that it has been measured. These elements are
+ * guaranteed to be measured:
+ * <ul>
+ * <li>ManagedLayouts and their child Connectors
+ * <li>Elements for which there is at least one ElementResizeListener
+ * <li>Elements for which at least one ManagedLayout has registered a
+ * dependency
+ * </ul>
+ *
+ * -1 is returned if the element has not been measured. If 0 is returned, it
+ * might indicate that the element is not attached to the DOM.
+ *
+ * @param element
+ * the element to get the measured size for
+ * @return the measured outer height (including margins, paddings and
+ * borders) of the element in pixels.
+ */
+ public final double getOuterHeightDouble(Element element) {
+ assert needsMeasure(element) : "Getting measurement for element that is not measured";
return getMeasuredSize(element, nullSize).getOuterHeight();
}
@@ -970,7 +998,7 @@ public class LayoutManager {
* given element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -978,6 +1006,9 @@ public class LayoutManager {
*
* -1 is returned if the element has not been measured. If 0 is returned, it
* might indicate that the element is not attached to the DOM.
+ * <p>
+ * The value returned by this method is always rounded up. To get the exact
+ * outer width, use {@link #getOuterWidthDouble(Element)}
*
* @param element
* the element to get the measured size for
@@ -986,6 +1017,31 @@ public class LayoutManager {
*/
public final int getOuterWidth(Element element) {
assert needsMeasure(element) : "Getting measurement for element that is not measured";
+ return (int) Math.ceil(getMeasuredSize(element, nullSize)
+ .getOuterWidth());
+ }
+
+ /**
+ * Gets the outer width (including margins, paddings and borders) of the
+ * given element, provided that it has been measured. These elements are
+ * guaranteed to be measured:
+ * <ul>
+ * <li>ManagedLayouts and their child Connectors
+ * <li>Elements for which there is at least one ElementResizeListener
+ * <li>Elements for which at least one ManagedLayout has registered a
+ * dependency
+ * </ul>
+ *
+ * -1 is returned if the element has not been measured. If 0 is returned, it
+ * might indicate that the element is not attached to the DOM.
+ *
+ * @param element
+ * the element to get the measured size for
+ * @return the measured outer width (including margins, paddings and
+ * borders) of the element in pixels.
+ */
+ public final double getOuterWidthDouble(Element element) {
+ assert needsMeasure(element) : "Getting measurement for element that is not measured";
return getMeasuredSize(element, nullSize).getOuterWidth();
}
@@ -994,7 +1050,7 @@ public class LayoutManager {
* given element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1002,6 +1058,9 @@ public class LayoutManager {
*
* -1 is returned if the element has not been measured. If 0 is returned, it
* might indicate that the element is not attached to the DOM.
+ * <p>
+ * The value returned by this method is always rounded up. To get the exact
+ * outer width, use {@link #getInnerHeightDouble(Element)}
*
* @param element
* the element to get the measured size for
@@ -1010,6 +1069,31 @@ public class LayoutManager {
*/
public final int getInnerHeight(Element element) {
assert needsMeasure(element) : "Getting measurement for element that is not measured";
+ return (int) Math.ceil(getMeasuredSize(element, nullSize)
+ .getInnerHeight());
+ }
+
+ /**
+ * Gets the inner height (excluding margins, paddings and borders) of the
+ * given element, provided that it has been measured. These elements are
+ * guaranteed to be measured:
+ * <ul>
+ * <li>ManagedLayouts and their child Connectors
+ * <li>Elements for which there is at least one ElementResizeListener
+ * <li>Elements for which at least one ManagedLayout has registered a
+ * dependency
+ * </ul>
+ *
+ * -1 is returned if the element has not been measured. If 0 is returned, it
+ * might indicate that the element is not attached to the DOM.
+ *
+ * @param element
+ * the element to get the measured size for
+ * @return the measured inner height (excluding margins, paddings and
+ * borders) of the element in pixels.
+ */
+ public final double getInnerHeightDouble(Element element) {
+ assert needsMeasure(element) : "Getting measurement for element that is not measured";
return getMeasuredSize(element, nullSize).getInnerHeight();
}
@@ -1018,7 +1102,7 @@ public class LayoutManager {
* given element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1026,6 +1110,9 @@ public class LayoutManager {
*
* -1 is returned if the element has not been measured. If 0 is returned, it
* might indicate that the element is not attached to the DOM.
+ * <p>
+ * The value returned by this method is always rounded up. To get the exact
+ * outer width, use {@link #getOuterHeightDouble(Element)}
*
* @param element
* the element to get the measured size for
@@ -1034,6 +1121,31 @@ public class LayoutManager {
*/
public final int getInnerWidth(Element element) {
assert needsMeasure(element) : "Getting measurement for element that is not measured";
+ return (int) Math.ceil(getMeasuredSize(element, nullSize)
+ .getInnerWidth());
+ }
+
+ /**
+ * Gets the inner width (excluding margins, paddings and borders) of the
+ * given element, provided that it has been measured. These elements are
+ * guaranteed to be measured:
+ * <ul>
+ * <li>ManagedLayouts and their child Connectors
+ * <li>Elements for which there is at least one ElementResizeListener
+ * <li>Elements for which at least one ManagedLayout has registered a
+ * dependency
+ * </ul>
+ *
+ * -1 is returned if the element has not been measured. If 0 is returned, it
+ * might indicate that the element is not attached to the DOM.
+ *
+ * @param element
+ * the element to get the measured size for
+ * @return the measured inner width (excluding margins, paddings and
+ * borders) of the element in pixels.
+ */
+ public final double getInnerWidthDouble(Element element) {
+ assert needsMeasure(element) : "Getting measurement for element that is not measured";
return getMeasuredSize(element, nullSize).getInnerWidth();
}
@@ -1042,7 +1154,7 @@ public class LayoutManager {
* provided that it has been measured. These elements are guaranteed to be
* measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1067,7 +1179,7 @@ public class LayoutManager {
* element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1092,7 +1204,7 @@ public class LayoutManager {
* provided that it has been measured. These elements are guaranteed to be
* measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1116,7 +1228,7 @@ public class LayoutManager {
* Gets the top border of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1139,7 +1251,7 @@ public class LayoutManager {
* Gets the left border of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1162,7 +1274,7 @@ public class LayoutManager {
* Gets the bottom border of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1185,7 +1297,7 @@ public class LayoutManager {
* Gets the right border of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1209,7 +1321,7 @@ public class LayoutManager {
* element, provided that it has been measured. These elements are
* guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1233,7 +1345,7 @@ public class LayoutManager {
* Gets the top padding of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1256,7 +1368,7 @@ public class LayoutManager {
* Gets the left padding of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1279,7 +1391,7 @@ public class LayoutManager {
* Gets the bottom padding of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1302,7 +1414,7 @@ public class LayoutManager {
* Gets the right padding of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1325,7 +1437,7 @@ public class LayoutManager {
* Gets the top margin of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1348,7 +1460,7 @@ public class LayoutManager {
* Gets the right margin of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1371,7 +1483,7 @@ public class LayoutManager {
* Gets the bottom margin of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1394,7 +1506,7 @@ public class LayoutManager {
* Gets the left margin of the given element, provided that it has been
* measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1417,7 +1529,7 @@ public class LayoutManager {
* Gets the combined top & bottom margin of the given element, provided that
* they have been measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
@@ -1439,7 +1551,7 @@ public class LayoutManager {
* Gets the combined left & right margin of the given element, provided that
* they have been measured. These elements are guaranteed to be measured:
* <ul>
- * <li>ManagedLayotus and their child Connectors
+ * <li>ManagedLayouts and their child Connectors
* <li>Elements for which there is at least one ElementResizeListener
* <li>Elements for which at least one ManagedLayout has registered a
* dependency
diff --git a/client/src/com/vaadin/client/MeasuredSize.java b/client/src/com/vaadin/client/MeasuredSize.java
index ba8fca417b..2099008350 100644
--- a/client/src/com/vaadin/client/MeasuredSize.java
+++ b/client/src/com/vaadin/client/MeasuredSize.java
@@ -45,8 +45,8 @@ public class MeasuredSize {
}
}
- private int width = -1;
- private int height = -1;
+ private double width = -1;
+ private double height = -1;
private int[] paddings = new int[4];
private int[] borders = new int[4];
@@ -54,11 +54,11 @@ public class MeasuredSize {
private FastStringSet dependents = FastStringSet.create();
- public int getOuterHeight() {
+ public double getOuterHeight() {
return height;
}
- public int getOuterWidth() {
+ public double getOuterWidth() {
return width;
}
@@ -86,17 +86,17 @@ public class MeasuredSize {
return sizes[0] + sizes[2];
}
- public int getInnerHeight() {
+ public double getInnerHeight() {
return height - sumHeights(margins) - sumHeights(borders)
- sumHeights(paddings);
}
- public int getInnerWidth() {
+ public double getInnerWidth() {
return width - sumWidths(margins) - sumWidths(borders)
- sumWidths(paddings);
}
- public boolean setOuterHeight(int height) {
+ public boolean setOuterHeight(double height) {
if (this.height != height) {
this.height = height;
return true;
@@ -105,7 +105,7 @@ public class MeasuredSize {
}
}
- public boolean setOuterWidth(int width) {
+ public boolean setOuterWidth(double width) {
if (this.width != width) {
this.width = width;
return true;
@@ -238,20 +238,20 @@ public class MeasuredSize {
Profiler.leave("Measure borders");
Profiler.enter("Measure height");
- int requiredHeight = WidgetUtil.getRequiredHeight(element);
- int marginHeight = sumHeights(margins);
- int oldHeight = height;
- int oldWidth = width;
- if (setOuterHeight(requiredHeight + marginHeight)) {
+ double requiredHeight = WidgetUtil.getRequiredHeightDouble(element);
+ double outerHeight = requiredHeight + sumHeights(margins);
+ double oldHeight = height;
+ if (setOuterHeight(outerHeight)) {
debugSizeChange(element, "Height (outer)", oldHeight, height);
heightChanged = true;
}
Profiler.leave("Measure height");
Profiler.enter("Measure width");
- int requiredWidth = WidgetUtil.getRequiredWidth(element);
- int marginWidth = sumWidths(margins);
- if (setOuterWidth(requiredWidth + marginWidth)) {
+ double requiredWidth = WidgetUtil.getRequiredWidthDouble(element);
+ double outerWidth = requiredWidth + sumWidths(margins);
+ double oldWidth = width;
+ if (setOuterWidth(outerWidth)) {
debugSizeChange(element, "Width (outer)", oldWidth, width);
widthChanged = true;
}
@@ -270,7 +270,7 @@ public class MeasuredSize {
}
private void debugSizeChange(Element element, String sizeChangeType,
- int changedFrom, int changedTo) {
+ double changedFrom, double changedTo) {
debugSizeChange(element, sizeChangeType, String.valueOf(changedFrom),
String.valueOf(changedTo));
}
diff --git a/client/src/com/vaadin/client/WidgetUtil.java b/client/src/com/vaadin/client/WidgetUtil.java
index 3157b844bd..fca6fbccbc 100644
--- a/client/src/com/vaadin/client/WidgetUtil.java
+++ b/client/src/com/vaadin/client/WidgetUtil.java
@@ -541,6 +541,29 @@ public class WidgetUtil {
}
/**
+ * Gets the border-box width for the given element, i.e. element width +
+ * border + padding.
+ *
+ * @param element
+ * The element to check
+ * @return The border-box width for the element
+ */
+ public static double getRequiredWidthDouble(
+ com.google.gwt.dom.client.Element element) {
+ double reqWidth = getRequiredWidthBoundingClientRectDouble(element);
+ if (BrowserInfo.get().isIE() && !BrowserInfo.get().isIE8()) {
+ double csWidth = getRequiredWidthComputedStyleDouble(element);
+ if (csWidth > reqWidth && csWidth < (reqWidth + 1)) {
+ // IE9 rounds reqHeight to integers BUT sometimes reports wrong
+ // csHeight it seems, so we only use csHeight if it is within a
+ // rounding error
+ return csWidth;
+ }
+ }
+ return reqWidth;
+ }
+
+ /**
* Gets the border-box height for the given element, i.e. element height +
* border + padding. Always rounds up to nearest integer.
*
@@ -567,6 +590,29 @@ public class WidgetUtil {
}
/**
+ * Gets the border-box height for the given element, i.e. element height +
+ * border + padding.
+ *
+ * @param element
+ * The element to check
+ * @return The border-box height for the element
+ */
+ public static double getRequiredHeightDouble(
+ com.google.gwt.dom.client.Element element) {
+ double reqHeight = getRequiredHeightBoundingClientRectDouble(element);
+ if (BrowserInfo.get().isIE() && !BrowserInfo.get().isIE8()) {
+ double csHeight = getRequiredHeightComputedStyleDouble(element);
+ if (csHeight > reqHeight && csHeight < (reqHeight + 1)) {
+ // IE9 rounds reqHeight to integers BUT sometimes reports wrong
+ // csHeight it seems, so we only use csHeight if it is within a
+ // rounding error
+ return csHeight;
+ }
+ }
+ return reqHeight;
+ }
+
+ /**
* Calculates the width of the element's bounding rectangle.
* <p>
* In case the browser doesn't support bounding rectangles, the returned
@@ -605,44 +651,44 @@ public class WidgetUtil {
}
}-*/;
- public static native int getRequiredHeightComputedStyle(
+ public static int getRequiredHeightComputedStyle(
+ com.google.gwt.dom.client.Element element) {
+ return (int) Math.ceil(getRequiredHeightComputedStyleDouble(element));
+ }
+
+ public static native double getRequiredHeightComputedStyleDouble(
com.google.gwt.dom.client.Element element)
/*-{
var cs = element.ownerDocument.defaultView.getComputedStyle(element);
var heightPx = cs.height;
if(heightPx == 'auto'){
- // Fallback for when IE reports auto
- heightPx = @com.vaadin.client.WidgetUtil::getRequiredHeightBoundingClientRect(Lcom/google/gwt/dom/client/Element;)(element) + 'px';
+ // Fallback for inline elements
+ return @com.vaadin.client.WidgetUtil::getRequiredHeightBoundingClientRectDouble(Lcom/google/gwt/dom/client/Element;)(element);
}
- var borderTopPx = cs.borderTop;
- var borderBottomPx = cs.borderBottom;
- var paddingTopPx = cs.paddingTop;
- var paddingBottomPx = cs.paddingBottom;
-
- var height = heightPx.substring(0,heightPx.length-2);
- var border = borderTopPx.substring(0,borderTopPx.length-2)+borderBottomPx.substring(0,borderBottomPx.length-2);
- var padding = paddingTopPx.substring(0,paddingTopPx.length-2)+paddingBottomPx.substring(0,paddingBottomPx.length-2);
- return Math.ceil(height+border+padding);
+ var height = parseFloat(heightPx); // Will automatically skip "px" suffix
+ var border = parseFloat(cs.borderTopWidth) + parseFloat(cs.borderBottomWidth); // Will automatically skip "px" suffix
+ var padding = parseFloat(cs.paddingTop) + parseFloat(cs.paddingBottom); // Will automatically skip "px" suffix
+ return height+border+padding;
}-*/;
- public static native int getRequiredWidthComputedStyle(
+ public static int getRequiredWidthComputedStyle(
+ com.google.gwt.dom.client.Element element) {
+ return (int) Math.ceil(getRequiredWidthComputedStyleDouble(element));
+ }
+
+ public static native int getRequiredWidthComputedStyleDouble(
com.google.gwt.dom.client.Element element)
/*-{
var cs = element.ownerDocument.defaultView.getComputedStyle(element);
var widthPx = cs.width;
if(widthPx == 'auto'){
- // Fallback for when IE reports auto
- widthPx = @com.vaadin.client.WidgetUtil::getRequiredWidthBoundingClientRect(Lcom/google/gwt/dom/client/Element;)(element) + 'px';
+ // Fallback for inline elements
+ return @com.vaadin.client.WidgetUtil::getRequiredWidthBoundingClientRectDouble(Lcom/google/gwt/dom/client/Element;)(element);
}
- var borderLeftPx = cs.borderLeft;
- var borderRightPx = cs.borderRight;
- var paddingLeftPx = cs.paddingLeft;
- var paddingRightPx = cs.paddingRight;
-
- var width = widthPx.substring(0,widthPx.length-2);
- var border = borderLeftPx.substring(0,borderLeftPx.length-2)+borderRightPx.substring(0,borderRightPx.length-2);
- var padding = paddingLeftPx.substring(0,paddingLeftPx.length-2)+paddingRightPx.substring(0,paddingRightPx.length-2);
- return Math.ceil(width+border+padding);
+ var width = parseFloat(widthPx); // Will automatically skip "px" suffix
+ var border = parseFloat(cs.borderLeftWidth) + parseFloat(cs.borderRightWidth); // Will automatically skip "px" suffix
+ var padding = parseFloat(cs.paddingLeft) + parseFloat(cs.paddingRight); // Will automatically skip "px" suffix
+ return width+border+padding;
}-*/;
/**
diff --git a/client/src/com/vaadin/client/communication/JsonEncoder.java b/client/src/com/vaadin/client/communication/JsonEncoder.java
index fad4ad602a..8d2a447ac5 100644
--- a/client/src/com/vaadin/client/communication/JsonEncoder.java
+++ b/client/src/com/vaadin/client/communication/JsonEncoder.java
@@ -75,8 +75,8 @@ public class JsonEncoder {
return Json.create((String) value);
} else if (value instanceof Boolean) {
return Json.create((Boolean) value);
- } else if (value instanceof Byte) {
- return Json.create((Byte) value);
+ } else if (value instanceof Number) {
+ return Json.create(((Number) value).doubleValue());
} else if (value instanceof Character) {
return Json.create(String.valueOf(value));
} else if (value instanceof Object[] && type == null) {
diff --git a/client/src/com/vaadin/client/connectors/GridConnector.java b/client/src/com/vaadin/client/connectors/GridConnector.java
index 8e27f526bf..052d8ee368 100644
--- a/client/src/com/vaadin/client/connectors/GridConnector.java
+++ b/client/src/com/vaadin/client/connectors/GridConnector.java
@@ -1232,6 +1232,8 @@ public class GridConnector extends AbstractHasComponentsConnector implements
column.setSortable(state.sortable);
+ column.setHeaderCaption(state.headerCaption);
+
column.setHidden(state.hidden);
column.setHidable(state.hidable);
column.setHidingToggleCaption(state.hidingToggleCaption);
diff --git a/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java b/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java
index b52663b161..5565daf19b 100644
--- a/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java
+++ b/client/src/com/vaadin/client/ui/VAbstractSplitPanel.java
@@ -43,9 +43,8 @@ import com.vaadin.client.BrowserInfo;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorMap;
import com.vaadin.client.LayoutManager;
-import com.vaadin.client.StyleConstants;
-import com.vaadin.client.WidgetUtil;
import com.vaadin.client.VConsole;
+import com.vaadin.client.WidgetUtil;
import com.vaadin.client.ui.TouchScrollDelegate.TouchScrollHandler;
import com.vaadin.client.ui.VAbstractSplitPanel.SplitterMoveHandler.SplitterMoveEvent;
import com.vaadin.shared.ui.Orientation;
@@ -125,14 +124,13 @@ public class VAbstractSplitPanel extends ComplexPanel {
public VAbstractSplitPanel(Orientation orientation) {
setElement(DOM.createDiv());
- setStyleName(StyleConstants.UI_LAYOUT);
switch (orientation) {
case HORIZONTAL:
- addStyleName(CLASSNAME + "-horizontal");
+ setStyleName(CLASSNAME + "-horizontal");
break;
case VERTICAL:
default:
- addStyleName(CLASSNAME + "-vertical");
+ setStyleName(CLASSNAME + "-vertical");
break;
}
// size below will be overridden in update from uidl, initial size
diff --git a/client/src/com/vaadin/client/ui/VGridLayout.java b/client/src/com/vaadin/client/ui/VGridLayout.java
index d1e055eb5d..0c1d4cec90 100644
--- a/client/src/com/vaadin/client/ui/VGridLayout.java
+++ b/client/src/com/vaadin/client/ui/VGridLayout.java
@@ -143,8 +143,10 @@ public class VGridLayout extends ComplexPanel {
if (!isUndefinedHeight()) {
int usedSpace = calcRowUsedSpace();
int[] actualExpandRatio = calcRowExpandRatio();
- int availableSpace = LayoutManager.get(client).getInnerHeight(
- getElement());
+ // Round down to avoid problems with fractions (100.1px available ->
+ // can use 100, not 101)
+ int availableSpace = (int) LayoutManager.get(client)
+ .getInnerHeightDouble(getElement());
int excessSpace = availableSpace - usedSpace;
int distributed = 0;
if (excessSpace > 0) {
@@ -223,8 +225,10 @@ public class VGridLayout extends ComplexPanel {
if (!isUndefinedWidth()) {
int usedSpace = calcColumnUsedSpace();
int[] actualExpandRatio = calcColumnExpandRatio();
- int availableSpace = LayoutManager.get(client).getInnerWidth(
- getElement());
+ // Round down to avoid problems with fractions (100.1px available ->
+ // can use 100, not 101)
+ int availableSpace = (int) LayoutManager.get(client)
+ .getInnerWidthDouble(getElement());
int excessSpace = availableSpace - usedSpace;
int distributed = 0;
if (excessSpace > 0) {
diff --git a/client/src/com/vaadin/client/ui/VSlider.java b/client/src/com/vaadin/client/ui/VSlider.java
index 651880502c..952c387539 100644
--- a/client/src/com/vaadin/client/ui/VSlider.java
+++ b/client/src/com/vaadin/client/ui/VSlider.java
@@ -160,11 +160,7 @@ public class VSlider extends SimpleFocusablePanel implements Field,
}
public void setFeedbackValue(double value) {
- String currentValue = "" + value;
- if (resolution == 0) {
- currentValue = "" + new Double(value).intValue();
- }
- feedback.setText(currentValue);
+ feedback.setText(String.valueOf(value));
}
private void updateFeedbackPosition() {
@@ -218,8 +214,7 @@ public class VSlider extends SimpleFocusablePanel implements Field,
public void execute() {
final Element p = getElement();
if (p.getPropertyInt(domProperty) > (MIN_SIZE + 5)
- || propertyNotNullOrEmpty(styleAttribute,
- p)) {
+ || propertyNotNullOrEmpty(styleAttribute, p)) {
if (isVertical()) {
setHeight();
} else {
diff --git a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
index 3daac849d0..8cfcf7feb1 100644
--- a/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/checkbox/CheckBoxConnector.java
@@ -132,6 +132,9 @@ public class CheckBoxConnector extends AbstractFieldConnector implements
.getElement());
getRpcProxy(CheckBoxServerRpc.class).setChecked(getState().checked,
details);
+ if (getState().immediate) {
+ getConnection().sendPendingVariableChanges();
+ }
}
}
}
diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
index 8757f46e71..1224a2eaf2 100644
--- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
+++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java
@@ -173,6 +173,12 @@ public class ComboBoxConnector extends AbstractFieldConnector implements
// started.
if (selectedKeys.length > 0 && !selectedKeys[0].equals("")) {
performSelection(selectedKeys[0]);
+ } else if (!getWidget().waitingForFilteringResponse
+ && uidl.hasAttribute("selectedCaption")) {
+ // scrolling to correct page is disabled, caption is passed as a
+ // special parameter
+ getWidget().tb.setText(uidl
+ .getStringAttribute("selectedCaption"));
} else {
resetSelection();
}
diff --git a/client/src/com/vaadin/client/ui/slider/SliderConnector.java b/client/src/com/vaadin/client/ui/slider/SliderConnector.java
index 1e5120ce76..8c3c0254d3 100644
--- a/client/src/com/vaadin/client/ui/slider/SliderConnector.java
+++ b/client/src/com/vaadin/client/ui/slider/SliderConnector.java
@@ -89,7 +89,6 @@ public class SliderConnector extends AbstractFieldConnector implements
getWidget().setMaxValue(getState().maxValue);
getWidget().setResolution(getState().resolution);
getWidget().setValue(getState().value, false);
- getWidget().setFeedbackValue(getState().value);
getWidget().buildBase();
getWidget().setTabIndex(getState().tabIndex);
diff --git a/client/src/com/vaadin/client/ui/table/TableConnector.java b/client/src/com/vaadin/client/ui/table/TableConnector.java
index 0d34d2d4d9..7bbda39c43 100644
--- a/client/src/com/vaadin/client/ui/table/TableConnector.java
+++ b/client/src/com/vaadin/client/ui/table/TableConnector.java
@@ -15,24 +15,29 @@
*/
package com.vaadin.client.ui.table;
+import java.util.Collections;
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.google.gwt.dom.client.Element;
import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.Widget;
import com.vaadin.client.ApplicationConnection;
import com.vaadin.client.BrowserInfo;
import com.vaadin.client.ComponentConnector;
import com.vaadin.client.ConnectorHierarchyChangeEvent;
+import com.vaadin.client.ConnectorHierarchyChangeEvent.ConnectorHierarchyChangeHandler;
import com.vaadin.client.DirectionalManagedLayout;
+import com.vaadin.client.HasComponentsConnector;
import com.vaadin.client.Paintable;
import com.vaadin.client.ServerConnector;
import com.vaadin.client.TooltipInfo;
import com.vaadin.client.UIDL;
import com.vaadin.client.WidgetUtil;
-import com.vaadin.client.ui.AbstractHasComponentsConnector;
+import com.vaadin.client.ui.AbstractFieldConnector;
import com.vaadin.client.ui.PostLayoutListener;
import com.vaadin.client.ui.VScrollTable;
import com.vaadin.client.ui.VScrollTable.ContextMenuDetails;
@@ -42,8 +47,15 @@ import com.vaadin.shared.ui.table.TableConstants;
import com.vaadin.shared.ui.table.TableState;
@Connect(com.vaadin.ui.Table.class)
-public class TableConnector extends AbstractHasComponentsConnector implements
- Paintable, DirectionalManagedLayout, PostLayoutListener {
+public class TableConnector extends AbstractFieldConnector implements
+ HasComponentsConnector, ConnectorHierarchyChangeHandler, Paintable,
+ DirectionalManagedLayout, PostLayoutListener {
+
+ private List<ComponentConnector> childComponents;
+
+ public TableConnector() {
+ addConnectorHierarchyChangeHandler(this);
+ }
@Override
protected void init() {
@@ -371,7 +383,7 @@ public class TableConnector extends AbstractHasComponentsConnector implements
/**
* Shows a saved row context menu if the row for the context menu is still
* visible. Does nothing if a context menu has not been saved.
- *
+ *
* @param savedContextMenu
*/
public void showSavedContextMenu(ContextMenuDetails savedContextMenu) {
@@ -429,11 +441,33 @@ public class TableConnector extends AbstractHasComponentsConnector implements
protected void updateComponentSize(String newWidth, String newHeight) {
super.updateComponentSize(newWidth, newHeight);
- if("".equals(newWidth)) {
+ if ("".equals(newWidth)) {
getWidget().updateWidth();
}
- if("".equals(newHeight)) {
+ if ("".equals(newHeight)) {
getWidget().updateHeight();
}
}
+
+ @Override
+ public List<ComponentConnector> getChildComponents() {
+ if (childComponents == null) {
+ return Collections.emptyList();
+ }
+
+ return childComponents;
+ }
+
+ @Override
+ public void setChildComponents(List<ComponentConnector> childComponents) {
+ this.childComponents = childComponents;
+ }
+
+ @Override
+ public HandlerRegistration addConnectorHierarchyChangeHandler(
+ ConnectorHierarchyChangeHandler handler) {
+ return ensureHandlerManager().addHandler(
+ ConnectorHierarchyChangeEvent.TYPE, handler);
+ }
+
}
diff --git a/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java
index 0d85e98ee3..fad094b87f 100644
--- a/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java
+++ b/client/src/com/vaadin/client/ui/textfield/TextFieldConnector.java
@@ -89,10 +89,9 @@ public class TextFieldConnector extends AbstractFieldConnector implements
* side value). <input> is updated only when it looses focus, so we
* force updating if not focused. Lost focus issue appeared in (#15144)
*/
- if (!(Util.getFocusedElement() == getWidget().getElement())
+ if (Util.getFocusedElement() != getWidget().getElement()
|| !uidl.getBooleanAttribute(TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS)
- || getWidget().valueBeforeEdit == null
- || !text.equals(getWidget().valueBeforeEdit)) {
+ || getWidget().valueBeforeEdit == null) {
getWidget().updateFieldContent(text);
}
diff --git a/client/src/com/vaadin/client/widget/grid/AutoScroller.java b/client/src/com/vaadin/client/widget/grid/AutoScroller.java
index f2e44196ec..90d206d98b 100644
--- a/client/src/com/vaadin/client/widget/grid/AutoScroller.java
+++ b/client/src/com/vaadin/client/widget/grid/AutoScroller.java
@@ -538,9 +538,8 @@ public class AutoScroller {
final int endBorder = getBodyClientEnd();
startBorder += getFrozenColumnsWidth();
- final int scrollCompensation = getScrollCompensation();
- startingBound = scrollCompensation + startBorder + scrollAreaPX;
- endingBound = scrollCompensation + endBorder - scrollAreaPX;
+ startingBound = startBorder + scrollAreaPX;
+ endingBound = endBorder - scrollAreaPX;
gradientArea = scrollAreaPX;
// modify bounds if they're too tightly packed
@@ -553,18 +552,6 @@ public class AutoScroller {
}
}
- private int getScrollCompensation() {
- Element cursor = grid.getElement();
- int scroll = 0;
- while (cursor != null) {
- scroll -= scrollDirection == ScrollAxis.VERTICAL ? cursor
- .getScrollTop() : cursor.getScrollLeft();
- cursor = cursor.getParentElement();
- }
-
- return scroll;
- }
-
private void injectNativeHandler() {
removeNativeHandler();
nativePreviewHandlerRegistration = Event
@@ -588,15 +575,6 @@ public class AutoScroller {
}
}
- private TableSectionElement getTbodyElement() {
- TableElement table = getTableElement();
- if (table != null) {
- return table.getTBodies().getItem(0);
- } else {
- return null;
- }
- }
-
private TableSectionElement getTheadElement() {
TableElement table = getTableElement();
if (table != null) {
@@ -615,47 +593,20 @@ public class AutoScroller {
}
}
- /** Get the "top" of an element in relation to "client" coordinates. */
- @SuppressWarnings("static-method")
- private int getClientTop(final Element e) {
- Element cursor = e;
- int top = 0;
- while (cursor != null) {
- top += cursor.getOffsetTop();
- cursor = cursor.getOffsetParent();
- }
- return top;
- }
-
- /** Get the "left" of an element in relation to "client" coordinates. */
- @SuppressWarnings("static-method")
- private int getClientLeft(final Element e) {
- Element cursor = e;
- int left = 0;
- while (cursor != null) {
- left += cursor.getOffsetLeft();
- cursor = cursor.getOffsetParent();
- }
- return left;
- }
-
private int getBodyClientEnd() {
if (scrollDirection == ScrollAxis.VERTICAL) {
- return getClientTop(getTfootElement()) - 1;
+ return getTfootElement().getAbsoluteTop() - 1;
} else {
- TableSectionElement tbodyElement = getTbodyElement();
- return getClientLeft(tbodyElement) + tbodyElement.getOffsetWidth()
- - 1;
+ return getTableElement().getAbsoluteRight();
}
}
private int getBodyClientStart() {
if (scrollDirection == ScrollAxis.VERTICAL) {
- return getClientTop(grid.getElement())
- + getTheadElement().getOffsetHeight();
+ return getTheadElement().getAbsoluteBottom() + 1;
} else {
- return getClientLeft(getTbodyElement());
+ return getTableElement().getAbsoluteLeft();
}
}
diff --git a/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java
index ddbf690970..1e47d3ad6b 100644
--- a/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java
+++ b/client/src/com/vaadin/client/widget/grid/selection/MultiSelectionRenderer.java
@@ -21,19 +21,25 @@ import java.util.HashSet;
import com.google.gwt.animation.client.AnimationScheduler;
import com.google.gwt.animation.client.AnimationScheduler.AnimationCallback;
import com.google.gwt.animation.client.AnimationScheduler.AnimationHandle;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.BrowserEvents;
import com.google.gwt.dom.client.Element;
-import com.google.gwt.dom.client.InputElement;
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.dom.client.TableElement;
import com.google.gwt.dom.client.TableSectionElement;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.MouseDownEvent;
+import com.google.gwt.event.dom.client.MouseDownHandler;
+import com.google.gwt.event.dom.client.TouchStartEvent;
+import com.google.gwt.event.dom.client.TouchStartHandler;
import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
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.ui.CheckBox;
import com.vaadin.client.WidgetUtil;
-import com.vaadin.client.renderers.ComplexRenderer;
+import com.vaadin.client.renderers.ClickableRenderer;
import com.vaadin.client.widget.grid.CellReference;
import com.vaadin.client.widget.grid.RendererCellReference;
import com.vaadin.client.widget.grid.selection.SelectionModel.Multi.Batched;
@@ -47,7 +53,8 @@ import com.vaadin.client.widgets.Grid;
* the type of the associated grid
* @since 7.4
*/
-public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
+public class MultiSelectionRenderer<T> extends
+ ClickableRenderer<Boolean, CheckBox> {
/** The size of the autoscroll area, both top and bottom. */
private static final int SCROLL_AREA_GRADIENT_PX = 100;
@@ -62,6 +69,43 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
private static final int MIN_NO_AUTOSCROLL_AREA_PX = 50;
/**
+ * Handler for MouseDown and TouchStart events for selection checkboxes.
+ *
+ * @since 7.5
+ */
+ private final class CheckBoxEventHandler implements MouseDownHandler,
+ TouchStartHandler, ClickHandler {
+ private final CheckBox checkBox;
+
+ /**
+ * @param checkBox
+ * checkbox widget for this handler
+ */
+ private CheckBoxEventHandler(CheckBox checkBox) {
+ this.checkBox = checkBox;
+ }
+
+ @Override
+ public void onMouseDown(MouseDownEvent event) {
+ if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
+ startDragSelect(event.getNativeEvent(), checkBox.getElement());
+ }
+ }
+
+ @Override
+ public void onTouchStart(TouchStartEvent event) {
+ startDragSelect(event.getNativeEvent(), checkBox.getElement());
+ }
+
+ @Override
+ public void onClick(ClickEvent event) {
+ // Clicking is already handled with MultiSelectionRenderer
+ event.preventDefault();
+ event.stopPropagation();
+ }
+ }
+
+ /**
* This class's main objective is to listen when to stop autoscrolling, and
* make sure everything stops accordingly.
*/
@@ -491,10 +535,8 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
final int topBorder = getBodyClientTop();
final int bottomBorder = getBodyClientBottom();
- final int scrollCompensation = getScrollCompensation();
- topBound = scrollCompensation + topBorder + SCROLL_AREA_GRADIENT_PX;
- bottomBound = scrollCompensation + bottomBorder
- - SCROLL_AREA_GRADIENT_PX;
+ topBound = topBorder + SCROLL_AREA_GRADIENT_PX;
+ bottomBound = bottomBorder - SCROLL_AREA_GRADIENT_PX;
gradientArea = SCROLL_AREA_GRADIENT_PX;
// modify bounds if they're too tightly packed
@@ -507,17 +549,6 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
}
}
- private int getScrollCompensation() {
- Element cursor = grid.getElement();
- int scroll = 0;
- while (cursor != null) {
- scroll -= cursor.getScrollTop();
- cursor = cursor.getParentElement();
- }
-
- return scroll;
- }
-
public void stop() {
if (handlerRegistration != null) {
handlerRegistration.removeHandler();
@@ -558,19 +589,30 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
}
@Override
- public void init(RendererCellReference cell) {
- final InputElement checkbox = InputElement.as(DOM.createInputCheck());
- cell.getElement().removeAllChildren();
- cell.getElement().appendChild(checkbox);
+ public CheckBox createWidget() {
+ final CheckBox checkBox = GWT.create(CheckBox.class);
+ CheckBoxEventHandler handler = new CheckBoxEventHandler(checkBox);
+
+ // Sink events
+ checkBox.sinkBitlessEvent(BrowserEvents.MOUSEDOWN);
+ checkBox.sinkBitlessEvent(BrowserEvents.TOUCHSTART);
+ checkBox.sinkBitlessEvent(BrowserEvents.CLICK);
+
+ // Add handlers
+ checkBox.addMouseDownHandler(handler);
+ checkBox.addTouchStartHandler(handler);
+ checkBox.addClickHandler(handler);
+
+ return checkBox;
}
@Override
- public void render(final RendererCellReference cell, final Boolean data) {
- InputElement checkbox = InputElement.as(cell.getElement()
- .getFirstChildElement());
- checkbox.setChecked(data.booleanValue());
- checkbox.setDisabled(grid.isEditorActive());
- checkbox.setPropertyInt(LOGICAL_ROW_PROPERTY_INT, cell.getRowIndex());
+ public void render(final RendererCellReference cell, final Boolean data,
+ CheckBox checkBox) {
+ checkBox.setValue(data, false);
+ checkBox.setEnabled(!grid.isEditorActive());
+ checkBox.getElement().setPropertyInt(LOGICAL_ROW_PROPERTY_INT,
+ cell.getRowIndex());
}
@Override
@@ -594,12 +636,7 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
if (BrowserEvents.TOUCHSTART.equals(event.getType())
|| (BrowserEvents.MOUSEDOWN.equals(event.getType()) && event
.getButton() == NativeEvent.BUTTON_LEFT)) {
- injectNativeHandler();
- int logicalRowIndex = getLogicalRowIndex(Element.as(event
- .getEventTarget()));
- autoScrollHandler.start(logicalRowIndex);
- event.preventDefault();
- event.stopPropagation();
+ startDragSelect(event, Element.as(event.getEventTarget()));
return true;
} else {
throw new IllegalStateException("received unexpected event: "
@@ -607,6 +644,14 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
}
}
+ private void startDragSelect(NativeEvent event, final Element target) {
+ injectNativeHandler();
+ int logicalRowIndex = getLogicalRowIndex(target);
+ autoScrollHandler.start(logicalRowIndex);
+ event.preventDefault();
+ event.stopPropagation();
+ }
+
private void injectNativeHandler() {
removeNativeHandler();
nativePreviewHandlerRegistration = Event
@@ -685,15 +730,8 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
}
/** Get the "top" of an element in relation to "client" coordinates. */
- @SuppressWarnings("static-method")
private int getClientTop(final Element e) {
- Element cursor = e;
- int top = 0;
- while (cursor != null) {
- top += cursor.getOffsetTop();
- cursor = cursor.getOffsetParent();
- }
- return top;
+ return e.getAbsoluteTop();
}
private int getBodyClientBottom() {
@@ -701,8 +739,9 @@ public class MultiSelectionRenderer<T> extends ComplexRenderer<Boolean> {
}
private int getBodyClientTop() {
+ // Off by one pixel miscalculation. possibly border related.
return getClientTop(grid.getElement())
- + getTheadElement().getOffsetHeight();
+ + getTheadElement().getOffsetHeight() + 1;
}
protected boolean isSelected(final int logicalRow) {
diff --git a/client/src/com/vaadin/client/widgets/Escalator.java b/client/src/com/vaadin/client/widgets/Escalator.java
index bb497e7e13..514fce26dc 100644
--- a/client/src/com/vaadin/client/widgets/Escalator.java
+++ b/client/src/com/vaadin/client/widgets/Escalator.java
@@ -879,6 +879,7 @@ public class Escalator extends Widget implements RequiresResize,
.getCalculatedColumnsWidth(Range.between(
columnConfiguration.getFrozenColumnCount(),
columnConfiguration.getColumnCount()));
+ unfrozenPixels -= subpixelBrowserBugDetector.getActiveAdjustment();
double frozenPixels = scrollContentWidth - unfrozenPixels;
double hScrollOffsetWidth = tableWrapperWidth - frozenPixels;
horizontalScrollbar.setOffsetSize(hScrollOffsetWidth);
@@ -1645,7 +1646,8 @@ public class Escalator extends Widget implements RequiresResize,
for (int row = 0; row < getDomRowCount(); row++) {
final TableRowElement tr = getTrByVisualIndex(row);
- paintInsertCells(tr, row, offset, numberOfColumns);
+ int logicalRowIndex = getLogicalRowIndex(tr);
+ paintInsertCells(tr, logicalRowIndex, offset, numberOfColumns);
}
reapplyRowWidths();
@@ -2127,6 +2129,11 @@ public class Escalator extends Widget implements RequiresResize,
* @return the height of this table section
*/
protected abstract double getHeightOfSection();
+
+ protected int getLogicalRowIndex(final TableRowElement tr) {
+ return tr.getSectionRowIndex();
+ };
+
}
private abstract class AbstractStaticRowContainer extends
@@ -3396,7 +3403,8 @@ public class Escalator extends Widget implements RequiresResize,
}
}
- private int getLogicalRowIndex(final Element tr) {
+ @Override
+ protected int getLogicalRowIndex(final TableRowElement tr) {
assert tr.getParentNode() == root : "The given element isn't a row element in the body";
int internalIndex = visualRowOrder.indexOf(tr);
return getTopRowLogicalIndex() + internalIndex;
@@ -3854,7 +3862,8 @@ public class Escalator extends Widget implements RequiresResize,
}
// Convert DOM coordinates to logical coordinates for rows
- Element rowElement = cell.getElement().getParentElement();
+ TableRowElement rowElement = (TableRowElement) cell.getElement()
+ .getParentElement();
return new Cell(getLogicalRowIndex(rowElement), cell.getColumn(),
cell.getElement());
}
@@ -4138,7 +4147,8 @@ public class Escalator extends Widget implements RequiresResize,
* @return the width of a row, in pixels
*/
public double calculateRowWidth() {
- return getCalculatedColumnsWidth(Range.between(0, getColumnCount()));
+ return getCalculatedColumnsWidth(Range.between(0, getColumnCount()))
+ - subpixelBrowserBugDetector.getActiveAdjustment();
}
private void assertArgumentsAreValidAndWithinRange(final int index,
@@ -4435,7 +4445,7 @@ public class Escalator extends Widget implements RequiresResize,
private class SubpixelBrowserBugDetector {
private static final double SUBPIXEL_ADJUSTMENT = .1;
- private boolean hasAlreadyBeenFixed = false;
+ private boolean fixActive = false;
/**
* This is a fix essentially for Firefox and how it handles subpixels.
@@ -4452,15 +4462,23 @@ public class Escalator extends Widget implements RequiresResize,
* {@value #SUBPIXEL_ADJUSTMENT}px narrower.
*/
public void checkAndFix() {
- if (!hasAlreadyBeenFixed && hasSubpixelBrowserBug()) {
+ if (!fixActive && hasSubpixelBrowserBug()) {
fixSubpixelBrowserBug();
- hasAlreadyBeenFixed = true;
+ fixActive = true;
+ }
+ }
+
+ private double getActiveAdjustment() {
+ if (fixActive) {
+ return -SUBPIXEL_ADJUSTMENT;
+ } else {
+ return 0.0;
}
}
public void invalidateFix() {
adjustBookkeepingPixels(SUBPIXEL_ADJUSTMENT);
- hasAlreadyBeenFixed = false;
+ fixActive = false;
}
private boolean hasSubpixelBrowserBug() {
@@ -4837,9 +4855,17 @@ public class Escalator extends Widget implements RequiresResize,
final double bodyBottom, final double decoWidth) {
final int top = deco.getAbsoluteTop();
final int bottom = deco.getAbsoluteBottom();
+ /*
+ * FIXME
+ *
+ * Height and its use is a workaround for the issue where
+ * coordinates of the deco are not calculated yet. This will
+ * prevent a deco from being displayed when it's added to DOM
+ */
+ final int height = bottom - top;
if (top < bodyTop || bottom > bodyBottom) {
final double topClip = Math.max(0.0D, bodyTop - top);
- final double bottomClip = decoHeight
+ final double bottomClip = height
- Math.max(0.0D, bottom - bodyBottom);
// TODO [optimize] not sure how GWT compiles this
final String clip = new StringBuilder("rect(")
@@ -4895,6 +4921,8 @@ public class Escalator extends Widget implements RequiresResize,
} else if (spacerExists(rowIndex)) {
removeSpacer(rowIndex);
}
+
+ updateSpacerDecosVisibility();
}
/** Checks if a given element is a spacer element */
diff --git a/client/src/com/vaadin/client/widgets/Grid.java b/client/src/com/vaadin/client/widgets/Grid.java
index 834280d89d..57c8a503f5 100644
--- a/client/src/com/vaadin/client/widgets/Grid.java
+++ b/client/src/com/vaadin/client/widgets/Grid.java
@@ -31,6 +31,7 @@ import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger;
+import com.google.gwt.core.client.Duration;
import com.google.gwt.core.client.Scheduler;
import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.core.shared.GWT;
@@ -2429,7 +2430,7 @@ public class Grid<T> extends ResizeComposite implements
* exist.
*/
final SelectionModel.Multi<T> model = (Multi<T>) getSelectionModel();
- final CheckBox checkBox = new CheckBox();
+ final CheckBox checkBox = GWT.create(CheckBox.class);
checkBox.addValueChangeHandler(new ValueChangeHandler<Boolean>() {
@Override
@@ -3161,6 +3162,26 @@ public class Grid<T> extends ResizeComposite implements
private final Grid<?> grid;
+ private NativePreviewHandler clickOutsideToCloseHandler = new NativePreviewHandler() {
+
+ @Override
+ public void onPreviewNativeEvent(NativePreviewEvent event) {
+ if (event.getTypeInt() != Event.ONMOUSEDOWN) {
+ return;
+ }
+
+ // Click outside the panel
+ EventTarget clickTarget = event.getNativeEvent()
+ .getEventTarget();
+ if (!rootContainer.getElement().isOrHasChild(
+ Element.as(clickTarget))) {
+ close();
+ }
+ }
+ };
+
+ private HandlerRegistration clickOutsideToCloseHandlerRegistration;
+
private Sidebar(Grid<?> grid) {
this.grid = grid;
@@ -3250,9 +3271,11 @@ public class Grid<T> extends ResizeComposite implements
*/
public void open() {
if (!isOpen() && isInDOM()) {
- addStyleName("opened");
+ addStyleName("open");
removeStyleName("closed");
rootContainer.add(content);
+ clickOutsideToCloseHandlerRegistration = Event
+ .addNativePreviewHandler(clickOutsideToCloseHandler);
}
openCloseButton.setHeight("");
}
@@ -3262,11 +3285,15 @@ public class Grid<T> extends ResizeComposite implements
*/
public void close() {
if (isOpen()) {
- removeStyleName("opened");
+ removeStyleName("open");
addStyleName("closed");
content.removeFromParent();
// adjust open button to header height when closed
setHeightToHeaderCellHeight();
+ if (clickOutsideToCloseHandlerRegistration != null) {
+ clickOutsideToCloseHandlerRegistration.removeHandler();
+ clickOutsideToCloseHandlerRegistration = null;
+ }
}
}
@@ -3334,27 +3361,22 @@ public class Grid<T> extends ResizeComposite implements
}
private void setHeightToHeaderCellHeight() {
- try {
- double height = WidgetUtil
- .getRequiredHeightBoundingClientRectDouble(grid.escalator
- .getHeader().getRowElement(0)
- .getFirstChildElement())
- - (WidgetUtil.measureVerticalBorder(getElement()) / 2);
- openCloseButton.setHeight(height + "px");
- } catch (NullPointerException npe) {
- getLogger()
- .warning(
- "Got null header first row or first row cell when calculating sidebar button height");
- openCloseButton.setHeight(grid.escalator.getHeader()
- .getDefaultRowHeight() + "px");
- } catch (IndexOutOfBoundsException ioobe) {
- // happens when escalator doesn't have any headers rendered yet.
+ RowContainer header = grid.escalator.getHeader();
+ if (header.getRowCount() == 0
+ || !header.getRowElement(0).hasChildNodes()) {
getLogger()
- .warning(
- "No header cell available when calculating sidebar button height");
- openCloseButton.setHeight(grid.escalator.getHeader()
- .getDefaultRowHeight() + "px");
+ .info("No header cell available when calculating sidebar button height");
+ openCloseButton.setHeight(header.getDefaultRowHeight() + "px");
+
+ return;
}
+
+ Element firstHeaderCell = header.getRowElement(0)
+ .getFirstChildElement();
+ double height = WidgetUtil
+ .getRequiredHeightBoundingClientRectDouble(firstHeaderCell)
+ - (WidgetUtil.measureVerticalBorder(getElement()) / 2);
+ openCloseButton.setHeight(height + "px");
}
private void updateVisibility() {
@@ -3569,6 +3591,10 @@ public class Grid<T> extends ResizeComposite implements
private final AutoColumnWidthsRecalculator autoColumnWidthsRecalculator = new AutoColumnWidthsRecalculator();
private boolean enabled = true;
+ private double lastTouchEventTime = 0;
+ private int lastTouchEventX = -1;
+ private int lastTouchEventY = -1;
+ private int lastTouchEventRow = -1;
private DetailsGenerator detailsGenerator = DetailsGenerator.NULL;
private GridSpacerUpdater gridSpacerUpdater = new GridSpacerUpdater();
@@ -3637,6 +3663,9 @@ public class Grid<T> extends ResizeComposite implements
/** Captures the value of the focused column before reordering */
private int focusedColumnIndex;
+ /** Offset caused by the drag and drop marker width */
+ private double dropMarkerWidthOffset;
+
private void initHeaderDragElementDOM() {
if (table == null) {
tableHeader = DOM.createTHead();
@@ -3659,6 +3688,9 @@ public class Grid<T> extends ResizeComposite implements
tableHeader.getStyle().setTop(topOffset, Unit.PX);
getElement().appendChild(table);
+
+ dropMarkerWidthOffset = WidgetUtil
+ .getRequiredWidthBoundingClientRectDouble(dropMarker) / 2;
}
@Override
@@ -3697,9 +3729,22 @@ public class Grid<T> extends ResizeComposite implements
dropMarkerLeft += autoScrollX;
final double frozenColumnsWidth = getFrozenColumnsWidth();
- if (dropMarkerLeft < frozenColumnsWidth
- || dropMarkerLeft > escalator.getHeader().getElement()
- .getOffsetWidth() || dropMarkerLeft < 0) {
+ final double rightBoundaryForDrag = getSidebarBoundaryComparedTo(dropMarkerLeft);
+ final int visibleColumns = getVisibleColumns().size();
+
+ // First check if the drop marker should move left because of the
+ // sidebar opening button. this only the case if the grid is
+ // scrolled to the right
+ if (latestColumnDropIndex == visibleColumns
+ && rightBoundaryForDrag < dropMarkerLeft
+ && dropMarkerLeft <= escalator.getInnerWidth()) {
+ dropMarkerLeft = rightBoundaryForDrag - dropMarkerWidthOffset;
+ }
+
+ // Check if the drop marker shouldn't be shown at all
+ else if (dropMarkerLeft < frozenColumnsWidth
+ || dropMarkerLeft > Math.min(rightBoundaryForDrag,
+ escalator.getInnerWidth()) || dropMarkerLeft < 0) {
dropMarkerLeft = -10000000;
}
dropMarker.getStyle().setLeft(dropMarkerLeft, Unit.PX);
@@ -3720,18 +3765,43 @@ public class Grid<T> extends ResizeComposite implements
}
// Do not show the drag element beyond the grid
- final int bodyOffsetWidth = getEscalator().getBody().getElement()
- .getOffsetWidth();
+ final double sidebarBoundary = getSidebarBoundaryComparedTo(left);
+ final double gridBoundary = escalator.getInnerWidth();
+ final double rightBoundary = Math
+ .min(sidebarBoundary, gridBoundary);
+
// Do not show on left of the frozen columns (even if scrolled)
final int frozenColumnsWidth = (int) getFrozenColumnsWidth();
- left = Math
- .max(frozenColumnsWidth, Math.min(left, bodyOffsetWidth));
+ left = Math.max(frozenColumnsWidth, Math.min(left, rightBoundary));
left -= dragElement.getClientWidth() / 2;
dragElement.getStyle().setLeft(left, Unit.PX);
}
+ private boolean isSidebarOnDraggedRow() {
+ return eventCell.getRowIndex() == 0 && getSidebar().isInDOM()
+ && !getSidebar().isOpen();
+ }
+
+ /**
+ * Returns the sidebar left coordinate, in relation to the grid. Or
+ * Double.MAX_VALUE if it doesn't cause a boundary.
+ */
+ private double getSidebarBoundaryComparedTo(double left) {
+ if (isSidebarOnDraggedRow()) {
+ double absoluteLeft = left + getElement().getAbsoluteLeft();
+ double sidebarLeft = getSidebar().getElement()
+ .getAbsoluteLeft();
+ double diff = absoluteLeft - sidebarLeft;
+
+ if (diff > 0) {
+ return left - diff;
+ }
+ }
+ return Double.MAX_VALUE;
+ }
+
@Override
public boolean onDragStart(NativeEvent startingEvent) {
calculatePossibleDropPositions();
@@ -4486,8 +4556,8 @@ public class Grid<T> extends ResizeComposite implements
* for this column in the grid's sidebar when the column is
* {@link #isHidable() hidable}.
* <p>
- * Defaults to <code>null</code>, when will use whatever is set with
- * {@link #setHeaderCaption(String)}.
+ * The default value is <code>null</code>. In this case the header
+ * caption is used, see {@link #setHeaderCaption(String)}.
*
* @since 7.5.0
* @param hidingToggleCaption
@@ -5437,8 +5507,17 @@ public class Grid<T> extends ResizeComposite implements
// Register this grid instance with the column
((Column<?, T>) column).setGrid(this);
- // Add to escalator
- escalator.getColumnConfiguration().insertColumns(index, 1);
+ // Grid knows about hidden columns, Escalator only knows about what is
+ // visible so column indexes do not match
+ if (!column.isHidden()) {
+ int escalatorIndex = index;
+ for (int existingColumn = 0; existingColumn < index; existingColumn++) {
+ if (getColumn(existingColumn).isHidden()) {
+ escalatorIndex--;
+ }
+ }
+ escalator.getColumnConfiguration().insertColumns(escalatorIndex, 1);
+ }
// Reapply column width
column.reapplyWidth();
@@ -6477,9 +6556,32 @@ public class Grid<T> extends ResizeComposite implements
final int key = event.getKeyCode();
final boolean editorIsActive = editor.getState() != Editor.State.INACTIVE;
+ double now = Duration.currentTimeMillis();
+ int currentX = WidgetUtil.getTouchOrMouseClientX(event);
+ int currentY = WidgetUtil.getTouchOrMouseClientY(event);
+
+ final boolean validTouchOpenEvent = event.getTypeInt() == Event.ONTOUCHEND
+ && now - lastTouchEventTime < 500
+ && lastTouchEventRow == eventCell.getRowIndex()
+ && Math.abs(lastTouchEventX - currentX) < 20
+ && Math.abs(lastTouchEventY - currentY) < 20;
+
final boolean openEvent = eventCell.isBody()
- && (type == Event.ONDBLCLICK || (type == Event.ONKEYDOWN && key == Editor.KEYCODE_SHOW));
+ && (event.getTypeInt() == Event.ONDBLCLICK
+ || (event.getTypeInt() == Event.ONKEYDOWN && event
+ .getKeyCode() == Editor.KEYCODE_SHOW) || validTouchOpenEvent);
+ if (event.getTypeInt() == Event.ONTOUCHSTART) {
+ lastTouchEventX = currentX;
+ lastTouchEventY = currentY;
+ }
+
+ if (event.getTypeInt() == Event.ONTOUCHEND) {
+ lastTouchEventTime = now;
+ lastTouchEventRow = eventCell.getRowIndex();
+ }
+
+ // TODO: Move on touch events
final boolean moveEvent = eventCell.isBody() && type == Event.ONCLICK;
final boolean closeEvent = type == Event.ONKEYDOWN
@@ -6489,6 +6591,7 @@ public class Grid<T> extends ResizeComposite implements
editor.editRow(eventCell.getRowIndex(),
eventCell.getColumnIndexDOM());
fireEvent(new EditorOpenEvent(eventCell));
+ event.preventDefault();
return true;
diff --git a/push/build.xml b/push/build.xml
index 689ed74b4b..9a45b86cfe 100644
--- a/push/build.xml
+++ b/push/build.xml
@@ -18,7 +18,7 @@
location="${result.dir}/js/VAADIN/vaadinPush.debug.js" />
<!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java -->
- <property name="atmosphere.runtime.version" value="2.2.4.vaadin8" />
+ <property name="atmosphere.runtime.version" value="2.2.7.vaadin1" />
<property name="jquery.js" location="lib/jquery/jquery-1.11.0.js" />
<path id="classpath.compile.custom" />
diff --git a/push/ivy.xml b/push/ivy.xml
index 4eb78629a1..faf96818e1 100644
--- a/push/ivy.xml
+++ b/push/ivy.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ivy-module [
<!-- Keep the version number in sync with build.xml -->
- <!ENTITY atmosphere.runtime.version "2.2.4.vaadin8">
+ <!ENTITY atmosphere.runtime.version "2.2.7.vaadin1">
<!ENTITY atmosphere.js.version "2.2.6.vaadin4">
]>
diff --git a/scripts/BuildArchetypes.py b/scripts/BuildArchetypes.py
new file mode 100644
index 0000000000..80dd745bfb
--- /dev/null
+++ b/scripts/BuildArchetypes.py
@@ -0,0 +1,69 @@
+#coding=UTF-8
+
+#
+# Windows users:
+# You need to setup your environment so that you have mvn on your PATH.
+# Maven needs that JAVA_HOME environment is set and points to a JDK
+# Python3 is required as this script uses some Python3 specific features.
+# Might work with Python2, haven't tested.
+#
+# python BuildArchetypes.py version fw-repo-id archetype-repo-id plugin-repo-id
+#
+
+import subprocess
+from BuildHelpers import mavenValidate, copyWarFiles, repo, getLogFile, parseArgs, mavenCmd, updateRepositories
+
+## DEFAULT VARIABLES ##
+
+# ArchetypeGroupId
+archetypeGroup = "com.vaadin"
+
+# List of built archetypes
+archetypes = [
+ "vaadin-archetype-widget",
+ "vaadin-archetype-application",
+ "vaadin-archetype-application-example",
+ "vaadin-archetype-application-multimodule"
+]
+
+# Maven GroupID
+group = "testpkg"
+
+log = None
+args = None
+
+## BUILDING METHODS ##
+
+# Generates and modifies a maven pom file
+def generateArchetype(archetype):
+ artifactId = "test-%s-%s" % (archetype, args.version.replace(".", "-"))
+
+ # Generate the required command line for archetype generation
+ cmd = [mavenCmd, "archetype:generate"]
+ cmd.append("-DarchetypeGroupId=%s" % (archetypeGroup))
+ cmd.append("-DarchetypeArtifactId=%s" % (archetype))
+ cmd.append("-DarchetypeVersion=%s" % (args.version))
+ if hasattr(args, "archetype") and args.archetype != None:
+ cmd.append("-DarchetypeRepository=%s" % (repo % (args.archetype)))
+ cmd.append("-DgroupId=%s" % (group))
+ cmd.append("-DartifactId=%s" % (artifactId))
+ cmd.append("-Dversion=1.0-SNAPSHOT")
+ cmd.append("-DinteractiveMode=false")
+
+ # Generate pom.xml
+ print("Generating pom.xml for archetype %s" % (archetype))
+ subprocess.check_call(cmd, stdout=log)
+
+ # Return the artifactId so we know the name in the future
+ return artifactId
+
+## DO THIS IF RUN AS A SCRIPT (not import) ##
+if __name__ == "__main__":
+ args = parseArgs()
+ for archetype in archetypes:
+ log = getLogFile(archetype)
+ artifactId = generateArchetype(archetype)
+ updateRepositories(artifactId)
+ mavenValidate(artifactId, logFile=log)
+ copyWarFiles(artifactId, name=archetype)
+
diff --git a/scripts/BuildDemos.py b/scripts/BuildDemos.py
new file mode 100644
index 0000000000..f9f2ed1b48
--- /dev/null
+++ b/scripts/BuildDemos.py
@@ -0,0 +1,41 @@
+#coding=UTF-8
+
+# See BuildArchetypes for details on environment
+# BuildDemos needs git in PATH and depends on gitpython library
+# gitpython can be installed with python installer script "pip":
+# pip install gitpython
+
+from git import Repo
+from BuildHelpers import updateRepositories, mavenValidate, copyWarFiles, VersionObject, getLogFile, parseArgs
+
+## Example of a non-staging test.
+#version = VersionObject()
+#version.version = "7.4.8"
+
+# Uncomment lines before this, and comment following line to make a non-staging test
+version = None
+
+demos = {
+ "dashboard" : "https://github.com/vaadin/dashboard-demo.git",
+ "parking" : "https://github.com/vaadin/parking-demo.git",
+ "addressbook" : "https://github.com/vaadin/addressbook.git",
+ "confirmdialog" : "https://github.com/samie/Vaadin-ConfirmDialog.git"
+}
+
+def checkout(folder, url):
+ Repo.clone_from(url, folder)
+
+if __name__ == "__main__":
+ if version is None:
+ version = parseArgs()
+ for demo in demos:
+ print("Validating demo %s" % (demo))
+ try:
+ checkout(demo, demos[demo])
+ updateRepositories(demo, repoIds = version)
+ mavenValidate(demo, repoIds = version, logFile = getLogFile(demo))
+ copyWarFiles(demo)
+ print("%s demo validation succeeded!" % (demo))
+ except:
+ print("%s demo validation failed" % (demo))
+ print("")
diff --git a/scripts/BuildHelpers.py b/scripts/BuildHelpers.py
new file mode 100644
index 0000000000..be21c0f721
--- /dev/null
+++ b/scripts/BuildHelpers.py
@@ -0,0 +1,160 @@
+#coding=UTF-8
+
+## Collection of helpers for Build scripts ##
+
+import sys, argparse, subprocess, platform
+from xml.etree import ElementTree
+from os.path import join, isdir, isfile, basename, exists
+from os import listdir, getcwd, mkdir
+from shutil import copy
+from glob import glob
+
+class VersionObject(object):
+ pass
+
+# Staging repo base url
+repo = "http://oss.sonatype.org/content/repositories/comvaadin-%d"
+
+# Directory where the resulting war files are stored
+# TODO: deploy results
+resultPath = "result"
+
+if not exists(resultPath):
+ mkdir(resultPath)
+elif not isdir(resultPath):
+ print("Result path is not a directory.")
+ sys.exit(1)
+
+args = None
+
+# Parse command line arguments <version> <framework-repo-id> <archetype-repo-id> <plugin-repo-id>
+def parseArgs():
+ # Command line arguments for this script
+ parser = argparse.ArgumentParser(description="Automated staging validation")
+ parser.add_argument("version", type=str, help="Vaadin version to use")
+ parser.add_argument("framework", type=int, help="Framework repo id (comvaadin-XXXX)", nargs='?')
+ parser.add_argument("archetype", type=int, help="Archetype repo id (comvaadin-XXXX)", nargs='?')
+ parser.add_argument("plugin", type=int, help="Maven Plugin repo id (comvaadin-XXXX)", nargs='?')
+
+ # If no args, give help
+ if len(sys.argv) == 1:
+ args = parser.parse_args(["-h"])
+ else:
+ args = parser.parse_args()
+
+ return args
+
+# Function for determining the path for maven executable
+def getMavenCommand():
+ # This method uses .split("\n")[0] which basically chooses the first result where/which returns.
+ # Fixes the case with multiple maven installations available on PATH
+ if platform.system() == "Windows":
+ try:
+ return subprocess.check_output(["where", "mvn.cmd"], universal_newlines=True).split("\n")[0]
+ except:
+ try:
+ return subprocess.check_output(["where", "mvn.bat"], universal_newlines=True).split("\n")[0]
+ except:
+ print("Unable to locate mvn with where. Is the maven executable in your PATH?")
+ else:
+ try:
+ return subprocess.check_output(["which", "mvn"], universal_newlines=True).split("\n")[0]
+ except:
+ print("Unable to locate maven executable with which. Is the maven executable in your PATH?")
+ return None
+
+mavenCmd = getMavenCommand()
+
+# Get command line arguments. Parses arguments if needed.
+def getArgs():
+ global args
+ if args is None:
+ args = parseArgs()
+ return args
+
+# Maven Package and Validation
+def mavenValidate(artifactId, mvnCmd = mavenCmd, logFile = sys.stdout, repoIds = None):
+ if repoIds is None:
+ repoIds = getArgs()
+
+ print("Do maven clean package validate")
+ cmd = [mvnCmd]
+ if hasattr(repoIds, "version") and repoIds.version is not None:
+ cmd.append("-Dvaadin.version=%s" % (repoIds.version))
+ cmd.extend(["clean", "package", "validate"])
+ print("executing: %s" % (" ".join(cmd)))
+ subprocess.check_call(cmd, cwd=join(getcwd(), artifactId), stdout=logFile)
+
+# Collect .war files to given folder with given naming
+def copyWarFiles(artifactId, resultDir = resultPath, name = None):
+ if name is None:
+ name = artifactId
+ warFiles = glob(join(getcwd(), artifactId, "target", "*.war"))
+ warFiles.extend(glob(join(getcwd(), artifactId, "*", "target", "*.war")))
+ for warFile in warFiles:
+ if len(warFiles) == 1:
+ deployName = "%s.war" % (name)
+ else:
+ deployName = "%s-%d.war" % (name, warFiles.index(warFile))
+ print("Copying .war file %s as %s to result folder" % (basename(warFile), deployName))
+ copy(warFile, join(resultDir, "%s" % (deployName)))
+
+# Recursive pom.xml update script
+def updateRepositories(path, repoIds = None, repoUrl = repo):
+ # If versions are not supplied, parse arguments
+ if repoIds is None:
+ repoIds = getArgs()
+
+ # Read pom.xml
+ pomXml = join(path, "pom.xml")
+ if isfile(pomXml):
+ # pom.xml namespace workaround
+ root = ElementTree.parse(pomXml).getroot()
+ nameSpace = root.tag[1:root.tag.index('}')]
+ ElementTree.register_namespace('', nameSpace)
+
+ # Read the pom.xml correctly
+ tree = ElementTree.parse(pomXml)
+
+ # NameSpace needed for finding the repositories node
+ repoNode = tree.getroot().find("{%s}repositories" % (nameSpace))
+ else:
+ return
+
+ if repoNode is not None:
+ print("Add staging repositories to " + pomXml)
+
+ if hasattr(repoIds, "framework") and repoIds.framework is not None:
+ # Add framework staging repository
+ addRepo(repoNode, "repository", "vaadin-%s-staging" % (repoIds.version), repoUrl % (repoIds.framework))
+
+ # Find the correct pluginRepositories node
+ pluginRepo = tree.getroot().find("{%s}pluginRepositories" % (nameSpace))
+ if pluginRepo is None:
+ # Add pluginRepositories node if needed
+ pluginRepo = ElementTree.SubElement(tree.getroot(), "pluginRepositories")
+
+ if hasattr(repoIds, "plugin") and repoIds.plugin is not None:
+ # Add plugin staging repository
+ addRepo(pluginRepo, "pluginRepository", "vaadin-%s-plugin-staging" % (repoIds.version), repoUrl % (repoIds.plugin))
+
+ # Overwrite the modified pom.xml
+ tree.write(pomXml, encoding='UTF-8')
+
+ # Recursive pom.xml search.
+ for i in listdir(path):
+ file = join(path, i)
+ if isdir(file):
+ updateRepositories(join(path, i), repoIds, repoUrl)
+
+# Add a repository of repoType to given repoNode with id and URL
+def addRepo(repoNode, repoType, id, url):
+ newRepo = ElementTree.SubElement(repoNode, repoType)
+ idElem = ElementTree.SubElement(newRepo, "id")
+ idElem.text = id
+ urlElem = ElementTree.SubElement(newRepo, "url")
+ urlElem.text = url
+
+# Get a logfile for given artifact
+def getLogFile(artifact, resultDir = resultPath):
+ return open(join(resultDir, "%s.log" % (artifact)), 'w')
diff --git a/scripts/ValidateVaadinDownload.py b/scripts/ValidateVaadinDownload.py
new file mode 100644
index 0000000000..78d9b99daa
--- /dev/null
+++ b/scripts/ValidateVaadinDownload.py
@@ -0,0 +1,66 @@
+#coding=UTF-8
+
+import argparse, sys
+from urllib.request import urlopen
+
+parse = argparse.ArgumentParser(description="Check vaadin.com version lists")
+parse.add_argument("version", help="Released Vaadin version number")
+
+args = parse.parse_args()
+if hasattr(args, "echo"):
+ print(args.echo)
+ sys.exit(1)
+
+prerelease = None
+(major, minor, maintenance) = args.version.split(".", 2)
+
+if "." in maintenance:
+ (maintenance, prerelease) = maintenance.split(".", 1)
+
+# Version without prerelease tag
+version = "%s.%s.%s" % (major, minor, maintenance)
+isPrerelease = prerelease is not None
+
+failed = False
+
+vaadin7Latest = "http://vaadin.com/download/LATEST7"
+vaadin7Versions = "http://vaadin.com/download/VERSIONS_7"
+vaadin6Latest = "http://vaadin.com/download/LATEST"
+vaadinPrerelease = "http://vaadin.com/download/PRERELEASES"
+
+try:
+ latest = urlopen(vaadin7Latest).read().decode().split("\n")
+ releaseRow = "release/%s.%s/%s" % (major, minor, version)
+
+ assert (version in latest[0]) ^ isPrerelease, "Latest version mismatch. %s: %s, was: %s" % ("should not be" if isPrerelease else "should be", args.version, latest[0])
+ assert (releaseRow in latest[1]) ^ isPrerelease, "Release row mismatch; %s: %s, was %s" % ("should not be" if isPrerelease else "should be", releaseRow, latest[1])
+except Exception as e:
+ failed = True
+ print("Latest version was not correctly updated: %s" % (e))
+
+try:
+ assert "%s," % (args.version) in urlopen(vaadin7Versions).read().decode().split("\n"), "Released version not in version list"
+except Exception as e:
+ if isPrerelease:
+ print("Prerelease version needs to be added manually to versions!")
+ else:
+ failed = True
+ print(e)
+
+try:
+ latest = urlopen(vaadin6Latest).read().decode().split("\n")
+ releaseRow = "release/6.8/6.8."
+
+ assert ("6.8." in latest[0]), "Latest version mismatch; should be: %sX, was: %s" % ("6.8.", latest[0])
+ assert (releaseRow in latest[1]), "Release row mismatch; should be: %sX, was %s" % (releaseRow, latest[1])
+except Exception as e:
+ failed = True
+ print("Latest Vaadin 6 version was updated by release. %s" % (e))
+
+try:
+ latest = urlopen(vaadinPrerelease).read().decode().split("\n")
+ assert (args.version in latest[0]) or not isPrerelease, "%s: %s, was: %s" % ("should be", args.version, latest[0])
+except Exception as e:
+ print("Prerelease file was not correctly updated: %s" % (e))
+
+sys.exit(1 if failed else 0)
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 79a5b6c067..6b800cb965 100644
--- a/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
+++ b/server/src/com/vaadin/data/util/sqlcontainer/query/FreeformQuery.java
@@ -155,8 +155,13 @@ public class FreeformQuery extends AbstractTransactionalQuery implements
pstmt = c.prepareStatement(sh.getQueryString());
sh.setParameterValuesToStatement(pstmt);
rs = pstmt.executeQuery();
- rs.next();
- count = rs.getInt(1);
+ if (rs.next()) {
+ count = rs.getInt(1);
+ } else {
+ // The result can be empty when using group by and there
+ // are no matches (#18043)
+ count = 0;
+ }
} finally {
releaseConnection(c, pstmt, rs);
}
@@ -175,8 +180,13 @@ public class FreeformQuery extends AbstractTransactionalQuery implements
try {
statement = conn.createStatement();
rs = statement.executeQuery(countQuery);
- rs.next();
- count = rs.getInt(1);
+ if (rs.next()) {
+ count = rs.getInt(1);
+ } else {
+ // The result can be empty when using group by and there
+ // are no matches (#18043)
+ count = 0;
+ }
return count;
} finally {
releaseConnection(conn, statement, rs);
diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java
index 65b3fec488..bd2b5711f8 100644
--- a/server/src/com/vaadin/navigator/Navigator.java
+++ b/server/src/com/vaadin/navigator/Navigator.java
@@ -745,9 +745,15 @@ public class Navigator implements Serializable {
* the requested view name is found.
*
* @param provider
- * provider to register
+ * provider to register, not <code>null</code>
+ * @throws IllegalArgumentException
+ * if the provided view provider is <code>null</code>
*/
public void addProvider(ViewProvider provider) {
+ if (provider == null) {
+ throw new IllegalArgumentException(
+ "Cannot add a null view provider");
+ }
providers.add(provider);
}
diff --git a/server/src/com/vaadin/server/ComponentSizeValidator.java b/server/src/com/vaadin/server/ComponentSizeValidator.java
index 2d88ae3b53..1fbd840932 100644
--- a/server/src/com/vaadin/server/ComponentSizeValidator.java
+++ b/server/src/com/vaadin/server/ComponentSizeValidator.java
@@ -415,7 +415,7 @@ public class ComponentSizeValidator implements Serializable {
// main window, valid situation
return true;
}
- if (parent.getHeight() < 0) {
+ if (isEffectiveUndefinedHeight(component)) {
// Undefined height
if (parent instanceof Window) {
// Sub window with undefined size has a min-height
@@ -513,10 +513,7 @@ public class ComponentSizeValidator implements Serializable {
// Sub window with undefined size has a min-width
return true;
}
-
- if (parent.getWidth() < 0) {
- // Undefined width
-
+ if (isEffectiveUndefinedWidth(parent)) {
if (parent instanceof AbstractOrderedLayout) {
AbstractOrderedLayout ol = (AbstractOrderedLayout) parent;
boolean horizontal = true;
@@ -591,6 +588,40 @@ public class ComponentSizeValidator implements Serializable {
}
+ /**
+ * Checks if this component will be rendered with undefined width, either
+ * because it has been set to undefined wide or because the parent forces it
+ * to be (100% inside undefined)
+ *
+ */
+ private static boolean isEffectiveUndefinedWidth(Component parent) {
+ if (parent == null) {
+ return false;
+ } else if (parent.getWidth() < 0) {
+ return true;
+ } else if (parent.getWidthUnits() == Unit.PERCENTAGE) {
+ return isEffectiveUndefinedWidth(parent.getParent());
+ }
+ return false;
+ }
+
+ /**
+ * Checks if this component will be rendered with undefined Height, either
+ * because it has been set to undefined wide or because the parent forces it
+ * to be (100% inside undefined)
+ *
+ */
+ private static boolean isEffectiveUndefinedHeight(Component parent) {
+ if (parent == null) {
+ return false;
+ } else if (parent.getHeight() < 0) {
+ return true;
+ } else if (parent.getHeightUnits() == Unit.PERCENTAGE) {
+ return isEffectiveUndefinedHeight(parent.getParent());
+ }
+ return false;
+ }
+
private static boolean hasNonRelativeWidthComponent(Form form) {
Layout layout = form.getLayout();
Layout footer = form.getFooter();
diff --git a/server/src/com/vaadin/server/ConnectorResourceHandler.java b/server/src/com/vaadin/server/ConnectorResourceHandler.java
index 6c486a2d65..8715134773 100644
--- a/server/src/com/vaadin/server/ConnectorResourceHandler.java
+++ b/server/src/com/vaadin/server/ConnectorResourceHandler.java
@@ -30,10 +30,11 @@ import com.vaadin.util.CurrentInstance;
public class ConnectorResourceHandler implements RequestHandler {
// APP/connector/[uiid]/[cid]/[filename.xyz]
+ private static final String CONNECTOR_RESOURCE_PREFIX = "/"
+ + ApplicationConstants.APP_PATH + "/"
+ + ConnectorResource.CONNECTOR_PATH + "/";
private static final Pattern CONNECTOR_RESOURCE_PATTERN = Pattern
- .compile("^/?" + ApplicationConstants.APP_PATH + '/'
- + ConnectorResource.CONNECTOR_PATH + '/'
- + "(\\d+)/(\\d+)/(.*)");
+ .compile("^" + CONNECTOR_RESOURCE_PREFIX + "(\\d+)/(\\d+)/(.*)");
private static Logger getLogger() {
return Logger.getLogger(ConnectorResourceHandler.class.getName());
@@ -44,12 +45,18 @@ public class ConnectorResourceHandler implements RequestHandler {
public boolean handleRequest(VaadinSession session, VaadinRequest request,
VaadinResponse response) throws IOException {
String requestPath = request.getPathInfo();
- if (requestPath == null) {
+ if (requestPath == null
+ || !requestPath.startsWith(CONNECTOR_RESOURCE_PREFIX)) {
return false;
}
Matcher matcher = CONNECTOR_RESOURCE_PATTERN.matcher(requestPath);
if (!matcher.matches()) {
- return false;
+ // This is a connector resource request based on the prefix but the
+ // pattern did not match
+ warnAboutInvalidURLEncoding(requestPath);
+ response.sendError(HttpServletResponse.SC_NOT_FOUND,
+ "Connector resource not found");
+ return true;
}
String uiId = matcher.group(1);
String cid = matcher.group(2);
@@ -102,6 +109,25 @@ public class ConnectorResourceHandler implements RequestHandler {
return true;
}
+ private boolean loggedDecodingWarning = false;
+
+ private void warnAboutInvalidURLEncoding(String requestPath) {
+ if (requestPath.contains("\n") || requestPath.indexOf(0x85) != -1) {
+ // What, path info should not contain a new line or UTF-8 Next Line
+ // (NEL) character, but it does in
+ // Tomcat 7 with default configuration in some cases (URL is encoded
+ // by the browser as UTF-8 and decoded as ISO-8859-1 by Tomcat)
+
+ if (!loggedDecodingWarning) {
+ loggedDecodingWarning = true;
+ getLogger()
+ .warning(
+ "Request path contains a new line character. This typically means that the server is incorrectly configured to use something else than UTF-8 for URL decoding (requestPath: "
+ + requestPath + ")");
+ }
+ }
+ }
+
private static boolean error(VaadinRequest request,
VaadinResponse response, String logMessage) throws IOException {
getLogger().log(Level.WARNING, logMessage);
diff --git a/server/src/com/vaadin/server/Constants.java b/server/src/com/vaadin/server/Constants.java
index 122cce2e74..5a0d852299 100644
--- a/server/src/com/vaadin/server/Constants.java
+++ b/server/src/com/vaadin/server/Constants.java
@@ -67,7 +67,7 @@ public interface Constants {
// Keep the version number in sync with push/build.xml and other locations
// listed in that file
- static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.4.vaadin8";
+ static final String REQUIRED_ATMOSPHERE_RUNTIME_VERSION = "2.2.7.vaadin1";
static final String INVALID_ATMOSPHERE_VERSION_WARNING = "\n"
+ "=================================================================\n"
diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java
index 681c438967..65ef560974 100644
--- a/server/src/com/vaadin/server/DownloadStream.java
+++ b/server/src/com/vaadin/server/DownloadStream.java
@@ -20,6 +20,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@@ -40,6 +42,8 @@ import javax.servlet.http.HttpServletResponse;
@SuppressWarnings("serial")
public class DownloadStream implements Serializable {
+ public static final String CONTENT_DISPOSITION = "Content-Disposition";
+
/**
* Maximum cache time.
*/
@@ -280,17 +284,14 @@ public class DownloadStream implements Serializable {
}
}
- // suggest local filename from DownloadStream if
- // Content-Disposition
- // not explicitly set
- String contentDispositionValue = getParameter("Content-Disposition");
- if (contentDispositionValue == null) {
- contentDispositionValue = "filename=\"" + getFileName()
- + "\"";
- response.setHeader("Content-Disposition",
- contentDispositionValue);
+ // Content-Disposition: attachment generally forces download
+ String contentDisposition = getParameter(CONTENT_DISPOSITION);
+ if (contentDisposition == null) {
+ contentDisposition = getContentDispositionFilename(getFileName());
}
+ response.setHeader(CONTENT_DISPOSITION, contentDisposition);
+
int bufferSize = getBufferSize();
if (bufferSize <= 0 || bufferSize > Constants.MAX_BUFFER_SIZE) {
bufferSize = Constants.DEFAULT_BUFFER_SIZE;
@@ -318,6 +319,25 @@ public class DownloadStream implements Serializable {
}
/**
+ * Returns the filename formatted for inclusion in a Content-Disposition
+ * header. Includes both a plain version of the name and a UTF-8 version
+ *
+ * @since 7.4.8
+ * @param filename
+ * The filename to include
+ * @return A value for inclusion in a Content-Disposition header
+ */
+ public static String getContentDispositionFilename(String filename) {
+ try {
+ String encodedFilename = URLEncoder.encode(filename, "UTF-8");
+ return String.format("filename=\"%s\"; filename*=utf-8''%s",
+ encodedFilename, encodedFilename);
+ } catch (UnsupportedEncodingException e) {
+ return null;
+ }
+ }
+
+ /**
* Helper method that tries to close an output stream and ignores any
* exceptions.
*
diff --git a/server/src/com/vaadin/server/FileDownloader.java b/server/src/com/vaadin/server/FileDownloader.java
index 42c2f76e1a..b0c3bb1120 100644
--- a/server/src/com/vaadin/server/FileDownloader.java
+++ b/server/src/com/vaadin/server/FileDownloader.java
@@ -141,12 +141,17 @@ public class FileDownloader extends AbstractExtension {
}
stream = ((ConnectorResource) resource).getStream();
- if (stream.getParameter("Content-Disposition") == null) {
- // Content-Disposition: attachment generally forces download
- stream.setParameter("Content-Disposition",
- "attachment; filename=\"" + stream.getFileName() + "\"");
+ String contentDisposition = stream
+ .getParameter(DownloadStream.CONTENT_DISPOSITION);
+ if (contentDisposition == null) {
+ contentDisposition = "attachment; "
+ + DownloadStream.getContentDispositionFilename(stream
+ .getFileName());
}
+ stream.setParameter(DownloadStream.CONTENT_DISPOSITION,
+ contentDisposition);
+
// Content-Type to block eager browser plug-ins from hijacking
// the file
if (isOverrideContentType()) {
@@ -158,4 +163,5 @@ public class FileDownloader extends AbstractExtension {
stream.writeResponse(request, response);
return true;
}
+
}
diff --git a/server/src/com/vaadin/server/GAEVaadinServlet.java b/server/src/com/vaadin/server/GAEVaadinServlet.java
index df7cd0a66e..6f5c15ebdd 100644
--- a/server/src/com/vaadin/server/GAEVaadinServlet.java
+++ b/server/src/com/vaadin/server/GAEVaadinServlet.java
@@ -57,7 +57,7 @@ import com.google.apphosting.api.DeadlineExceededException;
* &lt;servlet-name&gt;HelloWorld&lt;/servlet-name&gt;
* &lt;servlet-class&gt;com.vaadin.server.GAEApplicationServlet&lt;/servlet-class&gt;
* &lt;init-param&gt;
- * &lt;param-name&gt;application&lt;/param-name&gt;
+ * &lt;param-name&gt;UI&lt;/param-name&gt;
* &lt;param-value&gt;com.vaadin.demo.HelloWorld&lt;/param-value&gt;
* &lt;/init-param&gt;
* &lt;/servlet&gt;
diff --git a/server/src/com/vaadin/server/ServerRpcManager.java b/server/src/com/vaadin/server/ServerRpcManager.java
index 3a2cb3a32c..ae99622a4a 100644
--- a/server/src/com/vaadin/server/ServerRpcManager.java
+++ b/server/src/com/vaadin/server/ServerRpcManager.java
@@ -153,19 +153,9 @@ public class ServerRpcManager<T extends ServerRpc> implements Serializable {
public void applyInvocation(ServerRpcMethodInvocation invocation)
throws RpcInvocationException {
Method method = invocation.getMethod();
- Class<?>[] parameterTypes = method.getParameterTypes();
- Object[] args = new Object[parameterTypes.length];
Object[] arguments = invocation.getParameters();
- for (int i = 0; i < args.length; i++) {
- // no conversion needed for basic cases
- // Class<?> type = parameterTypes[i];
- // if (type.isPrimitive()) {
- // type = boxedTypes.get(type);
- // }
- args[i] = arguments[i];
- }
try {
- method.invoke(implementation, args);
+ method.invoke(implementation, arguments);
} catch (Exception e) {
throw new RpcInvocationException("Unable to invoke method "
+ invocation.getMethodName() + " in "
diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java
index 27d97d5e03..18c3509af7 100644
--- a/server/src/com/vaadin/ui/AbstractComponent.java
+++ b/server/src/com/vaadin/ui/AbstractComponent.java
@@ -243,6 +243,34 @@ public abstract class AbstractComponent extends AbstractClientConnector
}
}
+ /**
+ * Adds or removes a style name. Multiple styles can be specified as a
+ * space-separated list of style names.
+ *
+ * If the {@code add} parameter is true, the style name is added to the
+ * component. If the {@code add} parameter is false, the style name is
+ * removed from the component.
+ * <p>
+ * Functionally this is equivalent to using {@link #addStyleName(String)} or
+ * {@link #removeStyleName(String)}
+ *
+ * @since 7.5
+ * @param style
+ * the style name to be added or removed
+ * @param add
+ * <code>true</code> to add the given style, <code>false</code>
+ * to remove it
+ * @see #addStyleName(String)
+ * @see #removeStyleName(String)
+ */
+ public void setStyleName(String style, boolean add) {
+ if (add) {
+ addStyleName(style);
+ } else {
+ removeStyleName(style);
+ }
+ }
+
/*
* Get's the component's caption. Don't add a JavaDoc comment here, we use
* the default documentation from implemented interface.
diff --git a/server/src/com/vaadin/ui/AbstractLayout.java b/server/src/com/vaadin/ui/AbstractLayout.java
index 9cdb0a326a..0770670680 100644
--- a/server/src/com/vaadin/ui/AbstractLayout.java
+++ b/server/src/com/vaadin/ui/AbstractLayout.java
@@ -16,7 +16,12 @@
package com.vaadin.ui;
+import org.jsoup.nodes.Element;
+
import com.vaadin.shared.ui.AbstractLayoutState;
+import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.ui.declarative.DesignAttributeHandler;
+import com.vaadin.ui.declarative.DesignContext;
/**
* An abstract class that defines default implementation for the {@link Layout}
@@ -33,4 +38,90 @@ public abstract class AbstractLayout extends AbstractComponentContainer
return (AbstractLayoutState) super.getState();
}
+ /**
+ * Reads margin attributes from a design into a MarginInfo object. This
+ * helper method should be called from the
+ * {@link #readDesign(Element, DesignContext) readDesign} method of layouts
+ * that implement {@link MarginHandler}.
+ *
+ * @since 7.5
+ *
+ * @param design
+ * the design from which to read
+ * @param defMargin
+ * the default margin state for edges that are not set in the
+ * design
+ * @param context
+ * the DesignContext instance used for parsing the design
+ * @return the margin info
+ */
+ protected MarginInfo readMargin(Element design, MarginInfo defMargin,
+ DesignContext context) {
+
+ if (design.hasAttr("margin")) {
+ boolean margin = DesignAttributeHandler.readAttribute("margin",
+ design.attributes(), boolean.class);
+ return new MarginInfo(margin);
+ } else {
+ boolean left = DesignAttributeHandler.readAttribute("margin-left",
+ design.attributes(), defMargin.hasLeft(), boolean.class);
+
+ boolean right = DesignAttributeHandler.readAttribute(
+ "margin-right", design.attributes(), defMargin.hasRight(),
+ boolean.class);
+
+ boolean top = DesignAttributeHandler.readAttribute("margin-top",
+ design.attributes(), defMargin.hasTop(), boolean.class);
+
+ boolean bottom = DesignAttributeHandler.readAttribute(
+ "margin-bottom", design.attributes(),
+ defMargin.hasBottom(), boolean.class);
+
+ return new MarginInfo(top, right, bottom, left);
+ }
+ }
+
+ /**
+ * Writes margin attributes from a MarginInfo object to a design. This
+ * helper method should be called from the
+ * {@link #readDesign(Element, DesignContext) writeDesign} method of layouts
+ * that implement {@link MarginHandler}.
+ *
+ *
+ * @since 7.5
+ *
+ * @param design
+ * the design to write to
+ * @param margin
+ * the margin state to write
+ * @param defMargin
+ * the default margin state to compare against
+ * @param context
+ * the DesignContext instance used for parsing the design
+ */
+ protected void writeMargin(Element design, MarginInfo margin,
+ MarginInfo defMargin, DesignContext context) {
+ if (margin.hasAll()) {
+ DesignAttributeHandler.writeAttribute("margin",
+ design.attributes(), margin.hasAll(), defMargin.hasAll(),
+ boolean.class);
+ } else {
+
+ DesignAttributeHandler.writeAttribute("margin-left",
+ design.attributes(), margin.hasLeft(), defMargin.hasLeft(),
+ boolean.class);
+
+ DesignAttributeHandler.writeAttribute("margin-right",
+ design.attributes(), margin.hasRight(),
+ defMargin.hasRight(), boolean.class);
+
+ DesignAttributeHandler.writeAttribute("margin-top",
+ design.attributes(), margin.hasTop(), defMargin.hasTop(),
+ boolean.class);
+
+ DesignAttributeHandler.writeAttribute("margin-bottom",
+ design.attributes(), margin.hasBottom(),
+ defMargin.hasBottom(), boolean.class);
+ }
+ }
}
diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
index 0214ff4be1..afe4717212 100644
--- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java
+++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java
@@ -478,30 +478,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
// process default attributes
super.readDesign(design, designContext);
- // handle margins
- if (design.hasAttr("margin")) {
- setMargin(DesignAttributeHandler.readAttribute("margin",
- design.attributes(), Boolean.class));
- } else {
- boolean marginLeft = DesignAttributeHandler.readAttribute(
- "margin-left", design.attributes(), getMargin().hasLeft(),
- Boolean.class);
-
- boolean marginRight = DesignAttributeHandler.readAttribute(
- "margin-right", design.attributes(),
- getMargin().hasRight(), Boolean.class);
-
- boolean marginTop = DesignAttributeHandler.readAttribute(
- "margin-top", design.attributes(), getMargin().hasTop(),
- Boolean.class);
-
- boolean marginBottom = DesignAttributeHandler.readAttribute(
- "margin-bottom", design.attributes(), getMargin()
- .hasBottom(), Boolean.class);
-
- setMargin(new MarginInfo(marginTop, marginBottom, marginLeft,
- marginRight));
- }
+ setMargin(readMargin(design, getMargin(), designContext));
// handle children
for (Element childComponent : design.children()) {
@@ -557,31 +534,7 @@ public abstract class AbstractOrderedLayout extends AbstractLayout implements
AbstractOrderedLayout def = (AbstractOrderedLayout) designContext
.getDefaultInstance(this);
- // handle margin
- MarginInfo marginInfo = getMargin();
-
- if (marginInfo.hasAll()) {
- DesignAttributeHandler.writeAttribute("margin",
- design.attributes(), marginInfo.hasAll(), def.getMargin()
- .hasAll(), Boolean.class);
- } else {
-
- DesignAttributeHandler.writeAttribute("margin-left", design
- .attributes(), marginInfo.hasLeft(), def.getMargin()
- .hasLeft(), Boolean.class);
-
- DesignAttributeHandler.writeAttribute("margin-right", design
- .attributes(), marginInfo.hasRight(), def.getMargin()
- .hasRight(), Boolean.class);
-
- DesignAttributeHandler.writeAttribute("margin-top", design
- .attributes(), marginInfo.hasTop(), def.getMargin()
- .hasTop(), Boolean.class);
-
- DesignAttributeHandler.writeAttribute("margin-bottom", design
- .attributes(), marginInfo.hasBottom(), def.getMargin()
- .hasBottom(), Boolean.class);
- }
+ writeMargin(design, getMargin(), def.getMargin(), designContext);
// handle children
if (!designContext.shouldWriteChildren(this, def)) {
diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java
index 93025ac0fd..14c135228c 100644
--- a/server/src/com/vaadin/ui/AbstractTextField.java
+++ b/server/src/com/vaadin/ui/AbstractTextField.java
@@ -126,25 +126,22 @@ public abstract class AbstractTextField extends AbstractField<String> implements
selectionPosition = -1;
}
- if (hasListeners(TextChangeEvent.class)) {
- target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE,
- getTextChangeEventMode().toString());
- target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT,
- getTextChangeTimeout());
- if (lastKnownTextContent != null) {
- /*
- * The field has be repainted for some reason (e.g. caption,
- * size, stylename), but the value has not been changed since
- * the last text change event. Let the client side know about
- * the value the server side knows. Client side may then ignore
- * the actual value, depending on its state.
- */
- target.addAttribute(
- TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS,
- true);
- }
+ target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_EVENTMODE,
+ getTextChangeEventMode().toString());
+ target.addAttribute(TextFieldConstants.ATTR_TEXTCHANGE_TIMEOUT,
+ getTextChangeTimeout());
+ if (lastKnownTextContent != null) {
+ /*
+ * The field has be repainted for some reason (e.g. caption, size,
+ * stylename), but the value has not been changed since the last
+ * text change event. Let the client side know about the value the
+ * server side knows. Client side may then ignore the actual value,
+ * depending on its state.
+ */
+ target.addAttribute(
+ TextFieldConstants.ATTR_NO_VALUE_CHANGE_BETWEEN_PAINTS,
+ true);
}
-
}
@Override
diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java
index 4af93113f9..033ec3cd14 100644
--- a/server/src/com/vaadin/ui/ComboBox.java
+++ b/server/src/com/vaadin/ui/ComboBox.java
@@ -288,6 +288,13 @@ public class ComboBox extends AbstractSelect implements
// Paint variables
target.addVariable(this, "selected", selectedKeys);
+ if (getValue() != null && selectedKeys[0] == null) {
+ // not always available, e.g. scrollToSelectedIndex=false
+ // Give the caption for selected item still, not to make it look
+ // like there is no selection at all
+ target.addAttribute("selectedCaption",
+ getItemCaption(getValue()));
+ }
if (isNewItemsAllowed()) {
target.addVariable(this, "newitem", "");
}
diff --git a/server/src/com/vaadin/ui/Grid.java b/server/src/com/vaadin/ui/Grid.java
index 68676e5435..b0542352b9 100644
--- a/server/src/com/vaadin/ui/Grid.java
+++ b/server/src/com/vaadin/ui/Grid.java
@@ -57,7 +57,6 @@ import com.vaadin.data.RpcDataProviderExtension.DetailComponentManager;
import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.fieldgroup.DefaultFieldGroupFieldFactory;
import com.vaadin.data.fieldgroup.FieldGroup;
-import com.vaadin.data.fieldgroup.FieldGroup.BindException;
import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
import com.vaadin.data.fieldgroup.FieldGroupFieldFactory;
import com.vaadin.data.sort.Sort;
@@ -2536,9 +2535,10 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
private Converter<?, Object> converter;
/**
- * A check for allowing the {@link #Column(Grid, GridColumnState, Object)
- * constructor} to call {@link #setConverter(Converter)} with a
- * <code>null</code>, even if model and renderer aren't compatible.
+ * A check for allowing the
+ * {@link #Column(Grid, GridColumnState, Object) constructor} to call
+ * {@link #setConverter(Converter)} with a <code>null</code>, even if
+ * model and renderer aren't compatible.
*/
private boolean isFirstConverterAssignment = true;
@@ -2598,7 +2598,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
}
/**
- * Sets the caption of the header.
+ * Sets the caption of the header. This caption is also used as the
+ * hiding toggle caption, unless it is explicitly set via
+ * {@link #setHidingToggleCaption(String)}.
*
* @param caption
* the text to show in the caption
@@ -2610,6 +2612,9 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
public Column setHeaderCaption(String caption)
throws IllegalStateException {
checkColumnIsAttached();
+
+ state.headerCaption = caption;
+
HeaderRow row = grid.getHeader().getDefaultRow();
if (row != null) {
row.getCell(grid.getPropertyIdByColumnId(state.id)).setText(
@@ -2637,11 +2642,11 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
* toggle for this column in the grid's sidebar when the column is
* {@link #isHidable() hidable}.
* <p>
- * By default, before triggering this setter, a user friendly version of
- * the column's {@link #getPropertyId() property id} is used.
+ * The default value is <code>null</code>, and in that case the column's
+ * {@link #getHeaderCaption() header caption} is used.
* <p>
- * <em>NOTE:</em> setting this to <code>null</code> or empty string
- * might cause the hiding toggle to not render correctly.
+ * <em>NOTE:</em> setting this to empty string might cause the hiding
+ * toggle to not render correctly.
*
* @since 7.5.0
* @param hidingToggleCaption
@@ -3302,9 +3307,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
DesignAttributeHandler.writeAttribute("hidden", attributes,
isHidden(), def.hidden, boolean.class);
DesignAttributeHandler.writeAttribute("hiding-toggle-caption",
- attributes, getHidingToggleCaption(),
- SharedUtil.propertyIdToHumanFriendly(getPropertyId()),
- String.class);
+ attributes, getHidingToggleCaption(), null, String.class);
DesignAttributeHandler.writeAttribute("property-id", attributes,
getPropertyId(), null, Object.class);
}
@@ -3372,7 +3375,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
* currently extends the AbstractExtension superclass, but this fact should
* be regarded as an implementation detail and subject to change in a future
* major or minor Vaadin revision.
- *
+ *
* @param <T>
* the type this renderer knows how to present
*/
@@ -3445,7 +3448,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
* is desired. For instance, a {@code Renderer<Date>} could first turn a
* date value into a formatted string and return
* {@code encode(dateString, String.class)}.
- *
+ *
* @param value
* the value to be encoded
* @param type
@@ -3460,7 +3463,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
/**
* An abstract base class for server-side Grid extensions.
- *
+ *
* @since 7.5
*/
public static abstract class AbstractGridExtension extends
@@ -3475,7 +3478,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
/**
* Constructs a new Grid extension and extends given Grid.
- *
+ *
* @param grid
* a grid instance
*/
@@ -3977,7 +3980,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
@Override
public void bind(int rowIndex) {
- boolean success = false;
+ Exception exception = null;
try {
Object id = getContainerDataSource().getIdByIndex(rowIndex);
if (!isEditorBuffered() || editedItemId == null) {
@@ -3986,12 +3989,19 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
if (editedItemId.equals(id)) {
doEditItem();
- success = true;
}
} catch (Exception e) {
- handleError(e);
+ exception = e;
+ }
+
+ if (exception != null) {
+ handleError(exception);
+ doCancelEditor();
+ getEditorRpc().confirmBind(false);
+ } else {
+ doEditItem();
+ getEditorRpc().confirmBind(true);
}
- getEditorRpc().confirmBind(success);
}
@Override
@@ -4248,8 +4258,18 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
if (datasource.getContainerPropertyIds().contains(propertyId)
&& !columns.containsKey(propertyId)) {
appendColumn(propertyId);
- } else {
+ } else if (defaultContainer) {
addColumnProperty(propertyId, String.class, "");
+ } else {
+ if (columns.containsKey(propertyId)) {
+ throw new IllegalStateException("A column for property id '"
+ + propertyId.toString()
+ + "' already exists in this grid");
+ } else {
+ throw new IllegalStateException("Property id '"
+ + propertyId.toString()
+ + "' does not exist in the container");
+ }
}
// Inform the data provider of this new column.
@@ -4418,7 +4438,6 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
String humanFriendlyPropertyId = SharedUtil
.propertyIdToHumanFriendly(String.valueOf(datasourcePropertyId));
column.setHeaderCaption(humanFriendlyPropertyId);
- column.setHidingToggleCaption(humanFriendlyPropertyId);
if (datasource instanceof Sortable
&& ((Sortable) datasource).getSortableContainerPropertyIds()
@@ -4628,8 +4647,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
* @throws IllegalArgumentException
* if {@code rows} is zero or less
* @throws IllegalArgumentException
- * if {@code rows} is {@link Double#isInfinite(double)
- * infinite}
+ * if {@code rows} is {@link Double#isInfinite(double) infinite}
* @throws IllegalArgumentException
* if {@code rows} is {@link Double#isNaN(double) NaN}
*/
@@ -5803,13 +5821,20 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
}
Field<?> editor = editorFieldGroup.getField(propertyId);
- if (editor == null) {
- editor = editorFieldGroup.buildAndBind(propertyId);
- }
- if (editor.getParent() != Grid.this) {
- assert editor.getParent() == null;
- editor.setParent(this);
+ try {
+ if (editor == null) {
+ editor = editorFieldGroup.buildAndBind(propertyId);
+ }
+ } finally {
+ if (editor == null) {
+ editor = editorFieldGroup.getField(propertyId);
+ }
+
+ if (editor != null && editor.getParent() != Grid.this) {
+ assert editor.getParent() == null;
+ editor.setParent(this);
+ }
}
return editor;
}
@@ -5905,6 +5930,7 @@ public class Grid extends AbstractFocusable implements SelectionNotifier,
protected void doCancelEditor() {
editedItemId = null;
editorFieldGroup.discard();
+ editorFieldGroup.setItemDataSource(null);
}
void resetEditor() {
diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java
index 35110b39ab..6ccb272704 100644
--- a/server/src/com/vaadin/ui/GridLayout.java
+++ b/server/src/com/vaadin/ui/GridLayout.java
@@ -782,7 +782,14 @@ public class GridLayout extends AbstractLayout implements
}
}
}
- // TODO forget expands for removed columns
+
+ // Forget expands for removed columns
+ if (columns < getColumns()) {
+ for (int i = columns - 1; i < getColumns(); i++) {
+ columnExpandRatio.remove(i);
+ getState().explicitColRatios.remove(i);
+ }
+ }
getState().columns = columns;
}
@@ -826,7 +833,13 @@ public class GridLayout extends AbstractLayout implements
}
}
}
- // TODO forget expands for removed rows
+ // Forget expands for removed rows
+ if (rows < getRows()) {
+ for (int i = rows - 1; i < getRows(); i++) {
+ rowExpandRatio.remove(i);
+ getState().explicitRowRatios.remove(i);
+ }
+ }
getState().rows = rows;
}
@@ -1304,6 +1317,8 @@ public class GridLayout extends AbstractLayout implements
public void readDesign(Element design, DesignContext designContext) {
super.readDesign(design, designContext);
+ setMargin(readMargin(design, getMargin(), designContext));
+
// Prepare a 2D map for reading column contents
Elements rowElements = design.getElementsByTag("row");
List<Map<Integer, Component>> rows = new ArrayList<Map<Integer, Component>>();
@@ -1434,6 +1449,9 @@ public class GridLayout extends AbstractLayout implements
super.writeDesign(design, designContext);
GridLayout def = designContext.getDefaultInstance(this);
+
+ writeMargin(design, getMargin(), def.getMargin(), designContext);
+
if (components.isEmpty()
|| !designContext.shouldWriteChildren(this, def)) {
return;
diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java
index cb61fa31ec..42c4beab6c 100644
--- a/server/src/com/vaadin/ui/Table.java
+++ b/server/src/com/vaadin/ui/Table.java
@@ -676,26 +676,6 @@ public class Table extends AbstractSelect implements Action.Container,
}
}
- // Removes alignments, icons and headers from hidden columns
- if (this.visibleColumns != null) {
- boolean disabledHere = disableContentRefreshing();
- try {
- for (final Iterator<Object> i = this.visibleColumns.iterator(); i
- .hasNext();) {
- final Object col = i.next();
- if (!newVC.contains(col)) {
- setColumnHeader(col, null);
- setColumnAlignment(col, (Align) null);
- setColumnIcon(col, null);
- }
- }
- } finally {
- if (disabledHere) {
- enableContentRefreshing(false);
- }
- }
- }
-
this.visibleColumns = newVC;
// Assures visual refresh
diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java
index b16d7e32d3..2129db614b 100644
--- a/server/src/com/vaadin/ui/UI.java
+++ b/server/src/com/vaadin/ui/UI.java
@@ -718,6 +718,9 @@ public abstract class UI extends AbstractSingleComponentContainer implements
page.init(request);
+ // Reset heartbeat timeout to avoid surprise if it's almost expired
+ setLastHeartbeatTimestamp(System.currentTimeMillis());
+
refresh(request);
URI newLocation = page.getLocation();
diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java
index 61664fc95d..61ba5826b8 100644
--- a/server/src/com/vaadin/ui/Window.java
+++ b/server/src/com/vaadin/ui/Window.java
@@ -268,6 +268,21 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier,
}
/**
+ * Sets the position of the window on the screen using
+ * {@link #setPositionX(int)} and {@link #setPositionY(int)}
+ *
+ * @since 7.5
+ * @param x
+ * The new x coordinate for the window
+ * @param y
+ * The new y coordinate for the window
+ */
+ public void setPosition(int x, int y) {
+ setPositionX(x);
+ setPositionY(y);
+ }
+
+ /**
* Sets the distance of Window left border in pixels from left border of the
* containing (main window). Has effect only if in {@link WindowMode#NORMAL}
* mode.
diff --git a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java
index e193b79df3..bbf083c158 100644
--- a/server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java
+++ b/server/tests/src/com/vaadin/data/util/sqlcontainer/query/FreeformQueryTest.java
@@ -23,6 +23,7 @@ import com.vaadin.data.util.sqlcontainer.SQLContainer;
import com.vaadin.data.util.sqlcontainer.SQLTestsConstants;
import com.vaadin.data.util.sqlcontainer.SQLTestsConstants.DB;
import com.vaadin.data.util.sqlcontainer.connection.JDBCConnectionPool;
+import com.vaadin.data.util.sqlcontainer.query.generator.StatementHelper;
public class FreeformQueryTest {
@@ -892,6 +893,83 @@ public class FreeformQueryTest {
EasyMock.verify(delegate);
}
+ public static class NonMatchingDelegateWithGroupBy implements
+ FreeformQueryDelegate {
+
+ private String fromWhere = "FROM people p1 LEFT JOIN people p2 ON p2.id = p1.id WHERE p1.\"NAME\" LIKE 'notfound' GROUP BY p1.ID";
+
+ @Override
+ public int storeRow(Connection conn, RowItem row)
+ throws UnsupportedOperationException, SQLException {
+ // Not used in this test
+ return 0;
+ }
+
+ @Override
+ public void setOrderBy(List<OrderBy> orderBys)
+ throws UnsupportedOperationException {
+ // Not used in this test
+ }
+
+ @Override
+ public void setFilters(List<Filter> filters)
+ throws UnsupportedOperationException {
+ // Not used in this test
+ }
+
+ @Override
+ public boolean removeRow(Connection conn, RowItem row)
+ throws UnsupportedOperationException, SQLException {
+ // Not used in this test
+ return false;
+ }
+
+ @Override
+ public String getQueryString(int offset, int limit)
+ throws UnsupportedOperationException {
+ return "SELECT * " + fromWhere;
+ }
+
+ @Override
+ public String getCountQuery() throws UnsupportedOperationException {
+ return "SELECT COUNT(*) " + fromWhere;
+ }
+
+ @Override
+ public String getContainsRowQueryString(Object... keys)
+ throws UnsupportedOperationException {
+ // Not used in this test
+ return null;
+ }
+ }
+
+ public static class NonMatchingStatementDelegateWithGroupBy extends
+ NonMatchingDelegateWithGroupBy implements FreeformStatementDelegate {
+
+ @Override
+ public StatementHelper getQueryStatement(int offset, int limit)
+ throws UnsupportedOperationException {
+ StatementHelper sh = new StatementHelper();
+ sh.setQueryString(getQueryString(offset, limit));
+ return sh;
+ }
+
+ @Override
+ public StatementHelper getCountStatement()
+ throws UnsupportedOperationException {
+ StatementHelper sh = new StatementHelper();
+ sh.setQueryString(getCountQuery());
+ return sh;
+ }
+
+ @Override
+ public StatementHelper getContainsRowQueryStatement(Object... keys)
+ throws UnsupportedOperationException {
+ // Not used in this test
+ return null;
+ }
+ }
+
@Test
public void containsRowWithKeys_delegateRegisteredGetContainsRowQueryStringNotImplemented_shouldBuildQueryString()
throws SQLException {
@@ -909,4 +987,24 @@ public class FreeformQueryTest {
EasyMock.verify(delegate);
}
+
+ @Test
+ public void delegateStatementCountWithGroupBy() throws SQLException {
+ String dummyNotUsed = "foo";
+ FreeformQuery query = new FreeformQuery(dummyNotUsed, connectionPool,
+ "p1.ID");
+ query.setDelegate(new NonMatchingStatementDelegateWithGroupBy());
+
+ Assert.assertEquals(0, query.getCount());
+ }
+
+ @Test
+ public void delegateCountWithGroupBy() throws SQLException {
+ String dummyNotUsed = "foo";
+ FreeformQuery query = new FreeformQuery(dummyNotUsed, connectionPool,
+ "p1.ID");
+ query.setDelegate(new NonMatchingDelegateWithGroupBy());
+
+ Assert.assertEquals(0, query.getCount());
+ }
}
diff --git a/server/tests/src/com/vaadin/server/DownloadStreamTest.java b/server/tests/src/com/vaadin/server/DownloadStreamTest.java
new file mode 100644
index 0000000000..180b2e348b
--- /dev/null
+++ b/server/tests/src/com/vaadin/server/DownloadStreamTest.java
@@ -0,0 +1,39 @@
+package com.vaadin.server;
+
+import static org.mockito.Matchers.contains;
+import static org.mockito.Matchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URLEncoder;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class DownloadStreamTest {
+ private String filename = "日本語.png";
+ private DownloadStream stream;
+
+ @Before
+ public void setup() {
+ stream = new DownloadStream(mock(InputStream.class), "", filename);
+ }
+
+ @Test
+ public void contentDispositionFilenameIsUtf8Encoded() throws IOException {
+ VaadinResponse response = mock(VaadinResponse.class);
+
+ stream.writeResponse(mock(VaadinRequest.class), response);
+
+ String encodedFileName = URLEncoder.encode(filename, "utf-8");
+ verify(response).setHeader(eq(DownloadStream.CONTENT_DISPOSITION),
+ contains(String.format("filename=\"%s\";", encodedFileName)));
+ verify(response)
+ .setHeader(
+ eq(DownloadStream.CONTENT_DISPOSITION),
+ contains(String.format("filename*=utf-8''%s",
+ encodedFileName)));
+ }
+}
diff --git a/server/tests/src/com/vaadin/tests/server/component/AbstractLayoutDeclarativeMarginTest.java b/server/tests/src/com/vaadin/tests/server/component/AbstractLayoutDeclarativeMarginTest.java
deleted file mode 100644
index 70855f67dc..0000000000
--- a/server/tests/src/com/vaadin/tests/server/component/AbstractLayoutDeclarativeMarginTest.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Copyright 2000-2014 Vaadin Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package com.vaadin.tests.server.component;
-
-import org.junit.Test;
-
-import com.vaadin.shared.ui.MarginInfo;
-import com.vaadin.tests.design.DeclarativeTestBase;
-import com.vaadin.ui.AbstractLayout;
-import com.vaadin.ui.VerticalLayout;
-
-public class AbstractLayoutDeclarativeMarginTest extends
- DeclarativeTestBase<AbstractLayout> {
-
- @Test
- public void testMarginInfo() {
- VerticalLayout vl = new VerticalLayout();
-
- String left = getMarginTag(true, false, false, false);
- MarginInfo leftInfo = getMarginInfo(true, false, false, false);
-
- String right = getMarginTag(false, true, false, false);
- MarginInfo rightInfo = getMarginInfo(false, true, false, false);
-
- String top = getMarginTag(false, false, true, false);
- MarginInfo topInfo = getMarginInfo(false, false, true, false);
-
- String bottom = getMarginTag(false, false, false, true);
- MarginInfo bottomInfo = getMarginInfo(false, false, false, true);
-
- String topLeft = getMarginTag(true, false, true, false);
- MarginInfo topLeftInfo = getMarginInfo(true, false, true, false);
-
- String topRight = getMarginTag(false, true, true, false);
- MarginInfo topRightInfo = getMarginInfo(false, true, true, false);
-
- String bottomLeft = getMarginTag(true, false, false, true);
- MarginInfo bottomLeftInfo = getMarginInfo(true, false, false, true);
-
- String bottomRight = getMarginTag(false, true, false, true);
- MarginInfo bottomRightInfo = getMarginInfo(false, true, false, true);
-
- testRW(vl, left, leftInfo);
- testRW(vl, right, rightInfo);
- testRW(vl, top, topInfo);
- testRW(vl, bottom, bottomInfo);
-
- testRW(vl, topLeft, topLeftInfo);
- testRW(vl, topRight, topRightInfo);
- testRW(vl, bottomLeft, bottomLeftInfo);
- testRW(vl, bottomRight, bottomRightInfo);
-
- // Test special case of all edges margin'ed
- testRW(vl, getMarginTag(true, true, true, true), new MarginInfo(true));
- }
-
- private void testRW(VerticalLayout vl, String design, MarginInfo margin) {
- vl.setMargin(margin);
- testWrite(design, vl);
- testRead(design, vl);
- }
-
- private String getMarginTag(boolean left, boolean right, boolean top,
- boolean bottom) {
- String s = "<v-vertical-layout ";
-
- if (left && right && top && bottom) {
- s += "margin='true'";
- } else {
- if (left) {
- s += "margin-left='true' ";
- }
- if (right) {
- s += "margin-right='true' ";
- }
- if (top) {
- s += "margin-top='true' ";
- }
- if (bottom) {
- s += "margin-bottom='true' ";
- }
- }
- return s + " />";
- }
-
- private MarginInfo getMarginInfo(boolean left, boolean right, boolean top,
- boolean bottom) {
- return new MarginInfo(top, right, bottom, left);
- }
-
-}
diff --git a/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.java
new file mode 100644
index 0000000000..9fcb64acca
--- /dev/null
+++ b/server/tests/src/com/vaadin/tests/server/component/DeclarativeMarginTestBase.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.server.component;
+
+import org.junit.Assert;
+
+import com.vaadin.shared.ui.MarginInfo;
+import com.vaadin.tests.design.DeclarativeTestBase;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.Layout.MarginHandler;
+
+public abstract class DeclarativeMarginTestBase<L extends Layout & MarginHandler>
+ extends DeclarativeTestBase<L> {
+
+ protected void testMargins(String componentTag) {
+
+ for (int i = 0; i < 16; ++i) {
+ boolean top = (i & 1) == 1;
+ boolean right = (i & 2) == 2;
+ boolean bottom = (i & 4) == 4;
+ boolean left = (i & 8) == 8;
+
+ MarginInfo m = new MarginInfo(top, right, bottom, left);
+
+ String design = getMarginTag(componentTag, top, right, bottom, left);
+
+ // The assertEquals machinery in DeclarativeTestBase uses bean
+ // introspection and MarginInfo is not a proper bean. It ends up
+ // considering *all* MarginInfo objects equal... (#18229)
+ L layout = read(design);
+ Assert.assertEquals(m, layout.getMargin());
+
+ testWrite(design, layout);
+ }
+ }
+
+ private String getMarginTag(String componentTag, boolean top,
+ boolean right, boolean bottom, boolean left) {
+ String s = "<" + componentTag + " ";
+
+ if (left && right && top && bottom) {
+ s += "margin='true'";
+ } else {
+ if (left) {
+ s += "margin-left='true' ";
+ }
+ if (right) {
+ s += "margin-right='true' ";
+ }
+ if (top) {
+ s += "margin-top='true' ";
+ }
+ if (bottom) {
+ s += "margin-bottom='true' ";
+ }
+ }
+ return s + " />";
+ }
+}
diff --git a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
index 8ccd41f797..28ccfa407c 100644
--- a/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/abstractorderedlayout/AbstractOrderedLayoutDeclarativeTest.java
@@ -21,7 +21,7 @@ import java.util.List;
import org.junit.Test;
import com.vaadin.shared.ui.label.ContentMode;
-import com.vaadin.tests.design.DeclarativeTestBase;
+import com.vaadin.tests.server.component.DeclarativeMarginTestBase;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
@@ -35,58 +35,47 @@ import com.vaadin.ui.VerticalLayout;
* @author Vaadin Ltd
*/
public class AbstractOrderedLayoutDeclarativeTest extends
- DeclarativeTestBase<AbstractOrderedLayout> {
+ DeclarativeMarginTestBase<AbstractOrderedLayout> {
private List<String> defaultAlignments = Arrays.asList(new String[] {
":top", ":left" });
@Test
- public void testMargin() {
- String design = getDesign(0, true);
- AbstractOrderedLayout layout = getLayout(0, true, null);
- testRead(design, layout);
- testWrite(design, layout);
- design = getDesign(0, false);
- layout = getLayout(0, false, null);
- testRead(design, layout);
- testWrite(design, layout);
+ public void testMargins() {
+ testMargins("v-vertical-layout");
}
@Test
public void testExpandRatio() {
- String design = getDesign(1, false);
- AbstractOrderedLayout layout = getLayout(1, false, null);
+ String design = getDesign(1);
+ AbstractOrderedLayout layout = getLayout(1, null);
testRead(design, layout);
testWrite(design, layout);
- design = getDesign(0.25f, false);
- layout = getLayout(0.25f, false, null);
+ design = getDesign(0.25f);
+ layout = getLayout(0.25f, null);
testRead(design, layout);
testWrite(design, layout);
}
@Test
public void testAlignment() {
- String design = getDesign(0, false, ":top", ":left");
- AbstractOrderedLayout layout = getLayout(0, false, Alignment.TOP_LEFT);
+ String design = getDesign(0, ":top", ":left");
+ AbstractOrderedLayout layout = getLayout(0, Alignment.TOP_LEFT);
testRead(design, layout);
testWrite(design, layout);
- design = getDesign(0, false, ":middle", ":center");
- layout = getLayout(0, false, Alignment.MIDDLE_CENTER);
+ design = getDesign(0, ":middle", ":center");
+ layout = getLayout(0, Alignment.MIDDLE_CENTER);
testRead(design, layout);
testWrite(design, layout);
- design = getDesign(0, false, ":bottom", ":right");
- layout = getLayout(0, false, Alignment.BOTTOM_RIGHT);
+ design = getDesign(0, ":bottom", ":right");
+ layout = getLayout(0, Alignment.BOTTOM_RIGHT);
testRead(design, layout);
testWrite(design, layout);
}
- private String getDesign(float expandRatio, boolean margin,
- String... alignments) {
- String result = "<v-vertical-layout caption=test-layout";
- if (margin) {
- result += " margin=true";
- }
- result += "><v-label caption=test-label ";
+ private String getDesign(float expandRatio, String... alignments) {
+ String result = "<v-vertical-layout caption=test-layout>";
+ result += "<v-label caption=test-label ";
String ratioString = expandRatio == 1.0f ? "\"\"" : String
.valueOf(expandRatio);
if (expandRatio != 0) {
@@ -110,10 +99,9 @@ public class AbstractOrderedLayoutDeclarativeTest extends
return result;
}
- private AbstractOrderedLayout getLayout(float expandRatio, boolean margin,
+ private AbstractOrderedLayout getLayout(float expandRatio,
Alignment alignment) {
VerticalLayout layout = new VerticalLayout();
- layout.setMargin(margin);
layout.setCaption("test-layout");
Label l = new Label();
l.setCaption("test-label");
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
index 35553bb406..2b960d26a0 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridColumns.java
@@ -338,4 +338,20 @@ public class GridColumns {
public void testAddingColumnsWithSetColumnsNonDefaultContainer() {
grid.setColumns("column1", "column2", "column50");
}
+
+ @Test
+ public void testDefaultColumnHidingToggleCaption() {
+ Column firstColumn = grid.getColumns().get(0);
+ firstColumn.setHeaderCaption("headerCaption");
+ assertEquals(null, firstColumn.getHidingToggleCaption());
+ }
+
+ @Test
+ public void testOverriddenColumnHidingToggleCaption() {
+ Column firstColumn = grid.getColumns().get(0);
+ firstColumn.setHidingToggleCaption("hidingToggleCaption");
+ firstColumn.setHeaderCaption("headerCaption");
+ assertEquals("hidingToggleCaption",
+ firstColumn.getHidingToggleCaption());
+ }
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
index cbd448618b..527568eac8 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridContainerTest.java
@@ -15,9 +15,11 @@
*/
package com.vaadin.tests.server.component.grid;
+import org.junit.Assert;
import org.junit.Test;
import com.vaadin.data.util.IndexedContainer;
+import com.vaadin.ui.Grid;
public class GridContainerTest {
@@ -43,4 +45,56 @@ public class GridContainerTest {
container.addItem(0).getItemProperty("x").setValue("y");
return container;
}
+
+ @Test
+ public void setColumnsOrder() {
+ Grid grid = new Grid();
+ IndexedContainer ic = new IndexedContainer();
+ ic.addContainerProperty("foo", String.class, "");
+ ic.addContainerProperty("baz", String.class, "");
+ ic.addContainerProperty("bar", String.class, "");
+ grid.setContainerDataSource(ic);
+ grid.setColumns("foo", "baz", "bar");
+
+ Assert.assertEquals("foo", grid.getColumns().get(0).getPropertyId());
+ Assert.assertEquals("baz", grid.getColumns().get(1).getPropertyId());
+ Assert.assertEquals("bar", grid.getColumns().get(2).getPropertyId());
+ }
+
+ @Test
+ public void addColumnNotInContainer() {
+ Grid grid = new Grid();
+ grid.setContainerDataSource(new IndexedContainer());
+ try {
+ grid.addColumn("notInContainer");
+ Assert.fail("Adding a property id not in the container should throw an exception");
+ } catch (IllegalStateException e) {
+ Assert.assertTrue(e.getMessage().contains("notInContainer"));
+ Assert.assertTrue(e.getMessage().contains(
+ "does not exist in the container"));
+ }
+ }
+
+ @Test
+ public void setColumnsForPropertyIdNotInContainer() {
+ Grid grid = new Grid();
+ grid.setContainerDataSource(new IndexedContainer());
+ try {
+ grid.setColumns("notInContainer", "notThereEither");
+ Assert.fail("Setting columns for property ids not in the container should throw an exception");
+ } catch (IllegalStateException e) {
+ // addColumn is run in random order..
+ Assert.assertTrue(e.getMessage().contains("notInContainer")
+ || e.getMessage().contains("notThereEither"));
+ Assert.assertTrue(e.getMessage().contains(
+ "does not exist in the container"));
+ }
+ }
+
+ @Test(expected = IllegalStateException.class)
+ public void multipleAddColumnsForDefaultContainer() {
+ Grid grid = new Grid();
+ grid.addColumn("foo");
+ grid.addColumn("foo");
+ }
}
diff --git a/server/tests/src/com/vaadin/tests/server/component/grid/GridEditorTest.java b/server/tests/src/com/vaadin/tests/server/component/grid/GridEditorTest.java
index 135d7d398c..b70f17779a 100644
--- a/server/tests/src/com/vaadin/tests/server/component/grid/GridEditorTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/grid/GridEditorTest.java
@@ -184,12 +184,16 @@ public class GridEditorTest {
.getEditorField();
field.setValue("New Name");
+ Property<?> datasource = field.getPropertyDataSource();
+
grid.cancelEditor();
assertFalse(grid.isEditorActive());
assertNull(grid.getEditedItemId());
assertFalse(field.isModified());
- assertEquals(DEFAULT_NAME, field.getValue());
- assertEquals(DEFAULT_NAME, field.getPropertyDataSource().getValue());
+ assertEquals("", field.getValue());
+ assertEquals(DEFAULT_NAME, datasource.getValue());
+ assertNull(field.getPropertyDataSource());
+ assertNull(grid.getEditorFieldGroup().getItemDataSource());
}
@Test(expected = IllegalArgumentException.class)
diff --git a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
index 7c9c126707..9d3b5001da 100644
--- a/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/gridlayout/GridLayoutDeclarativeTest.java
@@ -18,13 +18,19 @@ package com.vaadin.tests.server.component.gridlayout;
import org.junit.Assert;
import org.junit.Test;
-import com.vaadin.tests.design.DeclarativeTestBase;
+import com.vaadin.tests.server.component.DeclarativeMarginTestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.declarative.DesignContext;
-public class GridLayoutDeclarativeTest extends DeclarativeTestBase<GridLayout> {
+public class GridLayoutDeclarativeTest extends
+ DeclarativeMarginTestBase<GridLayout> {
+
+ @Test
+ public void testMargins() {
+ testMargins("v-grid-layout");
+ }
@Test
public void testSimpleGridLayout() {
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
index b74896b7a1..e9e73c1e0f 100644
--- a/server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java
+++ b/server/tests/src/com/vaadin/tests/server/component/window/WindowTest.java
@@ -50,4 +50,11 @@ public class WindowTest {
Assert.assertEquals(b2, window.getAssistiveDescription()[1]);
}
+
+ @Test
+ public void testSetPosition() {
+ window.setPosition(100, 200);
+ Assert.assertEquals(100, window.getPositionX());
+ Assert.assertEquals(200, window.getPositionY());
+ }
}
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 ff6028648e..2c045d53fa 100644
--- a/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java
+++ b/server/tests/src/com/vaadin/tests/server/navigator/NavigatorTest.java
@@ -712,4 +712,21 @@ public class NavigatorTest extends TestCase {
navigator.addView("view", view);
navigator.navigateTo("view");
}
+
+ public void testNullViewProvider() {
+ IMocksControl control = EasyMock.createControl();
+ NavigationStateManager manager = control
+ .createMock(NavigationStateManager.class);
+ ViewDisplay display = control.createMock(ViewDisplay.class);
+
+ // create navigator to test
+ Navigator navigator = createNavigator(manager, display);
+
+ try {
+ navigator.addProvider(null);
+ fail("Should not be allowed to add a null view provider");
+ } catch (IllegalArgumentException e) {
+ // Expected
+ }
+ }
}
diff --git a/server/tests/src/com/vaadin/tests/util/MockUI.java b/server/tests/src/com/vaadin/tests/util/MockUI.java
new file mode 100644
index 0000000000..17dc24e9e8
--- /dev/null
+++ b/server/tests/src/com/vaadin/tests/util/MockUI.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.util;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.server.VaadinSession;
+import com.vaadin.ui.UI;
+
+public class MockUI extends UI {
+
+ public MockUI() {
+ this(findOrcreateSession());
+ }
+
+ public MockUI(VaadinSession session) {
+ setSession(session);
+ setCurrent(this);
+ }
+
+ @Override
+ protected void init(VaadinRequest request) {
+ // Do nothing
+ }
+
+ private static VaadinSession findOrcreateSession() {
+ VaadinSession session = VaadinSession.getCurrent();
+ if (session == null) {
+ session = new AlwaysLockedVaadinSession(null);
+ VaadinSession.setCurrent(session);
+ }
+ return session;
+ }
+}
diff --git a/server/tests/src/com/vaadin/ui/GridLayoutExpandRatioTest.java b/server/tests/src/com/vaadin/ui/GridLayoutExpandRatioTest.java
new file mode 100644
index 0000000000..617c7f54ed
--- /dev/null
+++ b/server/tests/src/com/vaadin/ui/GridLayoutExpandRatioTest.java
@@ -0,0 +1,113 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Test;
+
+import com.vaadin.server.Sizeable.Unit;
+
+public class GridLayoutExpandRatioTest {
+
+ private GridLayout gridLayout;
+
+ @Test
+ public void testColExpandRatioIsForgotten() {
+ gridLayout = new GridLayout(4, 1);
+ gridLayout.setWidth(100, Unit.PERCENTAGE);
+ gridLayout.setSizeFull();
+ gridLayout.setSpacing(true);
+
+ addComponents(true);
+
+ gridLayout.setColumnExpandRatio(1, 1);
+ gridLayout.setColumnExpandRatio(3, 1);
+
+ assertTrue(gridLayout.getColumnExpandRatio(0) == 0);
+ assertTrue(gridLayout.getColumnExpandRatio(1) == 1);
+ assertTrue(gridLayout.getColumnExpandRatio(2) == 0);
+ assertTrue(gridLayout.getColumnExpandRatio(3) == 1);
+ assertFalse(gridLayout.getState().explicitColRatios.contains(0));
+ assertTrue(gridLayout.getState().explicitColRatios.contains(1));
+ assertFalse(gridLayout.getState().explicitColRatios.contains(2));
+ assertTrue(gridLayout.getState().explicitColRatios.contains(3));
+
+ gridLayout.removeAllComponents();
+ gridLayout.setColumns(3);
+ addComponents(false);
+
+ assertTrue(gridLayout.getColumnExpandRatio(0) == 0);
+ assertTrue(gridLayout.getColumnExpandRatio(1) == 1);
+ assertTrue(gridLayout.getColumnExpandRatio(2) == 0);
+ assertTrue(gridLayout.getColumnExpandRatio(3) == 0);
+ assertFalse(gridLayout.getState().explicitColRatios.contains(0));
+ assertTrue(gridLayout.getState().explicitColRatios.contains(1));
+ assertFalse(gridLayout.getState().explicitColRatios.contains(2));
+ assertFalse(gridLayout.getState().explicitColRatios.contains(3));
+ }
+
+ @Test
+ public void testRowExpandRatioIsForgotten() {
+ gridLayout = new GridLayout(1, 4);
+ gridLayout.setWidth(100, Unit.PERCENTAGE);
+ gridLayout.setSizeFull();
+ gridLayout.setSpacing(true);
+
+ addComponents(true);
+
+ gridLayout.setRowExpandRatio(1, 1);
+ gridLayout.setRowExpandRatio(3, 1);
+
+ assertTrue(gridLayout.getRowExpandRatio(0) == 0);
+ assertTrue(gridLayout.getRowExpandRatio(1) == 1);
+ assertTrue(gridLayout.getRowExpandRatio(2) == 0);
+ assertTrue(gridLayout.getRowExpandRatio(3) == 1);
+ assertFalse(gridLayout.getState().explicitRowRatios.contains(0));
+ assertTrue(gridLayout.getState().explicitRowRatios.contains(1));
+ assertFalse(gridLayout.getState().explicitRowRatios.contains(2));
+ assertTrue(gridLayout.getState().explicitRowRatios.contains(3));
+
+ gridLayout.removeAllComponents();
+ gridLayout.setRows(3);
+ addComponents(false);
+
+ assertTrue(gridLayout.getRowExpandRatio(0) == 0);
+ assertTrue(gridLayout.getRowExpandRatio(1) == 1);
+ assertTrue(gridLayout.getRowExpandRatio(2) == 0);
+ assertTrue(gridLayout.getRowExpandRatio(3) == 0);
+ assertFalse(gridLayout.getState().explicitRowRatios.contains(0));
+ assertTrue(gridLayout.getState().explicitRowRatios.contains(1));
+ assertFalse(gridLayout.getState().explicitRowRatios.contains(2));
+ assertFalse(gridLayout.getState().explicitRowRatios.contains(3));
+ }
+
+ private void addComponents(boolean includeLastOne) {
+ gridLayout.addComponent(label("{1}"));
+ gridLayout.addComponent(label("{2}"));
+ gridLayout.addComponent(label("{3}"));
+ if (includeLastOne) {
+ gridLayout.addComponent(label("{4}"));
+ }
+ }
+
+ private Label label(String content) {
+ Label label = new Label(content);
+ label.setSizeUndefined();
+ return label;
+ }
+}
diff --git a/server/tests/src/com/vaadin/ui/LabelDataSourceTest.java b/server/tests/src/com/vaadin/ui/LabelDataSourceTest.java
index 8ec3ca1245..030504cf2b 100644
--- a/server/tests/src/com/vaadin/ui/LabelDataSourceTest.java
+++ b/server/tests/src/com/vaadin/ui/LabelDataSourceTest.java
@@ -22,9 +22,9 @@ import org.junit.Before;
import org.junit.Test;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinSession;
import com.vaadin.tests.util.AlwaysLockedVaadinSession;
+import com.vaadin.tests.util.MockUI;
public class LabelDataSourceTest {
@@ -104,18 +104,6 @@ public class LabelDataSourceTest {
Assert.assertEquals("after", label.getValue());
}
- public class MockUI extends UI {
-
- public MockUI() {
- setSession(vaadinSession);
- }
-
- @Override
- protected void init(VaadinRequest request) {
- }
-
- }
-
@Test
public void attachToSessionWithDifferentLocale() {
label.setValue("before");
diff --git a/shared/src/com/vaadin/shared/ui/MarginInfo.java b/shared/src/com/vaadin/shared/ui/MarginInfo.java
index 7119ce2f90..a8979b36cf 100644
--- a/shared/src/com/vaadin/shared/ui/MarginInfo.java
+++ b/shared/src/com/vaadin/shared/ui/MarginInfo.java
@@ -182,4 +182,10 @@ public class MarginInfo implements Serializable {
return bitMask;
}
+ @Override
+ public String toString() {
+ return "MarginInfo(" + hasTop() + ", " + hasRight() + ", "
+ + hasBottom() + ", " + hasLeft() + ")";
+
+ }
}
diff --git a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java
index 0041da4dfa..f4124100e0 100644
--- a/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java
+++ b/shared/src/com/vaadin/shared/ui/checkbox/CheckBoxServerRpc.java
@@ -16,8 +16,10 @@
package com.vaadin.shared.ui.checkbox;
import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.shared.annotations.Delayed;
import com.vaadin.shared.communication.ServerRpc;
public interface CheckBoxServerRpc extends ServerRpc {
+ @Delayed
public void setChecked(boolean checked, MouseEventDetails mouseEventDetails);
}
diff --git a/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
index 5aa9ea9b65..547a4a84ca 100644
--- a/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
+++ b/shared/src/com/vaadin/shared/ui/grid/GridColumnState.java
@@ -85,4 +85,7 @@ public class GridColumnState implements Serializable {
/** The caption for the column hiding toggle. */
public String hidingToggleCaption;
+
+ /** Column header caption */
+ public String headerCaption;
}
diff --git a/shared/src/com/vaadin/shared/ui/ui/Transport.java b/shared/src/com/vaadin/shared/ui/ui/Transport.java
index 1aae57e266..54d0f08434 100644
--- a/shared/src/com/vaadin/shared/ui/ui/Transport.java
+++ b/shared/src/com/vaadin/shared/ui/ui/Transport.java
@@ -29,7 +29,10 @@ public enum Transport {
WEBSOCKET("websocket"),
/**
* HTTP streaming
+ *
+ * @deprecated Use the more reliable {@link Transport#LONG_POLLING} instead.
*/
+ @Deprecated
STREAMING("streaming"),
/**
* HTTP long polling
@@ -47,11 +50,11 @@ public enum Transport {
}
/**
- * Returns a Transport by its identifier. Returns null if no value is found
- * for the given identifier.
- *
- * @since 7.3.10
- */
+ * Returns a Transport by its identifier. Returns null if no value is found
+ * for the given identifier.
+ *
+ * @since 7.3.10
+ */
public static Transport getByIdentifier(String identifier) {
for (Transport t : values()) {
if (t.getIdentifier().equals(identifier)) {
diff --git a/uitest/eclipse-run-selected-test.properties b/uitest/eclipse-run-selected-test.properties
index 535885f877..e0f93bfc7c 100644
--- a/uitest/eclipse-run-selected-test.properties
+++ b/uitest/eclipse-run-selected-test.properties
@@ -6,7 +6,7 @@
;
;
-; For both TestBench 2 and 3
+; For both TestBench 2 and 4
;
; Location of the screenshot directory.
@@ -18,13 +18,17 @@ com.vaadin.testbench.screenshot.directory=<enter the full path to the screenshot
; com.vaadin.testbench.deployment.url=http://<enter your ip here>:8888/
;
-; For only TestBench 3
+; For only TestBench 4
;
; Simulates @RunLocally with the given value on all test classes without a @RunLocally annotation.
; Use simple browser name (phantomjs, chrome, firefox, ie8, ie9, ie10, ie11)
; com.vaadin.testbench.runLocally=firefox
+; Optional override to specify the location of the Firefox/PhantomJS binary
+; firefox.path=/usr/bin/firefox
+; phantomjs.binary.path=/usr/bin/phantomjs
+
; By default using @RunLocally annotation in Framework tests is not allowed.
; Running tests locally can be done with com.vaadin.testbench.runLocally parameter above.
; Uncomment the following line if you want to be able to use @RunLocally annotation
diff --git a/uitest/integration_tests.xml b/uitest/integration_tests.xml
index d9945a9a45..d28ba47320 100644
--- a/uitest/integration_tests.xml
+++ b/uitest/integration_tests.xml
@@ -89,7 +89,7 @@
<subant target="run-tb2-tests" failonerror="false" antfile="test.xml">
<property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}" />
<property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}" />
- <property name="com.vaadin.testbench.deployment.url" value="http://vaadin-integration-test.appspot.com/" />
+ <property name="com.vaadin.testbench.deployment.url" value="http://vaadin-integration-test-hrd.appspot.com/" />
<property name="server.start.succeeded" value="1" />
<property name="browsers" value="${test_browsers}" />
<property name="testfiles" value="${test-GAE}" />
diff --git a/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeat.java b/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeat.java
new file mode 100644
index 0000000000..de45d2bccb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeat.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.application;
+
+import com.vaadin.annotations.PreserveOnRefresh;
+import com.vaadin.launcher.CustomDeploymentConfiguration;
+import com.vaadin.launcher.CustomDeploymentConfiguration.Conf;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Label;
+
+@PreserveOnRefresh
+@CustomDeploymentConfiguration({ @Conf(name = "heartbeatInterval", value = "5") })
+public class PreserveWithExpiredHeartbeat extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Label label = new Label("UI with id " + getUIId() + " in session "
+ + getSession().getSession().getId());
+ label.setId("idLabel");
+ addComponent(label);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeatTest.java b/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeatTest.java
new file mode 100644
index 0000000000..04dbdca31e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/application/PreserveWithExpiredHeartbeatTest.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.application;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class PreserveWithExpiredHeartbeatTest extends SingleBrowserTest {
+ @Test
+ public void testNavigateBackAfterMissingHeartbeats()
+ throws InterruptedException {
+ final int heartbeatInterval = 5000;
+
+ openTestURL();
+ String originalId = getUiIdentification();
+
+ long startTime = System.currentTimeMillis();
+
+ while (System.currentTimeMillis() - startTime < heartbeatInterval * 3.1) {
+ // "Close" the tab
+ driver.get("about:blank");
+
+ sleep(heartbeatInterval / 2);
+
+ // "Reopen" tab
+ openTestURL();
+
+ // Verify that that we still get the same UI
+ Assert.assertEquals("Original UI has been closed", originalId,
+ getUiIdentification());
+ }
+ }
+
+ private String getUiIdentification() {
+ return $(LabelElement.class).id("idLabel").getText();
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java
index a74692b169..6f97cbba05 100644
--- a/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java
+++ b/uitest/src/com/vaadin/tests/components/AbstractTestUIWithLog.java
@@ -21,7 +21,7 @@ import com.vaadin.ui.VerticalLayout;
public abstract class AbstractTestUIWithLog extends AbstractTestUI {
- protected Log log = new Log(5);
+ protected Log log = new Log(getLogSize());
@Override
public void init(VaadinRequest request) {
@@ -33,4 +33,8 @@ public abstract class AbstractTestUIWithLog extends AbstractTestUI {
log.log(message);
}
+ protected int getLogSize() {
+ return 5;
+ }
+
}
diff --git a/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java b/uitest/src/com/vaadin/tests/components/FileDownloaderUI.java
index 6e0616b115..b1379080e9 100644
--- a/uitest/src/com/vaadin/tests/components/FileDownloaderTest.java
+++ b/uitest/src/com/vaadin/tests/components/FileDownloaderUI.java
@@ -37,7 +37,6 @@ import com.vaadin.server.StreamResource;
import com.vaadin.server.VaadinRequest;
import com.vaadin.server.VaadinResponse;
import com.vaadin.tests.components.embedded.EmbeddedPdf;
-import com.vaadin.tests.util.Log;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -49,27 +48,18 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeButton;
-public class FileDownloaderTest extends AbstractTestUI {
+public class FileDownloaderUI extends AbstractTestUIWithLog {
private AbstractComponent firstDownloadComponent;
- private Log log = new Log(5);
@Override
protected void setup(VaadinRequest request) {
- addComponent(log);
-
List<Class<? extends Component>> components = new ArrayList<Class<? extends Component>>();
components.add(Button.class);
components.add(NativeButton.class);
components.add(CssLayout.class);
components.add(Label.class);
- // Resource resource = new ExternalResource(
- // "https://vaadin.com/download/prerelease/7.0/7.0.0/7.0.0.beta1/vaadin-all-7.0.0.beta1.zip");
- // addComponents(resource, components);
- // resource = new ExternalResource(
- // "https://vaadin.com/download/book-of-vaadin/current/pdf/book-of-vaadin.pdf");
- // addComponents(resource, components);
ConnectorResource resource;
resource = new StreamResource(new StreamResource.StreamSource() {
@@ -105,13 +95,16 @@ public class FileDownloaderTest extends AbstractTestUI {
} catch (IOException e) {
e.printStackTrace();
}
- // resource = new DynamicConnectorResource(this, "requestImage.png");
- // addComponents(resource, components);
- // resource = new ThemeResource("favicon.ico");
- // addComponents(resource, components);
resource = new ClassResource(new EmbeddedPdf().getClass(), "test.pdf");
addComponents("Class resource pdf", resource, components);
+ Button downloadUtf8File = new Button("Download UTF-8 named file");
+ FileDownloader fd = new FileDownloader(new ClassResource(
+ new EmbeddedPdf().getClass(), "åäö-日本語.pdf"));
+ fd.setOverrideContentType(false);
+ fd.extend(downloadUtf8File);
+ addComponent(downloadUtf8File);
+
addComponent(new Button("Remove first download button",
new ClickListener() {
@@ -131,7 +124,7 @@ public class FileDownloaderTest extends AbstractTestUI {
FileDownloader e = (FileDownloader) firstDownloadComponent
.getExtensions().iterator().next();
e.remove();
- log.log("FileDownload detached");
+ log("FileDownload detached");
}
}));
}
@@ -213,16 +206,4 @@ public class FileDownloaderTest extends AbstractTestUI {
return bi;
}
- @Override
- protected String getTestDescription() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- protected Integer getTicketNumber() {
- // TODO Auto-generated method stub
- return null;
- }
-
}
diff --git a/uitest/src/com/vaadin/tests/components/FileDownloaderUITest.java b/uitest/src/com/vaadin/tests/components/FileDownloaderUITest.java
new file mode 100644
index 0000000000..73d1ba6f52
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/FileDownloaderUITest.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class FileDownloaderUITest extends MultiBrowserTest {
+
+ @Test
+ public void ensureButtonWithDownloaderCanBeRemoved() {
+ openTestURL();
+ By id = By.id("com.vaadin.ui.ButtonDynamicimage");
+ assertElementPresent(id);
+ $(ButtonElement.class).caption("Remove first download button").first()
+ .click();
+ assertElementNotPresent(id);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentStyleNameTest.java b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentStyleNameTest.java
new file mode 100644
index 0000000000..41ba5571ad
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/abstractfield/AbstractComponentStyleNameTest.java
@@ -0,0 +1,115 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Button;
+
+public class AbstractComponentStyleNameTest {
+
+ AbstractComponent c;
+
+ @Before
+ public void setup() {
+ c = new Button();
+ }
+
+ @Test
+ public void add() {
+ c.addStyleName("foo");
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void addWithHeadingSpace() {
+ c.addStyleName(" foo");
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void addWithTrailingSpace() {
+ c.addStyleName("foo ");
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void removeWithHeadingSpace() {
+ c.setStyleName("foo");
+ c.removeStyleName(" foo");
+ Assert.assertEquals("", c.getStyleName());
+ }
+
+ @Test
+ public void removeWithTrailingSpace() {
+ c.setStyleName("foo");
+ c.removeStyleName("foo ");
+ Assert.assertEquals("", c.getStyleName());
+ }
+
+ @Test
+ public void addMultipleTimes() {
+ c.addStyleName("foo");
+ c.addStyleName("foo");
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void setStyleAdd() {
+ c.setStyleName("foo", true);
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void setStyleMultipleAdd() {
+ c.setStyleName("foo", true);
+ c.setStyleName("foo", true);
+ Assert.assertEquals("foo", c.getStyleName());
+ }
+
+ @Test
+ public void setStyleRemove() {
+ c.addStyleName("foo");
+ c.setStyleName("foo", false);
+ Assert.assertEquals("", c.getStyleName());
+ }
+
+ @Test
+ public void setStyleMultipleRemove() {
+ c.addStyleName("foo");
+ c.setStyleName("foo", false);
+ c.setStyleName("foo", false);
+ Assert.assertEquals("", c.getStyleName());
+ }
+
+ @Test
+ public void remove() {
+ c.addStyleName("foo");
+ c.removeStyleName("foo");
+ Assert.assertEquals("", c.getStyleName());
+ }
+
+ @Test
+ public void removeMultipleTimes() {
+ c.addStyleName("foo");
+ c.removeStyleName("foo");
+ c.removeStyleName("foo");
+ Assert.assertEquals("", c.getStyleName());
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediate.java
new file mode 100644
index 0000000000..fec753d5af
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediate.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.tests.components.checkbox;
+
+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.Label;
+
+public class CheckBoxImmediate extends AbstractTestUI {
+ private int count = 0;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ final Label status = new Label("Events received: " + count);
+ status.setId("count");
+ addComponent(status);
+
+ CheckBox cb = new CheckBox("Non-immediate");
+ ValueChangeListener listener = new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ count++;
+ status.setValue("Events received: " + count);
+ }
+ };
+ cb.addValueChangeListener(listener);
+ cb.setImmediate(false);
+ addComponent(cb);
+
+ cb = new CheckBox("Immediate");
+ cb.addValueChangeListener(listener);
+ cb.setImmediate(true);
+ addComponent(cb);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test for verifying that a non-immediate CheckBox does not send value change to server immediately.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 18102;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.java
new file mode 100644
index 0000000000..826b43b9cc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxImmediateTest.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.components.checkbox;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.testbench.elements.CheckBoxElement;
+import com.vaadin.testbench.elements.LabelElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class CheckBoxImmediateTest extends MultiBrowserTest {
+
+ @Test
+ public void testNonImmediateCheckBox() {
+ openTestURL();
+
+ CheckBoxElement checkBoxElement = $(CheckBoxElement.class).first();
+ WebElement inputElem = checkBoxElement.findElement(By.tagName("input"));
+ final WebElement countElem = $(LabelElement.class).id("count");
+
+ inputElem.click();
+ assertEquals("Events received: 0", countElem.getText());
+ }
+
+ @Test
+ public void testImmediateCheckBox() {
+ openTestURL();
+
+ CheckBoxElement checkBoxElement = $(CheckBoxElement.class).get(1);
+ WebElement inputElem = checkBoxElement.findElement(By.tagName("input"));
+ final WebElement countElem = $(LabelElement.class).id("count");
+
+ inputElem.click();
+ assertEquals("Events received: 1", countElem.getText());
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRpcCount.java b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRpcCount.java
index bd44e8a074..f909f97996 100644
--- a/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRpcCount.java
+++ b/uitest/src/com/vaadin/tests/components/checkbox/CheckBoxRpcCount.java
@@ -15,6 +15,8 @@
*/
package com.vaadin.tests.components.checkbox;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.server.VaadinRequest;
import com.vaadin.shared.MouseEventDetails;
import com.vaadin.shared.ui.checkbox.CheckBoxServerRpc;
@@ -46,6 +48,14 @@ public class CheckBoxRpcCount extends AbstractTestUI {
});
}
};
+ cb.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ // Adding an empty ValueChangeListener just to ensure that
+ // immediate mode is set to true
+ }
+ });
addComponent(cb);
}
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcutTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcutTest.java
new file mode 100644
index 0000000000..921c1b40e4
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcutTest.java
@@ -0,0 +1,37 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.Keys;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.tb3.newelements.ComboBoxElement;
+
+public class ComboBoxCombinedWithEnterShortcutTest extends MultiBrowserTest {
+ @Test
+ public void testKeyboardSelection() throws InterruptedException {
+ openTestURL();
+ ComboBoxElement cb = $(ComboBoxElement.class).first();
+ cb.click();
+ cb.sendKeys(500, Keys.DOWN, Keys.DOWN, Keys.DOWN, Keys.ENTER);
+ Assert.assertEquals("", getLogRow(0).trim());
+ cb.sendKeys(Keys.ENTER);
+ Assert.assertEquals("1. Button clicked. ComboBox value: Berlin",
+ getLogRow(0));
+ }
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java
new file mode 100644
index 0000000000..f94306d2fa
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabled.java
@@ -0,0 +1,74 @@
+package com.vaadin.tests.components.combobox;
+
+import java.util.ArrayList;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.ComponentTestCase;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Notification;
+
+public class ComboBoxScrollingToPageDisabled extends
+ ComponentTestCase<ComboBox> {
+
+ private static final Object CAPTION = "caption";
+
+ @Override
+ protected Class<ComboBox> getTestClass() {
+ return ComboBox.class;
+ }
+
+ @Override
+ protected void initializeComponents() {
+ ComboBox s = createSelect(null);
+ s.setScrollToSelectedItem(false);
+ populate(s, 100);
+ Object selection = new ArrayList<Object>(s.getItemIds()).get(50);
+ s.setValue(selection);
+ addTestComponent(s);
+ }
+
+ private void populate(ComboBox s, int nr) {
+ for (int i = 0; i < nr; i++) {
+ addItem(s, "Item " + i);
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private void addItem(ComboBox s, String string) {
+ Object id = s.addItem();
+ s.getItem(id).getItemProperty(CAPTION).setValue(string);
+
+ }
+
+ private ComboBox createSelect(String caption) {
+ final ComboBox cb = new ComboBox();
+ cb.setImmediate(true);
+ cb.addContainerProperty(CAPTION, String.class, "");
+ cb.setItemCaptionPropertyId(CAPTION);
+ cb.setCaption(caption);
+ cb.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ Notification.show("Value now:" + cb.getValue() + " "
+ + cb.getItemCaption(cb.getValue()));
+
+ }
+ });
+ return cb;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Test that selected value appears on the client "
+ + "side even though setScrollToSelectedItem(false) "
+ + "has been called. Textbox should containe 'Item 50'.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 16673;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java
new file mode 100644
index 0000000000..8c09279b87
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/combobox/ComboBoxScrollingToPageDisabledTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.Test;
+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 ComboBoxScrollingToPageDisabledTest extends MultiBrowserTest {
+
+ @Override
+ public void setup() throws Exception {
+ super.setup();
+ openTestURL();
+ }
+
+ @Test
+ public void checkValueIsVidinlr() throws InterruptedException {
+ WebElement input = driver.findElement(By
+ .className("v-filterselect-input"));
+ String value = input.getAttribute("value");
+ org.junit.Assert.assertEquals("Item 50", value);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/embedded/åäö-日本語.pdf b/uitest/src/com/vaadin/tests/components/embedded/åäö-日本語.pdf
new file mode 100644
index 0000000000..e44a87e9ad
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/embedded/åäö-日本語.pdf
Binary files differ
diff --git a/uitest/src/com/vaadin/tests/components/grid/BeanRenderer.java b/uitest/src/com/vaadin/tests/components/grid/BeanRenderer.java
new file mode 100644
index 0000000000..3e25f45283
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/BeanRenderer.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.tests.components.grid;
+
+import com.vaadin.tests.widgetset.client.SimpleTestBean;
+import com.vaadin.ui.Grid.AbstractRenderer;
+
+public class BeanRenderer extends AbstractRenderer<SimpleTestBean> {
+ public BeanRenderer() {
+ super(SimpleTestBean.class, "");
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/CustomRenderer.java b/uitest/src/com/vaadin/tests/components/grid/CustomRenderer.java
index f7d14bbff6..171d3f2a5e 100644
--- a/uitest/src/com/vaadin/tests/components/grid/CustomRenderer.java
+++ b/uitest/src/com/vaadin/tests/components/grid/CustomRenderer.java
@@ -22,6 +22,7 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.server.VaadinRequest;
import com.vaadin.tests.components.AbstractTestUI;
import com.vaadin.tests.widgetset.TestingWidgetSet;
+import com.vaadin.tests.widgetset.client.SimpleTestBean;
import com.vaadin.ui.Grid;
import com.vaadin.ui.Grid.SelectionMode;
import com.vaadin.ui.Label;
@@ -31,6 +32,7 @@ public class CustomRenderer extends AbstractTestUI {
private static final Object INT_ARRAY_PROPERTY = "int array";
private static final Object VOID_PROPERTY = "void";
+ private static final Object BEAN_PROPERTY = "pojo";
static final Object ITEM_ID = "itemId1";
static final String DEBUG_LABEL_ID = "debuglabel";
@@ -42,6 +44,8 @@ public class CustomRenderer extends AbstractTestUI {
container.addContainerProperty(INT_ARRAY_PROPERTY, int[].class,
new int[] {});
container.addContainerProperty(VOID_PROPERTY, Void.class, null);
+ container.addContainerProperty(BEAN_PROPERTY, SimpleTestBean.class,
+ null);
Item item = container.addItem(ITEM_ID);
@@ -50,14 +54,25 @@ public class CustomRenderer extends AbstractTestUI {
.getItemProperty(INT_ARRAY_PROPERTY);
propertyIntArray.setValue(new int[] { 1, 1, 2, 3, 5, 8, 13 });
+ @SuppressWarnings("unchecked")
+ Property<SimpleTestBean> propertyPojo = item
+ .getItemProperty(BEAN_PROPERTY);
+ SimpleTestBean bean = new SimpleTestBean();
+ bean.setValue(42);
+ propertyPojo.setValue(bean);
+
Label debugLabel = new Label(INIT_DEBUG_LABEL_CAPTION);
debugLabel.setId(DEBUG_LABEL_ID);
Grid grid = new Grid(container);
+
grid.getColumn(INT_ARRAY_PROPERTY).setRenderer(new IntArrayRenderer());
grid.getColumn(VOID_PROPERTY).setRenderer(
new RowAwareRenderer(debugLabel));
+ grid.getColumn(BEAN_PROPERTY).setRenderer(new BeanRenderer());
+
grid.setSelectionMode(SelectionMode.NONE);
+
addComponent(grid);
addComponent(debugLabel);
}
diff --git a/uitest/src/com/vaadin/tests/components/grid/CustomRendererTest.java b/uitest/src/com/vaadin/tests/components/grid/CustomRendererTest.java
index b17416df2a..7d706ecd30 100644
--- a/uitest/src/com/vaadin/tests/components/grid/CustomRendererTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/CustomRendererTest.java
@@ -52,6 +52,13 @@ public class CustomRendererTest extends MultiBrowserTest {
findDebugLabel().getText());
}
+ @Test
+ public void testBeanRenderer() throws Exception {
+ openTestURL();
+
+ assertEquals("SimpleTestBean(42)", findGrid().getCell(0, 2).getText());
+ }
+
private GridElement findGrid() {
List<GridElement> elements = $(GridElement.class).all();
return elements.get(0);
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.java
new file mode 100644
index 0000000000..1af1ad02d6
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolled.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.grid;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Grid.SelectionMode;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.VerticalLayout;
+
+public class GridDragSelectionWhileScrolled extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Layout layout = new VerticalLayout();
+
+ HorizontalLayout spacer = new HorizontalLayout();
+ spacer.setHeight("1000px");
+ layout.addComponent(spacer);
+
+ PersonTestGrid grid = new PersonTestGrid(100);
+ grid.setSelectionMode(SelectionMode.MULTI);
+ layout.addComponent(grid);
+
+ addComponent(layout);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 17895;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Drag selecting rows in Grid malfunctions if page is scrolled";
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.java
new file mode 100644
index 0000000000..6a452e1fec
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridDragSelectionWhileScrolledTest.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.grid;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.openqa.selenium.JavascriptExecutor;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridDragSelectionWhileScrolledTest extends MultiBrowserTest {
+
+ @Override
+ protected boolean requireWindowFocusForIE() {
+ return true;
+ }
+
+ @Test
+ public void testDragSelect() throws IOException {
+ openTestURL();
+
+ // Scroll grid to view
+ GridElement grid = $(GridElement.class).first();
+ ((JavascriptExecutor) getDriver()).executeScript(
+ "arguments[0].scrollIntoView(true);", grid);
+
+ // Drag select 2 rows
+ new Actions(getDriver()).moveToElement(grid.getCell(3, 0), 5, 5)
+ .clickAndHold().moveToElement(grid.getCell(2, 0), 5, 5)
+ .release().perform();
+
+ // Assert only those are selected.
+ assertTrue("Row 3 should be selected", grid.getRow(3).isSelected());
+ assertTrue("Row 2 should be selected", grid.getRow(2).isSelected());
+ assertFalse("Row 4 should not be selected", grid.getRow(4).isSelected());
+ assertFalse("Row 1 should not be selected", grid.getRow(1).isSelected());
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFound.java
new file mode 100644
index 0000000000..e5532b10ad
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFound.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.tests.components.grid;
+
+import com.vaadin.server.ErrorHandler;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.ui.Grid;
+
+public class GridEditorConverterNotFound extends AbstractTestUIWithLog {
+
+ class Foo {
+ }
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ Grid grid = new Grid();
+
+ grid.addColumn("foo", Foo.class);
+ grid.addRow(new Foo());
+ grid.setEditorEnabled(true);
+ grid.setErrorHandler(new ErrorHandler() {
+
+ @Override
+ public void error(com.vaadin.server.ErrorEvent event) {
+ log(event.getThrowable().toString());
+ }
+ });
+
+ addComponent(grid);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 17935;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Grid should gracefully handle bind failures when opening editor";
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java b/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java
new file mode 100644
index 0000000000..468ea8da3a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridEditorConverterNotFoundTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.grid;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.components.grid.basicfeatures.GridBasicFeaturesTest;
+
+public class GridEditorConverterNotFoundTest extends GridBasicFeaturesTest {
+
+ @Override
+ protected Class<?> getUIClass() {
+ // Use the correct UI with helpers from GridBasicFeatures
+ return GridEditorConverterNotFound.class;
+ }
+
+ @Test
+ public void testConverterNotFound() {
+ openTestURL();
+
+ $(GridElement.class).first().getCell(0, 0).doubleClick();
+
+ assertEquals("1. com.vaadin.data.Buffered$SourceException",
+ getLogRow(0));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java b/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java
new file mode 100644
index 0000000000..49b344bb85
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumns.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.grid;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.tests.fieldgroup.ComplexPerson;
+import com.vaadin.ui.Grid;
+
+public class GridInitiallyHiddenColumns extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Grid grid = new Grid();
+ grid.setContainerDataSource(ComplexPerson.createContainer(100));
+ grid.setColumns("firstName", "lastName", "age");
+ grid.getColumn("firstName").setHidden(true).setHidable(true);
+ grid.getColumn("lastName").setHidable(true);
+ grid.getColumn("age").setHidden(true).setHidable(true);
+
+ addComponent(grid);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java b/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.java
new file mode 100644
index 0000000000..a3e941053a
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridInitiallyHiddenColumnsTest.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.grid;
+
+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.testbench.elements.GridElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class GridInitiallyHiddenColumnsTest extends SingleBrowserTest {
+
+ @Test
+ public void ensureCorrectlyRendered() {
+ openTestURL("debug");
+ GridElement grid = $(GridElement.class).first();
+ Assert.assertEquals("Rowling", grid.getCell(0, 0).getText());
+ Assert.assertEquals("Scott", grid.getCell(1, 0).getText());
+
+ getSidebarOpenButton(grid).click();
+ getColumnHidingToggle(grid, "First Name").click();
+ getColumnHidingToggle(grid, "Age").click();
+ getSidebarOpenButton(grid).click();
+
+ Assert.assertEquals("Umberto", grid.getCell(0, 0).getText());
+ Assert.assertEquals("Rowling", grid.getCell(0, 1).getText());
+ Assert.assertEquals("25", grid.getCell(0, 2).getText());
+ Assert.assertEquals("Dan", grid.getCell(1, 0).getText());
+ Assert.assertEquals("Scott", grid.getCell(1, 1).getText());
+ Assert.assertEquals("54", grid.getCell(1, 2).getText());
+
+ }
+
+ protected WebElement getSidebarOpenButton(GridElement grid) {
+ List<WebElement> elements = grid.findElements(By
+ .className("v-grid-sidebar-button"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+ /**
+ * Returns the toggle inside the sidebar for hiding the column at the given
+ * index, or null if not found.
+ */
+ protected WebElement getColumnHidingToggle(GridElement grid, String caption) {
+ WebElement sidebar = getSidebar(grid);
+ List<WebElement> elements = sidebar.findElements(By
+ .className("column-hiding-toggle"));
+ for (WebElement e : elements) {
+ if (caption.equalsIgnoreCase(e.getText())) {
+ return e;
+ }
+ }
+ return null;
+ }
+
+ protected WebElement getSidebar(GridElement grid) {
+ List<WebElement> elements = findElements(By.className("v-grid-sidebar"));
+ return elements.isEmpty() ? null : elements.get(0);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java b/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.java
new file mode 100644
index 0000000000..c4db770ae1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridSpacerDecoClipTest.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.grid;
+
+import com.vaadin.testbench.TestBenchElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.tests.minitutorials.v7_5.ShowingExtraDataForRows;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.SearchContext;
+
+/**
+ * Test for "Grid detail row outline overflows" (#17826)
+ *
+ * @author Vaadin Ltd
+ */
+public class GridSpacerDecoClipTest extends MultiBrowserTest {
+
+ private static final String SPACER_CSS_CLASS_DECO = "v-grid-spacer-deco";
+ @Override
+ protected Class<?> getUIClass() {
+ return ShowingExtraDataForRows.class;
+ }
+
+ @Test
+ public void testNewSpacerClip() {
+ openTestURL();
+
+ GridElement gridElement = $(GridElement.class).first();
+ gridElement.scrollToRow(999);
+ GridElement.GridRowElement nextToLastRow = gridElement.getRow(998);
+ nextToLastRow.doubleClick();
+
+ TestBenchElement deco = getSpacerDeco(0);
+ System.out.println("Lower deco.clip = " + deco.getCssValue("clip"));
+ GridElement.GridRowElement nearToBottomRow = gridElement.getRow(993);
+ nearToBottomRow.doubleClick();
+ deco = getSpacerDeco(0);
+ System.out.println("Lower deco.clip = " + deco.getCssValue("clip"));
+ Assert.assertNotEquals("Spacer deco clipping is not updated after opening another spacer",
+ "auto", deco.getCssValue("clip"));
+ }
+
+ @Test
+ public void testRemovedSpacerClip() throws InterruptedException {
+ openTestURL();
+
+ GridElement gridElement = $(GridElement.class).first();
+ gridElement.scrollToRow(999);
+ GridElement.GridRowElement lastRow = gridElement.getRow(999);
+ lastRow.doubleClick(); //Open lowest Row Details
+
+ TestBenchElement deco = getSpacerDeco(0);
+ System.out.println("deco.rect = " + deco.getCssValue("clip"));
+
+ GridElement.GridRowElement nearToBottomRow = gridElement.getRow(993);
+
+ nearToBottomRow.doubleClick(); //Open upper Row Details, lower Row Details goes out of visible range
+ Thread.sleep(500);
+ nearToBottomRow.doubleClick(); //Close upper Row Details, lower Row Details goes back to visible range
+
+ deco = getSpacerDeco(0);
+ String clip = deco.getCssValue("clip");
+ System.out.println("deco.rect = " + clip);
+
+ Assert.assertTrue("Part of lower Row Details is visible, its deco clip height should be positive, but it is negative",
+ clip.indexOf('-') < 0);
+ }
+
+ private TestBenchElement getSpacerDeco(int index) {
+ SearchContext context = this.getContext();
+ return (TestBenchElement) context.findElements(By.className(SPACER_CSS_CLASS_DECO)).get(index);
+ }
+}
+
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java b/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java
new file mode 100644
index 0000000000..1e921bb18c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrapping.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.grid;
+
+import java.util.Random;
+
+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.Grid;
+import com.vaadin.ui.Grid.SelectionMode;
+
+@Theme("valo")
+public class GridSubPixelProblemWrapping extends AbstractTestUI {
+
+ Random r = new Random();
+
+ public static class DataObject {
+ String foo;
+ String Bar;
+
+ public DataObject(Random r) {
+ foo = r.nextInt() + "";
+ Bar = r.nextInt() + "";
+ }
+
+ public DataObject(String foo, String bar) {
+ this.foo = foo;
+ Bar = bar;
+ }
+
+ public String getFoo() {
+ return foo;
+ }
+
+ public void setFoo(String foo) {
+ this.foo = foo;
+ }
+
+ public String getBar() {
+ return Bar;
+ }
+
+ public void setBar(String bar) {
+ Bar = bar;
+ }
+
+ }
+
+ Button button = new Button("Click", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ addDAO();
+ }
+ });
+
+ private BeanItemContainer<DataObject> container;
+ private int counter = 0;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ addComponent(button);
+ container = new BeanItemContainer<DataObject>(DataObject.class);
+ container.addBean(new DataObject("Foo", "Bar"));
+ Grid grid = new Grid(container);
+ grid.getColumn("foo").setWidth(248.525);
+ grid.setSelectionMode(SelectionMode.SINGLE);
+ grid.setEditorEnabled(true);
+ grid.setWidth("500px");
+
+ addComponent(grid);
+ }
+
+ private void addDAO() {
+ counter++;
+ container.addBean(new DataObject("Foo" + counter, "Bar" + counter));
+
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java b/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java
new file mode 100644
index 0000000000..7aacfa8548
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/grid/GridSubPixelProblemWrappingTest.java
@@ -0,0 +1,67 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.grid;
+
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.GridElement;
+import com.vaadin.testbench.elements.GridElement.GridRowElement;
+import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridSubPixelProblemWrappingTest extends MultiBrowserTest {
+
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ List<DesiredCapabilities> l = super.getBrowsersToTest();
+ // Currently broken because of #18214
+ l.remove(Browser.IE9.getDesiredCapabilities());
+ return l;
+ }
+
+ @Test
+ public void addedRowShouldNotWrap() {
+ openTestURL();
+
+ GridElement grid = $(GridElement.class).first();
+
+ // Cells in first row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 0);
+
+ // Add a row
+ $(ButtonElement.class).first().click();
+
+ // Cells in the first row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 0);
+ // Cells in the second row should be at the same y coordinate as the row
+ assertRowAndCellTops(grid, 1);
+ }
+
+ private void assertRowAndCellTops(GridElement grid, int rowIndex) {
+ GridRowElement row = grid.getRow(rowIndex);
+ int rowTop = row.getLocation().y;
+
+ int cell0Top = grid.getCell(rowIndex, 0).getLocation().y;
+ int cell1Top = grid.getCell(rowIndex, 1).getLocation().y;
+ Assert.assertEquals(rowTop, cell0Top);
+ Assert.assertEquals(rowTop, cell1Top);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
index a9cc528ac0..44a6da224e 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridBasicFeatures.java
@@ -933,6 +933,18 @@ public class GridBasicFeatures extends AbstractComponentTest<Grid> {
}
}, null, c);
+ createClickAction("Change header caption", getColumnProperty(c),
+ new Command<Grid, String>() {
+ int count = 0;
+
+ @Override
+ public void execute(Grid grid, String value, Object data) {
+ final String columnProperty = getColumnProperty((Integer) data);
+ grid.getColumn(columnProperty).setHeaderCaption(
+ columnProperty + " header " + count++);
+ }
+ }, null, c);
+
createCategory("Column " + c + " Width", getColumnProperty(c));
createClickAction("Auto", "Column " + c + " Width",
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
index c4ad2ea347..a307aaca16 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/GridColumnHidingTest.java
@@ -372,10 +372,11 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
toggleHidableColumnAPI(6);
toggleHidableColumnAPI(0);
- verifyColumnHidingTogglesOrder(0, 1, 3, 6);
-
+ // Selecting from the menu closes the sidebar
clickSidebarOpenButton();
+ verifyColumnHidingTogglesOrder(0, 1, 3, 6);
+
toggleHidableColumnAPI(2);
toggleHidableColumnAPI(4);
toggleHidableColumnAPI(7);
@@ -611,6 +612,7 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
verifyColumnIsNotFrozen(1);
verifyColumnIsNotFrozen(2);
+ getSidebarOpenButton().click();
getColumnHidingToggle(2).click();
verifyColumnIsFrozen(0);
verifyColumnIsFrozen(1);
@@ -840,6 +842,84 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
.getDetails(1));
}
+ @Test
+ public void testHideShowAllColumns() {
+ selectMenuPath("Component", "State", "Width", "1000px");
+ int colCount = 12;
+ for (int i = 0; i < colCount; i++) {
+ toggleHidableColumnAPI(i);
+ }
+ clickSidebarOpenButton();
+ for (int i = 0; i < colCount; i++) {
+ getColumnHidingToggle(i).click();
+ }
+
+ clickSidebarOpenButton();
+ // All columns hidden
+ assertEquals(0, getGridHeaderRowCells().size());
+ clickSidebarOpenButton();
+ for (int i = 0; i < colCount; i++) {
+ getColumnHidingToggle(i).click();
+ }
+
+ assertEquals(colCount, getGridHeaderRowCells().size());
+ }
+
+ @Test
+ public void testColumnHidingPopupClosedWhenClickingOutside() {
+ selectMenuPath("Component", "Columns", "Column 0", "Hidable");
+ getSidebarOpenButton().click();
+ verifySidebarOpened();
+ findElement(By.className("v-app")).click();
+ verifySidebarClosed();
+ }
+
+ @Test
+ public void hideScrollAndShow() {
+ toggleHidableColumnAPI(1);
+ toggleHideColumnAPI(1);
+
+ getGridElement().scrollToRow(500);
+ Assert.assertEquals("(500, 0)", getGridElement().getCell(500, 0)
+ .getText());
+ Assert.assertEquals("(500, 2)", getGridElement().getCell(500, 1)
+ .getText());
+
+ toggleHideColumnAPI(1);
+
+ Assert.assertEquals("(500, 0)", getGridElement().getCell(500, 0)
+ .getText());
+ Assert.assertEquals("(500, 1)", getGridElement().getCell(500, 1)
+ .getText());
+ }
+
+ @Test
+ public void scrollHideAndShow() {
+ toggleHidableColumnAPI(0);
+ toggleHidableColumnAPI(1);
+
+ Assert.assertEquals("(500, 0)", getGridElement().getCell(500, 0)
+ .getText());
+ Assert.assertEquals("(500, 1)", getGridElement().getCell(500, 1)
+ .getText());
+
+ toggleHideColumnAPI(0);
+ toggleHideColumnAPI(1);
+
+ Assert.assertEquals("(500, 2)", getGridElement().getCell(500, 0)
+ .getText());
+ Assert.assertEquals("(500, 3)", getGridElement().getCell(500, 1)
+ .getText());
+
+ toggleHideColumnAPI(0);
+ toggleHideColumnAPI(1);
+
+ Assert.assertEquals("(500, 0)", getGridElement().getCell(500, 0)
+ .getText());
+ Assert.assertEquals("(500, 1)", getGridElement().getCell(500, 1)
+ .getText());
+ }
+
private void loadSpannedCellsFixture() {
selectMenuPath("Component", "State", "Width", "1000px");
appendHeaderRow();
@@ -932,12 +1012,12 @@ public class GridColumnHidingTest extends GridBasicClientFeaturesTest {
private void verifySidebarOpened() {
WebElement sidebar = getSidebar();
- assertTrue(sidebar.getAttribute("class").contains("opened"));
+ assertTrue(sidebar.getAttribute("class").contains("open"));
}
private void verifySidebarClosed() {
WebElement sidebar = getSidebar();
- assertFalse(sidebar.getAttribute("class").contains("opened"));
+ assertFalse(sidebar.getAttribute("class").contains("open"));
}
private void verifySidebarNotVisible() {
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java
index ec309c17a1..f437589a39 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridEditorClientTest.java
@@ -271,7 +271,10 @@ public class GridEditorClientTest extends GridBasicClientFeaturesTest {
WebElement focused = getFocusedElement();
- if (BrowserUtil.isIE(getDesiredCapabilities())) {
+ if (BrowserUtil.isIE8(getDesiredCapabilities())) {
+ assertEquals("Focus should be in html", "html",
+ focused.getTagName());
+ } else if (BrowserUtil.isIE(getDesiredCapabilities())) {
assertEquals("Focus should be nowhere", null, focused);
} else {
// GWT menubar loses focus after clicking a menuitem
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java
index c5092a9c22..619dd5ae12 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/client/GridSidebarContentTest.java
@@ -70,19 +70,14 @@ public class GridSidebarContentTest extends GridBasicClientFeaturesTest {
}
@Test
- public void testProgrammaticSidebarToggle() {
+ public void testProgrammaticSidebarOpen() {
openTestURL();
selectMenuPath("Component", "Columns", "Column 0", "Hidable");
selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");
- Assert.assertEquals("Sidebar be open", 1,
- countBySelector(".v-grid-sidebar-content"));
-
- selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");
-
- Assert.assertEquals("Sidebar be closed", 0,
+ Assert.assertEquals("Sidebar should be open", 1,
countBySelector(".v-grid-sidebar-content"));
}
@@ -122,6 +117,7 @@ public class GridSidebarContentTest extends GridBasicClientFeaturesTest {
"Header (0,1)");
selectMenuPath("Component", "Columns", "Column 2", "Hidable");
+ selectMenuPath("Component", "Sidebar", "Toggle sidebar visibility");
// Adding a new togglable column should have restored the expected order
assertSidebarMenuItems("Header (0,0)", "Header (0,1)", "Header (0,2)",
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
index 1714cdaaf3..3ccca105de 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnReorderTest.java
@@ -348,6 +348,31 @@ public class GridColumnReorderTest extends GridBasicFeaturesTest {
+ " was " + realLeft, Math.abs(expectedLeft - realLeft) < 5);
}
+ @Test
+ public void testDropMarker_sidebarOpenButtonVisible_dropMarkerOnCorrectPosition() {
+ // using runo since there the sidebar opening button is wider than the
+ // scroll deco, and because using Valo has some TB issues
+ openTestURL("theme=runo");
+
+ selectMenuPath("Component", "Size", "Width", "100%");
+ selectMenuPath("Component", "Columns", "All columns hidable");
+ toggleColumnReordering();
+ scrollGridHorizontallyTo(100000);
+
+ new Actions(getDriver()).clickAndHold(getDefaultColumnHeader(10))
+ .moveByOffset(800, 0).build().perform();
+
+ WebElement dragDropMarker = findElement(By
+ .className("v-grid-drop-marker"));
+ WebElement sidebar = findElement(By.className("v-grid-sidebar"));
+
+ int dragDropMarkerX = dragDropMarker.getLocation().getX();
+ int sidebarX = sidebar.getLocation().getX();
+ assertTrue("Drop marker misplaced " + dragDropMarkerX
+ + " compared to sidebar open button " + sidebarX,
+ dragDropMarkerX <= sidebarX);
+ }
+
private void toggleColumnReordering() {
selectMenuPath(COLUMN_REORDERING_PATH);
}
diff --git a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java
index d01e689b72..6e0d7cc87a 100644
--- a/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java
+++ b/uitest/src/com/vaadin/tests/components/grid/basicfeatures/server/GridColumnVisibilityTest.java
@@ -173,11 +173,14 @@ public class GridColumnVisibilityTest extends GridBasicFeaturesTest {
assertEquals("Column 1", getColumnHidingToggle(1).getText());
toggleColumnHidingToggleCaptionChange(1);
+
+ getSidebarOpenButton().click();
assertEquals("column 1", getGridElement().getHeaderCell(0, 1).getText()
.toLowerCase());
assertEquals("Column 1 caption 0", getColumnHidingToggle(1).getText());
toggleColumnHidingToggleCaptionChange(1);
+ getSidebarOpenButton().click();
assertEquals("Column 1 caption 1", getColumnHidingToggle(1).getText());
}
@@ -192,9 +195,38 @@ public class GridColumnVisibilityTest extends GridBasicFeaturesTest {
selectMenuPath("Component", "Columns", "Column 1", "Header Type",
"Widget Header");
+ getSidebarOpenButton().click();
assertEquals("Column 1", getColumnHidingToggle(1).getText());
}
+ @Test
+ public void testColumnHidingToggleCaption_settingColumnHeaderCaption_toggleCaptionIsEqual() {
+ toggleColumnHidable(1);
+
+ selectMenuPath("Component", "Columns", "Column 1",
+ "Change header caption");
+
+ getSidebarOpenButton().click();
+ assertEquals("column 1 header 0", getGridElement().getHeaderCell(0, 1)
+ .getText().toLowerCase());
+ assertEquals("Column 1 header 0", getColumnHidingToggle(1).getText());
+ }
+
+ @Test
+ public void testColumnHidingToggleCaption_explicitlySet_toggleCaptionIsNotOverridden() {
+ toggleColumnHidable(1);
+
+ selectMenuPath("Component", "Columns", "Column 1",
+ "Change hiding toggle caption");
+ selectMenuPath("Component", "Columns", "Column 1",
+ "Change header caption");
+
+ getSidebarOpenButton().click();
+ assertEquals("column 1 header 0", getGridElement().getHeaderCell(0, 1)
+ .getText().toLowerCase());
+ assertEquals("Column 1 caption 0", getColumnHidingToggle(1).getText());
+ }
+
private void toggleColumnHidingToggleCaptionChange(int index) {
selectMenuPath("Component", "Columns", "Column " + index,
"Change hiding toggle caption");
@@ -215,6 +247,7 @@ public class GridColumnVisibilityTest extends GridBasicFeaturesTest {
verifyColumnNotFrozen(0);
verifyColumnNotFrozen(1);
+ getSidebarOpenButton().click();
getColumnHidingToggle(0).click();
assertColumnHeaderOrder(0, 2, 3, 4, 5);
verifyColumnFrozen(0);
@@ -249,6 +282,7 @@ public class GridColumnVisibilityTest extends GridBasicFeaturesTest {
verifyColumnNotFrozen(0);
verifyColumnNotFrozen(1);
+ getSidebarOpenButton().click();
getColumnHidingToggle(0).click();
assertColumnHeaderOrder(0, 2, 3, 4, 5);
verifyColumnNotFrozen(0);
diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignment.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignment.java
new file mode 100644
index 0000000000..32d01f9910
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignment.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.gridlayout;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.tests.widgetset.TestingWidgetSet;
+import com.vaadin.tests.widgetset.server.ScrollableGridLayout;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.GridLayout;
+
+@Widgetset(TestingWidgetSet.NAME)
+public class GridLayoutFractionalSizeAndAlignment extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ widthTest();
+ heightTest();
+ }
+
+ private void widthTest() {
+ final GridLayout layout = new ScrollableGridLayout(1, 1);
+ layout.setMargin(false);
+ layout.setSpacing(true);
+
+ layout.setWidth(525.04f, Unit.PIXELS);
+
+ Button button = new Button("Button");
+
+ layout.addComponent(button);
+ layout.setComponentAlignment(button, Alignment.BOTTOM_RIGHT);
+
+ addComponent(layout);
+ }
+
+ private void heightTest() {
+ final GridLayout layout = new ScrollableGridLayout(1, 1);
+ layout.setMargin(false);
+ layout.setSpacing(true);
+
+ layout.setWidth(525.04f, Unit.PIXELS);
+ layout.setHeight(525.04f, Unit.PIXELS);
+
+ Button button = new Button("Button");
+
+ layout.addComponent(button);
+ layout.setComponentAlignment(button, Alignment.BOTTOM_RIGHT);
+
+ addComponent(layout);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignmentTest.java b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignmentTest.java
new file mode 100644
index 0000000000..b60aea49f0
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/gridlayout/GridLayoutFractionalSizeAndAlignmentTest.java
@@ -0,0 +1,31 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 java.io.IOException;
+
+import org.junit.Test;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class GridLayoutFractionalSizeAndAlignmentTest extends MultiBrowserTest {
+
+ @Test
+ public void ensureNoScrollbarsWithAlignBottomRight() throws IOException {
+ openTestURL();
+ compareScreen("noscrollbars");
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayouts.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayouts.java
new file mode 100644
index 0000000000..9bc8a418da
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayouts.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.orderedlayout;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ *
+ * @since
+ * @author Vaadin Ltd
+ */
+public class NestedInvalidLayouts extends AbstractTestUI {
+ @Override
+ protected void setup(VaadinRequest request) {
+ fullWidthTest(getLayout(), null);
+ fullWidthTest(getLayout(), "100%");
+ fullHeightTest(getLayout(), null);
+ fullHeightTest(getLayout(), "100%");
+ }
+
+ private void fullWidthTest(VerticalLayout layout, String rootWidth) {
+ // Contains
+ // HL (-1)
+ // * VL (100%)
+ // ** Button (-1) (wide)
+ // ** Button (100%)
+
+ // This should be rendered just as if VL width was -1 (which it will
+ // become when sending width to client), i.e. both buttons should be
+ // equally wide
+
+ final VerticalLayout l = new VerticalLayout();
+ l.setWidth(rootWidth);
+ final Button c = new Button("blaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+ c.setWidth(null);
+ l.addComponent(c);
+ final Button b = new Button("c");
+ b.setWidth("100%");
+ l.addComponent(b);
+ layout.addComponent(new HorizontalLayout(l));
+ }
+
+ private void fullHeightTest(VerticalLayout layout, String rootHeight) {
+ // Contains (height)
+ // VL (-1)
+ // * HL (100%)
+ // ** Button (200px) (high)
+ // ** Button (100%)
+
+ // This should be rendered just as if HL height was -1 (which it will
+ // become when sending height to client), i.e. both buttons should be
+ // equally high
+
+ final HorizontalLayout l = new HorizontalLayout();
+ l.setHeight(rootHeight);
+
+ final NativeButton c = new NativeButton("hiiiigh");
+ c.setWidth(null);
+ c.setHeight("200px");
+ l.addComponent(c);
+ final NativeButton b = new NativeButton("c");
+ b.setHeight("100%");
+ l.addComponent(b);
+ VerticalLayout vl = new VerticalLayout(l);
+ vl.setHeight("100%");
+ layout.addComponent(vl);
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayoutsTest.java b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayoutsTest.java
new file mode 100644
index 0000000000..cbae7acc94
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/orderedlayout/NestedInvalidLayoutsTest.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.orderedlayout;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.ButtonElement;
+import com.vaadin.testbench.elements.NativeButtonElement;
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class NestedInvalidLayoutsTest extends SingleBrowserTest {
+
+ @Test
+ public void ensureCorrectSizes() {
+ openTestURL();
+
+ // All Button components should have equal width
+ List<Integer> widths = new ArrayList<Integer>();
+ List<ButtonElement> all = $(ButtonElement.class).state(
+ "primaryStyleName", "v-button").all();
+ for (ButtonElement button : all) {
+ widths.add(button.getSize().getWidth());
+ }
+ assertAllEqual(widths);
+
+ // All NativeButton components should have equal height
+ List<Integer> heights = new ArrayList<Integer>();
+ for (NativeButtonElement button : $(NativeButtonElement.class).all()) {
+ heights.add(button.getSize().getHeight());
+ }
+ assertAllEqual(heights);
+ }
+
+ private void assertAllEqual(List<Integer> values) {
+ Integer first = values.get(0);
+ for (Integer w : values) {
+ Assert.assertEquals(first, w);
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java b/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java
new file mode 100644
index 0000000000..f28dfc8f79
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/slider/SliderFeedback.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.slider;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.Slider;
+
+public class SliderFeedback extends AbstractTestUI {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ Slider slider = new Slider(0, 5);
+ slider.setWidth(800, Unit.PIXELS);
+ slider.setMin(0);
+ slider.setMax(1e12);
+ addComponent(slider);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Slider feedback popup should display the correct value";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 18192;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java b/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java
new file mode 100644
index 0000000000..86bc351480
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/slider/SliderFeedbackTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.slider;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class SliderFeedbackTest extends MultiBrowserTest {
+
+ @Test
+ public void testValueGreaterThanMaxInt() {
+ openTestURL();
+
+ WebElement handle = findElement(By.className("v-slider-handle"));
+ new Actions(driver).dragAndDropBy(handle, 400, 0).perform();
+ testBench().waitForVaadin();
+
+ double value = Double.valueOf(findElement(
+ By.className("v-slider-feedback")).getText());
+
+ // Allow for some tolerance due to, you guessed it, IE8
+ assertLessThan("Unexpected feedback value {1} < {0}", 505000000000.0,
+ value);
+ assertGreater("Unexpected feedback value {1} > {0}", 510000000000.0,
+ value);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleName.java b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleName.java
new file mode 100644
index 0000000000..e6079dba60
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleName.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.splitpanel;
+
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.ui.AbstractSplitPanel;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.VerticalSplitPanel;
+
+/**
+ * Test UI for duplicate primary style name in SplitPanel.
+ *
+ * @author Vaadin Ltd
+ */
+public class SplitPanelDuplicateStyleName extends AbstractTestUIWithLog {
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ addSplitPanel(true);
+ addSplitPanel(false);
+ }
+
+ private void addSplitPanel(final boolean horizontal) {
+ AbstractSplitPanel splitPanel;
+ if (horizontal) {
+ splitPanel = new HorizontalSplitPanel();
+ } else {
+ splitPanel = new VerticalSplitPanel();
+ }
+ splitPanel.setWidth("200px");
+ splitPanel.setHeight("200px");
+ addComponent(splitPanel);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "SplitPanel should not have duplicate primary style name";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 17846;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleNameTest.java b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleNameTest.java
new file mode 100644
index 0000000000..8a142ac2e1
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/splitpanel/SplitPanelDuplicateStyleNameTest.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.splitpanel;
+
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.shared.ui.splitpanel.HorizontalSplitPanelState;
+import com.vaadin.testbench.elements.HorizontalSplitPanelElement;
+import com.vaadin.testbench.elements.VerticalSplitPanelElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Test for duplicate primary style name in SplitPanel.
+ *
+ * @author Vaadin Ltd
+ */
+public class SplitPanelDuplicateStyleNameTest extends MultiBrowserTest {
+
+ @Override
+ public void setup() throws Exception {
+ super.setup();
+ openTestURL();
+ waitForElementPresent(By.className("v-splitpanel-horizontal"));
+ }
+
+ @Test
+ public void testHorizontalNoDuplicateStyleName() {
+ HorizontalSplitPanelElement split = $(HorizontalSplitPanelElement.class)
+ .first();
+ String classNames = split.getAttribute("class");
+ String primaryStyleName = new HorizontalSplitPanelState().primaryStyleName;
+ assertEquals("Duplicate primary style name should not exist",
+ classNames.indexOf(primaryStyleName),
+ classNames.lastIndexOf(primaryStyleName));
+ }
+
+ @Test
+ public void testVerticalNoDuplicateStyleName() {
+ VerticalSplitPanelElement split = $(VerticalSplitPanelElement.class)
+ .first();
+ String classNames = split.getAttribute("class");
+ String primaryStyleName = new HorizontalSplitPanelState().primaryStyleName;
+ assertEquals("Duplicate primary style name should not exist",
+ classNames.indexOf(primaryStyleName),
+ classNames.lastIndexOf(primaryStyleName));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrder.java b/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrder.java
new file mode 100644
index 0000000000..7e33de502c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrder.java
@@ -0,0 +1,119 @@
+package com.vaadin.tests.components.table;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.Table;
+import com.vaadin.ui.VerticalLayout;
+
+public class ColumnWidthsAfterChangeTableColumnsCountOrOrder extends
+ AbstractTestUI {
+
+ protected static final String BUTTON_CHANGE_ORDER_AND_WIDTH_ID = "buttonChangeOrderAndWidth";
+ protected static final String BUTTON_CHANGE_COLUMN_COUNT_AND_WIDTH = "buttonChangeColumnCountAndWidth";
+ protected static final int NEW_COLUMN_WIDTH = 17;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ List<TestBean> beanList = new ArrayList<TestBean>();
+ beanList.add(new TestBean(1, "name1", "descr1"));
+ beanList.add(new TestBean(2, "name2", "descr2"));
+ beanList.add(new TestBean(3, "name3", "descr3"));
+ beanList.add(new TestBean(4, "name4", "descr4"));
+ beanList.add(new TestBean(5, "name5", "descr5"));
+
+ BeanItemContainer<TestBean> container = new BeanItemContainer<TestBean>(
+ TestBean.class, beanList);
+
+ VerticalLayout layout = new VerticalLayout();
+
+ final Table table = new Table("Test Table");
+ table.setContainerDataSource(container);
+ table.setVisibleColumns(new Object[] { "id", "name", "descr" });
+ layout.addComponent(table);
+
+ Button buttonChangeOrderAndWidth = new Button("Change order and width",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent clickEvent) {
+ table.setVisibleColumns(new Object[] { "name", "descr",
+ "id" });
+ table.setColumnWidth("descr", NEW_COLUMN_WIDTH);
+ }
+ });
+ buttonChangeOrderAndWidth.setId(BUTTON_CHANGE_ORDER_AND_WIDTH_ID);
+
+ Button buttonChangeColumnCountAndWidth = new Button(
+ "Change columns count and width", new Button.ClickListener() {
+ @Override
+ public void buttonClick(Button.ClickEvent clickEvent) {
+ table.setVisibleColumns(new Object[] { "name", "descr" });
+ table.setColumnWidth("descr", NEW_COLUMN_WIDTH);
+ }
+ });
+ buttonChangeColumnCountAndWidth
+ .setId(BUTTON_CHANGE_COLUMN_COUNT_AND_WIDTH);
+
+ layout.addComponent(buttonChangeOrderAndWidth);
+ layout.addComponent(buttonChangeColumnCountAndWidth);
+
+ addComponents(layout);
+ }
+
+ public class TestBean {
+ private int id;
+ private String name;
+ private String descr;
+
+ public TestBean(int id, String name, String descr) {
+ this.id = id;
+ this.name = name;
+ this.descr = descr;
+ }
+
+ public int getId() {
+ return id;
+ }
+
+ public void setId(int id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getDescr() {
+ return descr;
+ }
+
+ public void setDescr(String descr) {
+ this.descr = descr;
+ }
+
+ @Override
+ public String toString() {
+ return "TestBean{" + "id=" + id + ", name='" + name + '\''
+ + ", descr='" + descr + '\'' + '}';
+ }
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Tests that properties of columns are changed correctly after changing column's order/count";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9781;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrderTest.java b/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrderTest.java
new file mode 100644
index 0000000000..970b832e0c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/ColumnWidthsAfterChangeTableColumnsCountOrOrderTest.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.table;
+
+import static com.vaadin.tests.components.table.ColumnWidthsAfterChangeTableColumnsCountOrOrder.BUTTON_CHANGE_COLUMN_COUNT_AND_WIDTH;
+import static com.vaadin.tests.components.table.ColumnWidthsAfterChangeTableColumnsCountOrOrder.BUTTON_CHANGE_ORDER_AND_WIDTH_ID;
+import static com.vaadin.tests.components.table.ColumnWidthsAfterChangeTableColumnsCountOrOrder.NEW_COLUMN_WIDTH;
+import static org.junit.Assert.assertEquals;
+
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class ColumnWidthsAfterChangeTableColumnsCountOrOrderTest extends
+ MultiBrowserTest {
+
+ @Test
+ public void testColumnWidthAfterChangeTableColumnsOrder() {
+ openTestURL();
+
+ getButtonChangeOrderAndWidth().click();
+
+ waitForElementPresent(By.className("v-table"));
+
+ assertEquals("The width of descr column should be " + NEW_COLUMN_WIDTH,
+ NEW_COLUMN_WIDTH, getDescriptionColumnWidth());
+ }
+
+ @Test
+ public void testColumnWidthAfterChangeTableColumnsCount() {
+ openTestURL();
+
+ getButtonChangeColumnCountAndWidth().click();
+
+ waitForElementPresent(By.className("v-table"));
+
+ assertEquals("The width of descr column should be " + NEW_COLUMN_WIDTH,
+ NEW_COLUMN_WIDTH, getDescriptionColumnWidth());
+ }
+
+ private WebElement getButtonChangeOrderAndWidth() {
+ return vaadinElementById(BUTTON_CHANGE_ORDER_AND_WIDTH_ID);
+ }
+
+ private WebElement getButtonChangeColumnCountAndWidth() {
+ return vaadinElementById(BUTTON_CHANGE_COLUMN_COUNT_AND_WIDTH);
+ }
+
+ private int getDescriptionColumnWidth() {
+ return driver
+ .findElement(
+ By.xpath("//div[@class='v-table-cell-wrapper'"
+ + " and text() = 'descr1']")).getSize()
+ .getWidth();
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewport.java b/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewport.java
index 5a406eac48..3bd17c163c 100644
--- a/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewport.java
+++ b/uitest/src/com/vaadin/tests/components/table/SelectAllConstantViewport.java
@@ -72,6 +72,8 @@ public class SelectAllConstantViewport extends AbstractTestUIWithLog {
layout.addComponent(table);
layout.setSizeFull();
addComponent(layout);
+ getContent().setSizeFull();
+ getLayout().setSizeFull();
}
/*
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicator.java b/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicator.java
new file mode 100644
index 0000000000..2985932145
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicator.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.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.Notification;
+import com.vaadin.ui.Table;
+
+public class TableRequiredIndicator extends AbstractTestUI {
+
+ static final String TABLE = "table";
+ static final String COUNT_SELECTED_BUTTON = "button";
+ static final int TOTAL_NUMBER_OF_ROWS = 300;
+ static final String COUNT_OF_SELECTED_ROWS_LABEL = "label";
+
+ @Override
+ protected void setup(VaadinRequest request) {
+
+ final Table table = new Table();
+ table.setId(TABLE);
+ table.setSelectable(true);
+ table.addContainerProperty("row", String.class, null);
+ for (int i = 0; i < TOTAL_NUMBER_OF_ROWS; i++) {
+ Object itemId = table.addItem();
+ table.getContainerProperty(itemId, "row").setValue("row " + i);
+ }
+ addComponent(table);
+
+ // This should cause red asterisk to the vertical layout
+ table.setRequired(true);
+
+ table.addValueChangeListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ Object value = table.getValue();
+ if (value != null) {
+ Notification.show("Value is set.");
+ } else {
+ Notification.show("Value is NOT set.");
+ }
+
+ }
+ });
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Table is required and should have red asterisk to indicate that.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 13008;
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicatorTest.java b/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicatorTest.java
new file mode 100644
index 0000000000..b94ddaee45
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableRequiredIndicatorTest.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.table;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Checks that Table that has required flag set to true is also indicated as
+ * such on the client side.
+ *
+ * @author Vaadin Ltd
+ */
+public class TableRequiredIndicatorTest extends MultiBrowserTest {
+
+ @Test
+ public void testRequiredIndicatorIsVisible() {
+ openTestURL();
+ Assert.assertTrue(isElementPresent(By
+ .className("v-required-field-indicator")));
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibility.java b/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibility.java
new file mode 100644
index 0000000000..e78f247184
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibility.java
@@ -0,0 +1,96 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.ClassResource;
+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.VerticalLayout;
+
+/**
+ * Test that toggling column visibility does not change custom header, icon,
+ * alignment
+ */
+@SuppressWarnings("serial")
+public class TableToggleColumnVisibility extends AbstractTestUI {
+
+ private final Object[][] columnSets = new Object[][] { { "Name" },
+ { "Name", "Last Name" }, { "Last Name", "Name" } };
+ private int currentSetNumber = 1;
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ VerticalLayout layout = new VerticalLayout();
+
+ final Table table = new Table();
+
+ table.addContainerProperty("Name", String.class, "");
+ table.addContainerProperty("Last Name", String.class, null,
+ "Hello World", new ClassResource("fi.gif"), Table.Align.RIGHT);
+
+ table.setHeight("200px");
+
+ table.addItem(new Object[] { "Muoso", "Virtanen" }, new Integer(1));
+ table.addItem(new Object[] { "Nehemias", "Korhonen" }, new Integer(2));
+ table.addItem(new Object[] { "Hannu", "Nieminen" }, new Integer(3));
+ table.addItem(new Object[] { "Eelante", "Mäkinen" }, new Integer(4));
+ table.setVisibleColumns(columnSets[1]);
+
+ final Button visibToggler = new Button("visibility");
+ visibToggler.setId("visib-toggler");
+ visibToggler.addClickListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ currentSetNumber = (currentSetNumber == 0) ? 1 : 0;
+ table.setVisibleColumns(columnSets[currentSetNumber]);
+ }
+ });
+
+ final Button orderToggler = new Button("change order");
+ orderToggler.setId("order-toggler");
+ orderToggler.addClickListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ currentSetNumber = (currentSetNumber == 1) ? 2 : 1;
+ table.setVisibleColumns(columnSets[currentSetNumber]);
+ }
+ });
+
+ layout.addComponent(table);
+ layout.addComponent(visibToggler);
+ layout.addComponent(orderToggler);
+
+ addComponent(layout);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Toggling visibility of column should not change custom header,"
+ + " icon, alignment";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 6245;
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibilityTest.java b/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibilityTest.java
new file mode 100644
index 0000000000..4c44dcfed8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/table/TableToggleColumnVisibilityTest.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.components.table;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebElement;
+
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+/**
+ * Tests that column keeps its header, icon, alignment after toggling visibility
+ * (#6245).
+ *
+ * @author Vaadin Ltd
+ */
+public class TableToggleColumnVisibilityTest extends MultiBrowserTest {
+
+ @Test
+ public void testColumnWidthRestoredAfterTogglingVisibility() {
+ openTestURL();
+
+ WebElement toggleVisibilityButton = findElement(By.id("visib-toggler"));
+ WebElement changeOrderButton = findElement(By.id("order-toggler"));
+
+ checkHeaderAttributes(1);
+
+ toggleVisibilityButton.click(); // hide column #1
+ Assert.assertEquals("One column should be visible",
+ findElements(By.className("v-table-header-cell")).size(), 1);
+
+ toggleVisibilityButton.click(); // restore column #1
+ Assert.assertEquals("Two columns should be visible",
+ findElements(By.className("v-table-header-cell")).size(), 2);
+ checkHeaderAttributes(1);
+
+ changeOrderButton.click(); // change column order, column #1 now becomes
+ // column #0
+ checkHeaderAttributes(0);
+
+ }
+
+ /*
+ * Checks column header with number columnNumber.
+ */
+ private void checkHeaderAttributes(int columnNumber) {
+ WebElement headerCell = findElements(
+ By.className("v-table-header-cell")).get(columnNumber);
+
+ Assert.assertTrue("Column header text should be custom", headerCell
+ .getText().equalsIgnoreCase("Hello World"));
+
+ Assert.assertTrue("Column should have an icon", headerCell
+ .findElements(By.className("v-icon")).size() > 0);
+
+ Assert.assertTrue(
+ "Column should have alignment to the right",
+ headerCell.findElements(
+ By.className("v-table-caption-container-align-right"))
+ .size() > 0);
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java
new file mode 100644
index 0000000000..339160e6ff
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListener.java
@@ -0,0 +1,32 @@
+package com.vaadin.tests.components.textfield;
+
+import com.vaadin.event.FieldEvents;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.ui.TextField;
+
+public class RemoveTextChangeListener extends AbstractTestUI {
+ @Override
+ protected void setup(VaadinRequest request) {
+ final TextField textfield = new TextField();
+
+ textfield.addTextChangeListener(new FieldEvents.TextChangeListener() {
+ @Override
+ public void textChange(FieldEvents.TextChangeEvent event) {
+ textfield.removeTextChangeListener(this);
+ }
+ });
+
+ addComponent(textfield);
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 16270;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Removing text change listener on text change event should not reset the input.";
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java
new file mode 100644
index 0000000000..0b876864bc
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/components/textfield/RemoveTextChangeListenerTest.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.components.textfield;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.junit.Test;
+
+import com.vaadin.testbench.elements.TextFieldElement;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+
+public class RemoveTextChangeListenerTest extends MultiBrowserTest {
+
+ @Test
+ public void serverValueIsUpdated() {
+ openTestURL();
+
+ TextFieldElement textfield = $(TextFieldElement.class).first();
+
+ textfield.sendKeys("f");
+
+ assertThat(textfield.getValue(), is("f"));
+ }
+
+} \ No newline at end of file
diff --git a/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.java
new file mode 100644
index 0000000000..d67b01c71c
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplay.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.serialization;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.AbstractExtension;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUIWithLog;
+import com.vaadin.tests.widgetset.TestingWidgetSet;
+import com.vaadin.tests.widgetset.client.EncoderResultDisplayConnector;
+import com.vaadin.tests.widgetset.client.EncoderResultDisplayConnector.ReportRpc;
+
+@Widgetset(TestingWidgetSet.NAME)
+public class EncodeResultDisplay extends AbstractTestUIWithLog {
+
+ public static class EncoderResultDisplayExtension extends AbstractExtension {
+ public EncoderResultDisplayExtension(EncoderResultDisplayConnector.ReportRpc rpc) {
+ registerRpc(rpc);
+ }
+
+ public void extend(EncodeResultDisplay target) {
+ super.extend(target);
+ }
+ }
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ log.setNumberLogRows(false);
+ new EncoderResultDisplayExtension(new ReportRpc() {
+ @Override
+ public void report(String name, String encodedValue) {
+ log(name + ": " + encodedValue);
+ }
+ }).extend(this);
+ }
+
+ @Override
+ protected int getLogSize() {
+ return 15;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplayTest.java b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplayTest.java
new file mode 100644
index 0000000000..662a033745
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/serialization/EncodeResultDisplayTest.java
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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.serialization;
+
+import org.junit.Assert;
+import org.junit.Test;
+
+import com.vaadin.tests.tb3.SingleBrowserTest;
+
+public class EncodeResultDisplayTest extends SingleBrowserTest {
+ @Test
+ public void testEncodeResults() {
+ openTestURL();
+
+ int logRow = 0;
+
+ Assert.assertEquals("Void: null", getLogRow(logRow++));
+ Assert.assertEquals("SimpleTestBean: {\"value\":5}",
+ getLogRow(logRow++));
+ Assert.assertEquals("List: [\"Three\",\"Four\"]", getLogRow(logRow++));
+ Assert.assertEquals("String[]: [\"One\",\"Two\"]", getLogRow(logRow++));
+ Assert.assertEquals("Double: 2.2", getLogRow(logRow++));
+ // PhantomJS likes to add a couple of extra decimals
+ Assert.assertTrue(getLogRow(logRow++).startsWith("Float: 1.1"));
+ Assert.assertEquals("Long: 2147483648", getLogRow(logRow++));
+ Assert.assertEquals("Integer: 3", getLogRow(logRow++));
+ Assert.assertEquals("Byte: 1", getLogRow(logRow++));
+ Assert.assertEquals("Character: \"v\"", getLogRow(logRow++));
+ Assert.assertEquals("String: \"My string\"", getLogRow(logRow++));
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
index 7b77aaf817..2e33cc2741 100644
--- a/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
+++ b/uitest/src/com/vaadin/tests/tb3/AbstractTB3Test.java
@@ -1032,10 +1032,37 @@ public abstract class AbstractTB3Test extends ParallelTest {
*/
protected void selectMenuPath(String... menuCaptions) {
selectMenu(menuCaptions[0], true);
+
+ // Move to the menu item opened below the menu bar.
+ new Actions(getDriver()).moveByOffset(0,
+ getMenuElement(menuCaptions[0]).getSize().getHeight())
+ .perform();
+
for (int i = 1; i < menuCaptions.length - 1; i++) {
selectMenu(menuCaptions[i]);
new Actions(getDriver()).moveByOffset(40, 0).build().perform();
}
selectMenu(menuCaptions[menuCaptions.length - 1], true);
}
+
+ /**
+ * Asserts that an element is present
+ *
+ * @param by
+ * the locatore for the element
+ */
+ protected void assertElementPresent(By by) {
+ Assert.assertTrue("Element is not present", isElementPresent(by));
+ }
+
+ /**
+ * Asserts that an element is not present
+ *
+ * @param by
+ * the locatore for the element
+ */
+ protected void assertElementNotPresent(By by) {
+ Assert.assertFalse("Element is present", isElementPresent(by));
+ }
+
}
diff --git a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
index 61b7ef4dde..1c0542b209 100644
--- a/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
+++ b/uitest/src/com/vaadin/tests/tb3/PrivateTB3Configuration.java
@@ -57,6 +57,7 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
private static final File propertiesFile = new File("work",
"eclipse-run-selected-test.properties");
private static final String FIREFOX_PATH = "firefox.path";
+ private static final String PHANTOMJS_PATH = "phantomjs.binary.path";
static {
if (propertiesFile.exists()) {
@@ -74,6 +75,10 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
System.setProperty(FIREFOX_PATH,
properties.getProperty(FIREFOX_PATH));
}
+ if (properties.containsKey(PHANTOMJS_PATH)) {
+ System.setProperty(PHANTOMJS_PATH,
+ properties.getProperty(PHANTOMJS_PATH));
+ }
} catch (IOException e) {
throw new RuntimeException(e);
}
@@ -136,6 +141,9 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@Override
protected String getBaseURL() {
+ if (isRunLocally()) {
+ return "http://localhost:8888";
+ }
String url = getProperty(DEPLOYMENT_PROPERTY);
if (url == null || url.trim().isEmpty()) {
return super.getBaseURL();
@@ -145,12 +153,26 @@ public abstract class PrivateTB3Configuration extends ScreenshotTB3Test {
@Override
protected String getDeploymentHostname() {
- if (getRunLocallyBrowser() != null) {
+ if (isRunLocally()) {
return "localhost";
}
return getConfiguredDeploymentHostname();
}
+ private boolean isRunLocally() {
+ if (properties.containsKey(RUN_LOCALLY_PROPERTY)) {
+ return true;
+ }
+
+ if (properties.containsKey(ALLOW_RUN_LOCALLY_PROPERTY)
+ && properties.get(ALLOW_RUN_LOCALLY_PROPERTY).equals("true")
+ && getClass().getAnnotation(RunLocally.class) != null) {
+ return true;
+ }
+
+ return false;
+ }
+
/**
* Gets the hostname that tests are configured to use.
*
diff --git a/uitest/src/com/vaadin/tests/tb3/SingleBrowserTestPhantomJS2.java b/uitest/src/com/vaadin/tests/tb3/SingleBrowserTestPhantomJS2.java
index a5afe3afce..9f4e5938e7 100644
--- a/uitest/src/com/vaadin/tests/tb3/SingleBrowserTestPhantomJS2.java
+++ b/uitest/src/com/vaadin/tests/tb3/SingleBrowserTestPhantomJS2.java
@@ -28,6 +28,7 @@ public abstract class SingleBrowserTestPhantomJS2 extends
public List<DesiredCapabilities> getBrowsersToTest() {
DesiredCapabilities p2 = Browser.PHANTOMJS.getDesiredCapabilities();
p2.setVersion("2");
+ p2.setCapability("phantomjs.binary.path", "/usr/bin/phantomjs2");
return Collections.singletonList(p2);
}
}
diff --git a/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java b/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java
index c79447bd86..9a889b3bda 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/CheckBoxes.java
@@ -84,6 +84,11 @@ public class CheckBoxes extends VerticalLayout implements View {
check.setIcon(testIcon.get());
row.addComponent(check);
+ check = new CheckBox("Readonly", true);
+ check.setReadOnly(true);
+ check.setIcon(testIcon.get());
+ row.addComponent(check);
+
h1 = new Label("Option Groups");
h1.addStyleName("h1");
addComponent(h1);
diff --git a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java
index 3ab224f105..4ed7e33e13 100644
--- a/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java
+++ b/uitest/src/com/vaadin/tests/themes/valo/ValoThemeUITest.java
@@ -86,7 +86,7 @@ public class ValoThemeUITest extends MultiBrowserTest {
public void checkboxes() throws Exception {
openTestURL("test");
open("Check Boxes & Option Groups", "Check Boxes");
- compareScreen("checkboxes_with_disabled");
+ compareScreen("checkboxes_with_readonly");
}
@Test
diff --git a/uitest/src/com/vaadin/tests/util/WidgetUtilTest.java b/uitest/src/com/vaadin/tests/util/WidgetUtilTest.java
new file mode 100644
index 0000000000..2af015b406
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/util/WidgetUtilTest.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.util;
+
+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.remote.DesiredCapabilities;
+
+import com.vaadin.testbench.parallel.Browser;
+import com.vaadin.testbench.parallel.BrowserUtil;
+import com.vaadin.tests.tb3.MultiBrowserTest;
+import com.vaadin.tests.widgetset.server.WidgetUtilUI;
+
+public class WidgetUtilTest extends MultiBrowserTest {
+
+ @Override
+ public List<DesiredCapabilities> getBrowsersToTest() {
+ List<DesiredCapabilities> l = super.getBrowsersToTest();
+ // IE8 does not support getComputedStyle
+ l.remove(Browser.IE8.getDesiredCapabilities());
+ return l;
+ }
+
+ @Test
+ public void testBlockElementRequiredSizeComputedStyle() {
+ openTestURL();
+ WebElement testComponent = findElement(By
+ .className("v-widget-util-test"));
+ testComponent.click();
+
+ int padding = (int) Math.ceil(2.4 + 3.5);
+ int border = (int) Math.ceil(1.8 * 2);
+ int baseWidth = 300;
+ int baseHeight = 50;
+
+ if (BrowserUtil.isPhantomJS(getDesiredCapabilities())
+ && getDesiredCapabilities().getVersion().equals("1")) {
+ // PhantomJS1 rounds padding to integers
+ padding = 2 + 3;
+ }
+
+ if (browserRoundsBorderToInteger(getDesiredCapabilities())) {
+ border = 1 * 2;
+ }
+
+ assertExpectedSize(testComponent, "noBorderPadding", baseWidth + "x"
+ + baseHeight);
+
+ assertExpectedSize(testComponent, "border", (baseWidth + border) + "x"
+ + (baseHeight + border));
+
+ assertExpectedSize(testComponent, "padding", (baseWidth + padding)
+ + "x" + (baseHeight + padding));
+
+ assertExpectedSize(testComponent, "borderPadding",
+ (baseWidth + border + padding) + "x"
+ + (baseHeight + border + padding));
+
+ }
+
+ private void assertExpectedSize(WebElement testComponent, String id,
+ String size) {
+ WebElement e = testComponent.findElement(By.id(id));
+ Assert.assertEquals(id + ": " + size, e.getText());
+ }
+
+ private boolean browserRoundsBorderToInteger(
+ DesiredCapabilities capabilities) {
+ // Note that this is how the Windows browsers in the test cluster work.
+ // On Mac, Firefox works slightly differently (rounds border to 1.5px).
+ return (BrowserUtil.isChrome(capabilities)
+ || BrowserUtil.isPhantomJS(capabilities) || BrowserUtil
+ .isFirefox(capabilities));
+ }
+
+ @Override
+ protected Class<?> getUIClass() {
+ return WidgetUtilUI.class;
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/EncoderResultDisplayConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/EncoderResultDisplayConnector.java
new file mode 100644
index 0000000000..f2e9710404
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/EncoderResultDisplayConnector.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.widgetset.client;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.client.ServerConnector;
+import com.vaadin.client.communication.JsonEncoder;
+import com.vaadin.client.extensions.AbstractExtensionConnector;
+import com.vaadin.client.metadata.Type;
+import com.vaadin.client.metadata.TypeData;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.tests.serialization.EncodeResultDisplay.EncoderResultDisplayExtension;
+
+import elemental.json.JsonValue;
+
+@Connect(EncoderResultDisplayExtension.class)
+public class EncoderResultDisplayConnector extends AbstractExtensionConnector {
+
+ private ReportRpc reporter;
+
+ public interface ReportRpc extends ServerRpc {
+ public void report(String name, String encodedValue);
+ }
+
+ @Override
+ protected void extend(ServerConnector target) {
+ reporter = getRpcProxy(ReportRpc.class);
+
+ reportEncode("My string");
+ reportEncode(Character.valueOf('v'));
+ reportEncode(Byte.valueOf((byte) 1));
+ reportEncode(Integer.valueOf(3));
+ reportEncode(Long.valueOf(Integer.MAX_VALUE + 1l));
+ reportEncode(Float.valueOf((float) 1.1));
+ reportEncode(Double.valueOf("2.2"));
+
+ reportEncode(new String[] { "One", "Two" });
+ reportEncode(
+ "List",
+ Arrays.asList("Three", "Four"),
+ new Type(List.class.getName(), new Type[] { TypeData
+ .getType(String.class) }));
+ reportEncode(new SimpleTestBean(5));
+
+ reportEncode(Void.class.getSimpleName(), null,
+ TypeData.getType(Void.class));
+ }
+
+ private void reportEncode(Object value) {
+ Type type = TypeData.getType(value.getClass());
+ reportEncode(value.getClass().getSimpleName(), value, type);
+ }
+
+ private void reportEncode(String name, Object value, Type type) {
+ JsonValue encodedValue = JsonEncoder.encode(value, type,
+ getConnection());
+ reporter.report(name, encodedValue.toJson());
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/ScrollableGridLayoutConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/ScrollableGridLayoutConnector.java
new file mode 100644
index 0000000000..d6431ac9f9
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/ScrollableGridLayoutConnector.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 com.vaadin.client.ConnectorHierarchyChangeEvent;
+import com.vaadin.client.ui.VGridLayout;
+import com.vaadin.client.ui.gridlayout.GridLayoutConnector;
+import com.vaadin.client.ui.layout.MayScrollChildren;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.tests.widgetset.server.ScrollableGridLayout;
+
+@Connect(ScrollableGridLayout.class)
+public class ScrollableGridLayoutConnector extends GridLayoutConnector
+ implements MayScrollChildren {
+ @Override
+ public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
+ super.onConnectorHierarchyChange(event);
+
+ for (VGridLayout.Cell cell : getWidget().widgetToCell.values()) {
+ cell.slot.getWrapperElement().addClassName("v-scrollable");
+ }
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestComponentState.java b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestComponentState.java
new file mode 100644
index 0000000000..aa946d4ceb
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestComponentState.java
@@ -0,0 +1,7 @@
+package com.vaadin.tests.widgetset.client;
+
+import com.vaadin.shared.AbstractComponentState;
+
+public class WidgetUtilTestComponentState extends AbstractComponentState {
+ public boolean inline = false;
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestConnector.java
new file mode 100644
index 0000000000..2776f698fe
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestConnector.java
@@ -0,0 +1,43 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 com.vaadin.client.communication.StateChangeEvent;
+import com.vaadin.client.ui.AbstractComponentConnector;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.tests.widgetset.server.WidgetUtilUI.WidgetUtilTestComponent;
+
+@Connect(WidgetUtilTestComponent.class)
+public class WidgetUtilTestConnector extends AbstractComponentConnector {
+
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
+ getWidget().construct(getState().inline);
+
+ }
+
+ @Override
+ public WidgetUtilTestWidget getWidget() {
+ return (WidgetUtilTestWidget) super.getWidget();
+ }
+
+ @Override
+ public WidgetUtilTestComponentState getState() {
+ return (WidgetUtilTestComponentState) super.getState();
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestWidget.java b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestWidget.java
new file mode 100644
index 0000000000..6ff0f2433e
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/WidgetUtilTestWidget.java
@@ -0,0 +1,140 @@
+/*
+ * Copyright 2000-2014 Vaadin Ltd.
+ *
+ * Licensed under the Apache 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 com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.Style;
+import com.google.gwt.dom.client.Style.BorderStyle;
+import com.google.gwt.dom.client.Style.Unit;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.client.WidgetUtil;
+
+public class WidgetUtilTestWidget extends Widget {
+
+ private Element noBorderPadding;
+ private Element border;
+ private Element padding;
+ private Element borderPadding;
+ private DivElement result;
+ private boolean inline;
+ private DivElement root;
+
+ public WidgetUtilTestWidget() {
+ Document doc = Document.get();
+
+ root = doc.createDivElement();
+ root.addClassName("v-widget-util-test");
+ setElement(root);
+
+ addDomHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ showSizes();
+ }
+ }, ClickEvent.getType());
+ }
+
+ public void construct(boolean inline) {
+ this.inline = inline;
+
+ noBorderPadding = createElement();
+
+ border = createElement();
+ setBorder(border);
+
+ padding = createElement();
+ setPadding(padding);
+
+ borderPadding = createElement();
+ setBorder(borderPadding);
+ setPadding(borderPadding);
+
+ root.appendChild(noBorderPadding);
+ root.appendChild(border);
+ root.appendChild(padding);
+ root.appendChild(borderPadding);
+
+ result = Document.get().createDivElement();
+ result.addClassName("result");
+ result.getStyle().setWidth(500, Unit.PX);
+ root.appendChild(result);
+ }
+
+ private void setBorder(Element e) {
+ Style borderStyle = e.getStyle();
+ borderStyle.setBorderStyle(BorderStyle.SOLID);
+ borderStyle.setBorderWidth(1.8, Unit.PX);
+ }
+
+ private void setPadding(Element e) {
+ Style borderStyle = e.getStyle();
+ borderStyle.setPaddingLeft(2.4, Unit.PX);
+ borderStyle.setPaddingRight(3.5, Unit.PX);
+ borderStyle.setPaddingTop(2.4, Unit.PX);
+ borderStyle.setPaddingBottom(3.5, Unit.PX);
+ }
+
+ private Element createElement() {
+ Element e;
+ if (inline) {
+ e = Document.get().createSpanElement();
+ e.getStyle().setBackgroundColor("green");
+ } else {
+ e = Document.get().createDivElement();
+ e.getStyle().setWidth(300, Unit.PX);
+ e.getStyle().setHeight(50, Unit.PX);
+ e.getStyle().setBackgroundColor("blue");
+ }
+ e.getStyle().setMargin(3.7, Unit.PX);
+ return e;
+ }
+
+ public void showSizes() {
+ String sizes = "Measured required width x height<br/>";
+
+ sizes += "<div id='noBorderPadding'>noBorderPadding: "
+ + WidgetUtil.getRequiredWidthComputedStyle(noBorderPadding);
+ sizes += "x"
+ + WidgetUtil.getRequiredHeightComputedStyle(noBorderPadding)
+ + "</div>";
+ sizes += "<div id='border'>border: "
+ + WidgetUtil.getRequiredWidthComputedStyle(border);
+ sizes += "x" + WidgetUtil.getRequiredHeightComputedStyle(border);
+ sizes += "</div>";
+
+ sizes += "<div id='padding'>padding: "
+ + WidgetUtil.getRequiredWidthComputedStyle(padding);
+ sizes += "x" + WidgetUtil.getRequiredHeightComputedStyle(padding);
+ sizes += "</div>";
+
+ sizes += "<div id='borderPadding'>borderPadding: "
+ + WidgetUtil.getRequiredWidthComputedStyle(borderPadding);
+ sizes += "x" + WidgetUtil.getRequiredHeightComputedStyle(borderPadding)
+ + "</div>";
+
+ result.setInnerHTML(sizes);
+
+ if (inline) {
+ result.getStyle().setPaddingTop(200, Unit.PX);
+ }
+
+ }
+
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/client/grid/PojoRendererConnector.java b/uitest/src/com/vaadin/tests/widgetset/client/grid/PojoRendererConnector.java
new file mode 100644
index 0000000000..04dd08d274
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/client/grid/PojoRendererConnector.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.widgetset.client.grid;
+
+import com.vaadin.client.connectors.AbstractRendererConnector;
+import com.vaadin.client.renderers.Renderer;
+import com.vaadin.client.widget.grid.RendererCellReference;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.tests.widgetset.client.SimpleTestBean;
+
+@Connect(com.vaadin.tests.components.grid.BeanRenderer.class)
+public class PojoRendererConnector extends
+ AbstractRendererConnector<SimpleTestBean> {
+
+ public static class BeanRenderer implements Renderer<SimpleTestBean> {
+ @Override
+ public void render(RendererCellReference cell, SimpleTestBean bean) {
+ cell.getElement().setInnerText(bean.toString());
+ }
+ }
+
+ @Override
+ public BeanRenderer getRenderer() {
+ return (BeanRenderer) super.getRenderer();
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/server/ScrollableGridLayout.java b/uitest/src/com/vaadin/tests/widgetset/server/ScrollableGridLayout.java
new file mode 100644
index 0000000000..6958172aa8
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/server/ScrollableGridLayout.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.tests.widgetset.server;
+
+import com.vaadin.ui.Component;
+import com.vaadin.ui.GridLayout;
+
+public class ScrollableGridLayout extends GridLayout {
+
+ public ScrollableGridLayout() {
+ super();
+ }
+
+ public ScrollableGridLayout(int columns, int rows, Component... children) {
+ super(columns, rows, children);
+ }
+
+ public ScrollableGridLayout(int columns, int rows) {
+ super(columns, rows);
+ }
+}
diff --git a/uitest/src/com/vaadin/tests/widgetset/server/WidgetUtilUI.java b/uitest/src/com/vaadin/tests/widgetset/server/WidgetUtilUI.java
new file mode 100644
index 0000000000..0489a8676f
--- /dev/null
+++ b/uitest/src/com/vaadin/tests/widgetset/server/WidgetUtilUI.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.widgetset.server;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.server.VaadinRequest;
+import com.vaadin.tests.components.AbstractTestUI;
+import com.vaadin.tests.widgetset.TestingWidgetSet;
+import com.vaadin.tests.widgetset.client.WidgetUtilTestComponentState;
+import com.vaadin.ui.AbstractComponent;
+
+@Widgetset(TestingWidgetSet.NAME)
+public class WidgetUtilUI extends AbstractTestUI {
+
+ public static class WidgetUtilTestComponent extends AbstractComponent {
+
+ public WidgetUtilTestComponent(boolean inline) {
+ getState().inline = inline;
+ }
+
+ @Override
+ protected WidgetUtilTestComponentState getState() {
+ return (WidgetUtilTestComponentState) super.getState();
+ }
+ }
+
+ @Override
+ protected void setup(VaadinRequest request) {
+ addComponent(new WidgetUtilTestComponent(
+ request.getParameter("inline") != null));
+ }
+}
diff --git a/uitest/tb2/com/vaadin/tests/components/FileDownloaderTest.html b/uitest/tb2/com/vaadin/tests/components/FileDownloaderTest.html
deleted file mode 100644
index bfe87091cc..0000000000
--- a/uitest/tb2/com/vaadin/tests/components/FileDownloaderTest.html
+++ /dev/null
@@ -1,36 +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/com.vaadin.tests.components.FileDownloaderTest?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::PID_Scom.vaadin.ui.ButtonDynamicimage/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::/VVerticalLayout[0]/VOrderedLayout$Slot[1]/VVerticalLayout[0]/VOrderedLayout$Slot[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementNotPresent</td>
- <td>vaadin=runcomvaadintestscomponentsFileDownloaderTest::PID_Scom.vaadin.ui.ButtonDynamicimage/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-</tbody></table>
-</body>
-</html>
diff --git a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.html b/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.html
deleted file mode 100644
index c4d9fb0b3f..0000000000
--- a/uitest/tb2/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.html
+++ /dev/null
@@ -1,59 +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>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.combobox.ComboBoxCombinedWithEnterShortcut?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[0]</td>
- <td>81,11</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[0]</td>
- <td>down</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[0]</td>
- <td>down</td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[0]</td>
- <td>enter</td>
-</tr>
-<!--Enter in the popup should not send a shortcut event-->
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::PID_SLog_row_0</td>
- <td></td>
-</tr>
-<tr>
- <td>pressSpecialKey</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VFilterSelect[0]/domChild[0]</td>
- <td>enter</td>
-</tr>
-<!--Enter again in the combobox SHOULD send a shortcut event-->
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboBoxCombinedWithEnterShortcut::PID_SLog_row_0</td>
- <td>1. Button clicked. ComboBox value: Berlin</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/widgets/build.xml b/widgets/build.xml
index 52888cc9c8..d796c7f159 100644
--- a/widgets/build.xml
+++ b/widgets/build.xml
@@ -33,7 +33,8 @@
<target name="copysrc" depends="dependencies">
<delete dir="${result.deps}" />
- <ivy:resolve transitive="false" type="jar" conf="build-provided" />
+ <ivy:resolve transitive="false" type="jar"
+ conf="build-provided" />
<ivy:cachepath pathid="vaadin.jars" />
<unjar dest="${result.deps}">
<path refid="vaadin.jars" />
@@ -48,6 +49,7 @@
<include name="com/vaadin/client/Profiler.java" />
<include name="com/vaadin/client/StyleConstants.java" />
<include name="com/vaadin/client/WidgetUtil.java" />
+ <include name="com/vaadin/client/FocusUtil.java" />
<include name="com/vaadin/client/data/**/*.java" />
<include name="com/vaadin/client/widget/**/*.java" />
<include name="com/vaadin/client/Focusable.java" />
@@ -62,8 +64,7 @@
<include name="com/vaadin/shared/ui/grid/**/*.java" />
<include name="com/vaadin/shared/util/SharedUtil.java" />
<include name="com/vaadin/shared/VBrowserDetails.java" />
- <include
- name="com/vaadin/shared/data/sort/SortDirection.java" />
+ <include name="com/vaadin/shared/data/sort/SortDirection.java" />
<include name="com/vaadin/sass/linker/*.java" />
@@ -109,7 +110,7 @@
<reference torefid="extra.jar.includes" refid="jar.includes" />
</antcall>
<antcall target="common.javadoc.jar">
- <param name="src" value="${result.src}" />
+ <param name="src" value="${result.src}" />
</antcall>
<antcall target="common.publish-local" />