summaryrefslogtreecommitdiffstats
path: root/tests/testbench/com/vaadin
diff options
context:
space:
mode:
Diffstat (limited to 'tests/testbench/com/vaadin')
-rw-r--r--tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java295
-rw-r--r--tests/testbench/com/vaadin/launcher/DemoLauncher.java2
-rw-r--r--tests/testbench/com/vaadin/tests/Components.java17
-rw-r--r--tests/testbench/com/vaadin/tests/CustomLayoutDemo.java24
-rw-r--r--tests/testbench/com/vaadin/tests/FocusingComponents.java1
-rw-r--r--tests/testbench/com/vaadin/tests/LayoutDemo.java25
-rw-r--r--tests/testbench/com/vaadin/tests/ListenerOrder.java22
-rw-r--r--tests/testbench/com/vaadin/tests/ModalWindow.java8
-rw-r--r--tests/testbench/com/vaadin/tests/NativeWindowing.java18
-rw-r--r--tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java2
-rw-r--r--tests/testbench/com/vaadin/tests/Parameters.java42
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java3
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java5
-rw-r--r--tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java18
-rw-r--r--tests/testbench/com/vaadin/tests/RandomLayoutStress.java7
-rw-r--r--tests/testbench/com/vaadin/tests/ScrollbarStressTest.java6
-rw-r--r--tests/testbench/com/vaadin/tests/StressComponentsInTable.java1
-rw-r--r--tests/testbench/com/vaadin/tests/TableChangingDatasource.java1
-rw-r--r--tests/testbench/com/vaadin/tests/TableSelectTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/TestBench.java24
-rw-r--r--tests/testbench/com/vaadin/tests/TestCaptionWrapper.java4
-rw-r--r--tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java32
-rw-r--r--tests/testbench/com/vaadin/tests/TestContainerChanges.java10
-rw-r--r--tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java6
-rw-r--r--tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java2
-rw-r--r--tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java24
-rw-r--r--tests/testbench/com/vaadin/tests/TestForContainerFilterable.java10
-rw-r--r--tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java24
-rw-r--r--tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java1
-rw-r--r--tests/testbench/com/vaadin/tests/TestForNativeWindowing.java18
-rw-r--r--tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java12
-rw-r--r--tests/testbench/com/vaadin/tests/TestForRichTextEditor.java12
-rw-r--r--tests/testbench/com/vaadin/tests/TestForStyledUpload.java45
-rw-r--r--tests/testbench/com/vaadin/tests/TestForTabSheet.java2
-rw-r--r--tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java8
-rw-r--r--tests/testbench/com/vaadin/tests/TestForTrees.java12
-rw-r--r--tests/testbench/com/vaadin/tests/TestForUpload.java41
-rw-r--r--tests/testbench/com/vaadin/tests/TestForWindowOpen.java11
-rw-r--r--tests/testbench/com/vaadin/tests/TestForWindowing.java5
-rw-r--r--tests/testbench/com/vaadin/tests/TestIFrames.java3
-rw-r--r--tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java9
-rw-r--r--tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java11
-rw-r--r--tests/testbench/com/vaadin/tests/TestSplitPanel.java6
-rw-r--r--tests/testbench/com/vaadin/tests/TreeFilesystem.java14
-rw-r--r--tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java11
-rw-r--r--tests/testbench/com/vaadin/tests/UpgradingSample.java26
-rw-r--r--tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java1
-rw-r--r--tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java12
-rw-r--r--tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java20
-rw-r--r--tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java6
-rw-r--r--tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java22
-rw-r--r--tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.html122
-rw-r--r--tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.java74
-rw-r--r--tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html52
-rw-r--r--tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java39
-rw-r--r--tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java11
-rw-r--r--tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html111
-rw-r--r--tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java114
-rw-r--r--tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/application/WebBrowserTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java6
-rw-r--r--tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java6
-rw-r--r--tests/testbench/com/vaadin/tests/browserfeatures/FullHeightScrollbar.html (renamed from tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html)21
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java29
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java77
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java19
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestCase.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java69
-rw-r--r--tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html456
-rw-r--r--tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java83
-rw-r--r--tests/testbench/com/vaadin/tests/components/ComponentTestCase.java18
-rw-r--r--tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/DisableEnableCascade.html86
-rw-r--r--tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java93
-rw-r--r--tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.html250
-rw-r--r--tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java146
-rw-r--r--tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java14
-rw-r--r--tests/testbench/com/vaadin/tests/components/LongTooltip.html33
-rw-r--r--tests/testbench/com/vaadin/tests/components/TestBase.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/TouchScrollables.java19
-rw-r--r--tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java50
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java37
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html92
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java100
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java119
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java68
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java35
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java31
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java65
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java60
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html12
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java53
-rw-r--r--tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java39
-rw-r--r--tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html9
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonTabIndex.java53
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonUndefinedWidth.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/Buttons.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/Buttons2.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java32
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java13
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.html21
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java61
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.html31
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java63
-rw-r--r--tests/testbench/com/vaadin/tests/components/customcomponent/template.htm4
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java76
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AddressField.java97
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java46
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java46
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java88
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java67
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html82
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html82
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java96
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html96
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java145
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java26
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java18
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html34
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldDisabledReadonly.html8
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldMonth.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldPopup.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html81
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html49
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html20
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.html3
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html31
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormCaptionClickFocusing.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormDescription.java10
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormTest.java40
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java33
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java57
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/FormLayouts.java16
-rw-r--r--tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java115
-rw-r--r--tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponentConnector.js37
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelModes.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelTest.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelTooltip-chameleon.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelTooltip-runo.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelTooltip.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/LabelWrapping.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/Labels.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.html11
-rw-r--r--tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java50
-rw-r--r--tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/listselect/ListSelects.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/loginform/LoginFormTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java28
-rw-r--r--tests/testbench/com/vaadin/tests/components/media/Media.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarNavigation.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/menubar/MenuBarToolTips.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html8
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/nativeselect/NativeSelects.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/Notifications.java16
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html53
-rw-r--r--tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java31
-rw-r--r--tests/testbench/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.html5
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java142
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java37
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/BasicPanelTest.java88
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.html77
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java74
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelClickListenerRelativeCoordinates.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewShouldCloseOnTabOut.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.html73
-rw-r--r--tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java38
-rw-r--r--tests/testbench/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaTest.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java14
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html46
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java89
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootInitException.java23
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootInitTest.java27
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html47
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java36
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html27
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java28
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html36
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java26
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html77
-rw-r--r--tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java53
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/MultiSelect.java32
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/NativeSelects.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/NullSelectionItemId.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/StylingPopupOpener.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/select/TwinColSelectTest.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/slider/SliderTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java16
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelSplitterClick.html8
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java24
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSwapComponents.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java37
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html3
-rw-r--r--tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelSplitterClick.html8
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/AddItemToEmptyTable.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/CellStyleGeneratorTest.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java20
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnReorderEvent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ColumnResizeEvent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ContainerChangeWithPartlySamePropertyIds.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ContainerSizeChange.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java297
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java22
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/Footer.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/FooterClick.java30
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderClick.java39
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java25
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/KeyControl.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java54
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/MissingScrollbar.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ProgrammaticUnselectInRange.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java18
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/RowAdditionTest.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/RowGenerators.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java15
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SelectingItemScrollsRight.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.html192
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.java38
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/SortLongTable.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html128
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java30
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableContextMenuOnField.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java10
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java43
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java114
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java97
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableModifcationsWhenScrolledRight.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisibile.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisible.html3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableRowHeight.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.html2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableSorting.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithChildComponents.java68
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/Tables.java113
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TextFieldRelativeWidth.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/table/UncollapsedCollumnWidth.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/PreventTabChange.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/RemoveTabs.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDiscardsMovedComponents.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java32
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetMinimal.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetWithDisappearingContent.html5
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/tabsheet/WrapTabSheetInTabSheet.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/textarea/TextAreaNullRepresentation.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/textarea/TextAreaTest.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/textarea/Wordwrap.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java60
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/SetTabIndex.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents2.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java19
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java10
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldEagerRepaint.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java28
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentation.html4
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentationAndSelection.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html196
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java39
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithProperty.java14
-rw-r--r--tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java30
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/CtrlShiftMultiselect.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/ExpandCollapseTree.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/ItemStyleGenerator.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeContainerChange.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeDragAndDropFromTable.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java12
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeItemClickListening.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java9
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeToolTips.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/TreeWithPreselectedItemNotShown.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/tree/Trees.java16
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/DynamicallyModified.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java13
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticSelect.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableModifyAndSetCollapsed.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableNegativeArraySize.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/treetable/TreeTableTest.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/twincolselect/TwinColSelects.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/ForceSubmit.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/TestUpload.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/upload/TestUploadFilename.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html43
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java66
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java8
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java61
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/LongNotifications.java6
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html57
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java58
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html42
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java46
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowFocus.java3
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java17
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.html32
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java4
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.java11
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubWindows.java2
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/SubwindowDraggability.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.html69
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java41
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowCaptionTest.html6
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html19
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.java5
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java42
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java22
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java7
-rw-r--r--tests/testbench/com/vaadin/tests/components/window/WindowStyleNames.java3
-rw-r--r--tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java28
-rw-r--r--tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java4
-rw-r--r--tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java14
-rw-r--r--tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java8
-rw-r--r--tests/testbench/com/vaadin/tests/containers/TestItemSorter.java5
-rw-r--r--tests/testbench/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java5
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java18
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java6
-rw-r--r--tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java7
-rw-r--r--tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java47
-rw-r--r--tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java19
-rw-r--r--tests/testbench/com/vaadin/tests/dd/AcceptAnythingWindow.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/AcceptFromComponent.java5
-rw-r--r--tests/testbench/com/vaadin/tests/dd/ActiveDragSourceClassName.java16
-rw-r--r--tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java7
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest1.java5
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest2.java26
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest4.java8
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest5.java6
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest6.java22
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest7.java6
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DDTest8.java4
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java12
-rw-r--r--tests/testbench/com/vaadin/tests/dd/DragDropPane.java11
-rw-r--r--tests/testbench/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/HorizontalSortableCssLayoutWithWrappers.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/MyDragSourceConnector.java29
-rw-r--r--tests/testbench/com/vaadin/tests/dd/MyDropTargetConnector.java30
-rw-r--r--tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.html2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java3
-rw-r--r--tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSourceInTabSheet.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/ScrolledDropTarget.java5
-rw-r--r--tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java2
-rw-r--r--tests/testbench/com/vaadin/tests/dd/TreeDragStart.java10
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDragSource.java25
-rw-r--r--tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java29
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtension.java15
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html32
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java34
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java40
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java40
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.html47
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java51
-rw-r--r--tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java122
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java99
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java197
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html141
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html220
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html150
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java109
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html164
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java47
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java28
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java43
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java38
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java67
-rw-r--r--tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html101
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormManyToMany.java28
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormOneToMany.java43
-rw-r--r--tests/testbench/com/vaadin/tests/fields/FormOneToOne.java38
-rw-r--r--tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java42
-rw-r--r--tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java7
-rw-r--r--tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java45
-rw-r--r--tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java124
-rw-r--r--tests/testbench/com/vaadin/tests/integration/PortletConnectorResource.css3
-rw-r--r--tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java9
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java15
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.html3
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java8
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java91
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html9
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/DeepComponentTrees.java2
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java30
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java33
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java15
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutMoveComponent.java3
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutNPE.java2
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/GridLayoutWidthChange.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/LayoutPerformanceTests.java2
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html209
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/MovingInvisibleField.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java26
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java14
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java13
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java10
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java4
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java15
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java1
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html182
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java157
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java40
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java23
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html6
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java8
-rw-r--r--tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java40
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java77
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java28
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java31
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java33
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java31
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java63
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java80
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java50
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java98
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java60
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java67
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java56
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java51
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyConverterFactory.java17
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyStringToDoubleConverter.java18
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java113
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java74
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java56
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java52
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java26
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java27
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java48
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java36
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java63
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java52
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java30
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java32
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java49
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java45
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java37
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java27
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java27
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java53
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java19
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java18
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java62
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotClickRpc.java7
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java11
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java31
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotState.java18
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButton.java16
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java15
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/analytics_connector.js13
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js17
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/flot_connector.js31
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/jquery.flot.js2599
-rw-r--r--tests/testbench/com/vaadin/tests/minitutorials/v7a3/redbutton.css3
-rw-r--r--tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html66
-rw-r--r--tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java42
-rw-r--r--tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java1
-rw-r--r--tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java1
-rw-r--r--tests/testbench/com/vaadin/tests/resources/ResourceDownload.java6
-rw-r--r--tests/testbench/com/vaadin/tests/serialization/SerializerTest.html107
-rw-r--r--tests/testbench/com/vaadin/tests/serialization/SerializerTest.java292
-rw-r--r--tests/testbench/com/vaadin/tests/themes/ButtonsTest.java49
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1225.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1230.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket124.java12
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1245.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java275
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1365.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1368.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1397.java30
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1435.java15
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1444.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java24
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_Panel.java1
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java15
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java15
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1519.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1572.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1581.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1589.java28
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1598.java13
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket161.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1632.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1659.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1663.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1673.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1710.java28
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1737.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1767.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1772.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1775.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1804.java21
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1805.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1806.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1811.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1819.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1857.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1868.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1869.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1878.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1900.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1904.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1916.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1919.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1921.java35
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1923.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java51
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1925.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1939.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1940.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1953.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1969.java13
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1970.java33
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1972.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1973.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1975.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1982.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1983.java24
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1986.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1991.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket1995.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket20.java40
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2001.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2002.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2007.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2009.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2011.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2014.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2021.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2022.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2023.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2024.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2026.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2029.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2037.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2038.java12
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2040.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2042.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2043.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2048.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2051.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2053.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2060.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2062.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2083.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2090.java18
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2095.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2098.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2099.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2101.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2103.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2104.java22
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2106.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2107.java19
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2117.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2119.java25
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2125.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2126.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2151.java50
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2157.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2178.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2179.java16
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2180.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2181.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2186.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2204.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2208.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2215.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2221.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2222.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2231.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2232.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2234.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2235.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2240.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2242.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2244.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2245.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2267.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2271.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2279.java209
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2282.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2283.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2287.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2289.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2292.java28
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2294.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2296.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2297.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2303.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2304.java11
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2310.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2319.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2323.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2325.java5
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2329.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2337.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2339.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2341.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2344.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2347.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2364.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2365.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2398.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2404.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2405.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2406.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2407.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2411.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2415.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2420.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2425.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2426.java20
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2431.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2432.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2434.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2436.java9
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2440.java77
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2526.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2742.java8
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2901.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket2998.java33
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket3146.java10
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket34.java37
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5053.java6
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5157.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket5952.java36
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket6002.java15
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket677.java26
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket695.java7
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket736.java75
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket8291.java14
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket846.java27
-rw-r--r--tests/testbench/com/vaadin/tests/tickets/Ticket932.java9
-rw-r--r--tests/testbench/com/vaadin/tests/util/Address.java66
-rw-r--r--tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java23
-rw-r--r--tests/testbench/com/vaadin/tests/util/Log.java3
-rw-r--r--tests/testbench/com/vaadin/tests/util/Millionaire.java22
-rw-r--r--tests/testbench/com/vaadin/tests/util/Person.java56
-rw-r--r--tests/testbench/com/vaadin/tests/util/PersonContainer.java14
-rw-r--r--tests/testbench/com/vaadin/tests/util/Role.java37
-rw-r--r--tests/testbench/com/vaadin/tests/util/SampleDirectory.java10
-rw-r--r--tests/testbench/com/vaadin/tests/util/TestClickListener.java1
-rw-r--r--tests/testbench/com/vaadin/tests/util/TestUtils.java6
-rw-r--r--tests/testbench/com/vaadin/tests/util/User.java54
-rw-r--r--tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java16
-rw-r--r--tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java4
-rw-r--r--tests/testbench/com/vaadin/tests/validation/TestValidators.java11
-rw-r--r--tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html18
-rw-r--r--tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java4
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml6
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java27
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/ComplexTestBean.java70
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java26
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java245
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java64
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/SimpleTestBean.java38
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java12
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java49
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java10
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java18
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java20
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java38
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java9
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java58
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java10
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java17
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java16
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java38
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateState.java17
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java12
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java36
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java10
-rw-r--r--tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java22
893 files changed, 18399 insertions, 4597 deletions
diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
new file mode 100644
index 0000000000..b2148c8f08
--- /dev/null
+++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java
@@ -0,0 +1,295 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.launcher;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Collections;
+import java.util.LinkedHashSet;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.gwt.server.AbstractApplicationServlet;
+import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Root;
+
+@SuppressWarnings("serial")
+public class ApplicationRunnerServlet extends AbstractApplicationServlet {
+
+ /**
+ * Internal implementation of an application with a dynamically selected
+ * Root implementation;
+ */
+ private static class RootRunnerApplication extends Application {
+ private final Class<?> runnableClass;
+
+ private RootRunnerApplication(Class<?> runnableClass) {
+ this.runnableClass = runnableClass;
+ }
+
+ @Override
+ protected String getRootClassName(WrappedRequest request) {
+ return runnableClass.getCanonicalName();
+ }
+ }
+
+ /**
+ * The name of the application class currently used. Only valid within one
+ * request.
+ */
+ private LinkedHashSet<String> defaultPackages = new LinkedHashSet<String>();
+
+ private final ThreadLocal<HttpServletRequest> request = new ThreadLocal<HttpServletRequest>();
+
+ @Override
+ public void init(ServletConfig servletConfig) throws ServletException {
+ super.init(servletConfig);
+ String initParameter = servletConfig
+ .getInitParameter("defaultPackages");
+ if (initParameter != null) {
+ Collections.addAll(defaultPackages, initParameter.split(","));
+ }
+ String str = TestBase.class.getName().replace('.', '/') + ".class";
+ URL url = getDeploymentConfiguration().getClassLoader()
+ .getResource(str);
+ if ("file".equals(url.getProtocol())) {
+ File comVaadinTests = new File(url.getPath()).getParentFile()
+ .getParentFile();
+ addDirectories(comVaadinTests, defaultPackages, "com.vaadin.tests");
+
+ }
+ }
+
+ private void addDirectories(File parent, LinkedHashSet<String> packages,
+ String parentPackage) {
+ packages.add(parentPackage);
+
+ for (File f : parent.listFiles()) {
+ if (f.isDirectory()) {
+ String newPackage = parentPackage + "." + f.getName();
+ addDirectories(f, packages, newPackage);
+ }
+ }
+ }
+
+ @Override
+ protected void service(HttpServletRequest request,
+ HttpServletResponse response) throws ServletException, IOException {
+ this.request.set(request);
+ try {
+ super.service(request, response);
+ } finally {
+ this.request.set(null);
+ }
+ }
+
+ @Override
+ protected URL getApplicationUrl(HttpServletRequest request)
+ throws MalformedURLException {
+ URL url = super.getApplicationUrl(request);
+
+ String path = url.toString();
+ path += getApplicationRunnerApplicationClassName(request);
+ path += "/";
+
+ return new URL(path);
+ }
+
+ @Override
+ protected Application getNewApplication(HttpServletRequest request)
+ throws ServletException {
+
+ // Creates a new application instance
+ try {
+ final Class<?> classToRun = getClassToRun();
+ if (Root.class.isAssignableFrom(classToRun)) {
+ return new RootRunnerApplication(classToRun);
+ } else if (Application.class.isAssignableFrom(classToRun)) {
+ return (Application) classToRun.newInstance();
+ } else {
+ throw new ServletException(classToRun.getCanonicalName()
+ + " is neither an Application nor a Root");
+ }
+ } catch (final IllegalAccessException e) {
+ throw new ServletException(e);
+ } catch (final InstantiationException e) {
+ throw new ServletException(e);
+ } catch (final ClassNotFoundException e) {
+ throw new ServletException(
+ new InstantiationException(
+ "Failed to load application class: "
+ + getApplicationRunnerApplicationClassName(request)));
+ }
+
+ }
+
+ private String getApplicationRunnerApplicationClassName(
+ HttpServletRequest request) {
+ return getApplicationRunnerURIs(request).applicationClassname;
+ }
+
+ private static class URIS {
+ String staticFilesPath;
+ // String applicationURI;
+ // String context;
+ // String runner;
+ String applicationClassname;
+
+ }
+
+ /**
+ * Parses application runner URIs.
+ *
+ * If request URL is e.g.
+ * http://localhost:8080/vaadin/run/com.vaadin.demo.Calc then
+ * <ul>
+ * <li>context=vaadin</li>
+ * <li>Runner servlet=run</li>
+ * <li>Vaadin application=com.vaadin.demo.Calc</li>
+ * </ul>
+ *
+ * @param request
+ * @return string array containing widgetset URI, application URI and
+ * context, runner, application classname
+ */
+ private static URIS getApplicationRunnerURIs(HttpServletRequest request) {
+ final String[] urlParts = request.getRequestURI().toString()
+ .split("\\/");
+ String context = null;
+ // String runner = null;
+ URIS uris = new URIS();
+ String applicationClassname = null;
+ String contextPath = request.getContextPath();
+ if (urlParts[1].equals(contextPath.replaceAll("\\/", ""))) {
+ // class name comes after web context and runner application
+ context = urlParts[1];
+ // runner = urlParts[2];
+ if (urlParts.length == 3) {
+ throw new IllegalArgumentException("No application specified");
+ }
+ applicationClassname = urlParts[3];
+
+ uris.staticFilesPath = "/" + context;
+ // uris.applicationURI = "/" + context + "/" + runner + "/"
+ // + applicationClassname;
+ // uris.context = context;
+ // uris.runner = runner;
+ uris.applicationClassname = applicationClassname;
+ } else {
+ // no context
+ context = "";
+ // runner = urlParts[1];
+ if (urlParts.length == 2) {
+ throw new IllegalArgumentException("No application specified");
+ }
+ applicationClassname = urlParts[2];
+
+ uris.staticFilesPath = "/";
+ // uris.applicationURI = "/" + runner + "/" + applicationClassname;
+ // uris.context = context;
+ // uris.runner = runner;
+ uris.applicationClassname = applicationClassname;
+ }
+ return uris;
+ }
+
+ @Override
+ protected Class<? extends Application> getApplicationClass()
+ throws ClassNotFoundException {
+ Class<?> classToRun = getClassToRun();
+ if (Root.class.isAssignableFrom(classToRun)) {
+ return RootRunnerApplication.class;
+ } else if (Application.class.isAssignableFrom(classToRun)) {
+ return classToRun.asSubclass(Application.class);
+ } else {
+ throw new ClassCastException(classToRun.getCanonicalName()
+ + " is not an Application nor a Root");
+ }
+ }
+
+ private Class<?> getClassToRun() throws ClassNotFoundException {
+ // TODO use getClassLoader() ?
+
+ Class<?> appClass = null;
+
+ String baseName = getApplicationRunnerApplicationClassName(request
+ .get());
+ try {
+ appClass = getClass().getClassLoader().loadClass(baseName);
+ return appClass;
+ } catch (Exception e) {
+ //
+ for (String pkg : defaultPackages) {
+ try {
+ appClass = getClass().getClassLoader().loadClass(
+ pkg + "." + baseName);
+ } catch (ClassNotFoundException ee) {
+ // Ignore as this is expected for many packages
+ } catch (Exception e2) {
+ // TODO: handle exception
+ getLogger().log(
+ Level.FINE,
+ "Failed to find application class " + pkg + "."
+ + baseName, e2);
+ }
+ if (appClass != null) {
+ return appClass;
+ }
+ }
+
+ }
+
+ throw new ClassNotFoundException();
+ }
+
+ @Override
+ protected String getRequestPathInfo(HttpServletRequest request) {
+ String path = request.getPathInfo();
+ if (path == null) {
+ return null;
+ }
+
+ path = path.substring(1 + getApplicationRunnerApplicationClassName(
+ request).length());
+ return path;
+ }
+
+ @Override
+ protected String getStaticFilesLocation(HttpServletRequest request) {
+ URIS uris = getApplicationRunnerURIs(request);
+ String staticFilesPath = uris.staticFilesPath;
+ if (staticFilesPath.equals("/")) {
+ staticFilesPath = "";
+ }
+
+ return staticFilesPath;
+ }
+
+ @Override
+ protected WrappedHttpServletRequest createWrappedRequest(
+ HttpServletRequest request) {
+ return new WrappedHttpServletRequest(request,
+ getDeploymentConfiguration()) {
+ @Override
+ public String getRequestPathInfo() {
+ return ApplicationRunnerServlet.this.getRequestPathInfo(this);
+ }
+ };
+ }
+
+ private Logger getLogger() {
+ return Logger.getLogger(ApplicationRunnerServlet.class.getName());
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/launcher/DemoLauncher.java b/tests/testbench/com/vaadin/launcher/DemoLauncher.java
index 2b2f73abd6..91cdd343c7 100644
--- a/tests/testbench/com/vaadin/launcher/DemoLauncher.java
+++ b/tests/testbench/com/vaadin/launcher/DemoLauncher.java
@@ -75,6 +75,7 @@ public class DemoLauncher {
* dispatch thread.
*/
java.awt.EventQueue.invokeLater(new Runnable() {
+ @Override
public void run() {
try {
openServerControlDialog(url);
@@ -125,6 +126,7 @@ public class DemoLauncher {
// List for close verify buttons
final ActionListener buttonListener = new ActionListener() {
+ @Override
public void actionPerformed(ActionEvent e) {
if (e.getSource() == okButton) {
System.exit(0);
diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java
index 3366f6db43..f4fa1b6608 100644
--- a/tests/testbench/com/vaadin/tests/Components.java
+++ b/tests/testbench/com/vaadin/tests/Components.java
@@ -15,6 +15,7 @@ import com.vaadin.data.util.DefaultItemSorter;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.AbstractComponentTest;
@@ -24,18 +25,18 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Tree.ItemStyleGenerator;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Components extends Application {
+public class Components extends Application.LegacyApplication {
private static final Object CAPTION = "c";
private Map<Class<? extends AbstractComponentTest>, String> tests = new HashMap<Class<? extends AbstractComponentTest>, String>();
private Tree naviTree;
private HorizontalSplitPanel sp;
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private final Embedded applicationEmbedder = new Embedded();
private String baseUrl;
private List<Class<? extends Component>> componentsWithoutTests = new ArrayList<Class<? extends Component>>();
@@ -85,7 +86,7 @@ public class Components extends Application {
@Override
public void init() {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
setTheme("tests-components");
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
@@ -95,7 +96,7 @@ public class Components extends Application {
naviLayout
.addComponent(new Label(
"Click to open a test case.<br/>Right click to open test in a new window<br/><br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
naviLayout.addComponent(createMenu());
naviLayout.addComponent(createMissingTestsList());
@@ -106,7 +107,7 @@ public class Components extends Application {
embeddingLayout
.addComponent(new Label(
"<b>Do not use the embedded version for creating automated tests. Open the test in a new window before recording.</b><br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
applicationEmbedder.setSizeFull();
embeddingLayout.addComponent(applicationEmbedder);
embeddingLayout.setExpandRatio(applicationEmbedder, 1);
@@ -129,13 +130,14 @@ public class Components extends Application {
+ component.getSimpleName() + "</font><br/>";
}
return new Label("<b>Components without a test:</B><br/>"
- + missingTests, Label.CONTENT_XHTML);
+ + missingTests, ContentMode.XHTML);
}
private Component createMenu() {
naviTree = new Tree();
naviTree.setItemStyleGenerator(new ItemStyleGenerator() {
+ @Override
public String getStyle(Object itemId) {
Class<?> cls = (Class<?>) itemId;
if (!isAbstract(cls)) {
@@ -181,6 +183,7 @@ public class Components extends Application {
naviTree.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
Class<?> cls = (Class<?>) event.getItemId();
if (!isAbstract(cls)) {
diff --git a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
index 2b45ef7458..6991b669a8 100644
--- a/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
+++ b/tests/testbench/com/vaadin/tests/CustomLayoutDemo.java
@@ -4,7 +4,9 @@
package com.vaadin.tests;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component.Event;
import com.vaadin.ui.Component.Listener;
import com.vaadin.ui.CustomLayout;
@@ -12,9 +14,9 @@ import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.Window;
/**
* This example demonstrates custom layout. All components created here are
@@ -29,8 +31,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class CustomLayoutDemo extends com.vaadin.Application implements
- Listener {
+public class CustomLayoutDemo extends com.vaadin.Application.LegacyApplication
+ implements Listener {
private CustomLayout mainLayout = null;
@@ -40,7 +42,14 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
private final PasswordField loginPwd = new PasswordField("Password");
- private final Button loginButton = new Button("Login", this, "loginClicked");
+ private final Button loginButton = new Button("Login",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ loginClicked();
+ }
+ });
private final Tree menu = new Tree();
@@ -49,7 +58,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
*/
@Override
public void init() {
- final Window mainWindow = new Window("CustomLayout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("CustomLayout demo");
setMainWindow(mainWindow);
// set the application to use example -theme
@@ -89,7 +98,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
// Add heading label and custom layout panel to main window
mainWindow.addComponent(new Label("<h3>Custom layout demo</h3>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(customLayoutPanel);
}
@@ -105,7 +114,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
username.setValue("Anonymous");
}
mainLayout.replaceComponent(loginButton, new Label("Welcome user <em>"
- + username.getValue() + "</em>", Label.CONTENT_XHTML));
+ + username.getValue() + "</em>", ContentMode.XHTML));
}
/**
@@ -123,6 +132,7 @@ public class CustomLayoutDemo extends com.vaadin.Application implements
* Handle all menu events. Updates body panel contents if menu item is
* clicked.
*/
+ @Override
public void componentEvent(Event event) {
// Check if event occured at fsTree component
if (event.getSource() == menu) {
diff --git a/tests/testbench/com/vaadin/tests/FocusingComponents.java b/tests/testbench/com/vaadin/tests/FocusingComponents.java
index e74a935830..f63989fafb 100644
--- a/tests/testbench/com/vaadin/tests/FocusingComponents.java
+++ b/tests/testbench/com/vaadin/tests/FocusingComponents.java
@@ -54,6 +54,7 @@ public class FocusingComponents extends CustomComponent {
Button focus = new Button("focus");
focus.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
f.focus();
}
diff --git a/tests/testbench/com/vaadin/tests/LayoutDemo.java b/tests/testbench/com/vaadin/tests/LayoutDemo.java
index 989a4822ad..e2d858560a 100644
--- a/tests/testbench/com/vaadin/tests/LayoutDemo.java
+++ b/tests/testbench/com/vaadin/tests/LayoutDemo.java
@@ -4,6 +4,7 @@
package com.vaadin.tests;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ClassResource;
import com.vaadin.ui.Component;
import com.vaadin.ui.Embedded;
@@ -12,9 +13,9 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This example demonstrates layouts. Layouts are populated with sample Vaadin
@@ -24,14 +25,14 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class LayoutDemo extends com.vaadin.Application {
+public class LayoutDemo extends com.vaadin.Application.LegacyApplication {
/**
* Initialize Application. Demo components are added to main window.
*/
@Override
public void init() {
- final Window mainWindow = new Window("Layout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
setMainWindow(mainWindow);
//
@@ -85,25 +86,23 @@ public class LayoutDemo extends com.vaadin.Application {
//
mainWindow.addComponent(new Label(
"<h3>Horizontal ordered layout</h3>Added four components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutA);
mainWindow.addComponent(new Label(
"<br /><h3>Vertical ordered layout</h3>Added four components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutB);
mainWindow.addComponent(new Label(
"<br /><h3>Grid Layout (4 x 4)</h3>Added 16 components.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(layoutG);
- mainWindow
- .addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>"
- + "Added four panels and four embedded components "
- + "diagonally with absolute coordinates.",
- Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label("<br /><h3>Grid Layout (4 x 4)</h3>"
+ + "Added four panels and four embedded components "
+ + "diagonally with absolute coordinates.", ContentMode.XHTML));
mainWindow.addComponent(layoutG2);
mainWindow.addComponent(new Label(
"<br /><h3>TabSheet</h3>Added above layouts as tabs.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
mainWindow.addComponent(tabsheet);
}
@@ -124,7 +123,7 @@ public class LayoutDemo extends com.vaadin.Application {
+ "extremities and may have a caption to clarify the nature of the contained components' purpose."
+ " Panel contains an layout where the actual contained components are added, "
+ "this layout may be switched on the fly.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
panel.setWidth("222px");
return panel;
}
diff --git a/tests/testbench/com/vaadin/tests/ListenerOrder.java b/tests/testbench/com/vaadin/tests/ListenerOrder.java
index c1d6245222..7f136b10ed 100644
--- a/tests/testbench/com/vaadin/tests/ListenerOrder.java
+++ b/tests/testbench/com/vaadin/tests/ListenerOrder.java
@@ -13,12 +13,12 @@ import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class ListenerOrder extends com.vaadin.Application implements
- Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener,
- ValueChangeListener {
+public class ListenerOrder extends com.vaadin.Application.LegacyApplication
+ implements Button.ClickListener, PropertySetChangeListener,
+ ItemSetChangeListener, ValueChangeListener {
Button b1;
@@ -32,7 +32,7 @@ public class ListenerOrder extends com.vaadin.Application implements
}
public void createNewView() {
- final Window main = new Window("Test window");
+ final LegacyWindow main = new LegacyWindow("Test window");
setMainWindow(main);
main.removeAllComponents();
@@ -49,16 +49,17 @@ public class ListenerOrder extends com.vaadin.Application implements
addListeners(b1, 1);
b1.addListener(mutualListener);
b1.addListener(mutualListener);
- b1.addListener((Button.ClickListener) this);
+ b1.addListener(this);
b1.addListener(mutualListener);
Button.ClickListener b1Listener = addListeners(b1, 3);
b1.addListener(mutualListener);
- b1.addListener((Button.ClickListener) this);
- b1.addListener((ValueChangeListener) this);
+ b1.addListener(this);
+ // b1.addListener((ValueChangeListener) this);
b1.addListener(mutualListener);
b1.removeListener(b1Listener);
// remove non-existing listener
b1.removeListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
}
});
@@ -107,6 +108,7 @@ public class ListenerOrder extends com.vaadin.Application implements
return listener;
}
+ @Override
public void buttonClick(ClickEvent event) {
System.out.println("ClickEvent from Test1");
s1.addItem("new item " + System.currentTimeMillis());
@@ -133,6 +135,7 @@ public class ListenerOrder extends com.vaadin.Application implements
System.out.println("Created listener " + name + ", id=" + count);
}
+ @Override
public void buttonClick(ClickEvent event) {
String msg = "ClickEvent from MyClickListener " + name + ", id="
+ count;
@@ -142,18 +145,21 @@ public class ListenerOrder extends com.vaadin.Application implements
}
+ @Override
public void containerPropertySetChange(PropertySetChangeEvent event) {
String msg = "containerPropertySetChange from " + this;
System.out.println(msg);
getMainWindow().showNotification(msg);
}
+ @Override
public void containerItemSetChange(ItemSetChangeEvent event) {
String msg = "containerItemSetChange from " + this;
System.out.println(msg);
getMainWindow().showNotification(msg);
}
+ @Override
public void valueChange(ValueChangeEvent event) {
String msg = "valueChange from " + this;
System.out.println(msg);
diff --git a/tests/testbench/com/vaadin/tests/ModalWindow.java b/tests/testbench/com/vaadin/tests/ModalWindow.java
index 84adaf1a39..340571cd37 100644
--- a/tests/testbench/com/vaadin/tests/ModalWindow.java
+++ b/tests/testbench/com/vaadin/tests/ModalWindow.java
@@ -8,6 +8,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
@@ -21,8 +22,8 @@ import com.vaadin.ui.Window;
* @see com.vaadin.ui.Window
* @see com.vaadin.ui.Label
*/
-public class ModalWindow extends com.vaadin.Application implements
- ClickListener {
+public class ModalWindow extends com.vaadin.Application.LegacyApplication
+ implements ClickListener {
private Window test;
private Button reopen;
@@ -31,7 +32,7 @@ public class ModalWindow extends com.vaadin.Application implements
public void init() {
// Create main window
- final Window main = new Window("ModalWindow demo");
+ final LegacyWindow main = new LegacyWindow("ModalWindow demo");
setMainWindow(main);
main.addComponent(new Label("ModalWindow demo"));
@@ -53,6 +54,7 @@ public class ModalWindow extends com.vaadin.Application implements
}
+ @Override
public void buttonClick(ClickEvent event) {
if (event.getButton() == reopen) {
openSubWindow();
diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java
index f148c6a835..36cbe48935 100644
--- a/tests/testbench/com/vaadin/tests/NativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java
@@ -8,14 +8,16 @@ import java.net.MalformedURLException;
import java.net.URL;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class NativeWindowing extends Application {
+public class NativeWindowing extends Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
@Override
public void init() {
@@ -24,6 +26,7 @@ public class NativeWindowing extends Application {
main.addComponent(new Button("Add new subwindow",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window w = new Window("sw "
+ System.currentTimeMillis());
@@ -38,6 +41,7 @@ public class NativeWindowing extends Application {
final Button closebutton = new Button("Close "
+ w.getCaption(), new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
main.removeWindow(w);
}
@@ -68,7 +72,7 @@ public class NativeWindowing extends Application {
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
}
}));
@@ -76,6 +80,7 @@ public class NativeWindowing extends Application {
main.addComponent(new Button(
"Open a currently uncreated application level window",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
main.open(
@@ -95,16 +100,16 @@ public class NativeWindowing extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
- final Window w = super.getWindow(name);
+ final LegacyWindow w = super.getWindow(name);
if (w != null) {
return w;
}
if (name != null && name.startsWith("mainwin-")) {
final String postfix = name.substring("mainwin-".length());
- final Window ww = new Window("Window: " + postfix);
+ final LegacyWindow ww = new LegacyWindow("Window: " + postfix);
ww.setName(name);
ww.addComponent(new Label(
"This is a application-level window opened with name: "
@@ -112,6 +117,7 @@ public class NativeWindowing extends Application {
ww.addComponent(new Button("Click me", new Button.ClickListener() {
int state = 0;
+ @Override
public void buttonClick(ClickEvent event) {
ww.addComponent(new Label("Button clicked " + (++state)
+ " times"));
diff --git a/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java b/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java
index 93e6290ee4..af73bdc652 100644
--- a/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java
+++ b/tests/testbench/com/vaadin/tests/OrderedLayoutSwapComponents.java
@@ -60,6 +60,7 @@ public class OrderedLayoutSwapComponents extends CustomComponent {
ol.addComponent(new Label(name));
up = new Button("up");
up.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
int newIndex = order.indexOf(MyComponent.this) - 1;
MyComponent old = order.get(newIndex);
@@ -77,6 +78,7 @@ public class OrderedLayoutSwapComponents extends CustomComponent {
down = new Button("down");
down.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
int newIndex = order.indexOf(MyComponent.this) + 1;
MyComponent old = order.get(newIndex);
diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java
index 8b8bec8834..1e8ca53875 100644
--- a/tests/testbench/com/vaadin/tests/Parameters.java
+++ b/tests/testbench/com/vaadin/tests/Parameters.java
@@ -4,21 +4,23 @@
package com.vaadin.tests;
+import java.io.IOException;
import java.net.URL;
import java.util.Iterator;
import java.util.Map;
-import com.vaadin.terminal.DownloadStream;
+import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.ParameterHandler;
-import com.vaadin.terminal.URIHandler;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This is a demonstration of how URL parameters can be recieved and handled.
@@ -27,8 +29,8 @@ import com.vaadin.ui.Window;
*
* @since 3.1.1
*/
-public class Parameters extends com.vaadin.Application implements URIHandler,
- ParameterHandler {
+public class Parameters extends com.vaadin.Application.LegacyApplication
+ implements RequestHandler {
private final Label context = new Label();
@@ -38,12 +40,11 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
@Override
public void init() {
- final Window main = new Window("Parameters demo");
+ final LegacyWindow main = new LegacyWindow("Parameters demo");
setMainWindow(main);
// This class acts both as URI handler and parameter handler
- main.addURIHandler(this);
- main.addParameterHandler(this);
+ addRequestHandler(this);
final VerticalLayout layout = new VerticalLayout();
final Label info = new Label("To test URI and Parameter Handlers, "
@@ -92,24 +93,15 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
main.setContent(layout);
}
- /**
- * Update URI
- *
- * @see com.vaadin.terminal.URIHandler#handleURI(URL, String)
- */
@Override
- public DownloadStream handleURI(URL context, String relativeUri) {
- this.context.setValue(context.toString());
- relative.setValue(relativeUri);
- return null;
- }
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ context.setValue("Context not available");
+ relative.setValue(request.getRequestPathInfo());
- /**
- * Handles GET parameters, in this demo GET parameteres are used to
- * communicate with EmbeddedToolkit.jsp
- */
- public void handleParameters(Map<String, String[]> parameters) {
params.removeAllItems();
+ Map<String, String[]> parameters = request.getParameterMap();
for (final Iterator<String> i = parameters.keySet().iterator(); i
.hasNext();) {
final String name = i.next();
@@ -123,5 +115,7 @@ public class Parameters extends com.vaadin.Application implements URIHandler,
}
params.addItem(new Object[] { name, v }, name);
}
+
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
index 00f98657b8..e93ebc52f3 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java
@@ -7,6 +7,7 @@ package com.vaadin.tests;
import java.util.Date;
import java.util.Map;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
@@ -102,7 +103,7 @@ public class PerformanceTestBasicComponentRendering extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
index 9e4aac05d4..66c20009e0 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java
@@ -6,6 +6,7 @@ package com.vaadin.tests;
import java.util.Date;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -38,6 +39,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
main.addComponent(new Button("click when rendered",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
endTest();
}
@@ -46,6 +48,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
main.addComponent(new Button(
"Click for layout repaint (cached components)",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
testContainer.requestRepaint();
}
@@ -73,7 +76,7 @@ public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
index 4d36da40b5..e0a7e2c90c 100644
--- a/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
+++ b/tests/testbench/com/vaadin/tests/PerformanceTestSubTreeCaching.java
@@ -6,7 +6,9 @@ package com.vaadin.tests;
import java.util.Date;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
@@ -36,10 +38,20 @@ public class PerformanceTestSubTreeCaching extends CustomComponent {
setCompositionRoot(main);
addInfo();
- Button b = new Button("start test", this, "startTest");
+ Button b = new Button("start test", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ startTest();
+ }
+ });
b.setDescription("Push this button to start test. A test label will be rendered above existing components.");
main.addComponent(b);
- b = new Button("end test", this, "endTest");
+ b = new Button("end test", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ endTest();
+ }
+ });
b.setDescription("Push this button as soon as test componenet is rendered.");
main.addComponent(b);
@@ -77,7 +89,7 @@ public class PerformanceTestSubTreeCaching extends CustomComponent {
}
private void addInfo() {
- main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML));
+ main.addComponent(new Label(DESCRIPTION, ContentMode.XHTML));
}
}
diff --git a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
index d6f896527b..0390ea8157 100644
--- a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
+++ b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java
@@ -17,11 +17,11 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* This example demonstrates layouts. Layouts are populated with sample Vaadin
@@ -30,7 +30,8 @@ import com.vaadin.ui.Window;
* @author Vaadin Ltd.
*
*/
-public class RandomLayoutStress extends com.vaadin.Application {
+public class RandomLayoutStress extends
+ com.vaadin.Application.LegacyApplication {
private final Random seededRandom = new Random(1);
@@ -48,7 +49,7 @@ public class RandomLayoutStress extends com.vaadin.Application {
*/
@Override
public void init() {
- final Window mainWindow = new Window("Layout demo");
+ final LegacyWindow mainWindow = new LegacyWindow("Layout demo");
setMainWindow(mainWindow);
// Create horizontal ordered layout
diff --git a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
index a66274a635..9cd27e9d5c 100644
--- a/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
+++ b/tests/testbench/com/vaadin/tests/ScrollbarStressTest.java
@@ -10,15 +10,16 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
-public class ScrollbarStressTest extends Application {
+public class ScrollbarStressTest extends Application.LegacyApplication {
- final Window main = new Window("Scrollbar Stress Test");
+ final LegacyWindow main = new LegacyWindow("Scrollbar Stress Test");
final Panel panel = new Panel("Panel");
final VerticalSplitPanel splitPanel = new VerticalSplitPanel();
@@ -72,6 +73,7 @@ public class ScrollbarStressTest extends Application {
height.setValue("100%");
final Button set = new Button("Set", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getTable = testComponent.getValue().equals("Table");
diff --git a/tests/testbench/com/vaadin/tests/StressComponentsInTable.java b/tests/testbench/com/vaadin/tests/StressComponentsInTable.java
index 9c2703822e..87ab7fa1d4 100644
--- a/tests/testbench/com/vaadin/tests/StressComponentsInTable.java
+++ b/tests/testbench/com/vaadin/tests/StressComponentsInTable.java
@@ -37,6 +37,7 @@ public class StressComponentsInTable extends CustomComponent {
}
content.add(new Button("b" + i, new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
System.out.println(b.getCaption() + " click: "
diff --git a/tests/testbench/com/vaadin/tests/TableChangingDatasource.java b/tests/testbench/com/vaadin/tests/TableChangingDatasource.java
index fa7edc3a45..3f87f2fe4c 100644
--- a/tests/testbench/com/vaadin/tests/TableChangingDatasource.java
+++ b/tests/testbench/com/vaadin/tests/TableChangingDatasource.java
@@ -45,6 +45,7 @@ public class TableChangingDatasource extends CustomComponent implements
}
+ @Override
public void buttonClick(ClickEvent event) {
int i = mode % 4;
t.setContainerDataSource(ta[i].getContainerDataSource());
diff --git a/tests/testbench/com/vaadin/tests/TableSelectTest.java b/tests/testbench/com/vaadin/tests/TableSelectTest.java
index 62070c4b97..823bdfb3c4 100644
--- a/tests/testbench/com/vaadin/tests/TableSelectTest.java
+++ b/tests/testbench/com/vaadin/tests/TableSelectTest.java
@@ -113,6 +113,7 @@ public class TableSelectTest extends CustomComponent implements
return id;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
final Object val = event.getProperty().getValue();
diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java
index b15e3994b5..04f71ce535 100644
--- a/tests/testbench/com/vaadin/tests/TestBench.java
+++ b/tests/testbench/com/vaadin/tests/TestBench.java
@@ -16,6 +16,8 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.Page;
+import com.vaadin.terminal.Page.FragmentChangedEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalSplitPanel;
@@ -23,11 +25,9 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.UriFragmentUtility;
-import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* TestBench finds out testable classes within given java packages and adds them
@@ -39,8 +39,8 @@ import com.vaadin.ui.Window;
* @author Vaadin Ltd.
*
*/
-public class TestBench extends com.vaadin.Application implements
- Property.ValueChangeListener {
+public class TestBench extends com.vaadin.Application.LegacyApplication
+ implements Property.ValueChangeListener {
// Add here packages which are used for finding testable classes
String[] testablePackages = { "com.vaadin.tests",
@@ -48,7 +48,7 @@ public class TestBench extends com.vaadin.Application implements
HierarchicalContainer testables = new HierarchicalContainer();
- Window mainWindow = new Window("TestBench window");
+ LegacyWindow mainWindow = new LegacyWindow("TestBench window");
// Main layout consists of tree menu and body layout
HorizontalSplitPanel mainLayout = new HorizontalSplitPanel();
@@ -119,12 +119,10 @@ public class TestBench extends com.vaadin.Application implements
VerticalLayout lo = new VerticalLayout();
lo.addComponent(menu);
- UriFragmentUtility uri = new UriFragmentUtility();
- lo.addComponent(uri);
-
- uri.addListener(new UriFragmentUtility.FragmentChangedListener() {
+ mainWindow.getPage().addListener(new Page.FragmentChangedListener() {
+ @Override
public void fragmentChanged(FragmentChangedEvent source) {
- String fragment = source.getUriFragmentUtility().getFragment();
+ String fragment = source.getFragment();
if (fragment != null && !"".equals(fragment)) {
// try to find a proper test class
@@ -213,7 +211,8 @@ public class TestBench extends com.vaadin.Application implements
private Component createTestable(Class<?> c) {
try {
- final Application app = (Application) c.newInstance();
+ final Application.LegacyApplication app = (Application.LegacyApplication) c
+ .newInstance();
app.init();
Layout lo = (Layout) app.getMainWindow().getContent();
lo.setParent(null);
@@ -240,6 +239,7 @@ public class TestBench extends com.vaadin.Application implements
}
// Handle menu selection and update body
+ @Override
public void valueChange(Property.ValueChangeEvent event) {
bodyLayout.removeAllComponents();
bodyLayout.setCaption(null);
diff --git a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
index b0ccca2480..d086e0a665 100644
--- a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
+++ b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java
@@ -4,6 +4,7 @@
package com.vaadin.tests;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ClassResource;
import com.vaadin.terminal.ErrorMessage;
import com.vaadin.terminal.ExternalResource;
@@ -161,7 +162,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener {
// Custom components
layout.addComponent(new Label("<B>Below are few custom components</B>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
final TestForUpload tfu = new TestForUpload();
layout.addComponent(tfu);
@@ -194,6 +195,7 @@ public class TestCaptionWrapper extends CustomComponent implements Listener {
layout.addComponent(c);
}
+ @Override
public void componentEvent(Event event) {
final String feedback = eventListenerString + " source="
+ event.getSource() + ", toString()=" + event.toString();
diff --git a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
index 62a67cb747..e13b907f77 100644
--- a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
+++ b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java
@@ -3,14 +3,15 @@
*/
package com.vaadin.tests;
+import com.vaadin.terminal.Page;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* @author marc
@@ -42,6 +43,7 @@ public class TestComponentAddAndRecursion extends CustomComponent {
Button b = new Button("use gridlayout", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.setContent(new GridLayout());
p2.setContent(new GridLayout());
@@ -52,6 +54,7 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("use orderedlayout", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.setContent(new VerticalLayout());
p2.setContent(new VerticalLayout());
@@ -62,6 +65,7 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("move B", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p2.addComponent(l2);
}
@@ -70,6 +74,7 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("move p", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p3.addComponent(p);
}
@@ -78,6 +83,7 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("add to both", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Label l = new Label("both");
p.addComponent(l);
@@ -88,15 +94,17 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("recurse", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
p3.addComponent(p2);
- getWindow().showNotification("ERROR",
- "This should have failed",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ new Notification("ERROR", "This should have failed",
+ Notification.TYPE_ERROR_MESSAGE).show(Page
+ .getCurrent());
} catch (Exception e) {
- getWindow().showNotification("OK", "threw, as expected",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ new Notification("OK", "threw, as expected",
+ Notification.TYPE_ERROR_MESSAGE).show(Page
+ .getCurrent());
}
}
@@ -104,17 +112,19 @@ public class TestComponentAddAndRecursion extends CustomComponent {
main.addComponent(b);
b = new Button("recurse2", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Panel p = new Panel("dynamic");
p.addComponent(p2);
try {
p3.addComponent(p);
- getWindow().showNotification("ERROR",
- "This should have failed",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ new Notification("ERROR", "This should have failed",
+ Notification.TYPE_ERROR_MESSAGE).show(Page
+ .getCurrent());
} catch (Exception e) {
- getWindow().showNotification("OK", "threw, as expected",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ new Notification("OK", "threw, as expected",
+ Notification.TYPE_ERROR_MESSAGE).show(Page
+ .getCurrent());
}
}
diff --git a/tests/testbench/com/vaadin/tests/TestContainerChanges.java b/tests/testbench/com/vaadin/tests/TestContainerChanges.java
index b7f24abd8b..87251c0d65 100644
--- a/tests/testbench/com/vaadin/tests/TestContainerChanges.java
+++ b/tests/testbench/com/vaadin/tests/TestContainerChanges.java
@@ -70,6 +70,7 @@ public class TestContainerChanges extends CustomComponent {
tbl2.setMultiSelect(false);
tbl2.setImmediate(true);
tbl2.addListener(new Table.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err.println("Value now "
+ event.getProperty().getValue());
@@ -85,6 +86,7 @@ public class TestContainerChanges extends CustomComponent {
Button b = new Button("table.commit()", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.commit();
}
@@ -95,6 +97,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("indexedcontainer.addItem()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cont.addItem(new Integer(cnt++));
}
@@ -104,6 +107,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("indexedcontainer.addItem(null)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cont.addItem(null);
}
@@ -113,6 +117,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("indexedcontainer.removeItem(table.lastItemId()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cont.removeItem(tbl.lastItemId());
}
@@ -123,6 +128,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("indexedcontainer.addContainerProperty()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cont.addContainerProperty("prop" + cnt, String.class,
"#" + cnt++);
@@ -133,6 +139,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("indexedcontainer.clear()", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cont.removeAllItems();
}
@@ -142,6 +149,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("table.setContainerDataSource(indexedcontainer)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setContainerDataSource(cont);
}
@@ -151,6 +159,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("table.setContainerDataSource(orderedwrapper)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setContainerDataSource(ordered);
}
@@ -160,6 +169,7 @@ public class TestContainerChanges extends CustomComponent {
b = new Button("table.setContainerDataSource(hierarchicalwrapper)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setContainerDataSource(hierarchical);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
index 74ca67987d..c4b96e59b4 100644
--- a/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
+++ b/tests/testbench/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java
@@ -7,15 +7,15 @@ package com.vaadin.tests;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends
- Application {
+ Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
VerticalLayout rootLayout;
diff --git a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
index 67370039bb..eadc787ad8 100644
--- a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
+++ b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java
@@ -30,6 +30,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
click = new Button("Set height -1", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tab.setHeight(null);
}
@@ -38,6 +39,7 @@ public class TestForBasicApplicationLayout extends CustomComponent {
click2 = new Button("Set height 100%", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tab.setHeight(100, TabSheet.UNITS_PERCENTAGE);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
index 0dd0fdb1bb..3852c5f13f 100644
--- a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
@@ -51,14 +52,29 @@ public class TestForChildComponentRendering extends CustomComponent {
se.addItem("valinta1");
se.addItem("Valinta 2");
- Button b = new Button("refresh view", this, "createNewView");
+ Button b = new Button("refresh view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
- b = new Button("reorder view", this, "randomReorder");
+ b = new Button("reorder view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ randomReorder();
+ }
+ });
main.addComponent(b);
- b = new Button("remove randomly one component", this,
- "removeRandomComponent");
+ b = new Button("remove randomly one component",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ removeRandomComponent();
+ }
+ });
main.addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
index 395f677723..f3bd5ab227 100644
--- a/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
+++ b/tests/testbench/com/vaadin/tests/TestForContainerFilterable.java
@@ -60,14 +60,15 @@ public class TestForContainerFilterable extends CustomComponent {
// Handler
filterButton.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ic.removeAllContainerFilters();
- if (fooFilter.toString().length() > 0) {
- ic.addContainerFilter("foo", fooFilter.toString(), false,
+ if (fooFilter.getValue().length() > 0) {
+ ic.addContainerFilter("foo", fooFilter.getValue(), false,
false);
}
- if (barFilter.toString().length() > 0) {
- ic.addContainerFilter("bar", barFilter.toString(), true,
+ if (barFilter.getValue().length() > 0) {
+ ic.addContainerFilter("bar", barFilter.getValue(), true,
true);
}
count.setValue("Rows in table: " + ic.size());
@@ -77,6 +78,7 @@ public class TestForContainerFilterable extends CustomComponent {
// Resetbutton
lo.addComponent(new Button("Rebind table datasource",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
t.setContainerDataSource(ic);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
index c1cb7d6bb8..982c86781c 100644
--- a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java
@@ -9,6 +9,7 @@ import java.util.Iterator;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
@@ -52,14 +53,29 @@ public class TestForGridLayoutChildComponentRendering extends CustomComponent {
main.addComponent(se, 0, 1, 1, 1);
- Button b = new Button("refresh view", this, "createNewView");
+ Button b = new Button("refresh view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
- b = new Button("reorder view", this, "randomReorder");
+ b = new Button("reorder view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ randomReorder();
+ }
+ });
main.addComponent(b);
- b = new Button("remove randomly one component", this,
- "removeRandomComponent");
+ b = new Button("remove randomly one component",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ removeRandomComponent();
+ }
+ });
main.addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java b/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java
index e192d2738d..17c118803b 100644
--- a/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java
+++ b/tests/testbench/com/vaadin/tests/TestForMultipleStyleNames.java
@@ -65,6 +65,7 @@ public class TestForMultipleStyleNames extends CustomComponent implements
}
+ @Override
public void valueChange(ValueChangeEvent event) {
final String currentStyle = l.getStyleName();
diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
index b417d57a56..ea66ed1ab2 100644
--- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
+++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java
@@ -8,14 +8,16 @@ import java.net.MalformedURLException;
import java.net.URL;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class TestForNativeWindowing extends Application {
+public class TestForNativeWindowing extends Application.LegacyApplication {
- Window main = new Window("Windowing test");
+ LegacyWindow main = new LegacyWindow("Windowing test");
@Override
public void init() {
@@ -24,6 +26,7 @@ public class TestForNativeWindowing extends Application {
main.addComponent(new Button("Add new subwindow",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window w = new Window("sw "
+ System.currentTimeMillis());
@@ -38,6 +41,7 @@ public class TestForNativeWindowing extends Application {
final Button closebutton = new Button("Close "
+ w.getCaption(), new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
main.removeWindow(w);
}
@@ -68,7 +72,7 @@ public class TestForNativeWindowing extends Application {
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>"
+ "<p>Lorem ipsum dolor sit amet.</p>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
}
}));
@@ -76,6 +80,7 @@ public class TestForNativeWindowing extends Application {
main.addComponent(new Button(
"Open a currently uncreated application level window",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
main.open(
@@ -95,16 +100,16 @@ public class TestForNativeWindowing extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
- final Window w = super.getWindow(name);
+ final LegacyWindow w = super.getWindow(name);
if (w != null) {
return w;
}
if (name != null && name.startsWith("mainwin-")) {
final String postfix = name.substring("mainwin-".length());
- final Window ww = new Window("Window: " + postfix);
+ final LegacyWindow ww = new LegacyWindow("Window: " + postfix);
ww.setName(name);
ww.addComponent(new Label(
"This is a application-level window opened with name: "
@@ -112,6 +117,7 @@ public class TestForNativeWindowing extends Application {
ww.addComponent(new Button("Click me", new Button.ClickListener() {
int state = 0;
+ @Override
public void buttonClick(ClickEvent event) {
ww.addComponent(new Label("Button clicked " + (++state)
+ " times"));
diff --git a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
index 7ca9fd0cfc..9a41d719d4 100644
--- a/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
+++ b/tests/testbench/com/vaadin/tests/TestForPreconfiguredComponents.java
@@ -90,7 +90,12 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
test.setCaption("OptionGroup + multiselect manually (configured from select)");
main.addComponent(test);
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
@@ -142,6 +147,7 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
final Panel status = new Panel("Events");
final Button clear = new Button("clear event log");
clear.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
status.removeAllComponents();
status.addComponent(ol2);
@@ -158,8 +164,10 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
ol.addComponent(status);
t.addListener(new Listener() {
+ @Override
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
+ // TODO should not use Field.toString()
status.addComponent(new Label("selected: "
+ event.getSource().toString()));
}
@@ -168,10 +176,12 @@ public class TestForPreconfiguredComponents extends CustomComponent implements
return ol;
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
if (action == actions[1]) {
al.addComponent(new Label("Delete selected on " + target));
diff --git a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
index 15caf21b3c..417dde71c8 100644
--- a/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
+++ b/tests/testbench/com/vaadin/tests/TestForRichTextEditor.java
@@ -4,10 +4,11 @@
package com.vaadin.tests;
+import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
@@ -45,13 +46,15 @@ public class TestForRichTextEditor extends CustomComponent implements
main.addComponent(new Button("commit content to label below"));
- l = new Label("", Label.CONTENT_XHTML);
+ l = new Label("", ContentMode.XHTML);
main.addComponent(l);
CheckBox b = new CheckBox("enabled");
b.setImmediate(true);
- b.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ b.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
rte.setEnabled(!rte.isEnabled());
}
});
@@ -59,6 +62,7 @@ public class TestForRichTextEditor extends CustomComponent implements
}
+ @Override
public void valueChange(ValueChangeEvent event) {
l.setValue(rte.getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
index 88b71185ae..2526941ed1 100644
--- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java
@@ -15,6 +15,7 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.StreamResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -23,6 +24,7 @@ import com.vaadin.ui.Layout;
import com.vaadin.ui.Link;
import com.vaadin.ui.Panel;
import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Upload;
import com.vaadin.ui.Upload.FailedEvent;
import com.vaadin.ui.Upload.FailedListener;
@@ -33,10 +35,9 @@ import com.vaadin.ui.Upload.StartedListener;
import com.vaadin.ui.Upload.SucceededEvent;
import com.vaadin.ui.Upload.SucceededListener;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TestForStyledUpload extends Application implements
- Upload.FinishedListener, FailedListener, SucceededListener,
+public class TestForStyledUpload extends Application.LegacyApplication
+ implements Upload.FinishedListener, FailedListener, SucceededListener,
StartedListener {
Layout main = new VerticalLayout();
@@ -69,6 +70,7 @@ public class TestForStyledUpload extends Application implements
up.addListener(new Upload.ProgressListener() {
+ @Override
public void updateProgress(long readBytes, long contentLenght) {
pi.setValue(new Float(readBytes / (float) contentLenght));
@@ -80,9 +82,21 @@ public class TestForStyledUpload extends Application implements
});
- final Button b = new Button("Update status", this, "readState");
-
- final Button c = new Button("Update status with gc", this, "gc");
+ final Button b = new Button("Update status",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ readState();
+ }
+ });
+
+ final Button c = new Button("Update status with gc",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ gc();
+ }
+ });
main.addComponent(up);
l = new Label("Idle");
@@ -101,6 +115,7 @@ public class TestForStyledUpload extends Application implements
Button cancel = new Button("Cancel current upload");
cancel.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
buffer.cancel();
}
@@ -111,6 +126,7 @@ public class TestForStyledUpload extends Application implements
final Button restart = new Button("Restart demo application");
restart.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
TestForStyledUpload.this.close();
}
@@ -145,6 +161,7 @@ public class TestForStyledUpload extends Application implements
refreshMemUsage();
}
+ @Override
public void uploadFinished(FinishedEvent event) {
status.removeAllComponents();
final InputStream stream = buffer.getStream();
@@ -153,11 +170,11 @@ public class TestForStyledUpload extends Application implements
"Upload finished, but output buffer is null!!"));
} else {
status.addComponent(new Label(
- "<b>Name:</b> " + event.getFilename(), Label.CONTENT_XHTML));
+ "<b>Name:</b> " + event.getFilename(), ContentMode.XHTML));
status.addComponent(new Label("<b>Mimetype:</b> "
- + event.getMIMEType(), Label.CONTENT_XHTML));
+ + event.getMIMEType(), ContentMode.XHTML));
status.addComponent(new Label("<b>Size:</b> " + event.getLength()
- + " bytes.", Label.CONTENT_XHTML));
+ + " bytes.", ContentMode.XHTML));
status.addComponent(new Link("Download " + buffer.getFileName(),
new StreamResource(buffer, buffer.getFileName(), this)));
@@ -197,6 +214,7 @@ public class TestForStyledUpload extends Application implements
up.interruptUpload();
}
+ @Override
public InputStream getStream() {
if (file == null) {
return null;
@@ -214,6 +232,7 @@ public class TestForStyledUpload extends Application implements
/**
* @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String)
*/
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
fileName = filename;
mimeType = MIMEType;
@@ -231,6 +250,7 @@ public class TestForStyledUpload extends Application implements
*
* @return String
*/
+ @Override
public String getFileName() {
return fileName;
}
@@ -246,11 +266,13 @@ public class TestForStyledUpload extends Application implements
}
+ @Override
public void uploadFailed(FailedEvent event) {
pi.setVisible(false);
l.setValue("Upload was interrupted");
}
+ @Override
public void uploadSucceeded(SucceededEvent event) {
pi.setVisible(false);
l.setValue("Finished upload, idle");
@@ -269,6 +291,7 @@ public class TestForStyledUpload extends Application implements
}
+ @Override
public void uploadStarted(StartedEvent event) {
pi.setVisible(true);
l.setValue("Started uploading file " + event.getFilename());
@@ -276,8 +299,8 @@ public class TestForStyledUpload extends Application implements
@Override
public void init() {
- Window w = new Window();
- w.setTheme("runo");
+ LegacyWindow w = new LegacyWindow();
+ setTheme("runo");
w.addComponent(main);
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/TestForTabSheet.java b/tests/testbench/com/vaadin/tests/TestForTabSheet.java
index 938bf43115..d180bd4be3 100644
--- a/tests/testbench/com/vaadin/tests/TestForTabSheet.java
+++ b/tests/testbench/com/vaadin/tests/TestForTabSheet.java
@@ -32,6 +32,7 @@ public class TestForTabSheet extends CustomComponent implements
tabsheet.addTab(tab3_root, "Third tab", null);
}
+ @Override
public void buttonClick(ClickEvent event) {
System.out.println("tab2=" + tab2_root.isEnabled() + " tab3="
+ tab3_root.isEnabled());
@@ -39,6 +40,7 @@ public class TestForTabSheet extends CustomComponent implements
tab3_root.setEnabled(true);
}
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
/*
* Cast to a TabSheet. This isn't really necessary in this example, as
diff --git a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
index 5b301fbc5d..a8d42184a0 100644
--- a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
+++ b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java
@@ -102,7 +102,12 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
t.setWidth("200px");
main.addComponent(t);
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
@@ -121,6 +126,7 @@ public class TestForTablesInitialColumnWidthLogicRendering extends
}
Button button = new Button("b", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
System.out.println("b click");
diff --git a/tests/testbench/com/vaadin/tests/TestForTrees.java b/tests/testbench/com/vaadin/tests/TestForTrees.java
index 0499ceb8ec..24d6102f80 100644
--- a/tests/testbench/com/vaadin/tests/TestForTrees.java
+++ b/tests/testbench/com/vaadin/tests/TestForTrees.java
@@ -86,7 +86,12 @@ public class TestForTrees extends CustomComponent implements Handler {
main.addComponent(ol);
contextTree = t;
- final Button b = new Button("refresh view", this, "createNewView");
+ final Button b = new Button("refresh view", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ createNewView();
+ }
+ });
main.addComponent(b);
}
@@ -127,6 +132,7 @@ public class TestForTrees extends CustomComponent implements Handler {
final Panel status = new Panel("Events");
final Button clear = new Button("c");
clear.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
status.removeAllComponents();
status.addComponent(clear);
@@ -140,8 +146,10 @@ public class TestForTrees extends CustomComponent implements Handler {
ol.addComponent(status);
t.addListener(new Listener() {
+ @Override
public void componentEvent(Event event) {
status.addComponent(new Label(event.getClass().getName()));
+ // TODO should not use Field.toString()
status.addComponent(new Label("selected: "
+ event.getSource().toString()));
}
@@ -150,10 +158,12 @@ public class TestForTrees extends CustomComponent implements Handler {
return ol;
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
if (action == actions[1]) {
al.addComponent(new Label("Delete selected on " + target));
diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java
index 399669357d..cfb40fc854 100644
--- a/tests/testbench/com/vaadin/tests/TestForUpload.java
+++ b/tests/testbench/com/vaadin/tests/TestForUpload.java
@@ -17,6 +17,7 @@ import java.lang.management.ManagementFactory;
import java.lang.management.MemoryMXBean;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.StreamResource;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
@@ -94,6 +95,7 @@ public class TestForUpload extends CustomComponent implements
up.addListener(new Listener() {
private static final long serialVersionUID = -8319074730512324303L;
+ @Override
public void componentEvent(Event event) {
// print out all events fired by upload for debug purposes
System.out.println("Upload fired event | " + event);
@@ -103,6 +105,7 @@ public class TestForUpload extends CustomComponent implements
up.addListener(new StartedListener() {
private static final long serialVersionUID = 5508883803861085154L;
+ @Override
public void uploadStarted(StartedEvent event) {
pi.setVisible(true);
pi2.setVisible(true);
@@ -116,6 +119,7 @@ public class TestForUpload extends CustomComponent implements
up.addListener(new Upload.FinishedListener() {
private static final long serialVersionUID = -3773034195991947371L;
+ @Override
public void uploadFinished(FinishedEvent event) {
pi.setVisible(false);
pi2.setVisible(false);
@@ -136,12 +140,11 @@ public class TestForUpload extends CustomComponent implements
"Upload finished, but output buffer is null"));
} else {
status.addComponent(new Label("<b>Name:</b> "
- + event.getFilename(), Label.CONTENT_XHTML));
+ + event.getFilename(), ContentMode.XHTML));
status.addComponent(new Label("<b>Mimetype:</b> "
- + event.getMIMEType(), Label.CONTENT_XHTML));
+ + event.getMIMEType(), ContentMode.XHTML));
status.addComponent(new Label("<b>Size:</b> "
- + event.getLength() + " bytes.",
- Label.CONTENT_XHTML));
+ + event.getLength() + " bytes.", ContentMode.XHTML));
status.addComponent(new Link("Download "
+ buffer.getFileName(), new StreamResource(buffer,
@@ -156,6 +159,7 @@ public class TestForUpload extends CustomComponent implements
up.addListener(new Upload.ProgressListener() {
+ @Override
public void updateProgress(long readBytes, long contentLenght) {
pi2.setValue(new Float(readBytes / (float) contentLenght));
@@ -164,9 +168,20 @@ public class TestForUpload extends CustomComponent implements
});
- final Button b = new Button("Reed state from upload", this, "readState");
+ final Button b = new Button("Reed state from upload",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ readState();
+ }
+ });
- final Button c = new Button("Force GC", this, "gc");
+ final Button c = new Button("Force GC", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ gc();
+ }
+ });
main.addComponent(b);
main.addComponent(c);
@@ -174,6 +189,7 @@ public class TestForUpload extends CustomComponent implements
main.addComponent(throwExecption);
main.addComponent(interrupt);
interrupt.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
up.interruptUpload();
}
@@ -186,6 +202,7 @@ public class TestForUpload extends CustomComponent implements
uploadBufferSelector.addItem("tempfile");
uploadBufferSelector
.addListener(new AbstractField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setBuffer();
}
@@ -213,6 +230,7 @@ public class TestForUpload extends CustomComponent implements
final Button restart = new Button("R");
restart.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getApplication().close();
}
@@ -271,6 +289,7 @@ public class TestForUpload extends CustomComponent implements
}
+ @Override
public InputStream getStream() {
if (outputBuffer == null) {
return null;
@@ -281,6 +300,7 @@ public class TestForUpload extends CustomComponent implements
/**
* @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String)
*/
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
fileName = filename;
mimeType = MIMEType;
@@ -301,6 +321,7 @@ public class TestForUpload extends CustomComponent implements
*
* @return String
*/
+ @Override
public String getFileName() {
return fileName;
}
@@ -335,6 +356,7 @@ public class TestForUpload extends CustomComponent implements
}
+ @Override
public InputStream getStream() {
if (file == null) {
return null;
@@ -351,6 +373,7 @@ public class TestForUpload extends CustomComponent implements
/**
* @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String)
*/
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
fileName = filename;
mimeType = MIMEType;
@@ -378,6 +401,7 @@ public class TestForUpload extends CustomComponent implements
*
* @return String
*/
+ @Override
public String getFileName() {
return fileName;
}
@@ -393,6 +417,7 @@ public class TestForUpload extends CustomComponent implements
}
+ @Override
public void updateProgress(long readBytes, long contentLenght) {
pi.setValue(new Float(readBytes / (float) contentLenght));
@@ -413,7 +438,7 @@ public class TestForUpload extends CustomComponent implements
}
private void beSluggish() {
- if (beSluggish.booleanValue()) {
+ if (beSluggish.getValue()) {
try {
Thread.sleep(1000);
} catch (InterruptedException e) {
@@ -424,7 +449,7 @@ public class TestForUpload extends CustomComponent implements
}
private void throwExecption() {
- if (throwExecption.booleanValue()) {
+ if (throwExecption.getValue()) {
throwExecption.setValue(false);
throw new RuntimeException("Test execption in receiver.");
}
diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
index b523813c0b..761d9bc106 100644
--- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
+++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java
@@ -8,6 +8,7 @@ import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Root;
import com.vaadin.ui.VerticalLayout;
public class TestForWindowOpen extends CustomComponent {
@@ -20,10 +21,11 @@ public class TestForWindowOpen extends CustomComponent {
main.addComponent(new Button("Open in this window",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow().open(r);
+ Root.getCurrent().getPage().open(r);
}
@@ -32,10 +34,11 @@ public class TestForWindowOpen extends CustomComponent {
main.addComponent(new Button("Open in target \"mytarget\"",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow().open(r, "mytarget");
+ Root.getCurrent().getPage().open(r, "mytarget");
}
@@ -44,11 +47,11 @@ public class TestForWindowOpen extends CustomComponent {
main.addComponent(new Button("Open in target \"secondtarget\"",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final ExternalResource r = new ExternalResource(
"http://www.google.com");
- getApplication().getMainWindow()
- .open(r, "secondtarget");
+ Root.getCurrent().getPage().open(r, "secondtarget");
}
diff --git a/tests/testbench/com/vaadin/tests/TestForWindowing.java b/tests/testbench/com/vaadin/tests/TestForWindowing.java
index bf6d794c13..bbd523c0fd 100644
--- a/tests/testbench/com/vaadin/tests/TestForWindowing.java
+++ b/tests/testbench/com/vaadin/tests/TestForWindowing.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Select;
import com.vaadin.ui.Slider;
import com.vaadin.ui.VerticalLayout;
@@ -36,6 +37,7 @@ public class TestForWindowing extends CustomComponent {
final Button create = new Button("Create a new window",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Window w = new Window("Testing Window");
@@ -58,6 +60,7 @@ public class TestForWindowing extends CustomComponent {
s1.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String v = (String) event.getProperty()
.getValue();
@@ -84,7 +87,7 @@ public class TestForWindowing extends CustomComponent {
w.addComponent(s);
- getApplication().getMainWindow().addWindow(w);
+ Root.getCurrent().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/TestIFrames.java b/tests/testbench/com/vaadin/tests/TestIFrames.java
index 5bbe58ee62..48c4027a79 100644
--- a/tests/testbench/com/vaadin/tests/TestIFrames.java
+++ b/tests/testbench/com/vaadin/tests/TestIFrames.java
@@ -4,6 +4,7 @@
package com.vaadin.tests;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
@@ -31,7 +32,7 @@ public class TestIFrames extends CustomComponent {
final int height = 250;
final String iFrame = "<iframe height=\"" + height + "\" width=\""
+ width + "\" src=\"" + URL + "\" />";
- return new Label(iFrame, Label.CONTENT_XHTML);
+ return new Label(iFrame, ContentMode.XHTML);
}
}
diff --git a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
index 2da22f7f5d..064a04847a 100644
--- a/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
+++ b/tests/testbench/com/vaadin/tests/TestSetVisibleAndCaching.java
@@ -9,9 +9,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class TestSetVisibleAndCaching extends com.vaadin.Application {
+public class TestSetVisibleAndCaching extends
+ com.vaadin.Application.LegacyApplication {
Panel panelA = new Panel("Panel A");
Panel panelB = new Panel("Panel B");
@@ -23,7 +24,8 @@ public class TestSetVisibleAndCaching extends com.vaadin.Application {
@Override
public void init() {
- final Window mainWindow = new Window("TestSetVisibleAndCaching");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "TestSetVisibleAndCaching");
setMainWindow(mainWindow);
panelA.addComponent(new Label(
@@ -48,6 +50,7 @@ public class TestSetVisibleAndCaching extends com.vaadin.Application {
selectPanel(selectedPanel);
buttonNextPanel.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectedPanel++;
if (selectedPanel > 2) {
diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
index a140b56285..50028137df 100644
--- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
+++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java
@@ -25,11 +25,11 @@ import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TestSizeableIncomponents extends Application {
+public class TestSizeableIncomponents extends Application.LegacyApplication {
private IndexedContainer cont;
private ComboBox select;
@@ -42,9 +42,9 @@ public class TestSizeableIncomponents extends Application {
initComponentList();
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
- w.setTheme("tests-components");
+ setTheme("tests-components");
final VerticalLayout main = new VerticalLayout();
w.setContent(main);
@@ -56,6 +56,7 @@ public class TestSizeableIncomponents extends Application {
prev = new Button("<<-|");
prev.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object cur = select.getValue();
Testable prev = (Testable) cont.prevItemId(cur);
@@ -71,6 +72,7 @@ public class TestSizeableIncomponents extends Application {
});
next = new Button("|->>");
next.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object cur = select.getValue();
Testable next = (Testable) cont.nextItemId(cur);
@@ -93,6 +95,7 @@ public class TestSizeableIncomponents extends Application {
select.setContainerDataSource(cont);
select.addListener(new ComboBox.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Testable t = (Testable) select.getValue();
if (t != null) {
diff --git a/tests/testbench/com/vaadin/tests/TestSplitPanel.java b/tests/testbench/com/vaadin/tests/TestSplitPanel.java
index 9e03cd4f89..87c8309faf 100644
--- a/tests/testbench/com/vaadin/tests/TestSplitPanel.java
+++ b/tests/testbench/com/vaadin/tests/TestSplitPanel.java
@@ -5,16 +5,16 @@
package com.vaadin.tests;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class TestSplitPanel extends com.vaadin.Application {
+public class TestSplitPanel extends com.vaadin.Application.LegacyApplication {
VerticalSplitPanel verticalSplit = new VerticalSplitPanel();
@Override
public void init() {
- final Window mainWindow = new Window("Feature Browser");
+ final LegacyWindow mainWindow = new LegacyWindow("Feature Browser");
setMainWindow(mainWindow);
verticalSplit.setFirstComponent(new Label("vertical first"));
diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystem.java b/tests/testbench/com/vaadin/tests/TreeFilesystem.java
index 761fd688d3..f43bcfb576 100644
--- a/tests/testbench/com/vaadin/tests/TreeFilesystem.java
+++ b/tests/testbench/com/vaadin/tests/TreeFilesystem.java
@@ -7,12 +7,13 @@ package com.vaadin.tests;
import java.io.File;
import com.vaadin.data.Item;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.util.SampleDirectory;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.Tree.ExpandEvent;
-import com.vaadin.ui.Window;
/**
* Browsable file explorer using Vaadin Tree component. Demonstrates: how to add
@@ -23,8 +24,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class TreeFilesystem extends com.vaadin.Application implements
- Tree.ExpandListener {
+public class TreeFilesystem extends com.vaadin.Application.LegacyApplication
+ implements Tree.ExpandListener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
@@ -33,11 +34,11 @@ public class TreeFilesystem extends com.vaadin.Application implements
@Override
public void init() {
- final Window main = new Window("Tree filesystem demo");
+ final LegacyWindow main = new LegacyWindow("Tree filesystem demo");
setMainWindow(main);
// Main window contains heading and panel
- main.addComponent(new Label("<h2>Tree demo</h2>", Label.CONTENT_XHTML));
+ main.addComponent(new Label("<h2>Tree demo</h2>", ContentMode.XHTML));
// configure file structure panel
main.addComponent(explorerPanel);
@@ -48,7 +49,7 @@ public class TreeFilesystem extends com.vaadin.Application implements
tree.addListener(this);
// Get sample directory
- final File sampleDir = SampleDirectory.getDirectory(this);
+ final File sampleDir = SampleDirectory.getDirectory(this, main);
// populate tree's root node with example directory
if (sampleDir != null) {
populateNode(sampleDir.getAbsolutePath(), null);
@@ -59,6 +60,7 @@ public class TreeFilesystem extends com.vaadin.Application implements
* Handle tree expand event, populate expanded node's childs with new files
* and directories.
*/
+ @Override
public void nodeExpand(ExpandEvent event) {
final Item i = tree.getItem(event.getItemId());
if (!tree.hasChildren(i)) {
diff --git a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
index 60d0f24b4e..2458f2dfa1 100644
--- a/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
+++ b/tests/testbench/com/vaadin/tests/TreeFilesystemContainer.java
@@ -14,9 +14,9 @@ import com.vaadin.ui.Component.Listener;
import com.vaadin.ui.Field;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Browsable file explorer using Vaadin Tree component. Demonstrates: how to use
@@ -28,8 +28,8 @@ import com.vaadin.ui.Window;
* @since 4.0.0
*
*/
-public class TreeFilesystemContainer extends com.vaadin.Application implements
- Listener {
+public class TreeFilesystemContainer extends
+ com.vaadin.Application.LegacyApplication implements Listener {
// Filesystem explorer panel and it's components
private final Panel explorerPanel = new Panel("Filesystem explorer");
@@ -43,7 +43,7 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements
@Override
public void init() {
- final Window w = new Window("Tree FilesystemContainer demo");
+ final LegacyWindow w = new LegacyWindow("Tree FilesystemContainer demo");
setMainWindow(w);
final VerticalLayout main = new VerticalLayout();
w.setContent(main);
@@ -65,7 +65,7 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements
propertyPanel.setEnabled(false);
// Get sample directory
- final File sampleDir = SampleDirectory.getDirectory(this);
+ final File sampleDir = SampleDirectory.getDirectory(this, w);
// Populate tree with FilesystemContainer
final FilesystemContainer fsc = new FilesystemContainer(sampleDir, true);
filesystem.setContainerDataSource(fsc);
@@ -80,6 +80,7 @@ public class TreeFilesystemContainer extends com.vaadin.Application implements
* Listener for any component events. This class has been registered as an
* listener for component fsTree.
*/
+ @Override
public void componentEvent(Event event) {
// Check if event occured at fsTree component
if (event.getSource() == filesystem) {
diff --git a/tests/testbench/com/vaadin/tests/UpgradingSample.java b/tests/testbench/com/vaadin/tests/UpgradingSample.java
index 2b3a85624f..3090962b71 100644
--- a/tests/testbench/com/vaadin/tests/UpgradingSample.java
+++ b/tests/testbench/com/vaadin/tests/UpgradingSample.java
@@ -14,14 +14,15 @@ package com.vaadin.tests;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* <p>
@@ -34,7 +35,7 @@ import com.vaadin.ui.Window;
* @since 3.1.1
* @author Vaadin Ltd.
*/
-public class UpgradingSample extends Application implements
+public class UpgradingSample extends Application.LegacyApplication implements
Property.ValueChangeListener {
/* Menu for navigating inside the application. */
@@ -56,7 +57,7 @@ public class UpgradingSample extends Application implements
public void init() {
// Create the main window of the application
- final Window main = new Window("Login example", layout);
+ final LegacyWindow main = new LegacyWindow("Login example", layout);
setMainWindow(main);
// Add menu and loginbox to the application
@@ -93,6 +94,7 @@ public class UpgradingSample extends Application implements
}
// Handle menu selection and update visible page
+ @Override
public void valueChange(Property.ValueChangeEvent event) {
layout.removeComponent(1, 0);
final String title = (String) menu.getValue();
@@ -113,14 +115,25 @@ public class UpgradingSample extends Application implements
// The components this loginbox is composed of
private final TextField loginName = new TextField("Name");
- private final Button loginButton = new Button("Enter", this, "login");
+ private final Button loginButton = new Button("Enter",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ login();
+ }
+ });
private final Panel loginPanel = new Panel("Login");
private final Panel statusPanel = new Panel();
private final Button logoutButton = new Button("Logout",
- UpgradingSample.this, "close");
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ close();
+ }
+ });
private final Label statusLabel = new Label();
@@ -145,7 +158,7 @@ public class UpgradingSample extends Application implements
// Login into application
public void login() {
- final String name = (String) loginName.getValue();
+ final String name = loginName.getValue();
if (name != null && name.length() > 0) {
setUser(name);
}
@@ -153,6 +166,7 @@ public class UpgradingSample extends Application implements
}
// Update login status on application user change events
+ @Override
public void applicationUserChanged(Application.UserChangeEvent event) {
updateStatus();
}
diff --git a/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java b/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
index 54a7d3d080..94635d17c4 100644
--- a/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
+++ b/tests/testbench/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java
@@ -51,6 +51,7 @@ public class UsingCustomNewItemHandlerInSelect extends CustomComponent {
}
public class MyNewItemHandler implements AbstractSelect.NewItemHandler {
+ @Override
public void addNewItem(String newItemCaption) {
// here could be db insert or other backend operation
Integer id = new Integer(sequence++);
diff --git a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
index 405f23ef91..db17148549 100644
--- a/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
+++ b/tests/testbench/com/vaadin/tests/UsingObjectsInSelect.java
@@ -9,17 +9,18 @@ import java.util.Random;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class UsingObjectsInSelect extends com.vaadin.Application implements
- ValueChangeListener {
+public class UsingObjectsInSelect extends
+ com.vaadin.Application.LegacyApplication implements ValueChangeListener {
private final Select select = new Select();
private final Label selectedTask = new Label("Selected task",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
public LinkedList<?> exampleTasks = new LinkedList<Object>();
@@ -27,7 +28,7 @@ public class UsingObjectsInSelect extends com.vaadin.Application implements
@Override
public void init() {
- final Window main = new Window("Select demo");
+ final LegacyWindow main = new LegacyWindow("Select demo");
setMainWindow(main);
final Panel panel = new Panel("Select demo");
@@ -59,6 +60,7 @@ public class UsingObjectsInSelect extends com.vaadin.Application implements
}
}
+ @Override
public void valueChange(ValueChangeEvent event) {
final Task task = (Task) select.getValue();
selectedTask.setValue("<b>Type:</b> " + task.getType()
diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
index 2b6656f11a..fbf9e7b46e 100644
--- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
+++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java
@@ -11,11 +11,11 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class GAESyncTest extends Application {
+public class GAESyncTest extends Application.LegacyApplication {
/**
*
@@ -45,7 +45,7 @@ public class GAESyncTest extends Application {
}
- private class IntrWindow extends Window {
+ private class IntrWindow extends LegacyWindow {
private int n = 0;
private static final long serialVersionUID = -6521351715072191625l;
TextField tf;
@@ -59,6 +59,7 @@ public class GAESyncTest extends Application {
tf = new TextField("Echo thingie");
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
IntrWindow.this.showNotification((String) event
.getProperty().getValue());
@@ -73,6 +74,7 @@ public class GAESyncTest extends Application {
{
Button b = new Button("Slow", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
Thread.sleep(15000);
@@ -89,9 +91,11 @@ public class GAESyncTest extends Application {
{
Button b = new Button("Add", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- if (getWindow() == getApplication().getMainWindow()) {
- getWindow().showNotification("main");
+ if (getRoot() == getMainWindow()) {
+ getRoot().getPage().showNotification(
+ new Notification("main"));
try {
Thread.sleep((5000));
} catch (InterruptedException e) {
@@ -139,8 +143,8 @@ public class GAESyncTest extends Application {
}
@Override
- public Window getWindow(String name) {
- Window w = super.getWindow(name);
+ public LegacyWindow getWindow(String name) {
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
w = new IntrWindow(this);
addWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
index 3d767eb016..cfbb4045a2 100644
--- a/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
+++ b/tests/testbench/com/vaadin/tests/application/ApplicationCloseTest.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.application;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.gwt.server.WebApplicationContext;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
@@ -14,7 +15,7 @@ public class ApplicationCloseTest extends TestBase {
@Override
protected void setup() {
Label applications = new Label("Applications in session: <br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
for (Application a : ((WebApplicationContext) getContext())
.getApplications()) {
applications.setValue(applications.getValue() + "App: " + a
@@ -26,6 +27,7 @@ public class ApplicationCloseTest extends TestBase {
Label thisApp = new Label("This applications: " + this);
Button close = new Button("Close this", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
event.getButton().getApplication().close();
}
@@ -50,7 +52,7 @@ public class ApplicationCloseTest extends TestBase {
/ 1000
/ 1000
+ "MiB memory for this application.<br/>Total memory usage reported as "
- + totalUsageString + "<br/>", Label.CONTENT_XHTML);
+ + totalUsageString + "<br/>", ContentMode.XHTML);
addComponent(thisApp);
addComponent(memoryUsage);
diff --git a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
index f212e74ca3..690df3f360 100644
--- a/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
+++ b/tests/testbench/com/vaadin/tests/application/ErrorInUnloadEvent.java
@@ -9,13 +9,14 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.PasswordField;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class ErrorInUnloadEvent extends AbstractTestCase {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
@Override
public void init() {
@@ -28,7 +29,8 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
private void showLoginWindow() {
if (mainWindow == null) {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
} else {
mainWindow.removeAllComponents();
}
@@ -37,9 +39,8 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
FormLayout formLayout = new FormLayout();
final TextField userField = new TextField("Username");
userField.setDebugId("user");
- final TextField passwordField = new TextField("Password");
+ final PasswordField passwordField = new PasswordField("Password");
passwordField.setDebugId("pwd");
- passwordField.setSecret(true);
Button login = new Button("login");
login.setDebugId("loginButton");
login.setClickShortcut(KeyCode.ENTER);
@@ -49,21 +50,21 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
mainWindow.setContent(formLayout);
login.addListener(new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
- String username = (String) userField.getValue();
- String password = (String) passwordField.getValue();
+ String username = userField.getValue();
+ String password = passwordField.getValue();
setUser(username);
showMainWindow();
}
});
-
- setMainWindow(mainWindow);
}
private void showMainWindow() {
if (mainWindow == null) {
- mainWindow = new Window();
+ mainWindow = new LegacyWindow();
+ setMainWindow(mainWindow);
} else {
mainWindow.removeAllComponents();
}
@@ -81,6 +82,7 @@ public class ErrorInUnloadEvent extends AbstractTestCase {
header.addComponent(title);
Button logout = new Button("Logout");
logout.addListener(new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
setUser(null);
showLoginWindow();
diff --git a/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.html b/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.html
deleted file mode 100644
index 64b3197fb8..0000000000
--- a/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.html
+++ /dev/null
@@ -1,122 +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:8068/" />
-<title>PaintableIdsShouldBeUnique</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">PaintableIdsShouldBeUnique</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.application.PaintableIdsShouldBeUnique?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyLabel</td>
- <td>30,11</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyLabel</td>
- <td>A label with a debug id.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>A label without a debug id.</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyButton/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyButton/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyButton/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_SMyLabel</td>
- <td>Button clicked 3 times.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>Button clicked 3 times.</td>
-</tr>
-<tr>
- <td>clickAndWait</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_0SMyLabel</td>
- <td>A label with a debug id.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>A label without a debug id.</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_0SMyButton/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_0SMyLabel</td>
- <td>Button clicked 1 times.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>Button clicked 1 times.</td>
-</tr>
-<tr>
- <td>clickAndWait</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_1SMyLabel</td>
- <td>A label with a debug id.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>A label without a debug id.</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_1SMyButton/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::PID_1SMyLabel</td>
- <td>Button clicked 1 times.</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestsapplicationPaintableIdsShouldBeUnique::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
- <td>Button clicked 1 times.</td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.java b/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.java
deleted file mode 100644
index a7c9fe4a4f..0000000000
--- a/tests/testbench/com/vaadin/tests/application/PaintableIdsShouldBeUnique.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package com.vaadin.tests.application;
-
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.tests.components.AbstractTestCase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-
-public class PaintableIdsShouldBeUnique extends AbstractTestCase {
-
- @Override
- public void init() {
- setMainWindow(new MyWindow());
- }
-
- @Override
- protected String getDescription() {
- return "Two Paintables attached to different windows with the same debug id should have unique paintable ids";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 5109;
- }
-
- @Override
- public Window getWindow(String name) {
- Window win = super.getWindow(name);
- if (win == null) {
- win = new MyWindow();
- addWindow(win);
- win.open(new ExternalResource(win.getURL()));
- }
- return win;
- }
-
- private class MyWindow extends Window {
- int counter = 0;
- Label labelWithDebugId = new Label("A label with a debug id.");
- Label labelWithoutDebugId = new Label("A label without a debug id.");
- Button button = new Button("Click me.");
- Button newwin = new Button("New window");
-
- MyWindow() {
- labelWithDebugId.setDebugId("MyLabel");
-
- button.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- counter++;
- labelWithDebugId.setValue("Button clicked " + counter
- + " times.");
- labelWithoutDebugId.setValue("Button clicked " + counter
- + " times.");
- }
- });
- button.setDebugId("MyButton");
-
- newwin.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- Window win = new MyWindow();
- PaintableIdsShouldBeUnique.this.addWindow(win);
- open(new ExternalResource(win.getURL()));
- }
- });
-
- addComponent(labelWithDebugId);
- addComponent(labelWithoutDebugId);
- addComponent(button);
- addComponent(newwin);
- };
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html
new file mode 100644
index 0000000000..d48ab220b5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.html
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.RefreshStatePreserve</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.back()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationRefreshStatePreserve::/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>Root id: 0</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
new file mode 100644
index 0000000000..36a793bd6d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.application;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+public class RefreshStatePreserve extends AbstractTestApplication {
+ public static class RefreshStateRoot extends Root {
+ @Override
+ public void init(WrappedRequest request) {
+ getContent().addComponent(
+ new Label("window.name: "
+ + request.getBrowserDetails().getWindowName()));
+ getContent().addComponent(new Label("Root id: " + getRootId()));
+ }
+ }
+
+ @Override
+ public void init() {
+ super.init();
+ setRootPreserved(true);
+ }
+
+ @Override
+ protected String getRootClassName(WrappedRequest request) {
+ return RefreshStateRoot.class.getName();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Refreshing the browser window should preserve the state";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8068);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
index 93e38bac5b..4a029e3373 100644
--- a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
+++ b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java
@@ -6,8 +6,8 @@ package com.vaadin.tests.application;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
public class TerminalErrorNotification extends TestBase {
@@ -15,6 +15,8 @@ public class TerminalErrorNotification extends TestBase {
protected void setup() {
Button button = new Button("Throw exception",
new Button.ClickListener() {
+
+ @Override
public void buttonClick(ClickEvent event) {
throw new RuntimeException("You asked for it");
}
@@ -27,7 +29,7 @@ public class TerminalErrorNotification extends TestBase {
public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) {
event.getThrowable().printStackTrace();
- Window mainWindow = getMainWindow();
+ Root mainWindow = getMainWindow();
if (mainWindow != null) {
Throwable throwable = event.getThrowable();
@@ -36,8 +38,7 @@ public class TerminalErrorNotification extends TestBase {
throwable = throwable.getCause();
}
- mainWindow.showNotification(
- "Got an exception: " + throwable.getMessage(),
+ Notification.show("Got an exception: " + throwable.getMessage(),
Notification.TYPE_ERROR_MESSAGE);
} else {
System.out.println("No main window found");
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html
new file mode 100644
index 0000000000..35657c73fc
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.html
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.application.ThreadLocalInstances?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementHeight</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::/VVerticalLayout[0]/ChildComponentContainer[1]/VEmbedded[0]/domChild[0]</td>
+ <td>11</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_15</td>
+ <td>1. null app in class init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_14</td>
+ <td>2. null root in class init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_13</td>
+ <td>3. null app in app constructor</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_12</td>
+ <td>4. null root in app constructor</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_11</td>
+ <td>5. this app in app init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_10</td>
+ <td>6. null root in app init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_9</td>
+ <td>7. this app in root init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_8</td>
+ <td>8. this root in root init</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_7</td>
+ <td>9. this app in root paint</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_6</td>
+ <td>10. this root in root paint</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_5</td>
+ <td>11. null app in background thread</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_4</td>
+ <td>12. null root in background thread</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_3</td>
+ <td>13. this app in resource handler</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_2</td>
+ <td>14. null root in resource handler</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_1</td>
+ <td>15. this app in button listener</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsapplicationThreadLocalInstances::PID_SLog_row_0</td>
+ <td>16. this root in button listener</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
new file mode 100644
index 0000000000..def68a7357
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java
@@ -0,0 +1,114 @@
+package com.vaadin.tests.application;
+
+import com.vaadin.Application;
+import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.terminal.ApplicationResource;
+import com.vaadin.terminal.DownloadStream;
+import com.vaadin.terminal.PaintException;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.tests.integration.FlagSeResource;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.Root;
+
+public class ThreadLocalInstances extends AbstractTestApplication {
+ private static final Application staticInitApplication = Application
+ .getCurrent();
+ private static final Root staticInitRoot = Root.getCurrent();
+
+ private final Root mainWindow = new Root() {
+ boolean paintReported = false;
+
+ @Override
+ protected void init(WrappedRequest request) {
+ reportCurrentStatus("root init");
+ }
+
+ @Override
+ public void paintContent(com.vaadin.terminal.PaintTarget target)
+ throws PaintException {
+ if (!paintReported) {
+ reportCurrentStatus("root paint");
+ Thread thread = new Thread() {
+ @Override
+ public void run() {
+ synchronized (ThreadLocalInstances.this) {
+ reportCurrentStatus("background thread");
+ }
+ }
+ };
+ thread.start();
+ paintReported = true;
+ }
+ super.paintContent(target);
+ }
+ };
+
+ private final ApplicationResource resource = new FlagSeResource(this) {
+ @Override
+ public DownloadStream getStream() {
+ reportCurrentStatus("resource handler");
+ return super.getStream();
+ }
+ };
+
+ private final Log log = new Log(16);
+
+ public ThreadLocalInstances() {
+ mainWindow.addComponent(log);
+ mainWindow.addComponent(new Embedded("Icon", resource));
+ mainWindow.addComponent(new Button("Sync", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ reportCurrentStatus("button listener");
+ }
+ }));
+
+ reportStatus("class init", staticInitApplication, staticInitRoot);
+ reportCurrentStatus("app constructor");
+ }
+
+ @Override
+ public void init() {
+ reportCurrentStatus("app init");
+ }
+
+ @Override
+ protected Root getRoot(WrappedRequest request)
+ throws RootRequiresMoreInformationException {
+ return mainWindow;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Tests the precence of Application.getCurrentApplication() and Root.getCurrentRoot() from different contexts";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7895);
+ }
+
+ private void reportCurrentStatus(String phase) {
+ reportStatus(phase, Application.getCurrent(), Root.getCurrent());
+ }
+
+ private void reportStatus(String phase, Application application, Root root) {
+ log.log(getState(application, this) + " app in " + phase);
+ log.log(getState(root, mainWindow) + " root in " + phase);
+ }
+
+ private static String getState(Object value, Object reference) {
+ if (value == null) {
+ return "null";
+ } else if (value == reference) {
+ return "this";
+ } else {
+ return value.toString();
+ }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java
index a3f11f2cd3..817acf20b5 100644
--- a/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java
+++ b/tests/testbench/com/vaadin/tests/application/WebBrowserSizeTest.java
@@ -18,6 +18,7 @@ public class WebBrowserSizeTest extends TestBase {
final Button update = new Button("Refresh", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
screenSizeLabel.setValue(getBrowser().getScreenWidth() + " x "
+ getBrowser().getScreenHeight());
diff --git a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java
index 35235bbe1f..004c8f1c91 100644
--- a/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java
+++ b/tests/testbench/com/vaadin/tests/application/WebBrowserTest.java
@@ -38,6 +38,7 @@ public class WebBrowserTest extends TestBase {
final Button update = new Button("Get TimeZone from browser",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
TimeZone hkiTZ = TimeZone
.getTimeZone("Europe/Helsinki");
diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
index c0141a72d5..abcdf232cd 100644
--- a/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
+++ b/tests/testbench/com/vaadin/tests/applicationcontext/ChangeSessionId.java
@@ -6,7 +6,7 @@ import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class ChangeSessionId extends AbstractTestCase {
@@ -16,12 +16,13 @@ public class ChangeSessionId extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Sestest Application");
+ LegacyWindow mainWindow = new LegacyWindow("Sestest Application");
mainWindow.addComponent(log);
mainWindow.addComponent(loginButton);
mainWindow.addComponent(new Button("Show session id",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
logSessionId();
}
@@ -29,6 +30,7 @@ public class ChangeSessionId extends AbstractTestCase {
setMainWindow(mainWindow);
loginButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
WebApplicationContext context = ((WebApplicationContext) getContext());
diff --git a/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java b/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java
index 8723e23a2a..f1730ed5f5 100644
--- a/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java
+++ b/tests/testbench/com/vaadin/tests/applicationcontext/RemoveTransactionListener.java
@@ -15,10 +15,12 @@ public class RemoveTransactionListener extends TestBase {
// Add one listener that will remove itself from within transactionEnd
getMainWindow().getApplication().getContext()
.addTransactionListener(new TransactionListener() {
+ @Override
public void transactionStart(Application application,
Object transactionData) {
}
+ @Override
public void transactionEnd(Application application,
Object transactionData) {
removeListener(this);
@@ -29,12 +31,14 @@ public class RemoveTransactionListener extends TestBase {
// Add one listener that will remove itself from within transactionStart
getMainWindow().getApplication().getContext()
.addTransactionListener(new TransactionListener() {
+ @Override
public void transactionStart(Application application,
Object transactionData) {
removeListener(this);
log.log("Listener removed in transactionStart");
}
+ @Override
public void transactionEnd(Application application,
Object transactionData) {
}
@@ -45,11 +49,13 @@ public class RemoveTransactionListener extends TestBase {
// ignored
getMainWindow().getApplication().getContext()
.addTransactionListener(new TransactionListener() {
+ @Override
public void transactionStart(Application application,
Object transactionData) {
log.log("transactionStart from last listener");
}
+ @Override
public void transactionEnd(Application application,
Object transactionData) {
log.log("transactionEnd from last listener");
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html b/tests/testbench/com/vaadin/tests/browserfeatures/FullHeightScrollbar.html
index ecac497a1b..37fee35746 100644
--- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.html
+++ b/tests/testbench/com/vaadin/tests/browserfeatures/FullHeightScrollbar.html
@@ -3,7 +3,7 @@
<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/" />
+<link rel="selenium.base" href="http://192.168.2.41:8888/" />
<title>New Test</title>
</head>
<body>
@@ -13,28 +13,33 @@
</thead><tbody>
<tr>
<td>open</td>
- <td>/run/com.vaadin.tests.components.formlayout.FormLayoutReplaceComponent?restartApplication</td>
+ <td>/statictestfiles/browserfeatures/fullHeightScrollbar.html</td>
<td></td>
</tr>
<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>1-withScrolling</td>
+</tr>
+<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
- <td>6,6</td>
+ <td>disableScrolling</td>
+ <td>34,7</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
- <td>textarea-visible</td>
+ <td>2-withoutScrolling</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutReplaceComponent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCheckBox[0]/domChild[0]</td>
- <td>5,8</td>
+ <td>triggerReflow</td>
+ <td>34,7</td>
</tr>
<tr>
<td>screenCapture</td>
<td></td>
- <td>textarea-hidden</td>
+ <td>3-afterReflow</td>
</tr>
</tbody></table>
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
index 2a98988487..be3b7760f2 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentContainerTest.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.components;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
@@ -28,6 +29,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private String CATEGORY_COMPONENT_CONTAINER_FEATURES = "Component container features";
private Command<T, ComponentSize> addButtonCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
Button b = new Button("A button");
c.addComponent(b);
@@ -37,6 +39,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private Command<T, ComponentSize> addNativeButtonCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
NativeButton b = new NativeButton("Native button");
c.addComponent(b);
@@ -45,6 +48,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addTextAreaCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
TextArea ta = new TextArea();
c.addComponent(ta);
@@ -53,6 +57,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addRichTextAreaCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
RichTextArea ta = new RichTextArea();
c.addComponent(ta);
@@ -61,6 +66,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addTextFieldCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
TextField tf = new TextField();
c.addComponent(tf);
@@ -69,6 +75,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addInlineDateFieldCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
InlineDateField tf = new InlineDateField();
c.addComponent(tf);
@@ -76,6 +83,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
}
};
private Command<T, ComponentSize> addPopupDateFieldCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
PopupDateField tf = new PopupDateField();
c.addComponent(tf);
@@ -84,6 +92,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addVerticalSplitPanelCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
VerticalSplitPanel vsp = new VerticalSplitPanel();
c.addComponent(vsp);
@@ -92,6 +101,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addHorizontalSplitPanelCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
HorizontalSplitPanel vsp = new HorizontalSplitPanel();
c.addComponent(vsp);
@@ -100,6 +110,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, ComponentSize> addTabSheetCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
TabSheet ts = createTabSheet();
c.addComponent(ts);
@@ -109,6 +120,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private Command<T, ComponentSize> addTableCommand = new Command<T, ComponentSize>() {
+ @Override
public void execute(T c, ComponentSize size, Object data) {
Table t = createTable();
c.addComponent(t);
@@ -116,12 +128,14 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
}
};
private Command<T, Object> removeAllComponentsCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object value, Object data) {
c.removeAllComponents();
}
};
private Command<T, Integer> removeComponentByIndexCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
Component child = getComponentAtIndex(c, value);
c.removeComponent(child);
@@ -130,6 +144,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
};
private Command<T, Boolean> componentAttachListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((ComponentAttachListener) AbstractComponentContainerTest.this);
@@ -141,6 +156,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private Command<T, Boolean> componentDetachListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((ComponentDetachListener) AbstractComponentContainerTest.this);
@@ -152,6 +168,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private Command<T, Integer> setComponentHeight = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
Component child = getComponentAtIndex(c, value);
child.setHeight((String) data);
@@ -161,6 +178,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
private Command<T, Integer> setComponentWidth = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
Component child = getComponentAtIndex(c, value);
child.setWidth((String) data);
@@ -284,6 +302,11 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
addCommands.put("PopupDateField", addPopupDateFieldCommand);
addCommands.put("VerticalSplitPanel", addVerticalSplitPanelCommand);
addCommands.put("HorizontalSplitPanel", addHorizontalSplitPanelCommand);
+
+ HashSet<String> noVerticalSize = new HashSet<String>();
+ noVerticalSize.add("TextField");
+ noVerticalSize.add("Button");
+
// addCommands.put("AbsoluteLayout", addAbsoluteLayoutCommand);
// addCommands.put("HorizontalLayout", addHorizontalLayoutCommand);
// addCommands.put("VerticalLayout", addVerticalLayoutCommand);
@@ -303,6 +326,10 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
createCategory(componentCategory, subCategory);
for (ComponentSize size : sizes) {
+ if (size.getHeight() != null
+ && noVerticalSize.contains(componentCategory)) {
+ continue;
+ }
createClickAction(size.toString(), componentCategory,
addCommands.get(componentCategory), size);
}
@@ -338,6 +365,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
}
+ @Override
public void componentDetachedFromContainer(ComponentDetachEvent event) {
log(event.getClass().getSimpleName() + ": "
+ event.getDetachedComponent().getClass().getSimpleName()
@@ -345,6 +373,7 @@ public abstract class AbstractComponentContainerTest<T extends AbstractComponent
+ event.getContainer().getClass().getSimpleName());
}
+ @Override
public void componentAttachedToContainer(ComponentAttachEvent event) {
log(event.getClass().getSimpleName() + ": "
+ event.getAttachedComponent().getClass().getSimpleName()
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
index fe61df8913..38bba7721c 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java
@@ -8,6 +8,12 @@ import java.util.Locale;
import java.util.Map;
import java.util.Set;
+import com.vaadin.event.FieldEvents.BlurEvent;
+import com.vaadin.event.FieldEvents.BlurListener;
+import com.vaadin.event.FieldEvents.BlurNotifier;
+import com.vaadin.event.FieldEvents.FocusEvent;
+import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.util.Log;
@@ -15,9 +21,11 @@ import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
+import com.vaadin.ui.themes.BaseTheme;
public abstract class AbstractComponentTest<T extends AbstractComponent>
- extends AbstractComponentTestCase<T> {
+ extends AbstractComponentTestCase<T> implements FocusListener,
+ BlurListener {
protected static final String TEXT_SHORT = "Short";
protected static final String TEXT_MEDIUM = "This is a semi-long text that might wrap.";
@@ -112,6 +120,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
MenuItem showEventLog = settingsMenu.addItem("Show event log",
new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
boolean selected = !isSelected(selectedItem);
setLogVisible(selected);
@@ -123,6 +132,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
settingsMenu.addItem("Clear log", new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
log.clear();
}
@@ -132,6 +142,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
MenuItem layoutHeight = layoutSize.addItem("Height", null);
for (final String name : sizeOptions.keySet()) {
layoutWidth.addItem(name, new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
getTestComponents().get(0).getParent()
.setWidth(sizeOptions.get(name));
@@ -139,6 +150,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
});
layoutHeight.addItem(name, new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
getTestComponents().get(0).getParent()
.setHeight(sizeOptions.get(name));
@@ -150,11 +162,23 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
protected void setLogVisible(boolean visible) {
- log.setVisible(visible);
+ // This is only to be screenshot-compatible with Vaadin 6, where
+ // invisible components cause spacing
+ if (visible) {
+ log.setHeight(null);
+ log.setWidth(null);
+ log.setCaption((String) log.getData());
+ } else {
+ log.setHeight("0px");
+ log.setWidth("0px");
+ log.setCaption(null);
+ }
}
private void createLog() {
log = new Log(5).setNumberLogRows(true);
+ log.setData(log.getCaption());
+ log.setStyleName(BaseTheme.CLIP);
getLayout().addComponent(log, 1);
}
@@ -221,6 +245,41 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
+ protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
+
+ @Override
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((FocusNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((FocusNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+ protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
+
+ @Override
+ public void execute(T c, Boolean value, Object data) {
+ if (value) {
+ ((BlurNotifier) c).addListener(AbstractComponentTest.this);
+ } else {
+ ((BlurNotifier) c).removeListener(AbstractComponentTest.this);
+ }
+ }
+ };
+
+ protected void createFocusListener(String category) {
+ createBooleanAction("Focus listener", category, false,
+ focusListenerCommand);
+
+ }
+
+ protected void createBlurListener(String category) {
+ createBooleanAction("Blur listener", category, false,
+ blurListenerCommand);
+
+ }
+
private void createStyleNameSelect(String category) {
LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
options.put("-", null);
@@ -416,6 +475,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
final Object data) {
return new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
boolean selected = !isSelected(selectedItem);
doCommand(getText(selectedItem), booleanCommand, selected, data);
@@ -430,6 +490,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
final DATATYPE value, final Object data) {
return new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
doCommand(getText(selectedItem), command, value, data);
}
@@ -453,6 +514,7 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
final com.vaadin.tests.components.ComponentTestCase.Command<T, VALUETYPE> cmd,
final VALUETYPE object, final Object data) {
return new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
doCommand(getText(selectedItem), cmd, object, data);
@@ -668,4 +730,15 @@ public abstract class AbstractComponentTest<T extends AbstractComponent>
}
}
+
+ @Override
+ public void focus(FocusEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
+ @Override
+ public void blur(BlurEvent event) {
+ log(event.getClass().getSimpleName());
+ }
+
}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
index 1b04198da0..d8ae43fd6d 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java
@@ -71,12 +71,14 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, String> widthCommand = new Command<T, String>() {
+ @Override
public void execute(T t, String value, Object data) {
t.setWidth(value);
}
};
protected Command<T, String> heightCommand = new Command<T, String>() {
+ @Override
public void execute(T t, String value, Object data) {
t.setHeight(value);
}
@@ -84,6 +86,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Boolean> enabledCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean enabled, Object data) {
c.setEnabled(enabled);
}
@@ -91,6 +94,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Boolean> immediateCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean immediate, Object data) {
c.setImmediate(immediate);
}
@@ -98,6 +102,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Boolean> errorIndicatorCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean enabled, Object data) {
if (enabled) {
c.setComponentError(new UserError(errorMessage));
@@ -111,6 +116,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, String> errorMessageCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
errorMessage = value;
if (c.getComponentError() != null) {
@@ -124,9 +130,10 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
// TODO Move to AbstractFieldTestCase
protected Command<T, Boolean> requiredCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean enabled, Object data) {
if (c instanceof Field) {
- ((Field) c).setRequired(enabled);
+ ((Field<?>) c).setRequired(enabled);
} else {
throw new IllegalArgumentException(c.getClass().getName()
+ " is not a field and cannot be set to required");
@@ -135,13 +142,15 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
};
protected Command<T, String> requiredErrorMessageCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
- ((Field) c).setRequiredError(value);
+ ((Field<?>) c).setRequiredError(value);
}
};
protected Command<T, String> descriptionCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setDescription(value);
}
@@ -149,6 +158,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Boolean> readonlyCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean enabled, Object data) {
c.setReadOnly(enabled);
}
@@ -156,6 +166,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Boolean> visibleCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean enabled, Object data) {
c.setVisible(enabled);
}
@@ -163,6 +174,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Resource> iconCommand = new Command<T, Resource>() {
+ @Override
public void execute(T c, Resource value, Object data) {
c.setIcon(value);
}
@@ -170,6 +182,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
};
protected Command<T, String> captionCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setCaption(value);
}
@@ -178,6 +191,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
protected Command<T, Locale> localeCommand = new Command<T, Locale>() {
+ @Override
public void execute(T c, Locale value, Object data) {
c.setLocale(value);
}
@@ -206,6 +220,7 @@ public abstract class AbstractComponentTestCase<T extends AbstractComponent>
}
protected Command<T, String> styleNameCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setStyleName(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java
index 5c25359e28..af62e5e4a4 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractLayoutTest.java
@@ -15,6 +15,7 @@ public abstract class AbstractLayoutTest<T extends AbstractLayout> extends
protected static final String CATEGORY_LAYOUT_FEATURES = "Layout features";
private Command<T, MarginInfo> marginCommand = new Command<T, MarginInfo>() {
+ @Override
public void execute(T c, MarginInfo value, Object data) {
c.setMargin(value);
@@ -22,6 +23,7 @@ public abstract class AbstractLayoutTest<T extends AbstractLayout> extends
};
protected Command<T, Boolean> spacingCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
((SpacingHandler) c).setSpacing(value);
}
@@ -29,6 +31,7 @@ public abstract class AbstractLayoutTest<T extends AbstractLayout> extends
private Command<T, Integer> setComponentAlignment = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object alignment) {
Component child = getComponentAtIndex(c, value);
((AlignmentHandler) c).setComponentAlignment(child,
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java b/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java
index fd323d2156..1d18cba952 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractOrderedLayoutTest.java
@@ -12,6 +12,7 @@ public abstract class AbstractOrderedLayoutTest<T extends AbstractOrderedLayout>
private Command<T, Boolean> layoutClickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((LayoutClickListener) AbstractOrderedLayoutTest.this);
@@ -24,6 +25,7 @@ public abstract class AbstractOrderedLayoutTest<T extends AbstractOrderedLayout>
private Command<T, Integer> setComponentExpandRatio = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object ratio) {
Component child = getComponentAtIndex(c, value);
c.setExpandRatio(child, (Float) ratio);
@@ -74,6 +76,7 @@ public abstract class AbstractOrderedLayoutTest<T extends AbstractOrderedLayout>
}
+ @Override
public void layoutClick(LayoutClickEvent event) {
log(event.getClass().getSimpleName() + ": button="
+ event.getButtonName() + ", childComponent="
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java b/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java
new file mode 100644
index 0000000000..8de1e68b4b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestApplication.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.Application;
+import com.vaadin.service.ApplicationContext;
+import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+
+public abstract class AbstractTestApplication extends Application {
+ protected abstract String getTestDescription();
+
+ protected abstract Integer getTicketNumber();
+
+ protected WebBrowser getBrowser() {
+ ApplicationContext context = getContext();
+ if (context instanceof AbstractWebApplicationContext) {
+ WebBrowser webBrowser = ((AbstractWebApplicationContext) context)
+ .getBrowser();
+ return webBrowser;
+ }
+
+ return null;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
index e2b3ad0fe1..11d960e143 100644
--- a/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestCase.java
@@ -5,7 +5,7 @@ import com.vaadin.service.ApplicationContext;
import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
import com.vaadin.terminal.gwt.server.WebBrowser;
-public abstract class AbstractTestCase extends Application {
+public abstract class AbstractTestCase extends Application.LegacyApplication {
protected abstract String getDescription();
diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java
new file mode 100644
index 0000000000..d20f7a4a21
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AbstractTestRoot.java
@@ -0,0 +1,69 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.Application;
+import com.vaadin.service.ApplicationContext;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.VerticalLayout;
+
+public abstract class AbstractTestRoot extends Root {
+
+ @Override
+ public void init(WrappedRequest request) {
+ getPage().setTitle(getClass().getName());
+
+ Label label = new Label(getTestDescription(), ContentMode.XHTML);
+ label.setWidth("100%");
+
+ layout = new VerticalLayout();
+
+ getContent().addComponent(label);
+ getContent().addComponent(layout);
+ ((VerticalLayout) getContent()).setExpandRatio(layout, 1);
+
+ setup(request);
+ }
+
+ private VerticalLayout layout;
+
+ protected VerticalLayout getLayout() {
+ return layout;
+ }
+
+ protected abstract void setup(WrappedRequest request);
+
+ @Override
+ public void addComponent(Component c) {
+ getLayout().addComponent(c);
+ }
+
+ @Override
+ public void removeComponent(Component c) {
+ getLayout().removeComponent(c);
+ }
+
+ @Override
+ public void replaceComponent(Component oldComponent, Component newComponent) {
+ getLayout().replaceComponent(oldComponent, newComponent);
+ }
+
+ protected abstract String getTestDescription();
+
+ protected abstract Integer getTicketNumber();
+
+ protected WebBrowser getBrowser() {
+ ApplicationContext context = Application.getCurrent().getContext();
+ if (context instanceof AbstractWebApplicationContext) {
+ AbstractWebApplicationContext webContext = (AbstractWebApplicationContext) context;
+ return webContext.getBrowser();
+ }
+
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html
new file mode 100644
index 0000000000..512140cc6d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.html
@@ -0,0 +1,456 @@
+<?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>AddRemoveSetStyleNamesTest</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">AddRemoveSetStyleNamesTest</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>run/com.vaadin.tests.components.AddRemoveSetStyleNamesTest?restartApplication</td>
+ <td></td>
+</tr>
+<!--add style 1. assert style1-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<!--add style 2. assert style1, style2-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style2</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style2</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style2</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style2</td>
+</tr>
+<!--remove style 1. assertNot style1. assert style2-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style2</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style2</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style2</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style2</td>
+</tr>
+<!--remove style 2. assertNot style1, style2-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style2</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style2</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style2</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style2</td>
+</tr>
+<!--add style1. set thestyle. assertNot style1. assert thestyle.-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-thestyle</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>thestyle</td>
+</tr>
+<!--remove thestyle. assertNot thestyle-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>thestyle</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-thestyle</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-thestyle</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>thestyle</td>
+</tr>
+<!--set thestyle. add style1. assert thestyle, style1-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>thestyle</td>
+</tr>
+<!--remove style 1. assertNot style1. assert thestyle-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>thestyle</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-thestyle</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>thestyle</td>
+</tr>
+<!--add style 1. remove thestyle. assertNot style1, thestyle-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>v-datefield-thestyle</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]</td>
+ <td>thestyle</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupCalendar[0]#popupButton</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-style1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>style1</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>v-datefield-popup-thestyle</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsAddRemoveSetStyleNamesTest::Root/VOverlay[0]</td>
+ <td>thestyle</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java
new file mode 100644
index 0000000000..926af72a2f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/AddRemoveSetStyleNamesTest.java
@@ -0,0 +1,83 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.PopupDateField;
+
+public class AddRemoveSetStyleNamesTest extends TestBase {
+
+ private String style1 = "style1";
+ private String style2 = "style2";
+ private String thestyle = "thestyle";
+
+ private PopupDateField popupDateField;
+ private Button button1;
+ private Button button2;
+ private Button button3;
+
+ private Button.ClickListener listener;
+
+ @Override
+ protected void setup() {
+ popupDateField = new PopupDateField("PopupDateField");
+ popupDateField.setRequired(true);
+ popupDateField.setRequiredError("abcd");
+ addComponent(popupDateField);
+
+ listener = new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String style = (String) event.getButton().getData();
+ setComponentsStyle(style, !popupDateField.getStyleName()
+ .contains(style), event.getButton());
+ }
+ };
+
+ button1 = new Button("Add style1", listener);
+ button1.setData(style1);
+ addComponent(button1);
+
+ button2 = new Button("Add style2", listener);
+ button2.setData(style2);
+ addComponent(button2);
+
+ button3 = new Button("Set thestyle", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (popupDateField.getStyleName().contains(thestyle)) {
+ popupDateField.removeStyleName(thestyle);
+ button3.setCaption("Set thestyle");
+ } else {
+ popupDateField.setStyleName(thestyle);
+ button1.setCaption("Add style1");
+ button2.setCaption("Add style2");
+ button3.setCaption("Remove thestyle");
+ }
+ }
+ });
+ addComponent(button3);
+ }
+
+ private void setComponentsStyle(String style, boolean add, Button button) {
+ if (add) {
+ popupDateField.addStyleName(style);
+ button.setCaption("Remove " + style);
+ } else {
+ popupDateField.removeStyleName(style);
+ button.setCaption("Add " + style);
+ }
+ }
+
+ @Override
+ protected String getDescription() {
+ return "If a widget has set multiple css class names, AbtractComponentConnector.getStyleNames() removes all but first one of them. This is not acceptable, because we should be able to create connector for any existing GWT component and thus we do not know it it depends on multiple css class names.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8664;
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
index 1e15f7a47b..e949d62f71 100644
--- a/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/ComponentTestCase.java
@@ -7,6 +7,7 @@ import java.util.List;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
@@ -111,9 +112,11 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
boolean initialState, final Command<T, Boolean> command) {
CheckBox checkBox = new CheckBox(caption);
- checkBox.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ checkBox.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
doCommand(command, enabled);
}
});
@@ -132,10 +135,14 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
final Command<T, Boolean> command) {
Button button = new Button(caption);
+ button.setData(Boolean.FALSE);
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
- doCommand(command, enabled);
+ Button b = event.getButton();
+ boolean state = (Boolean) b.getData();
+ b.setData(!state);
+ doCommand(command, state);
}
});
@@ -158,6 +165,7 @@ public abstract class ComponentTestCase<T extends AbstractComponent> extends
select.setNullSelectionAllowed(false);
select.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object itemId = event.getProperty().getValue();
Item item = select.getItem(itemId);
diff --git a/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java b/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java
index 57b81ddecc..9fe13c457a 100644
--- a/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java
+++ b/tests/testbench/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java
@@ -57,6 +57,7 @@ public class CustomComponentwithUndefinedSize extends TestBase {
Button button = new Button("Change panel size",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
switch (step++ % 4) {
case 0:
diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.html b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.html
new file mode 100644
index 0000000000..029da64754
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.html
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>DisableEnableCascade</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">DisableEnableCascade</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.DisableEnableCascade?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>panel-disabled</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tabsheet-disabled</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>all-enabled</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>tabsheet-button-disabled</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascade::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>all-enabled2</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java
new file mode 100644
index 0000000000..cd284224a0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascade.java
@@ -0,0 +1,93 @@
+package com.vaadin.tests.components;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TabSheet;
+
+public class DisableEnableCascade extends TestBase {
+
+ private Panel outerPanel;
+ private TabSheet innerTabsheet;
+ private Button button;
+ private Button enableDisablePanelButton;
+ private Button enableDisableTabSheetButton;
+ private Button enableDisableButtonButton;
+
+ @Override
+ protected void setup() {
+
+ outerPanel = new Panel("Outer panel, enabled");
+ innerTabsheet = new TabSheet();
+ innerTabsheet.setCaption("Inner Tabsheet, enabled");
+
+ button = new Button("Button, enabled");
+
+ outerPanel.setContent(innerTabsheet);
+ innerTabsheet.addTab(button, "Tab containing button");
+
+ addComponent(outerPanel);
+
+ enableDisablePanelButton = new Button("Disable panel",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(outerPanel, enableDisablePanelButton);
+
+ }
+ });
+
+ enableDisableTabSheetButton = new Button("Disable TabSheet",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(innerTabsheet,
+ enableDisableTabSheetButton);
+
+ }
+ });
+
+ enableDisableButtonButton = new Button("Disable Button",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(button, enableDisableButtonButton);
+
+ }
+ });
+
+ addComponent(enableDisablePanelButton);
+ addComponent(enableDisableTabSheetButton);
+ addComponent(enableDisableButtonButton);
+ }
+
+ protected void enableDisable(Component target, Button button) {
+ if (target.isEnabled()) {
+ target.setEnabled(false);
+ button.setCaption(button.getCaption().replace("Disable", "Enable"));
+ target.setCaption(target.getCaption()
+ .replace("enabled", "disabled"));
+ } else {
+ target.setEnabled(true);
+ button.setCaption(button.getCaption().replace("Enable", "Disable"));
+ target.setCaption(target.getCaption()
+ .replace("disabled", "enabled"));
+ }
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests the disable state is cascaded correctly to children. Disabling a parent should disabled its children aswell. The buttons only toggle the state of the target component.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8507;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.html b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.html
new file mode 100644
index 0000000000..ac3a4f0cb0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.html
@@ -0,0 +1,250 @@
+<?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>DisableEnableCascadeStyles</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">DisableEnableCascadeStyles</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.DisableEnableCascadeStyles?restartApplication</td>
+ <td></td>
+</tr>
+<!--disable tabsheet-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--enable tabsheet-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--disable layout containing components-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--enable layout containing components-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--disable all bottom level components-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[3]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--enable all bottom level components-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VButton[3]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--assert css class names for bottom level components-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VNativeButton[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/VTextArea[0]</td>
+ <td>v-disabled</td>
+</tr>
+<!--assert css class name for component captions-->
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestscomponentsDisableEnableCascadeStyles::/VVerticalLayout[0]/VVerticalLayout[0]/VPanel[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/domChild[3]/domChild[0]</td>
+ <td>v-disabled</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java
new file mode 100644
index 0000000000..0279a92437
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/DisableEnableCascadeStyles.java
@@ -0,0 +1,146 @@
+package com.vaadin.tests.components;
+
+import java.util.Iterator;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class DisableEnableCascadeStyles extends TestBase {
+
+ private Panel outerPanel;
+ private TabSheet innerTabsheet;
+ private Button button;
+ private TextArea textArea;
+ private TextField textField;
+ private VerticalLayout layout;
+ private NativeButton nativeButton;
+ private Button enableDisablePanelButton;
+ private Button enableDisableTabSheetButton;
+ private Button enableDisableLayoutButton;
+ private Button enableDisableComponentsButton;
+
+ @Override
+ protected void setup() {
+
+ outerPanel = new Panel("Outer panel, enabled");
+ innerTabsheet = new TabSheet();
+ innerTabsheet.setCaption("Inner Tabsheet, enabled");
+
+ button = new Button("Button, enabled");
+ nativeButton = new NativeButton("NativeButton, enabled");
+ textField = new TextField("TextField with caption and value, enabled");
+ textField.setValue("Text");
+ textArea = new TextArea("TextArea with caption and value, enabled");
+ textArea.setValue("Text");
+ layout = new VerticalLayout();
+ layout.setCaption("VerticalLayout, enabled");
+ layout.addComponent(button);
+ layout.addComponent(nativeButton);
+ layout.addComponent(textField);
+ layout.addComponent(textArea);
+
+ outerPanel.setContent(innerTabsheet);
+ innerTabsheet.addTab(layout, "Tab containing layout");
+
+ addComponent(outerPanel);
+
+ enableDisablePanelButton = new Button("Disable panel",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(outerPanel, enableDisablePanelButton);
+
+ }
+ });
+
+ enableDisableTabSheetButton = new Button("Disable TabSheet",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(innerTabsheet,
+ enableDisableTabSheetButton);
+
+ }
+ });
+
+ enableDisableLayoutButton = new Button("Disable Tab content (Layout)",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ enableDisable(layout, enableDisableLayoutButton);
+
+ }
+ });
+ enableDisableComponentsButton = new Button("Disable Layout Components",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ for (Iterator<Component> i = layout
+ .getComponentIterator(); i.hasNext();) {
+ final Component c = i.next();
+ if (c.isEnabled()) {
+ c.setEnabled(false);
+ c.setCaption(c.getCaption().replace("enabled",
+ "disabled"));
+ } else {
+ c.setEnabled(true);
+ c.setCaption(c.getCaption().replace("disabled",
+ "enabled"));
+ }
+ }
+ if (layout.getComponent(0).isEnabled()) {
+ enableDisableComponentsButton
+ .setCaption(enableDisableComponentsButton
+ .getCaption().replace("Enable",
+ "Disable"));
+ } else {
+ enableDisableComponentsButton
+ .setCaption(enableDisableComponentsButton
+ .getCaption().replace("Disable",
+ "Enable"));
+ }
+ }
+ });
+ addComponent(enableDisablePanelButton);
+ addComponent(enableDisableTabSheetButton);
+ addComponent(enableDisableLayoutButton);
+ addComponent(enableDisableComponentsButton);
+ }
+
+ protected void enableDisable(Component target, Button button) {
+ if (target.isEnabled()) {
+ target.setEnabled(false);
+ button.setCaption(button.getCaption().replace("Disable", "Enable"));
+ target.setCaption(target.getCaption()
+ .replace("enabled", "disabled"));
+ } else {
+ target.setEnabled(true);
+ button.setCaption(button.getCaption().replace("Enable", "Disable"));
+ target.setCaption(target.getCaption()
+ .replace("disabled", "enabled"));
+ }
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests the disable state is cascaded correctly to children components that can be disabled. The children and their captions must get the v-disabled style name.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8708;
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java
index 267807b16b..7987c800f9 100644
--- a/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java
+++ b/tests/testbench/com/vaadin/tests/components/FocusAndBlurListeners.java
@@ -23,6 +23,7 @@ public class FocusAndBlurListeners extends TestBase {
private FocusListener focusListener = new FocusListener() {
+ @Override
public void focus(FocusEvent event) {
Label msg = new Label(new Date() + " Focused "
+ event.getComponent().getCaption());
@@ -31,6 +32,7 @@ public class FocusAndBlurListeners extends TestBase {
};
private BlurListener blurListener = new BlurListener() {
+ @Override
public void blur(BlurEvent event) {
Label msg = new Label(new Date() + " Blurred "
+ event.getComponent().getCaption());
@@ -74,6 +76,7 @@ public class FocusAndBlurListeners extends TestBase {
private int i;
+ @Override
public void buttonClick(ClickEvent event) {
ogm.addItem("newItem" + i++);
diff --git a/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java b/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java
index 124f2b9cdf..cffc8ca27b 100644
--- a/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java
+++ b/tests/testbench/com/vaadin/tests/components/FocusFromShortcutAction.java
@@ -20,6 +20,7 @@ public class FocusFromShortcutAction extends TestBase {
addComponent(select);
addComponent(text);
Button focusText = new Button("Focus text", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
text.focus();
}
@@ -29,6 +30,7 @@ public class FocusFromShortcutAction extends TestBase {
addComponent(focusText);
Button focusSelect = new Button("Focus select",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
select.focus();
}
diff --git a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
index 7ed44768fd..6e54c0d9f4 100644
--- a/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
+++ b/tests/testbench/com/vaadin/tests/components/LayoutAttachListenerInfo.java
@@ -11,10 +11,9 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.ComponentContainer.ComponentAttachEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.OptionGroup;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
-
public class LayoutAttachListenerInfo extends TestBase {
@@ -28,6 +27,7 @@ public class LayoutAttachListenerInfo extends TestBase {
layouts.select("AbsoluteLayout");
layouts.setImmediate(true);
layouts.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (event.getProperty().getValue().equals("AbsoluteLayout")) {
testAbsoluteLayout();
@@ -65,6 +65,7 @@ public class LayoutAttachListenerInfo extends TestBase {
a.setWidth("300px");
a.setHeight("300px");
a.addListener(new ComponentContainer.ComponentAttachListener() {
+ @Override
public void componentAttachedToContainer(ComponentAttachEvent event) {
AbsoluteLayout layout = (AbsoluteLayout) event.getContainer();
AbsoluteLayout.ComponentPosition position = layout
@@ -79,19 +80,21 @@ public class LayoutAttachListenerInfo extends TestBase {
content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
a.addComponent(new Label("X"), "top:50px;left:50px");
}
}));
}
- private void testOrderedLayout(){
+ private void testOrderedLayout() {
content.removeAllComponents();
-
+
final VerticalLayout v = new VerticalLayout();
v.setWidth("300px");
v.setHeight("300px");
v.addListener(new ComponentContainer.ComponentAttachListener() {
+ @Override
public void componentAttachedToContainer(ComponentAttachEvent event) {
VerticalLayout layout = (VerticalLayout) event.getContainer();
getMainWindow().showNotification(
@@ -105,6 +108,7 @@ public class LayoutAttachListenerInfo extends TestBase {
content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
v.addComponent(new Label("X"));
@@ -119,6 +123,7 @@ public class LayoutAttachListenerInfo extends TestBase {
g.setWidth("300px");
g.setHeight("300px");
g.addListener(new ComponentContainer.ComponentAttachListener() {
+ @Override
public void componentAttachedToContainer(ComponentAttachEvent event) {
GridLayout layout = (GridLayout) event.getContainer();
GridLayout.Area area = layout.getComponentArea(event
@@ -134,6 +139,7 @@ public class LayoutAttachListenerInfo extends TestBase {
content.addComponent(new Button("Attach label to layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
g.addComponent(new Label("X"), 2, 3);
}
diff --git a/tests/testbench/com/vaadin/tests/components/LongTooltip.html b/tests/testbench/com/vaadin/tests/components/LongTooltip.html
index ac317380b8..a5055741f1 100644
--- a/tests/testbench/com/vaadin/tests/components/LongTooltip.html
+++ b/tests/testbench/com/vaadin/tests/components/LongTooltip.html
@@ -36,8 +36,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -63,8 +63,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -113,8 +113,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -140,8 +140,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -190,8 +190,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -217,8 +217,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -267,8 +267,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -294,8 +294,8 @@
</tr>
<!--Hide tooltip-->
<tr>
- <td>mouseOut</td>
- <td>vaadin=runcomvaadintestscomponentsLongTooltip::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsLongTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>55,43</td>
</tr>
<!--Wait for tooltip to disappear. Cannot for some reason use waitForNotVisible-->
@@ -319,7 +319,6 @@
<td></td>
<td>tooltip-upper-left-3</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/TestBase.java b/tests/testbench/com/vaadin/tests/components/TestBase.java
index 4d34fb2c8d..a66f0efe64 100644
--- a/tests/testbench/com/vaadin/tests/components/TestBase.java
+++ b/tests/testbench/com/vaadin/tests/components/TestBase.java
@@ -1,19 +1,20 @@
package com.vaadin.tests.components;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public abstract class TestBase extends AbstractTestCase {
@Override
public final void init() {
- window = new Window(getClass().getName());
+ window = new LegacyWindow(getClass().getName());
setMainWindow(window);
window.getContent().setSizeFull();
- Label label = new Label(getDescription(), Label.CONTENT_XHTML);
+ Label label = new Label(getDescription(), ContentMode.XHTML);
label.setWidth("100%");
window.getContent().addComponent(label);
@@ -24,8 +25,10 @@ public abstract class TestBase extends AbstractTestCase {
setup();
}
+ private LegacyWindow window;
+
@Override
- public void setMainWindow(Window mainWindow) {
+ public void setMainWindow(LegacyWindow mainWindow) {
if (mainWindow != window) {
throw new IllegalStateException(
"You should not set your own main window when using TestBase. If you need to use a custom Window as the main window, use AbstractTestCase instead.");
@@ -33,7 +36,6 @@ public abstract class TestBase extends AbstractTestCase {
super.setMainWindow(mainWindow);
}
- private Window window;
private VerticalLayout layout;
public TestBase() {
diff --git a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java
index 52f5a7c067..415f660c62 100644
--- a/tests/testbench/com/vaadin/tests/components/TouchScrollables.java
+++ b/tests/testbench/com/vaadin/tests/components/TouchScrollables.java
@@ -11,7 +11,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.SourceIs;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.tests.util.Person;
import com.vaadin.tests.util.PersonContainer;
import com.vaadin.tests.util.TestUtils;
@@ -24,6 +24,7 @@ import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
@@ -50,7 +51,7 @@ public class TouchScrollables extends TestBase {
TestUtils
.injectCSS(
- getLayout().getWindow(),
+ getLayout().getRoot(),
"body * {-webkit-user-select: none;} .v-table-row-drag-middle .v-table-cell-content {"
+ " background-color: inherit ; border-bottom: 1px solid cyan;"
+ "}"
@@ -65,7 +66,6 @@ public class TouchScrollables extends TestBase {
cssLayout.setCaption("Panel");
final Panel p = new Panel();
- p.setScrollable(true);
p.setHeight("400px");
Label l50 = null;
for (int i = 0; i < 100; i++) {
@@ -79,12 +79,14 @@ public class TouchScrollables extends TestBase {
final Label l = l50;
Button button = new Button("Scroll to label 50",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- getLayout().getWindow().scrollIntoView(l);
+ getLayout().getRoot().scrollIntoView(l);
}
});
cssLayout.addComponent(button);
button = new Button("Scroll to 100px", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.setScrollTop(100);
}
@@ -117,6 +119,7 @@ public class TouchScrollables extends TestBase {
Button button = new Button("Toggle lazyloading");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (table.getCacheRate() == 100) {
table.setCacheRate(2);
@@ -131,6 +134,7 @@ public class TouchScrollables extends TestBase {
button = new Button("Toggle selectable");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setSelectable(!table.isSelectable());
}
@@ -159,6 +163,7 @@ public class TouchScrollables extends TestBase {
private Component getSubWindowTest() {
Button b = new Button("Open subwindow", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Window w = new Window("Subwindow");
w.center();
@@ -185,12 +190,14 @@ public class TouchScrollables extends TestBase {
Action[] actions = new Action[] { new Action("FOO"),
new Action("BAR"), new Action("CAR") };
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
- getLayout().getWindow().showNotification(action.getCaption());
+ Notification.show(action.getCaption());
}
});
@@ -206,10 +213,12 @@ public class TouchScrollables extends TestBase {
// accept only drags from this table
AcceptCriterion crit = new SourceIs(table);
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit;
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dropEvent
.getTargetDetails();
diff --git a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java
index 139ed5bb0b..826b7cee07 100644
--- a/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/absolutelayout/MoveComponentsFromAbsoluteLayoutToInnerLayout.java
@@ -22,6 +22,7 @@ public class MoveComponentsFromAbsoluteLayoutToInnerLayout extends TestBase {
testButton = new Button("Click to move to inner layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
vl.addComponent(testButton);
}
@@ -37,6 +38,7 @@ public class MoveComponentsFromAbsoluteLayoutToInnerLayout extends TestBase {
Button b = new Button("Repaint inner layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
vl.requestRepaint();
}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java
new file mode 100644
index 0000000000..17cc4270fb
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java
@@ -0,0 +1,50 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.abstractcomponent;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.VaadinClasses;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.GridLayout;
+
+public class AllComponentTooltipTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ setContent(new GridLayout(5, 5));
+ for (Class<? extends Component> cls : VaadinClasses.getComponents()) {
+ try {
+ AbstractComponent c = (AbstractComponent) cls.newInstance();
+ if (c instanceof LegacyWindow) {
+ continue;
+ }
+
+ c.setDebugId(cls.getName());
+ c.setCaption(cls.getName());
+ c.setDescription(cls.getName());
+ c.setWidth("100px");
+ c.setHeight("100px");
+ getContent().addComponent(c);
+ System.out.println("Added " + cls.getName());
+ } catch (Exception e) {
+ System.err.println("Could not instatiate " + cls.getName());
+ }
+ }
+ }
+
+ @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/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
index a5498660be..f8931ecdea 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/EnableState.java
@@ -1,25 +1,28 @@
package com.vaadin.tests.components.abstractcomponent;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class EnableState extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Helloworld Application");
+ LegacyWindow mainWindow = new LegacyWindow("Helloworld Application");
final Panel panel = new Panel("Test");
final Button button = new Button("ablebutton");
panel.addComponent(button);
CheckBox enable = new CheckBox("Toggle button enabled", true);
- enable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ enable.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
button.setEnabled(enabled);
// button.requestRepaint();
}
@@ -27,17 +30,21 @@ public class EnableState extends AbstractTestCase {
enable.setImmediate(true);
CheckBox caption = new CheckBox("Toggle button caption", true);
- caption.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ caption.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
button.setCaption(button.getCaption() + "+");
}
});
caption.setImmediate(true);
CheckBox visible = new CheckBox("Toggle panel visibility", true);
- visible.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean visible = (Boolean) event.getButton().getValue();
+ visible.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean visible = (Boolean) event.getProperty().getValue();
panel.setVisible(visible);
}
@@ -45,9 +52,11 @@ public class EnableState extends AbstractTestCase {
visible.setImmediate(true);
CheckBox panelEnable = new CheckBox("Toggle panel enabled", true);
- panelEnable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean enabled = (Boolean) event.getButton().getValue();
+ panelEnable.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean enabled = (Boolean) event.getProperty().getValue();
panel.setEnabled(enabled);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html
new file mode 100644
index 0000000000..3cea965690
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.html
@@ -0,0 +1,92 @@
+<?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>TooltipTests</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">TooltipTests</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.abstractcomponent.TooltipTests?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='label']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>no_tooltip</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[0]/domChild[0]</td>
+ <td>10,7</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='label']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>panel_tooltip</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[1]/domChild[0]</td>
+ <td>8,6</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='label']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>layout_tooltip</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractcomponentTooltipTests::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/VCheckBox[2]/domChild[0]</td>
+ <td>5,5</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>//div[@id='label']</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>label_tooltip</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java
new file mode 100644
index 0000000000..300abe1851
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/TooltipTests.java
@@ -0,0 +1,100 @@
+package com.vaadin.tests.components.abstractcomponent;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.VerticalLayout;
+
+public class TooltipTests extends TestBase {
+
+ private Panel panel;
+ private VerticalLayout layout;
+ private Label label;
+
+ @Override
+ protected String getDescription() {
+ return "Generic tooltip handling tests";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8425;
+ }
+
+ @Override
+ protected void setup() {
+ HorizontalLayout topLayout = new HorizontalLayout();
+ addComponent(topLayout);
+ CheckBox panelCbox = new CheckBox("Panel");
+ panelCbox.addListener(panelListener);
+ topLayout.addComponent(panelCbox);
+ CheckBox layoutCbox = new CheckBox("Layout");
+ layoutCbox.addListener(layoutListener);
+ topLayout.addComponent(layoutCbox);
+ CheckBox labelCbox = new CheckBox("Label");
+ topLayout.addComponent(labelCbox);
+ labelCbox.addListener(labelListener);
+
+ panel = new Panel();
+ panel.setCaption("Panel caption");
+ panel.setDebugId("panel");
+ addComponent(panel);
+
+ layout = new VerticalLayout();
+ layout.setDebugId("layout");
+ layout.setMargin(true);
+ layout.setSpacing(true);
+ panel.setContent(layout);
+
+ label = new Label("Hover me!");
+ label.setDebugId("label");
+ layout.addComponent(label);
+ }
+
+ private final Property.ValueChangeListener panelListener = new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean value = (Boolean) (event.getProperty().getValue());
+ if (value) {
+ panel.setDescription("I'm panel!");
+ } else {
+ panel.setDescription("");
+ }
+ }
+
+ };
+
+ private final Property.ValueChangeListener layoutListener = new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean value = (Boolean) (event.getProperty().getValue());
+ if (value) {
+ layout.setDescription("I'm layout!");
+ } else {
+ layout.setDescription("");
+ }
+ }
+
+ };
+
+ private final Property.ValueChangeListener labelListener = new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean value = (Boolean) (event.getProperty().getValue());
+ if (value) {
+ label.setDescription("I'm label!");
+ } else {
+ label.setDescription("");
+ }
+ }
+
+ };
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java
new file mode 100644
index 0000000000..9b29ae1bab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractComponentDataBindingTest.java
@@ -0,0 +1,119 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.HashSet;
+import java.util.Locale;
+import java.util.Set;
+
+import com.vaadin.data.Container;
+import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.AbstractField;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Component;
+
+public abstract class AbstractComponentDataBindingTest extends TestBase
+ implements ValueChangeListener {
+ private static final Object CAPTION = "CAPTION";
+ private Log log = new Log(5);
+ private ComboBox localeSelect;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ localeSelect = createLocaleSelect();
+ addComponent(localeSelect);
+
+ // Causes fields to be created
+ localeSelect.setValue(Locale.US);
+ }
+
+ private ComboBox createLocaleSelect() {
+ ComboBox cb = new ComboBox("Locale");
+ cb.addContainerProperty(CAPTION, String.class, "");
+ cb.setItemCaptionPropertyId(CAPTION);
+ cb.setNullSelectionAllowed(false);
+ for (Locale l : Locale.getAvailableLocales()) {
+ Item i = cb.addItem(l);
+ i.getItemProperty(CAPTION).setValue(
+ l.getDisplayName(Locale.ENGLISH));
+ }
+ ((Container.Sortable) cb.getContainerDataSource()).sort(
+ new Object[] { CAPTION }, new boolean[] { true });
+ cb.setImmediate(true);
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ updateLocale((Locale) localeSelect.getValue());
+ }
+ });
+ return cb;
+ }
+
+ protected void updateLocale(Locale locale) {
+ setLocale(locale);
+ for (Component c : fields) {
+ removeComponent(c);
+ }
+ fields.clear();
+ createFields();
+ }
+
+ protected abstract void createFields();
+
+ private Set<Component> fields = new HashSet<Component>();
+
+ @Override
+ protected void addComponent(Component c) {
+ super.addComponent(c);
+ if (c instanceof AbstractField) {
+ configureField((AbstractField<?>) c);
+ if (c != localeSelect) {
+ fields.add(c);
+ }
+ }
+ }
+
+ protected void configureField(AbstractField<?> field) {
+ field.setImmediate(true);
+ field.addListener(this);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ AbstractField field = (AbstractField) event.getProperty();
+ // if (field == localeSelect) {
+ // return;
+ // }
+
+ Object newValue = field.getValue();
+ if (newValue != null) {
+ newValue = newValue + " (" + newValue.getClass().getName() + ")";
+ }
+
+ String message = "Value of " + field.getCaption() + " changed to "
+ + newValue + ".";
+ if (field.getPropertyDataSource() != null) {
+ Object dataSourceValue = field.getPropertyDataSource().getValue();
+ message += "Data model value is " + dataSourceValue;
+ message += " (" + field.getPropertyDataSource().getType().getName()
+ + ")";
+ }
+ log.log(message);
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
index a08f8999a6..aa630c79fd 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java
@@ -6,8 +6,8 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class AbstractFieldCommitWithInvalidValues extends TestBase {
@@ -33,6 +33,7 @@ public class AbstractFieldCommitWithInvalidValues extends TestBase {
Button b = new Button("Commit", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
tf.commit();
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java
index 780130847a..f1b96d24fd 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldDataSourceReadOnly.java
@@ -34,6 +34,7 @@ public class AbstractFieldDataSourceReadOnly extends TestBase {
// Button
Button button = new Button("Make data source read-only");
button.addListener(new Listener() {
+ @Override
public void componentEvent(Event event) {
stateHolder.buttonClicked();
}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
index c1107061ed..1bc76fff1e 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractFieldTest.java
@@ -13,20 +13,16 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ReadOnlyStatusChangeEvent;
import com.vaadin.data.Property.ReadOnlyStatusChangeListener;
import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.event.FieldEvents.BlurEvent;
-import com.vaadin.event.FieldEvents.BlurListener;
import com.vaadin.event.FieldEvents.BlurNotifier;
-import com.vaadin.event.FieldEvents.FocusEvent;
-import com.vaadin.event.FieldEvents.FocusListener;
import com.vaadin.event.FieldEvents.FocusNotifier;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.MenuItem;
-public abstract class AbstractFieldTest<T extends AbstractField> extends
+public abstract class AbstractFieldTest<T extends AbstractField<?>> extends
AbstractComponentTest<T> implements ValueChangeListener,
- ReadOnlyStatusChangeListener, FocusListener, BlurListener {
+ ReadOnlyStatusChangeListener {
private boolean sortValueChanges = true;
@@ -35,6 +31,13 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
super.createActions();
createBooleanAction("Required", CATEGORY_STATE, false, requiredCommand);
createRequiredErrorSelect(CATEGORY_DECORATIONS);
+ if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
+ createFocusListener(CATEGORY_LISTENERS);
+ }
+
+ if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
+ createBlurListener(CATEGORY_LISTENERS);
+ }
createValueChangeListener(CATEGORY_LISTENERS);
createReadOnlyStatusChangeListener(CATEGORY_LISTENERS);
@@ -64,6 +67,7 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
.addItem("AbstractField", null);
abstractField.addItem("Show value", new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
for (T a : getTestComponents()) {
log(a.getClass().getSimpleName() + " value: "
@@ -95,14 +99,6 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
createSelectAction("Required error message", category, options, "-",
requiredErrorMessageCommand);
- if (FocusNotifier.class.isAssignableFrom(getTestClass())) {
- createFocusListener(CATEGORY_LISTENERS);
- }
-
- if (BlurNotifier.class.isAssignableFrom(getTestClass())) {
- createBlurListener(CATEGORY_LISTENERS);
- }
-
}
private void createValueChangeListener(String category) {
@@ -117,20 +113,9 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
false, readonlyStatusChangeListenerCommand);
}
- private void createFocusListener(String category) {
- createBooleanAction("Focus listener", category, false,
- focusListenerCommand);
-
- }
-
- private void createBlurListener(String category) {
- createBooleanAction("Blur listener", category, false,
- blurListenerCommand);
-
- }
-
protected Command<T, Boolean> valueChangeListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((ValueChangeListener) AbstractFieldTest.this);
@@ -141,6 +126,7 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
};
protected Command<T, Boolean> readonlyStatusChangeListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((ReadOnlyStatusChangeListener) AbstractFieldTest.this);
@@ -149,33 +135,16 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
}
}
};
- protected Command<T, Boolean> focusListenerCommand = new Command<T, Boolean>() {
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((FocusNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((FocusNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
- protected Command<T, Boolean> blurListenerCommand = new Command<T, Boolean>() {
-
- public void execute(T c, Boolean value, Object data) {
- if (value) {
- ((BlurNotifier) c).addListener(AbstractFieldTest.this);
- } else {
- ((BlurNotifier) c).removeListener(AbstractFieldTest.this);
- }
- }
- };
protected Command<T, Object> setValueCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object value, Object data) {
c.setValue(value);
}
};
+ @Override
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
log(event.getClass().getSimpleName() + ", new value: "
+ getValue(event.getProperty()));
@@ -217,18 +186,11 @@ public abstract class AbstractFieldTest<T extends AbstractField> extends
}
+ @Override
public void readOnlyStatusChange(ReadOnlyStatusChangeEvent event) {
log(event.getClass().getSimpleName());
}
- public void focus(FocusEvent event) {
- log(event.getClass().getSimpleName());
- }
-
- public void blur(BlurEvent event) {
- log(event.getClass().getSimpleName());
- }
-
protected void createSetTextValueAction(String category) {
String subCategory = "Set text value";
createCategory(subCategory, category);
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java
index b68134f379..1f407c710f 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/AbstractTextFieldTest.java
@@ -14,12 +14,14 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
private Command<T, Integer> maxlengthCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.setMaxLength(value);
}
};
private Command<T, Boolean> nullSelectionAllowedCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setNullSettingAllowed(value);
@@ -27,18 +29,21 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
};
private Command<T, String> nullRepresentationCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setNullRepresentation(value);
}
};
private Command<T, String> inputPromptCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setInputPrompt(value);
}
};
private Command<T, Boolean> textChangeListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((TextChangeListener) AbstractTextFieldTest.this);
@@ -49,24 +54,28 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
};
private Command<T, Integer> colsCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.setColumns(value);
}
};
private Command<T, TextChangeEventMode> textChangeEventModeCommand = new Command<T, TextChangeEventMode>() {
+ @Override
public void execute(T c, TextChangeEventMode value, Object data) {
c.setTextChangeEventMode(value);
}
};
private Command<T, Integer> textChangeTimeoutCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.setTextChangeTimeout(value);
}
};
private Command<T, Range> selectionRangeCommand = new Command<T, Range>() {
+ @Override
public void execute(T c, Range value, Object data) {
c.setSelectionRange(value.getStart(),
value.getEnd() - value.getStart());
@@ -74,6 +83,7 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
}
};
private Command<T, Object> selectAllCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object value, Object data) {
c.selectAll();
}
@@ -81,6 +91,7 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
private Command<T, Integer> setCursorPositionCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.setCursorPosition(value);
}
@@ -230,6 +241,7 @@ public abstract class AbstractTextFieldTest<T extends AbstractTextField>
}
+ @Override
public void textChange(TextChangeEvent event) {
AbstractTextField tf = (AbstractTextField) event.getComponent();
log("TextChangeEvent: text='" + event.getText() + "', cursor position="
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java
new file mode 100644
index 0000000000..d4b2f89522
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBackedByString.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.ui.DateField;
+
+public class DateFieldBackedByString extends AbstractComponentDataBindingTest {
+
+ private String s = null;
+
+ @Override
+ protected void createFields() {
+ DateField df = new DateField("Date field");
+ addComponent(df);
+ df.setPropertyDataSource(new com.vaadin.data.util.ObjectProperty<String>(
+ s, String.class));
+
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java
new file mode 100644
index 0000000000..aa8c7ff778
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DateFieldBasedOnLong.java
@@ -0,0 +1,35 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Date;
+
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.PopupDateField;
+
+public class DateFieldBasedOnLong extends AbstractComponentDataBindingTest {
+
+ private Long l = null;
+ private ObjectProperty<Long> property;
+
+ @Override
+ protected void createFields() {
+ PopupDateField pdf = new PopupDateField("DateField");
+ addComponent(pdf);
+ property = new ObjectProperty<Long>(l, Long.class);
+ pdf.setPropertyDataSource(property);
+
+ property.setValue(new Date(2011 - 1900, 4, 6).getTime());
+
+ addComponent(new Button("Set property value to 10000L",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ property.setValue(10000L);
+
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java b/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java
new file mode 100644
index 0000000000..4fd81081ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/DoubleInTextField.java
@@ -0,0 +1,31 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.util.MethodProperty;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.TextField;
+
+public class DoubleInTextField extends AbstractComponentDataBindingTest {
+
+ @Override
+ protected void createFields() {
+ Person person = new Person("John", "Doe", "john@doe.com", 78, Sex.MALE,
+ new Address("Dovestreet 12", 12233, "Johnston",
+ Country.SOUTH_AFRICA));
+
+ TextField salary = new TextField("Vaadin 7 - TextField with Double");
+ addComponent(salary);
+ salary.setPropertyDataSource(new MethodProperty<Double>(person,
+ "salaryDouble"));
+
+ TextField salary6 = new TextField("Vaadin 6 - TextField with Double");
+ addComponent(salary6);
+ salary6.setPropertyDataSource(new MethodProperty<Double>(person,
+ "salaryDouble"));
+ salary6.setConverter(new Vaadin6ImplicitDoubleConverter());
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java
new file mode 100644
index 0000000000..01fcb02b77
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerDoubleFieldsWithDataSource.java
@@ -0,0 +1,65 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.data.validator.DoubleValidator;
+import com.vaadin.data.validator.IntegerValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class IntegerDoubleFieldsWithDataSource extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ TextField tf = createIntegerTextField();
+ tf.addValidator(new IntegerValidator("Must be an Integer"));
+ addComponent(tf);
+
+ tf = createIntegerTextField();
+ tf.setCaption("Enter a double");
+ tf.setPropertyDataSource(new ObjectProperty<Double>(2.1));
+ tf.addValidator(new DoubleValidator("Must be a Double"));
+ addComponent(tf);
+ }
+
+ private TextField createIntegerTextField() {
+ final TextField tf = new TextField("Enter an integer");
+ tf.setPropertyDataSource(new ObjectProperty<Integer>(new Integer(2)));
+ tf.setImmediate(true);
+ tf.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ log.log("Value for " + tf.getCaption() + " changed to "
+ + tf.getValue());
+ log.log("Converted value is " + tf.getConvertedValue());
+ } catch (Exception e) {
+ // TODO: handle exception
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tf;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java
new file mode 100644
index 0000000000..929247fc80
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/IntegerFieldWithoutDataSource.java
@@ -0,0 +1,60 @@
+package com.vaadin.tests.components.abstractfield;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class IntegerFieldWithoutDataSource extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ TextField tf = createIntegerTextField();
+ tf.setCaption(tf.getCaption() + "(invalid allowed)");
+ addComponent(tf);
+ tf = createIntegerTextField();
+ tf.setInvalidAllowed(false);
+ tf.setCaption(tf.getCaption() + "(invalid not allowed)");
+ addComponent(tf);
+ }
+
+ private TextField createIntegerTextField() {
+ final TextField tf = new TextField("Enter an integer");
+ tf.setConverter(Integer.class);
+ tf.setImmediate(true);
+ tf.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ try {
+ log.log("Value for " + tf.getCaption() + " changed to "
+ + tf.getValue());
+ log.log("Converted value is " + tf.getConvertedValue());
+ } catch (Exception e) {
+ // TODO: handle exception
+ e.printStackTrace();
+ }
+ }
+ });
+
+ return tf;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html
index cad194d37a..a7b8e24ae7 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/domChild[0]</td>
<td>316,58</td>
</tr>
<!--Enter on background - should cause event-->
@@ -159,7 +159,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>625,2</td>
</tr>
<tr>
@@ -185,15 +185,10 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/VVerticalLayout[0]</td>
<td>631,52</td>
</tr>
<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
- <td>597,57</td>
-</tr>
-<tr>
<td>pressSpecialKey</td>
<td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::</td>
<td>enter</td>
@@ -203,7 +198,6 @@
<td>vaadin=runcomvaadintestscomponentsabstractfieldShortcutAddAndRemove::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>4. Log button was clicked</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java
index 26720d67f3..309e297374 100644
--- a/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/ShortcutAddAndRemove.java
@@ -20,6 +20,7 @@ public class ShortcutAddAndRemove extends TestBase {
final Button logButton = new Button("Log a row (enter shortcut)");
logButton.setClickShortcut(KeyCode.ENTER);
logButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Log button was clicked");
}
@@ -27,6 +28,7 @@ public class ShortcutAddAndRemove extends TestBase {
final Button removeShortcut = new Button("Remove shortcut");
removeShortcut.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
logButton.removeClickShortcut();
logButton.setCaption("Log a row (no shortcut)");
@@ -34,6 +36,7 @@ public class ShortcutAddAndRemove extends TestBase {
});
final Button addShortcut = new Button("Add shortcut");
addShortcut.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
logButton.setClickShortcut(KeyCode.ENTER);
logButton.setCaption("Log a row (enter shortcut)");
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java
new file mode 100644
index 0000000000..fc08a4505c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Date;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.terminal.UserError;
+import com.vaadin.ui.AbstractComponent.ComponentErrorEvent;
+import com.vaadin.ui.AbstractComponent.ComponentErrorHandler;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.TextField;
+
+public class TextFieldConversions extends AbstractComponentDataBindingTest {
+
+ private TextField tf;
+
+ private Object o;
+
+ private ComboBox dataType;
+
+ @Override
+ protected void createFields() {
+ dataType = new ComboBox("Data type");
+ dataType.setImmediate(true);
+ dataType.addItem(Long.class);
+ dataType.addItem(Integer.class);
+ dataType.addItem(Double.class);
+ dataType.addItem(Date.class);
+ dataType.addItem(String.class);
+
+ dataType.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ tf.setPropertyDataSource(new ObjectProperty<Object>(o,
+ (Class<Object>) dataType.getValue()));
+ }
+ });
+ addComponent(dataType);
+
+ tf = new TextField("TextField");
+ addComponent(tf);
+ tf.setErrorHandler(new ComponentErrorHandler() {
+
+ @Override
+ public boolean handleComponentError(ComponentErrorEvent event) {
+ tf.setComponentError(new UserError("Invalid value"));
+ return true;
+ }
+ });
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
new file mode 100644
index 0000000000..a9aa4d2a43
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/abstractfield/Vaadin6ImplicitDoubleConverter.java
@@ -0,0 +1,39 @@
+package com.vaadin.tests.components.abstractfield;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+
+public class Vaadin6ImplicitDoubleConverter implements
+ Converter<String, Double> {
+
+ @Override
+ public Double convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (null == value) {
+ return null;
+ }
+ return new Double(value.toString());
+ }
+
+ @Override
+ public String convertToPresentation(Double value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ return null;
+ }
+ return value.toString();
+
+ }
+
+ @Override
+ public Class<Double> getModelType() {
+ return Double.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java b/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java
index a048cf04a8..d24def22dd 100644
--- a/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/accordion/RemoveTabs.java
@@ -47,6 +47,7 @@ public class RemoveTabs extends TestBase {
closeCurrent = new Button("Close current tab");
closeCurrent.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeCurrentTab();
@@ -55,6 +56,7 @@ public class RemoveTabs extends TestBase {
closeFirst = new Button("close first tab");
closeFirst.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeFirstTab();
@@ -63,6 +65,7 @@ public class RemoveTabs extends TestBase {
closeLast = new Button("close last tab");
closeLast.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeLastTab();
@@ -71,6 +74,7 @@ public class RemoveTabs extends TestBase {
reorderTabs = new Button("reorder");
reorderTabs.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
reorder();
diff --git a/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java b/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java
index 9045d18940..605ab676b6 100644
--- a/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java
+++ b/tests/testbench/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java
@@ -29,12 +29,13 @@ public class BeanItemContainerNullValues extends TestBase {
Button b = new Button("Disable sorting", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- table.setSortDisabled(!table.isSortDisabled());
- if (table.isSortDisabled()) {
- event.getButton().setCaption("Enable sorting");
- } else {
+ table.setSortEnabled(!table.isSortEnabled());
+ if (table.isSortEnabled()) {
event.getButton().setCaption("Disable sorting");
+ } else {
+ event.getButton().setCaption("Enable sorting");
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
index 850d553b5b..d39f72ef1f 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonDisableOnClick.html
@@ -16,7 +16,7 @@
<td>/run/com.vaadin.tests.components.button.Buttons2?restartApplication</td>
<td></td>
</tr>
-<!--value change listener-->
+<!--click listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_Smenu#item0</td>
@@ -29,7 +29,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item4</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item2</td>
<td>35,8</td>
</tr>
<!--disable on click-->
@@ -45,7 +45,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>22,4</td>
</tr>
<tr>
@@ -133,7 +133,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtons2::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>36,3</td>
</tr>
<tr>
@@ -151,7 +151,6 @@
<td>vaadin=runcomvaadintestscomponentsbuttonButtons2::PID_StestComponent</td>
<td>v-disabled</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java b/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java
index 7efd40ca5d..0d4981a441 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonEnterWithWindowShortcut.java
@@ -17,10 +17,12 @@ public class ButtonEnterWithWindowShortcut extends TestBase {
getMainWindow().addActionHandler(new Handler() {
private static final long serialVersionUID = -4976129418325394913L;
+ @Override
public void handleAction(Action action, Object sender, Object target) {
log.log(action.getCaption() + " pressed in window");
}
+ @Override
public Action[] getActions(Object target, Object sender) {
ShortcutAction enter = new ShortcutAction("enter",
ShortcutAction.KeyCode.ENTER, null);
@@ -32,6 +34,7 @@ public class ButtonEnterWithWindowShortcut extends TestBase {
Button button = new Button("Focus me and press enter",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("button click listener fired");
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java b/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java
index aca85d4efe..b27f948669 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonErrorMessage.java
@@ -11,6 +11,7 @@ public class ButtonErrorMessage extends TestBase {
protected void setup() {
Button b = new Button("Click for error");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
throw new NullPointerException();
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java
index 253de5b43c..5cdc34e8e8 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonHtml.java
@@ -19,6 +19,7 @@ public class ButtonHtml extends TestBase {
final Button swapButton = new Button("<i>Swap button<i>");
swapButton.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
swapButton.setHtmlContentAllowed(!swapButton
.isHtmlContentAllowed());
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
index 40caf620a8..1b6a81551a 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonMouseDetails.java
@@ -1,19 +1,20 @@
package com.vaadin.tests.components.button;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
public class ButtonMouseDetails extends TestBase {
- private Label out = new Label("", Label.CONTENT_PREFORMATTED);
+ private Label out = new Label("", ContentMode.PREFORMATTED);
private int clickCounter = 1;
private Button.ClickListener clickListener = new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
StringBuilder str = new StringBuilder(out.getValue().toString());
str.append(clickCounter + ":\t");
@@ -46,10 +47,6 @@ public class ButtonMouseDetails extends TestBase {
button.setImmediate(true);
addComponent(button);
- CheckBox cb = new CheckBox("CHECK ME!", clickListener);
- cb.setImmediate(true);
- addComponent(cb);
-
addComponent(out);
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonTabIndex.java b/tests/testbench/com/vaadin/tests/components/button/ButtonTabIndex.java
new file mode 100644
index 0000000000..048e0698f3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonTabIndex.java
@@ -0,0 +1,53 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.button;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.TextField;
+
+public class ButtonTabIndex extends TestBase {
+
+ @Override
+ protected void setup() {
+ TextField tf1 = new TextField("Tab index 0");
+ tf1.setTabIndex(0);
+ TextField tf2 = new TextField("Tab index -1, focused initially");
+ tf2.setTabIndex(-1);
+ tf2.focus();
+ addComponent(tf1);
+ addComponent(tf2);
+
+ addComponent(createButton(1));
+ addComponent(createButton(5));
+ addComponent(createNativeButton(3));
+ addComponent(createButton(4));
+ addComponent(createNativeButton(2));
+
+ }
+
+ private Button createButton(int i) {
+ Button b = new Button("Button with tab index " + i);
+ b.setTabIndex(i);
+ return b;
+ }
+
+ private NativeButton createNativeButton(int i) {
+ NativeButton b = new NativeButton("NativeButton with tab index " + i);
+ b.setTabIndex(i);
+ return b;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Test for tab indexes for Button and NativeButton";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 9022;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonUndefinedWidth.html b/tests/testbench/com/vaadin/tests/components/button/ButtonUndefinedWidth.html
index 28fe12f5a2..0aaa01f05b 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonUndefinedWidth.html
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonUndefinedWidth.html
@@ -63,7 +63,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsbuttonButtonUndefinedWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsbuttonButtonUndefinedWidth::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[2]</td>
<td>636,149</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons.java b/tests/testbench/com/vaadin/tests/components/button/Buttons.java
index afbc90d197..573c95c2b8 100644
--- a/tests/testbench/com/vaadin/tests/components/button/Buttons.java
+++ b/tests/testbench/com/vaadin/tests/components/button/Buttons.java
@@ -46,13 +46,7 @@ public class Buttons extends ComponentTestCase<Button> {
l.setWidth("100%");
l.setHeight("65px");
- boolean ie6 = (getBrowser().isIE() && getBrowser()
- .getBrowserMajorVersion() == 6);
- if (!ie6 || !nat) {
- // Skip this NativeButton for IE6 as it can't decide how to
- // render it
- addTestComponent(l);
- }
+ addTestComponent(l);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
index b65a9fc0cd..7526e7dbc3 100644
--- a/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
+++ b/tests/testbench/com/vaadin/tests/components/button/Buttons2.java
@@ -2,25 +2,18 @@ package com.vaadin.tests.components.button;
import java.util.LinkedHashMap;
-import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
+import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.themes.Reindeer;
-public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
- ClickListener {
-
- private Command<T, Boolean> switchModeCommand = new Command<T, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(T c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
+public class Buttons2<T extends Button> extends AbstractComponentTest<T>
+ implements ClickListener {
private Command<T, Boolean> disableOnClickCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setDisableOnClick(value);
}
@@ -28,6 +21,7 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
private Command<T, Boolean> clickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((Button.ClickListener) Buttons2.this);
@@ -38,6 +32,7 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) Button.class;
@@ -47,8 +42,9 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, false,
- switchModeCommand);
+ createFocusListener(CATEGORY_LISTENERS);
+ createBlurListener(CATEGORY_LISTENERS);
+
createBooleanAction("Disable on click", CATEGORY_FEATURES, false,
disableOnClickCommand);
addClickListener(CATEGORY_LISTENERS);
@@ -68,6 +64,7 @@ public class Buttons2<T extends Button> extends AbstractFieldTest<T> implements
}
+ @Override
public void buttonClick(ClickEvent event) {
log(event.getClass().getSimpleName());
}
diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
index 46d92c3a03..bdabed3032 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ButtonsInHorizontalLayout.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.button;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.BaseTheme;
public class ButtonsInHorizontalLayout extends AbstractTestCase {
@@ -18,7 +18,7 @@ public class ButtonsInHorizontalLayout extends AbstractTestCase {
content.addComponent(createButtonLayout(null));
content.addComponent(createButtonLayout(BaseTheme.BUTTON_LINK));
- setMainWindow(new Window("", content));
+ setMainWindow(new LegacyWindow("", content));
}
private HorizontalLayout createButtonLayout(String style) {
diff --git a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
index 3d4dfeda04..4fb8df678e 100644
--- a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
+++ b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java
@@ -6,8 +6,9 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
@SuppressWarnings("serial")
public class ShortCutListenerModification extends TestBase implements
@@ -59,9 +60,14 @@ public class ShortCutListenerModification extends TestBase implements
}
+ @Override
public void buttonClick(ClickEvent event) {
- Window window2 = event.getButton().getWindow();
- window2.getParent().removeWindow(window2);
+ Component c = event.getButton();
+ while (!(c instanceof Window)) {
+ c = c.getParent();
+ }
+ ((Window) c).close();
+
Button prev = (Button) event.getButton().getData();
if (prev != null) {
prev.focus();
diff --git a/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java b/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java
index 4952b4bc50..c1f1846415 100644
--- a/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java
+++ b/tests/testbench/com/vaadin/tests/components/button/TooltipForDisabledButton.java
@@ -27,6 +27,7 @@ public class TooltipForDisabledButton extends TestBase {
buttonDisabled.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification("Clicked Disabled");
}
@@ -35,6 +36,7 @@ public class TooltipForDisabledButton extends TestBase {
buttonEnabled.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification("Clicked Enabled");
}
diff --git a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
index 926088ff48..57ef9e6656 100644
--- a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
+++ b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java
@@ -2,6 +2,7 @@ package com.vaadin.tests.components.caption;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.VaadinClasses;
import com.vaadin.tests.components.TestBase;
@@ -46,6 +47,7 @@ public class IconsInCaption extends TestBase {
iconTypeSelect.setImmediate(true);
iconTypeSelect.setNullSelectionAllowed(false);
iconTypeSelect.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateContainer();
}
@@ -59,6 +61,7 @@ public class IconsInCaption extends TestBase {
containerSelect.setImmediate(true);
containerSelect.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateContainer();
@@ -103,7 +106,7 @@ public class IconsInCaption extends TestBase {
ComponentContainer container = containerClass.newInstance();
for (String size : sizes) {
Label title = new Label("<h3>" + size + "x" + size + "</h3>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
container.addComponent(title);
for (String icon : icons) {
ThemeResource res = new ThemeResource("../runo/icons/" + size
diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java
index a961b48426..28abf5172d 100644
--- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java
+++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.components.checkbox;
import com.vaadin.data.Validator.InvalidValueException;
+import com.vaadin.terminal.AbstractErrorMessage;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -28,18 +29,21 @@ public class CheckBoxNullValue extends TestBase {
final Button button = new Button("Validate");
addComponent(button);
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
checkbox.setComponentError(null);
requiredCheckbox.setComponentError(null);
try {
checkbox.validate();
} catch (InvalidValueException e) {
- checkbox.setComponentError(e);
+ checkbox.setComponentError(AbstractErrorMessage
+ .getErrorMessageForException(e));
}
try {
requiredCheckbox.validate();
} catch (InvalidValueException e) {
- requiredCheckbox.setComponentError(e);
+ requiredCheckbox.setComponentError(AbstractErrorMessage
+ .getErrorMessageForException(e));
}
valueLabel.setValue("Checkbox: " + checkbox.getValue()
+ "; Required checkbox: " + requiredCheckbox.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
index 2af1e41867..6734c752de 100644
--- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
+++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes2.java
@@ -8,48 +8,18 @@ import com.vaadin.ui.CheckBox;
public class CheckBoxes2 extends AbstractFieldTest<CheckBox> implements
ClickListener {
- // cannot extend Buttons2 because of Switch mode problems
-
@Override
protected Class<CheckBox> getTestClass() {
return CheckBox.class;
}
- private Command<CheckBox, Boolean> switchModeCommand = new Command<CheckBox, Boolean>() {
-
- @SuppressWarnings("deprecation")
- public void execute(CheckBox c, Boolean value, Object data) {
- c.setSwitchMode(value);
- }
- };
-
- private Command<CheckBox, Boolean> clickListenerCommand = new Command<CheckBox, Boolean>() {
-
- public void execute(CheckBox c, Boolean value, Object data) {
- if (value) {
- c.addListener((ClickListener) CheckBoxes2.this);
- } else {
- c.removeListener((ClickListener) CheckBoxes2.this);
- }
-
- }
- };
-
@Override
protected void createActions() {
super.createActions();
- createBooleanAction("Switch mode", CATEGORY_FEATURES, true,
- switchModeCommand);
- addClickListener(CATEGORY_LISTENERS);
- }
-
- private void addClickListener(String category) {
- createBooleanAction("Click listener", category, false,
- clickListenerCommand);
-
}
+ @Override
public void buttonClick(ClickEvent event) {
log(event.getClass().getSimpleName());
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java
index 88a403b1b6..38bdf0c5fe 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxCombinedWithEnterShortcut.java
@@ -29,6 +29,7 @@ public class ComboBoxCombinedWithEnterShortcut extends TestBase {
aButton.setClickShortcut(KeyCode.ENTER);
aButton.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Button clicked. ComboBox value: " + l.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java
index 9285983b99..a475c86ca0 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxDataSourceChange.java
@@ -57,6 +57,7 @@ public class ComboBoxDataSourceChange extends TestBase {
Button b = new Button("Use ds1");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cb2.setContainerDataSource(ds1);
currentDS.setValue("ds1");
@@ -72,6 +73,7 @@ public class ComboBoxDataSourceChange extends TestBase {
b = new Button("Use ds2");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cb2.setContainerDataSource(ds2);
currentDS.setValue("ds2");
@@ -82,6 +84,7 @@ public class ComboBoxDataSourceChange extends TestBase {
addComponent(hl);
cb2.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentValue.setValue(event.getProperty().getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java
index d9739602f6..c5e411678d 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxEnablesComboBox.java
@@ -16,6 +16,7 @@ public class ComboBoxEnablesComboBox extends TestBase {
populate(cb);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
cb2.setEnabled(true);
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java
index fd434a7acd..5f33b96a73 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxIdenticalItems.java
@@ -27,6 +27,7 @@ public class ComboBoxIdenticalItems extends TestBase {
select.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = -7932700771673919620L;
+ @Override
public void valueChange(ValueChangeEvent event) {
log.log("Item " + select.getValue() + " selected");
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
index 8160fb576e..c0490c127d 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInPopup.java
@@ -17,14 +17,15 @@ public class ComboBoxInPopup extends TestBase {
w.addComponent(createComboBox());
Button close = new Button("Close window", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- w.getParent().removeWindow(w);
+ w.close();
}
});
close.setClickShortcut(KeyCode.ESCAPE, null);
w.addComponent(close);
- getLayout().getWindow().addWindow(w);
+ getLayout().getRoot().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java
index e11b10f3e1..0afa1e887e 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxInvalidNullSelection.java
@@ -24,6 +24,7 @@ public class ComboBoxInvalidNullSelection extends TestBase {
Button b = new Button("Swap data source");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (combo.getContainerDataSource() == ds1) {
combo.setContainerDataSource(ds2);
@@ -39,6 +40,7 @@ public class ComboBoxInvalidNullSelection extends TestBase {
combo.setContainerDataSource(ds1);
combo.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
log.log("Value is now: " + combo.getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.html b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.html
index a46f48fcfc..fd2aceb7f2 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.html
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.html
@@ -89,7 +89,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>409,27</td>
</tr>
<tr>
@@ -109,7 +109,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[4]</td>
<td>535,43</td>
</tr>
<tr>
@@ -154,7 +154,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[6]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentscomboboxComboboxes::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[6]/domChild[0]</td>
<td>510,1</td>
</tr>
</tbody></table>
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
index 0e295231c5..5dc5a2efbd 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxReapperingOldValue.java
@@ -8,19 +8,19 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
@SuppressWarnings("serial")
-public class ComboBoxReapperingOldValue extends Application implements
- ValueChangeListener {
+public class ComboBoxReapperingOldValue extends Application.LegacyApplication
+ implements ValueChangeListener {
ComboBox cbox1 = new ComboBox();
ComboBox cbox2 = new ComboBox();
@Override
public void init() {
- Window mainWindow = new Window("ComboBoxCacheTest");
+ LegacyWindow mainWindow = new LegacyWindow("ComboBoxCacheTest");
setMainWindow(mainWindow);
VerticalLayout layout = new VerticalLayout();
@@ -58,6 +58,7 @@ public class ComboBoxReapperingOldValue extends Application implements
return container;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
cbox2.removeAllItems();
if ("1".equals(event.getProperty().getValue().toString())) {
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java
index 15742cc783..0336ff423b 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlow.java
@@ -45,6 +45,7 @@ public class ComboBoxSlow extends TestBase {
}
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
log.log("Value changed to " + cb.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java
index 5c1dad4a30..d98997d28f 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSlowInFF.java
@@ -24,6 +24,7 @@ public class ComboBoxSlowInFF extends TestBase {
Button fill = new Button("fill it");
fill.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
t.removeAllItems();
for (int i = 0; i < 200; i++) {
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
index 134e13e49c..24aea18314 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxSuggestionOnDetach.java
@@ -16,8 +16,9 @@ public class ComboBoxSuggestionOnDetach extends TestBase {
ComboBox comboBox = new ComboBox("Combo box", Arrays.asList("Option 1",
"Option 2", "Option 3"));
comboBox.addListener(new FieldEvents.FocusListener() {
+ @Override
public void focus(FocusEvent event) {
- popup.getParent().removeWindow(popup);
+ popup.close();
}
});
popup.addComponent(comboBox);
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java
index d92a1872b8..d33a858dc8 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxTextFieldEventOrder.java
@@ -1,4 +1,5 @@
package com.vaadin.tests.components.combobox;
+
import java.util.Arrays;
import com.vaadin.data.Property.ValueChangeEvent;
@@ -16,6 +17,7 @@ public class ComboBoxTextFieldEventOrder extends TestBase {
final Select select = new Select("select", Arrays.asList("1", "2", "3",
"4"));
textField.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
select.addItem(Long.valueOf(select.size() + 1).toString()); // or
// just
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java
index b8f7a9758d..76ee83384e 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java
@@ -29,6 +29,7 @@ public class ComboBoxValueUpdate extends TestBase {
select.addListener(new ComboBox.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err
.println("Selected " + event.getProperty().getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java
index 8befbb4612..3071ab4c2d 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java
@@ -10,12 +10,14 @@ import com.vaadin.ui.Select;
public class ComboBoxes2 extends SelectTest<ComboBox> {
private Command<ComboBox, String> inputPromptCommand = new Command<ComboBox, String>() {
+ @Override
public void execute(ComboBox c, String value, Object data) {
c.setInputPrompt(value);
}
};
private Command<ComboBox, Integer> filteringModeCommand = new Command<ComboBox, Integer>() {
+ @Override
public void execute(ComboBox c, Integer value, Object data) {
c.setFilteringMode(value);
}
@@ -39,6 +41,7 @@ public class ComboBoxes2 extends SelectTest<ComboBox> {
private void createTextInputAlowedAction(String category) {
createBooleanAction("Text input allowed", category, true,
new Command<ComboBox, Boolean>() {
+ @Override
public void execute(ComboBox c, Boolean value, Object data) {
c.setTextInputAllowed(value.booleanValue());
}
@@ -48,6 +51,7 @@ public class ComboBoxes2 extends SelectTest<ComboBox> {
private void createNewItemsAllowedAction(String category) {
createBooleanAction("New items allowed", category, false,
new Command<ComboBox, Boolean>() {
+ @Override
public void execute(ComboBox c, Boolean value, Object data) {
c.setNewItemsAllowed(value.booleanValue());
}
@@ -80,6 +84,7 @@ public class ComboBoxes2 extends SelectTest<ComboBox> {
createSelectAction("Icon", category, createIconOptions(false), "-",
new Command<ComboBox, Resource>() {
+ @Override
public void execute(ComboBox c, Resource value, Object data) {
for (Object id : c.getItemIds()) {
if (value == null) {
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
index 6681342ea6..b9c222247b 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboFocusBlurEvents.java
@@ -7,6 +7,7 @@ import com.vaadin.data.util.ObjectProperty;
import com.vaadin.event.FieldEvents;
import com.vaadin.event.FieldEvents.BlurEvent;
import com.vaadin.event.FieldEvents.FocusEvent;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
@@ -18,21 +19,22 @@ public class ComboFocusBlurEvents extends TestBase {
@Override
protected void setup() {
-
+
List<String> list = new ArrayList<String>();
for (int i = 0; i < 100; i++) {
list.add("Item " + i);
}
-
+
ComboBox cb = new ComboBox("Combobox", list);
cb.setImmediate(true);
cb.setInputPrompt("Enter text");
cb.setDescription("Some Combobox");
addComponent(cb);
-
+
final ObjectProperty<String> log = new ObjectProperty<String>("");
cb.addListener(new FieldEvents.FocusListener() {
+ @Override
public void focus(FocusEvent event) {
log.setValue(log.getValue().toString() + "<br>" + counter
+ ": Focus event!");
@@ -41,13 +43,14 @@ public class ComboFocusBlurEvents extends TestBase {
});
cb.addListener(new FieldEvents.BlurListener() {
+ @Override
public void blur(BlurEvent event) {
log.setValue(log.getValue().toString() + "<br>" + counter
+ ": Blur event!");
counter++;
}
});
-
+
TextField field = new TextField("Some textfield");
field.setImmediate(true);
addComponent(field);
@@ -55,7 +58,7 @@ public class ComboFocusBlurEvents extends TestBase {
Label output = new Label(log);
output.setCaption("Events:");
- output.setContentMode(Label.CONTENT_XHTML);
+ output.setContentMode(ContentMode.XHTML);
addComponent(output);
}
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java
index 94ab20df43..5b1af58421 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java
@@ -136,6 +136,7 @@ public class Comboboxes extends ComponentTestCase<ComboBox> {
return createSelectAction("Icon", options, "<None>",
new Command<ComboBox, String>() {
+ @Override
public void execute(ComboBox c, String value, Object data) {
for (Object id : c.getItemIds()) {
if (value == null) {
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java b/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java
index a192f1a3a6..37b0fe21a1 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/GridLayoutComboBoxZoomOut.java
@@ -1,19 +1,20 @@
package com.vaadin.tests.components.combobox;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
@SuppressWarnings("serial")
-public class GridLayoutComboBoxZoomOut extends TestBase {
+public class GridLayoutComboBoxZoomOut extends AbstractTestCase {
@Override
- public void setup() {
- Window mainWindow = new Window("Gridlayoutbug Application");
+ public void init() {
+ Root.LegacyWindow mainWindow = new Root.LegacyWindow(
+ "Gridlayoutbug Application");
setMainWindow(mainWindow);
Label description = new Label(
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java b/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java
index d93db563e3..00e9242a7a 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/NewItemsESCPress.java
@@ -17,6 +17,7 @@ public class NewItemsESCPress extends TestBase {
final ComboBox box = new ComboBox("New items are allowed");
box.setNewItemsAllowed(true);
box.setNewItemHandler(new NewItemHandler() {
+ @Override
public void addNewItem(String newItemCaption) {
String value = (String) addedItems.getValue();
addedItems.setValue(value + newItemCaption + "\n");
diff --git a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java
index a79b85ece4..ce6a24d9bd 100644
--- a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java
+++ b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java
@@ -22,6 +22,7 @@ public class RemovalOfSelectedIcon extends TestBase {
btClear.setImmediate(true);
btClear.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cb2.removeAllItems();
cb2.setContainerDataSource(null);
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
index 8bc464f176..094a63c163 100644
--- a/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/ClipContent.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.components.customcomponent;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomComponent;
@@ -14,7 +15,7 @@ public class ClipContent extends TestBase {
Label text = new Label(
"1_long_line_that_should_be_clipped<br/>2_long_line_that_should_be_clipped<br/>3_long_line_that_should_be_clipped<br/>4_long_line_that_should_be_clipped<br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final CustomComponent cc = new CustomComponent(text);
cc.setWidth("20px");
@@ -23,16 +24,18 @@ public class ClipContent extends TestBase {
final TextField w = new TextField("Width");
w.setValue("20px");
w.addListener(new TextField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- cc.setWidth((String) w.getValue());
+ cc.setWidth(w.getValue());
}
});
addComponent(w);
final TextField h = new TextField("Height");
h.setValue("20px");
h.addListener(new TextField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- cc.setHeight((String) h.getValue());
+ cc.setHeight(h.getValue());
}
});
addComponent(h);
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java
index 9a559f7414..4311ad1f08 100644
--- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentGrowingContent.java
@@ -24,6 +24,7 @@ public class CustomComponentGrowingContent extends TestBase {
});
addComponent(new Button("Set long content", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
label.setValue("Longer content that should be fully visible");
}
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java
index 43d4c70eb8..2351b02e2a 100644
--- a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomComponentSizeUpdate.java
@@ -20,6 +20,7 @@ public class CustomComponentSizeUpdate extends TestBase {
nb.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cc.setWidth((cc.getWidth() - 20) + "px");
cc.setHeight((cc.getHeight() - 20) + "px");
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.html b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.html
new file mode 100644
index 0000000000..b2806afe5c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.html
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head profile="http://selenium-ide.openqa.org/profiles/test-case"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="selenium.base" href="" /><title>com.vaadin.tests.components.accordion.AccordionInactiveTabSize</title></head><body><table cellpadding="1" cellspacing="1" border="1"><thead><tr><td rowspan="1" colspan="3">com.vaadin.tests.components.accordion.AccordionInactiveTabSize</td></tr></thead><tbody><tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customcomponent.CustomLayoutUsingTemplate?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomcomponentCustomLayoutUsingTemplate::/VVerticalLayout[0]/VVerticalLayout[0]/VCustomLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>with-text-field</td>
+</tr>
+</tbody></table></body></html> \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java
new file mode 100644
index 0000000000..28e4dfb385
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTemplate.java
@@ -0,0 +1,61 @@
+package com.vaadin.tests.components.customcomponent;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TextField;
+
+public class CustomLayoutUsingTemplate extends TestBase implements
+ ClickListener {
+
+ CustomLayout layout;
+
+ @Override
+ protected void setup() {
+ String thisPackage = CustomLayoutUsingTemplate.class.getName().replace(
+ '.', '/');
+ thisPackage = thisPackage.replaceAll(
+ CustomLayoutUsingTemplate.class.getSimpleName() + "$", "");
+ String template = thisPackage + "template.htm";
+ InputStream is = getClass().getClassLoader().getResourceAsStream(
+ template);
+ try {
+ layout = new CustomLayout(is);
+ layout.addComponent(new Button(
+ "Click to add a TextField to second location", this),
+ "location1");
+ addComponent(layout);
+ } catch (IOException e) {
+ addComponent(new Label(e.getMessage()));
+ e.printStackTrace();
+ } finally {
+ try {
+ is.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Test for using a CustomLayout with a template read from an input stream and passed through the state";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new TextField("A text field!"), "location2");
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.html b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.html
new file mode 100644
index 0000000000..954afb2adb
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.html
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head profile="http://selenium-ide.openqa.org/profiles/test-case"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="selenium.base" href="" /><title>com.vaadin.tests.components.accordion.AccordionInactiveTabSize</title></head><body><table cellpadding="1" cellspacing="1" border="1"><thead><tr><td rowspan="1" colspan="3">com.vaadin.tests.components.accordion.AccordionInactiveTabSize</td></tr></thead><tbody><tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customcomponent.CustomLayoutUsingTheme?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomcomponentCustomLayoutUsingTheme::/VVerticalLayout[0]/VVerticalLayout[0]/VCustomLayout[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>label</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomcomponentCustomLayoutUsingTheme::/VVerticalLayout[0]/VVerticalLayout[0]/VCustomLayout[0]/VVerticalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>button</td>
+</tr>
+</tbody></table></body></html> \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java
new file mode 100644
index 0000000000..06dd39ac38
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/CustomLayoutUsingTheme.java
@@ -0,0 +1,63 @@
+package com.vaadin.tests.components.customcomponent;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.LoremIpsum;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.VerticalLayout;
+
+public class CustomLayoutUsingTheme extends TestBase implements ClickListener {
+
+ private CustomLayout layout;
+
+ @Override
+ protected void setup() {
+ setTheme("tests-tickets");
+ layout = new CustomLayout("Ticket1775");
+ addComponent(layout);
+ layout.addComponent(new TextField("Username"), "loginUser");
+ layout.addComponent(new TextField("Password"), "loginPassword");
+ layout.addComponent(new Button("Login"), "loginButton");
+ layout.setWidth(null);
+
+ VerticalLayout menu = new VerticalLayout();
+ menu.addComponent(new Button("Set body to label", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new Label(LoremIpsum.get(200)), "body");
+ }
+ }));
+ menu.addComponent(new Button("Set body to huge NativeButton",
+ new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new NativeButton(
+ "This is it, the body!"), "body");
+ }
+ }));
+ layout.addComponent(menu, "menu");
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Test for using a CustomLayout with a template read from an input stream and passed through the state";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ layout.addComponent(new TextField("A text field!"), "location2");
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/template.htm b/tests/testbench/com/vaadin/tests/components/customcomponent/template.htm
new file mode 100644
index 0000000000..fa023050da
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customcomponent/template.htm
@@ -0,0 +1,4 @@
+<b>Contents</b>
+<div location="location1">This is where the first component goes</div>
+<div style="width: 500px; border: 1 px solid blue; margin: 10px;" location="location2">This is where the second component goes</div>
+<b>End of template</b> \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java
new file mode 100644
index 0000000000..07c740a96d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AbstractNestedFormExample.java
@@ -0,0 +1,76 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Table;
+
+/**
+ * Demonstrate the use of a form as a custom field within another form.
+ */
+public abstract class AbstractNestedFormExample extends TestBase {
+ private NestedPersonForm personForm;
+ private boolean embeddedAddress;
+
+ public void setup(boolean embeddedAddress) {
+ this.embeddedAddress = embeddedAddress;
+
+ addComponent(getPersonTable());
+ }
+
+ /**
+ * Creates a table with two person objects
+ */
+ public Table getPersonTable() {
+ Table table = new Table();
+ table.setPageLength(5);
+ table.setSelectable(true);
+ table.setImmediate(true);
+ table.setNullSelectionAllowed(true);
+ table.addContainerProperty("Name", String.class, null);
+ table.addListener(getTableValueChangeListener());
+ Person person = new Person("Teppo", "Testaaja",
+ "teppo.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
+ "Turku");
+ Person person2 = new Person("Taina", "Testaaja",
+ "taina.testaaja@example.com", "", "Ruukinkatu 2–4", 20540,
+ "Turku");
+ Item item = table.addItem(person);
+ item.getItemProperty("Name").setValue(
+ person.getFirstName() + " " + person.getLastName());
+ item = table.addItem(person2);
+ item.getItemProperty("Name").setValue(
+ person2.getFirstName() + " " + person2.getLastName());
+ return table;
+ }
+
+ /**
+ * Creates value change listener for the table
+ */
+ private Property.ValueChangeListener getTableValueChangeListener() {
+ return new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (personForm != null) {
+ removeComponent(personForm);
+ }
+ if (event.getProperty().getValue() != null) {
+ personForm = new NestedPersonForm((Person) event
+ .getProperty().getValue(), embeddedAddress);
+ personForm.setWidth("350px");
+ addComponent(personForm);
+ }
+ }
+
+ };
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
new file mode 100644
index 0000000000..a3ee89b3ee
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressField.java
@@ -0,0 +1,97 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.data.Buffered;
+import com.vaadin.data.Validator.InvalidValueException;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.util.Address;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomField;
+import com.vaadin.ui.Form;
+
+/**
+ * Nested form for the Address object of the Person object
+ */
+public class AddressField extends CustomField<Address> {
+ private Form addressForm;
+ private final Form parentForm;
+
+ public AddressField() {
+ this(null);
+ }
+
+ public AddressField(Form parentForm) {
+ this.parentForm = parentForm;
+ }
+
+ @Override
+ protected Component initContent() {
+ if (parentForm != null) {
+ addressForm = new EmbeddedForm(parentForm);
+ } else {
+ addressForm = new Form();
+ }
+ addressForm.setCaption("Address");
+ addressForm.setWriteThrough(false);
+
+ // make sure field changes are sent early
+ addressForm.setImmediate(true);
+
+ return addressForm;
+ }
+
+ @Override
+ protected Form getContent() {
+ return (Form) super.getContent();
+ }
+
+ @Override
+ public void setInternalValue(Address address) throws ReadOnlyException {
+ // create the address if not given
+ if (null == address) {
+ address = new Address();
+ }
+
+ super.setInternalValue(address);
+
+ // set item data source and visible properties in a single operation to
+ // avoid creating fields multiple times
+ List<String> visibleProperties = Arrays.asList("streetAddress",
+ "postalCode", "city");
+ getContent().setItemDataSource(new BeanItem<Address>(address),
+ visibleProperties);
+ }
+
+ /**
+ * commit changes of the address form
+ */
+ @Override
+ public void commit() throws Buffered.SourceException, InvalidValueException {
+ addressForm.commit();
+ super.commit();
+ }
+
+ /**
+ * discard changes of the address form
+ */
+ @Override
+ public void discard() throws Buffered.SourceException {
+ // Do not discard the top-level value
+ // super.discard();
+ addressForm.discard();
+ }
+
+ @Override
+ public boolean isReadOnly() {
+ // In this application, the address is modified implicitly by
+ // addressForm.commit(), not by setting the Address object for a Person.
+ return false;
+ }
+
+ @Override
+ public Class<Address> getType() {
+ return Address.class;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java
new file mode 100644
index 0000000000..693b1e11b1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/AddressFormExample.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Address;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
+
+/**
+ * Demonstrate a custom field which is a form, and contains another custom field
+ * for the selection of a city.
+ */
+public class AddressFormExample extends TestBase {
+
+ @Override
+ protected void setup() {
+ Address address = new Address("Ruukinkatu 2-4", 20540, "Turku");
+ final AddressField field = new AddressField();
+ field.setValue(address);
+
+ addComponent(field);
+
+ Button commitButton = new Button("Save", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ field.commit();
+ Address address = field.getValue();
+ Notification.show("Address saved: "
+ + address.getStreetAddress() + ", "
+ + address.getPostalCode() + ", " + address.getCity());
+ }
+ });
+ addComponent(commitButton);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Custom field for editing an Address";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
new file mode 100644
index 0000000000..409ecccca8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanField.java
@@ -0,0 +1,46 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CustomField;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * An example of a custom field for editing a boolean value. The field is
+ * composed of multiple components, and could also edit a more complex data
+ * structures. Here, the commit etc. logic is not overridden.
+ */
+public class BooleanField extends CustomField {
+
+ @Override
+ protected Component initContent() {
+ VerticalLayout layout = new VerticalLayout();
+
+ layout.addComponent(new Label("Please click the button"));
+
+ final Button button = new Button("Click me");
+ button.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Object value = getValue();
+ boolean newValue = true;
+ if ((value instanceof Boolean) && ((Boolean) value)) {
+ newValue = false;
+ }
+ setValue(newValue);
+ button.setCaption(newValue ? "On" : "Off");
+ }
+ });
+ layout.addComponent(button);
+
+ return layout;
+ }
+
+ @Override
+ public Class<?> getType() {
+ return Boolean.class;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html
new file mode 100644
index 0000000000..6b1b3e8a2d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.html
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>BooleanFieldExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">BooleanFieldExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.BooleanFieldExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldBooleanFieldExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>on</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldBooleanFieldExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>off</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java
new file mode 100644
index 0000000000..a52b168e84
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/BooleanFieldExample.java
@@ -0,0 +1,88 @@
+package com.vaadin.tests.components.customfield;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.VerticalLayout;
+
+public class BooleanFieldExample extends TestBase {
+
+ /**
+ * Data model class with two boolean fields.
+ */
+ public static class TwoBooleans {
+ private boolean normal;
+ private boolean custom;
+
+ public void setNormal(boolean normal) {
+ this.normal = normal;
+ }
+
+ public boolean isNormal() {
+ return normal;
+ }
+
+ public void setCustom(boolean custom) {
+ this.custom = custom;
+ }
+
+ public boolean isCustom() {
+ return custom;
+ }
+ }
+
+ @Override
+ protected void setup() {
+ final VerticalLayout layout = new VerticalLayout();
+ layout.setMargin(true);
+
+ final Form form = new Form();
+ form.setFormFieldFactory(new DefaultFieldFactory() {
+ @Override
+ public Field createField(Item item, Object propertyId,
+ Component uiContext) {
+ if ("custom".equals(propertyId)) {
+ return new BooleanField();
+ }
+ return super.createField(item, propertyId, uiContext);
+ }
+ });
+ final TwoBooleans data = new TwoBooleans();
+ form.setItemDataSource(new BeanItem<TwoBooleans>(data));
+
+ layout.addComponent(form);
+
+ Button submit = new Button("Submit", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ form.commit();
+ Notification.show("The custom boolean field value is "
+ + data.isCustom() + ".\n"
+ + "The checkbox (default boolean field) value is "
+ + data.isNormal() + ".");
+ }
+ });
+ layout.addComponent(submit);
+
+ addComponent(layout);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "A customized field (a two-state button) for editing a boolean value.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java
new file mode 100644
index 0000000000..d305afde1d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedForm.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.Layout;
+
+/**
+ * Form that displays its fields in the layout of another form.
+ *
+ * The fields are still logically part of this form even though they are in the
+ * layout of the parent form. The embedded form itself is automatically hidden.
+ *
+ * TODO Known issue: any field factory creating an {@link EmbeddedForm}
+ * (directly or indirectly) should re-use the field once it has been created to
+ * avoid the creation of duplicate fields when e.g. setting the visible item
+ * properties.
+ */
+public class EmbeddedForm extends Form {
+ private Form parentForm;
+ private Map<Object, Field> fields = new HashMap<Object, Field>();
+
+ /**
+ * Create a form that places its fields in another {@link Form}.
+ *
+ * @param parentForm
+ * form to which to embed the fields, not null
+ */
+ public EmbeddedForm(Form parentForm) {
+ this.parentForm = parentForm;
+ setVisible(false);
+ }
+
+ @Override
+ protected void attachField(Object propertyId, Field field) {
+ if (propertyId == null || field == null) {
+ return;
+ }
+
+ Layout layout = parentForm.getLayout();
+
+ Field oldField = fields.get(propertyId);
+ if (oldField != null) {
+ layout.removeComponent(oldField);
+ }
+
+ fields.put(propertyId, field);
+
+ if (layout instanceof CustomLayout) {
+ ((CustomLayout) layout).addComponent(field, propertyId.toString());
+ } else {
+ layout.addComponent(field);
+ }
+ }
+
+ @Override
+ public boolean removeItemProperty(Object id) {
+ // remove the field from the parent layout if already added there
+ parentForm.getLayout().removeComponent(fields.get(id));
+ fields.remove(id);
+
+ return super.removeItemProperty(id);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html
new file mode 100644
index 0000000000..2af441bc83
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.html
@@ -0,0 +1,82 @@
+<?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>EmbeddedFormExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">EmbeddedFormExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.EmbeddedFormExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>66,10</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turkuaa</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>52,15</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>56,10</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldEmbeddedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[4]</td>
+ <td>Helsinki</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java
new file mode 100644
index 0000000000..aeb1984937
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/EmbeddedFormExample.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.components.customfield;
+
+public class EmbeddedFormExample extends AbstractNestedFormExample {
+
+ @Override
+ protected void setup() {
+ super.setup(true);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "An address form embedded in a person form.\n"
+ + "The address fields are placed in the layout of the parent (person) form.\n"
+ + "Note that in many cases the same result can be achieved with a property that maps subfields to the top level.";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html
new file mode 100644
index 0000000000..f9f5783c05
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.html
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>NestedFormExample</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">NestedFormExample</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.customfield.NestedFormExample?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>33,9</td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turkuaa</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>56,14</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Turku</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>30,9</td>
+</tr>
+<tr>
+ <td>verifyValue</td>
+ <td>vaadin=runcomvaadintestscomponentscustomfieldNestedFormExample::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VCustomComponent[0]/VForm[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VTextField[2]</td>
+ <td>Helsinki</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java
new file mode 100644
index 0000000000..91fb43f4e2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedFormExample.java
@@ -0,0 +1,15 @@
+package com.vaadin.tests.components.customfield;
+
+public class NestedFormExample extends AbstractNestedFormExample {
+
+ @Override
+ protected void setup() {
+ super.setup(false);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "An address form nested in a person form.";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java
new file mode 100644
index 0000000000..0bc4f45545
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/customfield/NestedPersonForm.java
@@ -0,0 +1,96 @@
+package com.vaadin.tests.components.customfield;
+
+import java.util.Arrays;
+
+import com.vaadin.data.Item;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.DefaultFieldFactory;
+import com.vaadin.ui.Field;
+import com.vaadin.ui.Form;
+import com.vaadin.ui.HorizontalLayout;
+
+/**
+ * Example of nested forms
+ */
+public class NestedPersonForm extends Form {
+ private BeanItem<Person> beanItem;
+ private final boolean embeddedAddress;
+
+ /**
+ * Creates a person form which contains nested form for the persons address
+ */
+ public NestedPersonForm(Person person, boolean embeddedAddress) {
+ this.embeddedAddress = embeddedAddress;
+
+ beanItem = new BeanItem<Person>(person);
+ setCaption("Update person details");
+ setWriteThrough(false);
+ setFormFieldFactory(new PersonFieldFactory());
+ // set the data source and the visible fields
+ // Note that if the nested form is the first or last field in the parent
+ // form, styles from the parent (padding, ...) may leak to its contents.
+ setItemDataSource(beanItem, Arrays.asList("firstName", "lastName",
+ "address", "email", "phoneNumber"));
+ getFooter().addComponent(getButtonsLayout());
+ getFooter().setMargin(false, false, true, true);
+ }
+
+ /**
+ * Get apply and discard button in the layout
+ */
+ private Component getButtonsLayout() {
+ HorizontalLayout buttons = new HorizontalLayout();
+ buttons.setSpacing(true);
+ Button discardChanges = new Button("Discard changes",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ NestedPersonForm.this.discard();
+ }
+ });
+ buttons.addComponent(discardChanges);
+ buttons.setComponentAlignment(discardChanges, Alignment.MIDDLE_LEFT);
+
+ Button apply = new Button("Apply", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ try {
+ NestedPersonForm.this.commit();
+ } catch (Exception e) {
+ // Ignored, we'll let the Form handle the errors
+ }
+ }
+ });
+ buttons.addComponent(apply);
+ return buttons;
+ }
+
+ /**
+ * Field factory for person form
+ */
+ private class PersonFieldFactory extends DefaultFieldFactory {
+ // reuse the address field - required by EmbeddedForm
+ private AddressField addressField;
+
+ @Override
+ public Field createField(Item item, Object propertyId,
+ Component uiContext) {
+ Field f = super.createField(item, propertyId, uiContext);
+ if ("address".equals(propertyId)) {
+ // create a custom field for the Address object
+ if (addressField == null) {
+ Form form = (embeddedAddress && uiContext instanceof Form) ? (Form) uiContext
+ : null;
+ addressField = new AddressField(form);
+ }
+ f = addressField;
+ }
+ return f;
+ }
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
index 29ad93c6c6..8420888098 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.html
@@ -45,12 +45,12 @@
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldCommitInvalid::PID_SLog_row_2</td>
- <td>4. Commit failed : Not an integer</td>
+ <td>4. Commit failed : Could not convert value to Integer</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldCommitInvalid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VForm[0]/domChild[0]/domChild[2]/domChild[0]</td>
- <td>Not an integer</td>
+ <td>Could not convert value to Integer</td>
</tr>
<tr>
<td>assertText</td>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
index 36ee068af4..c4f001ac41 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CommitInvalid.java
@@ -6,7 +6,6 @@ import java.util.Locale;
import com.vaadin.data.Validator.InvalidValueException;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -64,7 +63,6 @@ public class CommitInvalid extends TestBase {
*/
integerProperty = new ObjectProperty<Integer>(42);
integerField = new TextField("Another Field", integerProperty);
- integerField.addValidator(new IntegerValidator("Not an integer"));
integerField.setDebugId("_IF");
form.addField("text", integerField);
@@ -74,6 +72,7 @@ public class CommitInvalid extends TestBase {
Button validate = new Button("Validate");
validate.setDebugId("_validate");
validate.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
form.validate();
@@ -90,6 +89,7 @@ public class CommitInvalid extends TestBase {
Button commit = new Button("Commit");
commit.setDebugId("_commit");
commit.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
form.commit();
@@ -105,6 +105,7 @@ public class CommitInvalid extends TestBase {
form.getFooter().addComponent(commit);
Button printState = new Button("printState");
printState.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
printState();
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.html b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.html
index 61ff29d1c5..1acdded4cb 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.html
@@ -161,12 +161,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[11]</td>
<td>10 maalis 1999</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[14]</td>
<td>26 syyskuu 1980</td>
</tr>
<tr>
@@ -211,7 +211,7 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[43]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[35]</td>
<td>10. tammikuuta 2011</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java
index 48bf3622d1..acca47ee5e 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/CustomDateFormats.java
@@ -37,6 +37,7 @@ public class CustomDateFormats extends TestBase {
s.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setDateFieldLocale((Locale) s.getValue());
}
@@ -155,6 +156,7 @@ public class CustomDateFormats extends TestBase {
df.setValue(cal.getTime());
df.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateServerSideLabel((DateField) event.getProperty());
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.html
index 751c7ba9bd..f387695b5f 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.html
@@ -98,7 +98,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldEmptyValid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldEmptyValid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[2]</td>
<td>208,5</td>
</tr>
<tr>
@@ -128,7 +128,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldEmptyValid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldEmptyValid::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[2]</td>
<td>186,10</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
index 440f004531..5098a4e459 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldEmptyValid.java
@@ -7,6 +7,7 @@ import java.util.Locale;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -36,7 +37,7 @@ public class DateFieldEmptyValid extends TestBase {
@Override
protected void setup() {
- addComponent(new Label("<br/><br/>", Label.CONTENT_XHTML));
+ addComponent(new Label("<br/><br/>", ContentMode.XHTML));
log = new Log(8);
addComponent(log);
df = new MyDateField();
@@ -47,6 +48,7 @@ public class DateFieldEmptyValid extends TestBase {
df.setImmediate(true);
df.setResolution(DateField.RESOLUTION_DAY);
df.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
log.log("Value changeEvent");
checkEmpty();
@@ -58,6 +60,7 @@ public class DateFieldEmptyValid extends TestBase {
b.setDebugId("clear");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Clearing date aka setValue(null)");
df.setValue(null);
@@ -69,6 +72,7 @@ public class DateFieldEmptyValid extends TestBase {
b.setDebugId("set4.5.1990");
b.addListener(new ClickListener() {
+ @Override
@SuppressWarnings("deprecation")
public void buttonClick(ClickEvent event) {
log.log("Setting new value to datefield (4.5.1990)");
@@ -80,6 +84,7 @@ public class DateFieldEmptyValid extends TestBase {
b = new Button("Set date to 5.6.2000 using a property data source");
b.addListener(new ClickListener() {
+ @Override
@SuppressWarnings("deprecation")
public void buttonClick(ClickEvent event) {
log.log("Setting new object property (5.6.2000) to datefield");
@@ -96,6 +101,7 @@ public class DateFieldEmptyValid extends TestBase {
b.setDebugId("set-via-ds");
b.addListener(new ClickListener() {
+ @Override
@SuppressWarnings("deprecation")
public void buttonClick(ClickEvent event) {
log.log("Setting object property (with value null) to datefield and set value of property to 27.8.2005");
@@ -110,6 +116,7 @@ public class DateFieldEmptyValid extends TestBase {
b = new Button("Check value");
b.setDebugId("check-value");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Checking state");
checkEmpty();
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
index 18bc719850..2a7807670b 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldInSubWindow.java
@@ -13,6 +13,7 @@ import com.vaadin.ui.DefaultFieldFactory;
import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -59,9 +60,9 @@ public class DateFieldInSubWindow extends AbstractTestCase {
public static final String COMMON_FIELD_WIDTH = "12em";
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
if ("myDate".equals(propertyId)) {
((DateField) f).setResolution(DateField.RESOLUTION_MIN);
@@ -105,8 +106,9 @@ public class DateFieldInSubWindow extends AbstractTestCase {
Button b = new Button("Close", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- (getParent()).removeWindow(TestCaseWindow.this);
+ TestCaseWindow.this.close();
}
});
buttons.addComponent(b);
@@ -118,9 +120,10 @@ public class DateFieldInSubWindow extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
Button open = new Button("Open window", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().addWindow(new TestCaseWindow());
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java
index dd61ccd60c..5d06895d11 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldLocale.java
@@ -21,6 +21,7 @@ public class DateFieldLocale extends TestBase {
addComponent(new Button("Change locale", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (dateField.getLocale().getCountry().equalsIgnoreCase("fi")) {
dateField.setLocale(new Locale("zh", "CN"));
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java
index e7c3442060..1a3b3858b8 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldMinResolution.java
@@ -39,6 +39,7 @@ public class DateFieldMinResolution extends TestBase {
idf.setImmediate(true);
idf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
lbl.setValue(dformat.format(event.getProperty().getValue()));
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
index 3521e8b95e..b87c458c01 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldPopupOffScreen.java
@@ -6,8 +6,9 @@ import java.util.Locale;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class DateFieldPopupOffScreen extends AbstractTestCase {
@@ -23,7 +24,7 @@ public class DateFieldPopupOffScreen extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window(getClass().getName());
+ LegacyWindow mainWindow = new LegacyWindow(getClass().getName());
GridLayout mainLayout = new GridLayout(3, 3);
mainLayout.setSizeFull();
@@ -57,7 +58,7 @@ public class DateFieldPopupOffScreen extends AbstractTestCase {
private DateField createDateField() {
DateField df = new DateField();
df.setLocale(new Locale("fi"));
- df.setResolution(DateField.RESOLUTION_SEC);
+ df.setResolution(Resolution.SECOND);
df.setDescription("This is a long, multiline tooltip.<br/>It should always be on screen so it can be read.");
df.setValue(new Date(1000000L));
return df;
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html
new file mode 100644
index 0000000000..444f8e3bac
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.html
@@ -0,0 +1,96 @@
+<?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.datefield.DateFieldRangeValidation?restartApplication</td>
+ <td></td>
+</tr>
+<!--select 15.12.2011-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton</td>
+ <td>11,17</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::Root/VOverlay[0]/VCalendarPanel[0]#day15</td>
+ <td>7,5</td>
+</tr>
+<!--should not be error-->
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[4]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
+ <td>26,6</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[4]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--select 3.12.2011-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#popupButton</td>
+ <td>13,17</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::Root/VOverlay[0]/VCalendarPanel[0]#day3</td>
+ <td>13,13</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[4]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--change to 4.12.2011 by writing-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field</td>
+ <td>52,6</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VPopupCalendar[0]#field</td>
+ <td>12/4/11</td>
+</tr>
+<!--should not be error-->
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[4]/domChild[1]</td>
+ <td></td>
+</tr>
+<!--no longer include start date-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>6,8</td>
+</tr>
+<!--should be error-->
+<tr>
+ <td>assertElementPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldRangeValidation::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[4]/domChild[1]</td>
+ <td></td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
new file mode 100644
index 0000000000..befdd65693
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldRangeValidation.java
@@ -0,0 +1,145 @@
+package com.vaadin.tests.components.datefield;
+
+import java.util.Date;
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.validator.RangeValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.DateField.Resolution;
+import com.vaadin.ui.PopupDateField;
+
+public class DateFieldRangeValidation extends TestBase {
+
+ public class Range {
+ private Date from, to;
+ private boolean fromInclusive = true;
+ private boolean toInclusive = true;
+
+ public boolean isFromInclusive() {
+ return fromInclusive;
+ }
+
+ public void setFromInclusive(boolean fromInclusive) {
+ this.fromInclusive = fromInclusive;
+ }
+
+ public boolean isToInclusive() {
+ return toInclusive;
+ }
+
+ public void setToInclusive(boolean toInclusive) {
+ this.toInclusive = toInclusive;
+ }
+
+ public Date getFrom() {
+ return from;
+ }
+
+ public void setFrom(Date from) {
+ this.from = from;
+ }
+
+ public Date getTo() {
+ return to;
+ }
+
+ public void setTo(Date to) {
+ this.to = to;
+ }
+
+ }
+
+ private Range range = new Range();
+ private ValueChangeListener refreshField = new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ actualDateField.requestRepaint();
+ }
+ };
+
+ private PopupDateField actualDateField;
+
+ @Override
+ protected void setup() {
+ BeanItem<Range> bi = new BeanItem<Range>(range);
+ range.setFrom(new Date(2011 - 1900, 12 - 1, 4));
+ range.setTo(new Date(2011 - 1900, 12 - 1, 15));
+
+ PopupDateField fromField = createDateField();
+ fromField.setPropertyDataSource(bi.getItemProperty("from"));
+ CheckBox fromInclusive = new CheckBox("From inclusive",
+ bi.getItemProperty("fromInclusive"));
+ CheckBox toInclusive = new CheckBox("To inclusive",
+ bi.getItemProperty("toInclusive"));
+ fromInclusive.setImmediate(true);
+ fromInclusive.addListener(refreshField);
+ toInclusive.setImmediate(true);
+ toInclusive.addListener(refreshField);
+
+ PopupDateField toField = createDateField();
+ toField.setPropertyDataSource(bi.getItemProperty("to"));
+
+ actualDateField = createDateField();
+ actualDateField.setValue(new Date(2011 - 1900, 12 - 1, 1));
+ actualDateField.addValidator(new RangeValidator<Date>("", Date.class,
+ null, null) {
+ @Override
+ public boolean isMinValueIncluded() {
+ return range.isFromInclusive();
+ }
+
+ @Override
+ public boolean isMaxValueIncluded() {
+ return range.isToInclusive();
+ }
+
+ @Override
+ public Date getMaxValue() {
+ return range.getTo();
+ }
+
+ @Override
+ public Date getMinValue() {
+ return range.getFrom();
+ }
+
+ @Override
+ public String getErrorMessage() {
+ return "Date must be in range " + getMinValue() + " - "
+ + getMaxValue();
+ }
+ });
+ addComponent(fromField);
+ addComponent(fromInclusive);
+ addComponent(toField);
+ addComponent(toInclusive);
+ addComponent(actualDateField);
+ }
+
+ private PopupDateField createDateField() {
+ PopupDateField df = new PopupDateField();
+ df.setLocale(new Locale("en", "US"));
+ df.setResolution(Resolution.DAY);
+ df.setWriteThrough(true);
+ df.setReadThrough(true);
+ df.setImmediate(true);
+ return df;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Tests the DateField range validator. The first field sets the minimum date, the second the maximum. Checkboxes control if the selected date is ok or not.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java
index 516d207a38..392dbaf9c6 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldReadOnly.java
@@ -43,6 +43,7 @@ public class DateFieldReadOnly extends TestBase {
Button b = new Button("Switch read-only");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
timeField.setReadOnly(!timeField.isReadOnly());
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
index 7d1bdfc2c8..c502b9597e 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTest.java
@@ -9,9 +9,11 @@ import java.util.Locale;
import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) DateField.class;
@@ -19,6 +21,7 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
private Command<T, Date> setValue = new Command<T, Date>() {
+ @Override
public void execute(T c, Date value, Object data) {
c.setValue(value);
}
@@ -93,28 +96,29 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
}
private void createResolutionSelectAction(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
createSelectAction("Resolution", category, options, "Year",
resolutionCommand);
}
- private Command<T, Integer> resolutionCommand = new Command<T, Integer>() {
+ private Command<T, Resolution> resolutionCommand = new Command<T, Resolution>() {
- public void execute(T c, Integer value, Object data) {
+ @Override
+ public void execute(T c, Resolution value, Object data) {
c.setResolution(value);
}
};
private Command<T, Boolean> lenientCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setLenient(false);
@@ -122,6 +126,7 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
};
private Command<T, Boolean> weekNumberCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setShowISOWeekNumbers(value);
@@ -129,6 +134,7 @@ public class DateFieldTest<T extends DateField> extends AbstractFieldTest<T> {
};
private Command<T, String> dateFormatCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
c.setDateFormat(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
index 2a67b16170..be325ef2eb 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.html
@@ -39,12 +39,12 @@
<tr>
<td>assertValue</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldTimezone::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field</td>
- <td>1/1/10 02:00:00.000 AM</td>
+ <td>1/1/10 02:00:00 AM</td>
</tr>
<tr>
<td>type</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldDateFieldTimezone::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VPopupCalendar[0]#field</td>
- <td>1/1/10 01:00:00.000 AM</td>
+ <td>1/1/10 01:00:00 AM</td>
</tr>
<tr>
<td>assertText</td>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
index 6562e5412e..6f31b4d80f 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldTimezone.java
@@ -14,6 +14,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
public class DateFieldTimezone extends TestBase {
@@ -25,6 +26,8 @@ public class DateFieldTimezone extends TestBase {
@Override
protected void setup() {
+ dateField.setResolution(Resolution.SECOND);
+
ArrayList<String> timeZoneCodes = new ArrayList<String>();
timeZoneCodes.add(nullValue);
timeZoneCodes.addAll(Arrays.asList(TimeZone.getAvailableIDs()));
@@ -48,6 +51,7 @@ public class DateFieldTimezone extends TestBase {
timezoneSelector.setNullSelectionItemId(nullValue);
timezoneSelector.setFilteringMode(ComboBox.FILTERINGMODE_CONTAINS);
timezoneSelector.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object value = event.getProperty().getValue();
TimeZone timeZone;
@@ -72,8 +76,9 @@ public class DateFieldTimezone extends TestBase {
dateField.setTimeZone(cal.getTimeZone());
dateField.setLocale(EN);
dateField.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- Date date = (Date) dateField.getValue();
+ Date date = dateField.getValue();
DateFormat format = DateFormat.getDateTimeInstance(
DateFormat.SHORT, DateFormat.LONG, EN);
format.setTimeZone(UTC);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
index 4f83575b39..bbe2423a3f 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DateFieldUnparsableDate.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.datefield;
import java.util.Date;
import com.vaadin.data.Property;
+import com.vaadin.data.util.converter.Converter;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.DateField;
@@ -14,16 +15,17 @@ public class DateFieldUnparsableDate extends TestBase {
public MyDateField(String caption) {
super(caption);
addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(
com.vaadin.data.Property.ValueChangeEvent event) {
- oldDate = (Date) getValue();
+ oldDate = getValue();
}
});
}
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
return oldDate;
}
}
@@ -35,7 +37,7 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
return null;
}
}
@@ -47,8 +49,9 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
- throw new ConversionException("You should not enter invalid dates!");
+ throws Converter.ConversionException {
+ throw new Converter.ConversionException(
+ "You should not enter invalid dates!");
}
}
@@ -59,11 +62,12 @@ public class DateFieldUnparsableDate extends TestBase {
@Override
protected Date handleUnparsableDateString(String dateString)
- throws ConversionException {
+ throws Converter.ConversionException {
if (dateString != null && dateString.equals("today")) {
return new Date();
}
- throw new ConversionException("You should not enter invalid dates!");
+ throw new Converter.ConversionException(
+ "You should not enter invalid dates!");
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
index bcdc8260b0..b5842694f0 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DefaultHandleUnparsableDateField.java
@@ -15,9 +15,11 @@ public class DefaultHandleUnparsableDateField extends TestBase {
date.setImmediate(true);
addComponent(date);
date.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (date.isValid()) {
- getMainWindow().showNotification(date.toString());
+ getMainWindow()
+ .showNotification(date.getValue().toString());
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java
index 8f201e120d..4e256aa947 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java
@@ -16,6 +16,7 @@ public class DisabledDateFieldWidth extends TestBase {
Button button = new Button("Repaint datefield",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
dateField1.requestRepaint();
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
index 3cdf70d5ab..4bf57177bd 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFieldResolutionMsec.html
@@ -53,7 +53,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>29,2</td>
</tr>
<tr>
@@ -83,12 +83,7 @@
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>000</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>PM</td>
</tr>
<tr>
@@ -108,7 +103,7 @@
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>label=AM</td>
</tr>
<tr>
@@ -148,43 +143,38 @@
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#h</td>
<td>03</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#m</td>
<td>04</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[4]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
<td>05</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>006</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#ampm</td>
<td>AM</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>label=002</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
+ <td>label=02</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>6. ValueChangeEvent, new value: Jan 2, 2000 03:04:05.002</td>
+ <td>6. ValueChangeEvent, new value: Jan 2, 2000 03:04:02.006</td>
</tr>
<tr>
<td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>002</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/VCalendarPanel[0]#s</td>
+ <td>02</td>
</tr>
</tbody></table>
</body>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
index efda17f7c6..c642db1bc0 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/InlineDateFields.java
@@ -8,6 +8,7 @@ import java.util.Locale;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.InlineDateField;
@SuppressWarnings("serial")
@@ -51,7 +52,7 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
pd.setWidth(width);
pd.setValue(new Date(12312312313L));
pd.setLocale(locale);
- pd.setResolution(DateField.RESOLUTION_YEAR);
+ pd.setResolution(DateField.Resolution.YEAR);
return pd;
}
@@ -70,18 +71,18 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
}
private Component createResolutionSelectAction() {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
return createSelectAction("Resolution", options, "Year",
- new Command<InlineDateField, Integer>() {
+ new Command<InlineDateField, Resolution>() {
- public void execute(InlineDateField c, Integer value,
+ @Override
+ public void execute(InlineDateField c, Resolution value,
Object data) {
c.setResolution(value);
@@ -97,6 +98,7 @@ public class InlineDateFields extends ComponentTestCase<InlineDateField> {
return createSelectAction("Locale", options, LOCALES[0].toString(),
new Command<InlineDateField, Locale>() {
+ @Override
public void execute(InlineDateField c, Locale value,
Object data) {
c.setCaption(c.getCaption().replaceAll(
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java b/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java
index cbe9ac613f..585395d747 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/LenientMode.java
@@ -73,6 +73,7 @@ public class LenientMode extends TestBase implements ValueChangeListener {
}
+ @Override
public void valueChange(ValueChangeEvent event) {
getMainWindow().showNotification(
"New value" + event.getProperty().getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java b/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java
index 1c1994cbe5..9c2d3d7d51 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/LowResolution.java
@@ -16,6 +16,7 @@ public class LowResolution extends TestBase {
dateField.setValue(new java.util.Date());
dateField.setResolution(PopupDateField.RESOLUTION_MONTH);
dateField.addListener(new PopupDateField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
getMainWindow().showNotification(
"Date now" + event.getProperty());
@@ -28,6 +29,7 @@ public class LowResolution extends TestBase {
// dateField.setValue(new java.util.Date());
dateField3.setResolution(PopupDateField.RESOLUTION_YEAR);
dateField3.addListener(new PopupDateField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
getMainWindow().showNotification(
"Date now" + event.getProperty());
@@ -40,6 +42,7 @@ public class LowResolution extends TestBase {
dateField2.setValue(new java.util.Date());
dateField2.setResolution(PopupDateField.RESOLUTION_MONTH);
dateField2.addListener(new PopupDateField.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
getMainWindow().showNotification(
"Date now" + event.getProperty());
@@ -52,6 +55,7 @@ public class LowResolution extends TestBase {
"Immediate (use sync button to change fields) ");
immediate.setValue(true);
immediate.addListener(new CheckBox.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
boolean immediate = !dateField.isImmediate();
dateField.setImmediate(immediate);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldDisabledReadonly.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldDisabledReadonly.html
index fcd2ddf573..009ca0aaf9 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldDisabledReadonly.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldDisabledReadonly.html
@@ -39,7 +39,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[4]</td>
<td>759,5</td>
</tr>
<tr>
@@ -59,7 +59,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[2]/domChild[0]</td>
<td>566,9</td>
</tr>
<tr>
@@ -84,7 +84,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[4]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[4]</td>
<td>699,43</td>
</tr>
<tr>
@@ -109,7 +109,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[3]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[3]</td>
<td>630,30</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
index 357c61f4f6..a12bdfa44c 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldExtendedRange.java
@@ -41,6 +41,7 @@ public class PopupDateFieldExtendedRange extends TestBase {
}
addComponent(new Button("Change date", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
date.set(2010, 1, 16);
for (PopupDateField f : fields) {
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldMonth.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldMonth.html
index 440de7c952..9111388f5a 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldMonth.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldMonth.html
@@ -23,7 +23,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VPopupCalendar[0]/domChild[1]</td>
<td>10,14</td>
</tr>
<tr>
@@ -33,12 +33,12 @@
</tr>
<tr>
<td>enterCharacter</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VPopupCalendar[0]/domChild[0]</td>
<td>1 1 2010</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VPopupCalendar[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldCustomDateFormats::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VPopupCalendar[0]/domChild[1]</td>
<td>14,13</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldPopup.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldPopup.html
index 993d053b63..1ec418e523 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldPopup.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldPopup.html
@@ -43,7 +43,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldPopup::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldPopup::/VVerticalLayout[0]</td>
<td>85,81</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
index 6dae483332..8ecf9a4731 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldResolutions.html
@@ -272,67 +272,6 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#field</td>
<td>10,12</td>
</tr>
-<!--Resolution: msec-->
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_Sselectaction-Resolution/domChild[0]</td>
- <td>label=Msec</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>enabled-msec</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#popupButton</td>
- <td>10,12</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#header</td>
- <td>May 1970</td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#day23</td>
- <td>23</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
- <td>02</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
- <td>05</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
- <td>12</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#ms</td>
- <td>313</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::Root/VOverlay[0]/VCalendarPanel[0]#ampm</td>
- <td>PM</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>msec-popup-us</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::PID_SLocale-en_US-undefined-wide#field</td>
- <td>10,12</td>
-</tr>
<!--Check resolution year functionality-->
<tr>
<td>select</td>
@@ -401,7 +340,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>202,40</td>
</tr>
<tr>
@@ -451,7 +390,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>129,26</td>
</tr>
<!--Check resolution month functionality-->
@@ -542,7 +481,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]/domChild[0]</td>
<td>174,3</td>
</tr>
<tr>
@@ -552,7 +491,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>129,26</td>
</tr>
<!--Check resolution day functionality-->
@@ -568,7 +507,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[2]</td>
<td>478,1</td>
</tr>
<tr>
@@ -618,7 +557,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]/domChild[0]</td>
<td>193,12</td>
</tr>
<tr>
@@ -858,7 +797,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]/domChild[0]</td>
<td>185,8</td>
</tr>
<tr>
@@ -888,7 +827,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>364,32</td>
</tr>
<!--Also check finnish locale-->
@@ -924,7 +863,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[7]/domChild[0]</td>
<td>286,10</td>
</tr>
<tr>
@@ -1080,7 +1019,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[7]</td>
<td>291,3</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java
index 3ab1f52891..3e8b0678a7 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFieldTest.java
@@ -27,6 +27,7 @@ public class PopupDateFieldTest extends DateFieldTest<PopupDateField> {
createSelectAction("Input prompt", category, options, "<none>",
new Command<PopupDateField, String>() {
+ @Override
public void execute(PopupDateField c, String value,
Object data) {
c.setInputPrompt(value);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
index 7e8b19b2a1..bf2a679c63 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/PopupDateFields.java
@@ -8,6 +8,7 @@ import java.util.Locale;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
+import com.vaadin.ui.DateField.Resolution;
import com.vaadin.ui.PopupDateField;
@SuppressWarnings("serial")
@@ -47,7 +48,7 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> {
pd.setWidth(width);
pd.setValue(new Date(12312312313L));
pd.setLocale(locale);
- pd.setResolution(DateField.RESOLUTION_YEAR);
+ pd.setResolution(DateField.Resolution.YEAR);
return pd;
}
@@ -66,18 +67,18 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> {
}
private Component createResolutionSelectAction() {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Year", DateField.RESOLUTION_YEAR);
- options.put("Month", DateField.RESOLUTION_MONTH);
- options.put("Day", DateField.RESOLUTION_DAY);
- options.put("Hour", DateField.RESOLUTION_HOUR);
- options.put("Min", DateField.RESOLUTION_MIN);
- options.put("Sec", DateField.RESOLUTION_SEC);
- options.put("Msec", DateField.RESOLUTION_MSEC);
+ LinkedHashMap<String, Resolution> options = new LinkedHashMap<String, Resolution>();
+ options.put("Year", DateField.Resolution.YEAR);
+ options.put("Month", DateField.Resolution.MONTH);
+ options.put("Day", DateField.Resolution.DAY);
+ options.put("Hour", DateField.Resolution.HOUR);
+ options.put("Min", DateField.Resolution.MINUTE);
+ options.put("Sec", DateField.Resolution.SECOND);
return createSelectAction("Resolution", options, "Year",
- new Command<PopupDateField, Integer>() {
+ new Command<PopupDateField, Resolution>() {
- public void execute(PopupDateField c, Integer value,
+ @Override
+ public void execute(PopupDateField c, Resolution value,
Object data) {
c.setResolution(value);
@@ -94,6 +95,7 @@ public class PopupDateFields extends ComponentTestCase<PopupDateField> {
return createSelectAction("Input prompt", options, "<none>",
new Command<PopupDateField, String>() {
+ @Override
public void execute(PopupDateField c, String value,
Object data) {
c.setInputPrompt(value);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
index 7176dae48b..a89459d37a 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/RequiredInvalidDateField.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.DateField;
public class RequiredInvalidDateField extends TestBase {
+ @SuppressWarnings("deprecation")
@Override
protected void setup() {
// StringLengthValidator textValidator = new StringLengthValidator(
@@ -34,20 +35,26 @@ public class RequiredInvalidDateField extends TestBase {
Date date = new Date(2011 - 1900, 9 - 1, 1);
- Validator dateValidator = new AbstractValidator(
+ Validator dateValidator = new AbstractValidator<Date>(
"Day of month must be an even number") {
- public boolean isValid(Object value) {
- if (!(value instanceof Date)) {
- return false;
+ @Override
+ protected boolean isValidValue(Date value) {
+ if (value == null) {
+ return true;
}
- Date date = (Date) value;
- return (date.getDate() % 2 == 0);
+
+ return (value.getDate() % 2 == 0);
+ }
+
+ @Override
+ public Class getType() {
+ return Date.class;
}
};
// not required
- Property dateProperty1 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty1 = new ObjectProperty<Date>(date);
DateField dateField1 = new DateField("Not required", dateProperty1);
dateField1.setLocale(new Locale("fi", "FI"));
dateField1.setResolution(DateField.RESOLUTION_DAY);
@@ -57,7 +64,7 @@ public class RequiredInvalidDateField extends TestBase {
addComponent(dateField1);
// required
- Property dateProperty2 = new ObjectProperty<Date>(date);
+ Property<Date> dateProperty2 = new ObjectProperty<Date>(date);
DateField dateField2 = new DateField("Required", dateProperty2);
dateField2.setLocale(new Locale("fi", "FI"));
dateField2.setResolution(DateField.RESOLUTION_DAY);
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java b/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java
index 6686fa6fe0..da8f45690c 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/ShowSelectedDateAfterInvalid.java
@@ -28,6 +28,7 @@ public class ShowSelectedDateAfterInvalid extends TestBase {
Button button = new Button("Validate");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
form.setValidationVisible(true);
if (form.isValid()) {
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
index 40d50f0328..7f4cd92be2 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullInlineDateField.html
@@ -16,16 +16,7 @@
<td>/run/com.vaadin.tests.components.datefield.InlineDateFieldTest?restartApplication</td>
<td></td>
</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
- <td>42,20</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
- <td>42,20</td>
-</tr>
+<!--locale -> en_us-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -46,6 +37,7 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
<td>34,4</td>
</tr>
+<!--resolution seconds-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -63,19 +55,10 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>27,5</td>
</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>7539</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
+<!--set value to null-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -96,16 +79,7 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item0</td>
<td>12,8</td>
</tr>
-<tr>
- <td>scroll</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>3542</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>300</td>
- <td></td>
-</tr>
+<!--add a value change listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_Smenu#item0</td>
@@ -139,19 +113,14 @@
<tr>
<td>select</td>
<td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[6]</td>
- <td>index=0</td>
-</tr>
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_StestComponent/domChild[0]/domChild[1]/domChild[2]/domChild[0]/domChild[0]/domChild[8]</td>
<td>index=1</td>
</tr>
+<!--As we start from current date - might be 0-4 value changes and the day may be any day-->
<tr>
- <td>verifyTextPresent</td>
- <td>12:00:00.000</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldInlineDateFieldTest::PID_SLog_row_0</td>
+ <td>*. ValueChangeEvent, new value: * DATE(D), DATE(YYYY) 12:00:00.000</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
index b7f63591f9..9fabd8b1e7 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/TestSettingTimeOnInitiallyNullPopupDateField.html
@@ -78,7 +78,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[2]/VMenuBar[0]#item5</td>
<td>30,12</td>
</tr>
<tr>
@@ -88,22 +88,17 @@
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
- <td>index=0</td>
-</tr>
-<tr>
- <td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
<td>index=0</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#ms</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#m</td>
<td>index=0</td>
</tr>
<tr>
<td>select</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#h</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::Root/VOverlay[0]/VCalendarPanel[0]#s</td>
<td>index=0</td>
</tr>
<tr>
@@ -112,11 +107,10 @@
<td>index=1</td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>12:00:00.000</td>
- <td></td>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldPopupDateFieldTest::PID_SLog_row_0</td>
+ <td>*. ValueChangeEvent, new value: * DATE(D), DATE(YYYY) 12:00:00.000</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.html b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.html
index ce74f8941e..07b8b1b237 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.html
+++ b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.html
@@ -28,7 +28,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsdatefieldValueThroughProperty::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsdatefieldValueThroughProperty::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>246,18</td>
</tr>
<tr>
@@ -41,7 +41,6 @@
<td>vaadin=runcomvaadintestscomponentsdatefieldValueThroughProperty::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPopupCalendar[0]#field</td>
<td>12/14/10</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
index 1f9735b543..a45d3b8ad0 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/ValueThroughProperty.java
@@ -6,6 +6,7 @@ import java.util.Locale;
import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -15,7 +16,7 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.PopupDateField;
public class ValueThroughProperty extends TestBase {
- private final Property dateProperty = new ObjectProperty<Date>(null,
+ private final Property<Date> dateProperty = new ObjectProperty<Date>(null,
Date.class);
@Override
@@ -25,7 +26,7 @@ public class ValueThroughProperty extends TestBase {
+ "Then try to set DateField's value using the first button. It sets the value "
+ "correctly (as we can see from the Label) but the client-side is not updated.<br/>"
+ "Using second button updates value correctly on the client-side too.",
- Label.CONTENT_XML));
+ ContentMode.XML));
final PopupDateField df = new PopupDateField(dateProperty);
df.setLocale(new Locale("en", "US"));
@@ -43,6 +44,7 @@ public class ValueThroughProperty extends TestBase {
cal.set(Calendar.DAY_OF_MONTH, 14);
Button setDateButton1 = new Button(
"Set value to 12/14/10 using property", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
dateProperty.setValue(cal.getTime());
}
@@ -52,6 +54,7 @@ public class ValueThroughProperty extends TestBase {
Button setDateButton2 = new Button(
"Set value to 12/14/10 using setValue", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
df.setValue(cal.getTime());
}
diff --git a/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java b/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java
index 88542751c3..b7b0f50947 100644
--- a/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java
+++ b/tests/testbench/com/vaadin/tests/components/datefield/WidthRecalculationOnEnableStateChange.java
@@ -20,12 +20,14 @@ public class WidthRecalculationOnEnableStateChange extends TestBase {
addComponent(df);
addComponent(new Button("Toggle disabled for date field",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
df.setEnabled(!df.isEnabled());
}
}));
addComponent(new Button("Toggle read only for date field",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
df.setReadOnly(!df.isReadOnly());
}
diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java
index 6b89d1392c..aeb0864707 100644
--- a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java
+++ b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/DragAndDropWrapperTooltips.java
@@ -80,10 +80,12 @@ public class DragAndDropWrapperTooltips extends TestBase {
private DropHandler dh = new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
Transferable transferable = dropEvent.getTransferable();
if (transferable instanceof TransferableImpl) {
diff --git a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.html b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.html
index 08dc608787..c85d7e0626 100644
--- a/tests/testbench/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.html
+++ b/tests/testbench/com/vaadin/tests/components/draganddropwrapper/TooltipHandlingWhenNotDefined.html
@@ -17,7 +17,7 @@
<td></td>
</tr>
<tr>
- <td>mouseOver</td>
+ <td>showTooltip</td>
<td>vaadin=runcomvaadintestscomponentsdraganddropwrapperTooltipHandlingWhenNotDefined::PID_StooltipLabel</td>
<td></td>
</tr>
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java
index f8874810fc..9a412cee9d 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java
@@ -38,6 +38,7 @@ public class EmbeddedAltText extends TestBase {
Button changeAltTexts = new Button("Change alt texts",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
e.setAlternateText("New alt text of the image!");
player.setAlternateText("New alt text of the object!");
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html
index 3afb322a22..2dcd1b5071 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.html
@@ -17,38 +17,23 @@
<td></td>
</tr>
<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VEmbedded[0]/domChild[0]</td>
<td>41,22</td>
</tr>
<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>click-41-22</td>
-</tr>
-<!-- Should really be 41,22 but due to v-view border-top it is not always... <tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td>
<td>41, 22</td>
-</tr>-->
+</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]</td>
<td>0,0</td>
</tr>
<tr>
- <td>waitForVaadin</td>
- <td></td>
+ <td>waitForElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -57,19 +42,9 @@
<td>0,0</td>
</tr>
<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<!-- Should really be 0,0 but due to v-view border-top it is not always... <tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentsembeddedEmbeddedClickListenerRelativeCoordinates::Root/VNotification[0]/HTML[0]/domChild[0]</td>
<td>0, 0</td>
-</tr>-->
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>click-0-0</td>
</tr>
</tbody></table>
</body>
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java
index 96b1d36901..c9b6991d8f 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java
@@ -14,6 +14,7 @@ public class EmbeddedClickListenerRelativeCoordinates extends TestBase {
"../runo/icons/64/ok.png"));
e.addListener(new ClickListener() {
+ @Override
public void click(ClickEvent event) {
getMainWindow()
.showNotification(
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java
index 1a5327c8b9..e316fcc5ec 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java
@@ -45,6 +45,7 @@ public class EmbeddedImageRefresh extends TestBase {
// The button requests repainting the embedded.
Button button = new Button("refr");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
embedded.requestRepaint();
}
@@ -52,6 +53,7 @@ public class EmbeddedImageRefresh extends TestBase {
addComponent(button);
button = new Button("refr name");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
((StreamResource) embedded.getSource()).setFilename(new Date()
.getTime() + ".png");
@@ -61,6 +63,7 @@ public class EmbeddedImageRefresh extends TestBase {
addComponent(button);
button = new Button("200x200");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
embedded.setWidth("200px");
embedded.setHeight("200px");
@@ -69,6 +72,7 @@ public class EmbeddedImageRefresh extends TestBase {
addComponent(button);
button = new Button("undef");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
embedded.setSizeUndefined();
}
@@ -85,6 +89,7 @@ public class EmbeddedImageRefresh extends TestBase {
return (int) Math.round(pos * resolution / (cells * 1.0));
}
+ @Override
public InputStream getStream() {
// Create an image and draw some background on it.
BufferedImage image = new BufferedImage(640, 480,
diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
index 320df648b1..c3854d2420 100644
--- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
+++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java
@@ -29,12 +29,13 @@ public class EmbeddedPdf extends TestBase {
addComponent(player);
addComponent(new Button("Remove pdf", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
removeComponent(player);
}
}));
- player.getWindow().addWindow(new Window("Testwindow"));
+ player.getRoot().addWindow(new Window("Testwindow"));
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormCaptionClickFocusing.html b/tests/testbench/com/vaadin/tests/components/form/FormCaptionClickFocusing.html
index ab0aa25c44..14dbc6d4c8 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormCaptionClickFocusing.html
+++ b/tests/testbench/com/vaadin/tests/components/form/FormCaptionClickFocusing.html
@@ -28,7 +28,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsformFormCaptionClickFocusing::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsformFormCaptionClickFocusing::/VVerticalLayout[0]/domChild[1]</td>
<td>161,159</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java b/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java
index 39305d5638..539263a363 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormClearDatasourceRepaint.java
@@ -37,12 +37,12 @@ public class FormClearDatasourceRepaint extends TestBase {
@Override
protected void setup() {
-
final Form form = new Form();
form.setItemDataSource(new BeanItem<MySecondBean>(new MySecondBean()));
addComponent(form);
addComponent(new Button("Clear datasource", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setItemDataSource(null);
}
@@ -50,10 +50,11 @@ public class FormClearDatasourceRepaint extends TestBase {
addComponent(new Button("Change data source",
new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ @Override
+ public void buttonClick(ClickEvent event) {
form.setItemDataSource(new BeanItem<MyBean>(
new MyBean()));
- }
+ }
}));
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
index 0a3054b0e4..907b8a27f3 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java
@@ -6,8 +6,8 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class FormCommitWithInvalidValues extends TestBase {
@@ -34,6 +34,7 @@ public class FormCommitWithInvalidValues extends TestBase {
Button b = new Button("Commit", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
form.commit();
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormDescription.java b/tests/testbench/com/vaadin/tests/components/form/FormDescription.java
index d05d179ac8..76ea039756 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormDescription.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormDescription.java
@@ -10,13 +10,14 @@ public class FormDescription extends TestBase {
@Override
protected void setup() {
- final Form form = new Form();
- form.setDescription("Some description");
+ final Form form = new Form();
+ form.setDescription("Some description");
form.addField("AAAA", new TextField());
- addComponent(form);
-
+ addComponent(form);
+
addComponent(new Button("Toggle description",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (form.getDescription() == null) {
form.setDescription("Form description");
@@ -25,7 +26,6 @@ public class FormDescription extends TestBase {
}
}
}));
-
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java b/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java
index ecf3215005..41e1a91781 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormRenderingFlicker.java
@@ -49,6 +49,7 @@ public class FormRenderingFlicker extends TestBase {
table.setImmediate(true);
table.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
clicked(event.getItem());
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormTest.java b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
index e3e873c1bb..604beb5fcc 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormTest.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormTest.java
@@ -4,7 +4,7 @@ import java.util.LinkedHashMap;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
+import com.vaadin.shared.ui.AlignmentInfo;
import com.vaadin.tests.components.abstractfield.AbstractFieldTest;
import com.vaadin.tests.components.select.AbstractSelectTestCase;
import com.vaadin.tests.util.Person;
@@ -30,6 +30,7 @@ public class FormTest extends AbstractFieldTest<Form> {
private Command<Form, String> footerWidthCommand = new Command<Form, String>() {
+ @Override
public void execute(Form c, String value, Object data) {
Layout footer = c.getFooter();
if (footer != null) {
@@ -40,6 +41,7 @@ public class FormTest extends AbstractFieldTest<Form> {
};
private Command<Form, String> footerHeightCommand = new Command<Form, String>() {
+ @Override
public void execute(Form c, String value, Object data) {
Layout footer = c.getFooter();
if (footer != null) {
@@ -51,6 +53,7 @@ public class FormTest extends AbstractFieldTest<Form> {
private Command<Form, Class<? extends Layout>> formLayoutCommand = new Command<Form, Class<? extends Layout>>() {
+ @Override
public void execute(Form c, Class<? extends Layout> value, Object data) {
if (value == null) {
c.setLayout(null);
@@ -73,6 +76,7 @@ public class FormTest extends AbstractFieldTest<Form> {
};
private Command<Form, Class<? extends Layout>> formFooterCommand = new Command<Form, Class<? extends Layout>>() {
+ @Override
public void execute(Form c, Class<? extends Layout> value, Object data) {
if (value == null) {
c.setFooter(null);
@@ -92,6 +96,7 @@ public class FormTest extends AbstractFieldTest<Form> {
};
private Command<Form, Item> formItemDataSourceCommand = new Command<Form, Item>() {
+ @Override
public void execute(Form c, Item value, Object data) {
c.setItemDataSource(value);
}
@@ -118,26 +123,41 @@ public class FormTest extends AbstractFieldTest<Form> {
private void createDataSourceSelect(String category) {
LinkedHashMap<String, Item> options = new LinkedHashMap<String, Item>();
- options.put("Person", new BeanItem<Person>(new Person("First", "Last",
- "foo@vaadin.com", "02-111 2222", "Ruukinkatu 2-4", 20540,
- "Turku")));
- options.put("Product", new BeanItem<Product>(new Product(
- "Computer Monitor", 399.99f,
- "A monitor that can display both color and black and white.")));
+
+ options.put("Person", createPersonItem());
+ options.put("Product", createProductItem());
+
createSelectAction("Form data source", category, options, "Person",
formItemDataSourceCommand);
}
+ private BeanItem<Product> createProductItem() {
+ return new BeanItem<Product>(new Product("Computer Monitor", 399.99f,
+ "A monitor that can display both color and black and white."));
+ }
+
+ private BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> personItem = new BeanItem<Person>(person);
+ // add nested properties from address
+ personItem.expandProperty("address");
+
+ return personItem;
+ }
+
private void createFormFactorySelect(String category) {
LinkedHashMap<String, FormFieldFactory> options = new LinkedHashMap<String, FormFieldFactory>();
options.put("Default", DefaultFieldFactory.get());
options.put("Custom FieldFactory", new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ @Override
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
Class<?> type = item.getItemProperty(propertyId).getType();
- Field c = null;
+ Field<?> c = null;
if (Number.class.isAssignableFrom(type)) {
TextField tf = new TextField();
tf.setCaption(DefaultFieldFactory
@@ -172,6 +192,7 @@ public class FormTest extends AbstractFieldTest<Form> {
Command<Form, FormFieldFactory> formFactoryCommand = new Command<Form, FormFieldFactory>() {
+ @Override
public void execute(Form c, FormFieldFactory value, Object data) {
c.setFormFieldFactory(value);
c.setItemDataSource(c.getItemDataSource());
@@ -213,6 +234,7 @@ public class FormTest extends AbstractFieldTest<Form> {
}
Command<Form, Alignment> footerComponentAlignmentCommand = new Command<Form, Alignment>() {
+ @Override
public void execute(Form c, Alignment value, Object data) {
Layout l = c.getFooter();
if (l instanceof AlignmentHandler) {
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
index a3baab921f..ed1a3d9bd9 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormWithEnterShortCut.java
@@ -5,7 +5,6 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Field;
import com.vaadin.ui.Form;
import com.vaadin.ui.TextField;
@@ -16,11 +15,12 @@ public class FormWithEnterShortCut extends TestBase {
protected void setup() {
final Form form = new Form();
- final Field tf = new TextField("Search");
+ final TextField tf = new TextField("Search");
form.addField("searchfield", tf);
Button button = new Button("Go");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("search: " + tf.getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java b/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java
index eba570c490..24d207739e 100644
--- a/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java
+++ b/tests/testbench/com/vaadin/tests/components/form/FormWithPropertyFormatterConnected.java
@@ -18,6 +18,7 @@ public class FormWithPropertyFormatterConnected extends TestBase {
Form form2 = new Form();
form2.setFormFieldFactory(new FormFieldFactory() {
+ @Override
public Field createField(Item item, Object propertyId,
Component uiContext) {
AbstractField f = (AbstractField) DefaultFieldFactory.get()
@@ -28,8 +29,8 @@ public class FormWithPropertyFormatterConnected extends TestBase {
@Override
public Object parse(String formattedValue)
throws Exception {
- String str = formattedValue
- .replaceAll("[^0-9.]", "");
+ String str = formattedValue.replaceAll("[^0-9.]",
+ "");
if (formattedValue.toLowerCase().contains("months")) {
return Double.parseDouble(str) / 12;
}
@@ -40,7 +41,7 @@ public class FormWithPropertyFormatterConnected extends TestBase {
public String format(Object value) {
Double dValue = (Double) value;
if (dValue < 1) {
- return ((int)(dValue * 12)) + " months";
+ return ((int) (dValue * 12)) + " months";
}
return dValue + " years";
}
@@ -51,7 +52,7 @@ public class FormWithPropertyFormatterConnected extends TestBase {
}
});
form2.setItemDataSource(createItem());
-
+
addComponent(form2);
addComponent(new Button("B"));
}
diff --git a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
index cb616d4548..21430d8936 100644
--- a/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
+++ b/tests/testbench/com/vaadin/tests/components/form/UndefinedWideFormWithRelativeWideFooter.java
@@ -5,16 +5,17 @@ import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
@SuppressWarnings("serial")
-public class UndefinedWideFormWithRelativeWideFooter extends Application {
+public class UndefinedWideFormWithRelativeWideFooter extends
+ Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window("Test");
+ LegacyWindow w = new LegacyWindow("Test");
setMainWindow(w);
final Form f = new Form();
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java
index e74969f637..0055c3782e 100644
--- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutCaptionStyles.java
@@ -20,6 +20,7 @@ public class FormLayoutCaptionStyles extends TestBase {
fl.addComponent(new Button("Toggle Text field 2 bold style",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if ("bold".equals(f2.getStyleName())) {
f2.setStyleName("");
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html
new file mode 100644
index 0000000000..7733da4e95
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.html
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>PropertyValueChange</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">PropertyValueChange</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.formlayout.FormLayoutErrorHover?restartApplication&amp;debug</td>
+ <td></td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]#field</td>
+ <td>asdf</td>
+</tr>
+<tr>
+ <td>pressSpecialKey</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/VFormLayout$VFormLayoutTable[0]/VPopupCalendar[0]#field</td>
+ <td>enter</td>
+</tr>
+<!--Hover error indicator-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::/VVerticalLayout[0]/VVerticalLayout[0]/VFormLayout[0]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>2000</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsformlayoutFormLayoutErrorHover::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]</td>
+ <td>Date format not recognized</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java
new file mode 100644
index 0000000000..b65a448830
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java
@@ -0,0 +1,33 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.formlayout;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.PopupDateField;
+
+public class FormLayoutErrorHover extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ FormLayout formLayout = new FormLayout();
+ PopupDateField fromDate = new PopupDateField("Date");
+ fromDate.setImmediate(true);
+ formLayout.addComponent(fromDate);
+
+ addComponent(formLayout);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Enter some random text to the date field and press enter. Then hover the error indicator. This should show a message about the error.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8794);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
deleted file mode 100644
index 9427318a10..0000000000
--- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutReplaceComponent.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package com.vaadin.tests.components.formlayout;
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.FormLayout;
-import com.vaadin.ui.TextField;
-
-public class FormLayoutReplaceComponent extends TestBase {
-
- @Override
- protected void setup() {
- addComponent(new FL());
-
- }
-
- public class FL extends FormLayout implements ClickListener {
-
- private TextField messages;
- private CheckBox control;
-
- @SuppressWarnings("deprecation")
- public FL() {
- setCaption("Test");
- control = new CheckBox("Messages On/Off");
- control.addListener(this);
- control.setImmediate(true);
- addComponent(control);
-
- // The bug is in replaceComponent, triggered when VTextField is
- // replaced by VTextArea so cannot replace this with TextArea.
- messages = new TextField("Messages");
- messages.setRows(10);
- messages.setColumns(40);
- messages.setVisible(false);
- messages.setEnabled(false);
- addComponent(messages);
- }
-
- public final void buttonClick(Button.ClickEvent e) {
- if (e.getButton() == control) {
- messages.setVisible(control.booleanValue());
- }
- }
- }
-
- @Override
- protected String getDescription() {
- return "Check or uncheck the CheckBox to show/hide the messages field inside the FormLayout.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 6308;
- }
-
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayouts.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayouts.java
new file mode 100644
index 0000000000..e247ce95f7
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayouts.java
@@ -0,0 +1,16 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.formlayout;
+
+import com.vaadin.tests.components.AbstractOrderedLayoutTest;
+import com.vaadin.ui.FormLayout;
+
+public class FormLayouts extends AbstractOrderedLayoutTest<FormLayout> {
+
+ @Override
+ protected Class getTestClass() {
+ return FormLayout.class;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
index c8eb1483b4..bbe88b1770 100644
--- a/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
+++ b/tests/testbench/com/vaadin/tests/components/formlayout/TableInFormLayoutCausesScrolling.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.components.formlayout;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.FormLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
public class TableInFormLayoutCausesScrolling extends AbstractTestCase {
@Override
public void init() {
// Window Initialization.
- final Window window = new Window("Main Window");
+ final LegacyWindow window = new LegacyWindow("Main Window");
setMainWindow(window);
// FormLayout creation
diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java b/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java
index 648bbd2d52..165827eb6b 100644
--- a/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java
+++ b/tests/testbench/com/vaadin/tests/components/gridlayout/GridLayoutInForm.java
@@ -45,6 +45,7 @@ public class GridLayoutInForm extends TestBase {
addComponent(new Button("Use 15 first fields",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setVisibleItemProperties(propertyIds
.subList(0, 15));
@@ -52,6 +53,7 @@ public class GridLayoutInForm extends TestBase {
}));
addComponent(new Button("Use 15 last fields",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setVisibleItemProperties(propertyIds.subList(35,
50));
@@ -59,6 +61,7 @@ public class GridLayoutInForm extends TestBase {
}));
addComponent(new Button("Use all fields", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setVisibleItemProperties(propertyIds);
}
diff --git a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java
index da0efe9464..1c10b1d9d7 100644
--- a/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/gridlayout/MoveComponentsFromGridLayoutToInnerLayout.java
@@ -22,6 +22,7 @@ public class MoveComponentsFromGridLayoutToInnerLayout extends TestBase {
testButton = new Button("Click to move to inner layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
vl.addComponent(testButton);
}
@@ -37,6 +38,7 @@ public class MoveComponentsFromGridLayoutToInnerLayout extends TestBase {
Button b = new Button("Repaint inner layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
vl.requestRepaint();
}
diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java
new file mode 100644
index 0000000000..7de2d13663
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java
@@ -0,0 +1,115 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.javascriptcomponent;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.external.json.JSONArray;
+import com.vaadin.external.json.JSONException;
+import com.vaadin.shared.communication.ClientRpc;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.shared.ui.JavaScriptComponentState;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.AbstractJavaScriptComponent;
+import com.vaadin.ui.HasComponents;
+import com.vaadin.ui.JavaScriptCallback;
+
+public class BasicJavaScriptComponent extends AbstractTestRoot {
+
+ public interface TestRpc extends ServerRpc, ClientRpc {
+ public void sendRpc(String message);
+ }
+
+ public static class TestState extends JavaScriptComponentState {
+ private List<String> messages = new ArrayList<String>();
+
+ public List<String> getMessages() {
+ return messages;
+ }
+
+ public void setMessages(List<String> messages) {
+ this.messages = messages;
+ }
+ }
+
+ @JavaScript("BasicJavaScriptComponentConnector.js")
+ public class ExampleWidget extends AbstractJavaScriptComponent {
+ public ExampleWidget() {
+ registerRpc(new TestRpc() {
+ @Override
+ public void sendRpc(String message) {
+ log.log("Got RPC message: " + message);
+ }
+ });
+ registerCallback("messageToServer", new JavaScriptCallback() {
+ @Override
+ public void call(JSONArray arguments) throws JSONException {
+ log.log("Got callback message: " + arguments.getString(0));
+ }
+ });
+
+ registerCallback("reportParentIds", new JavaScriptCallback() {
+ @Override
+ public void call(JSONArray arguments) throws JSONException {
+ JSONArray parentIds = arguments.getJSONArray(0);
+ if (!parentIds.getString(0).equals(getConnectorId())) {
+ log.log("Connector ids doesn't match");
+ }
+
+ HasComponents parent = getParent();
+ int i = 1;
+ while (parent != null) {
+ if (!parentIds.getString(i).equals(
+ parent.getConnectorId())) {
+ log.log("parentIds[" + i + "] doesn't match");
+ }
+ i++;
+ parent = parent.getParent();
+ }
+ log.log("Parent ids checked");
+ }
+ });
+
+ getRpcProxy(TestRpc.class).sendRpc("RPC message");
+ invokeCallback("messageToClient", "Callback message");
+
+ getState()
+ .setMessages(
+ Arrays.asList("First state message",
+ "Second state message"));
+ }
+
+ @Override
+ public TestState getState() {
+ return (TestState) super.getState();
+ }
+ }
+
+ private final Log log = new Log(5);
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(log);
+
+ ExampleWidget c = new ExampleWidget();
+ c.setCaption("Component caption");
+ addComponent(c);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test for basic JavaScript component functionality.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8888);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponentConnector.js b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponentConnector.js
new file mode 100644
index 0000000000..4e9c5280b3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponentConnector.js
@@ -0,0 +1,37 @@
+window.com_vaadin_tests_components_javascriptcomponent_BasicJavaScriptComponent_ExampleWidget = function() {
+ var parentIds = [];
+ var connectorId = this.getConnectorId();
+ while(connectorId) {
+ parentIds.push(connectorId);
+ connectorId = this.getParentId(connectorId);
+ }
+ this.reportParentIds(parentIds);
+
+ this.onStateChange = function() {
+ var e = this.getElement();
+
+ e.innerHTML = '';
+
+ var row = 1;
+ var log = function(text) {
+ e.innerHTML = "<div>" + row++ + ". " + text + "</div>" + e.innerHTML;
+ }
+
+ log("Parent element className: " + this.getElement(this.getParentId()).className);
+
+ var messages = this.getState().messages;
+ for(var i = 0; i < messages.length; i++) {
+ log("State message: " + messages[i]);
+ }
+ }
+
+ this.registerRpc({
+ sendRpc: function(message) {
+ this.getRpcProxy().sendRpc(message + " processed");
+ }
+ });
+
+ this.messageToClient = function(message) {
+ this.messageToServer(message + " processed");
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java b/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java
index a5bb291b67..61caf9a2f2 100644
--- a/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java
+++ b/tests/testbench/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java
@@ -27,6 +27,7 @@ public class HundredPercentWideLabelResize extends TestBase {
getLayout().addComponent(
new Button("toggle width", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (getLayout().getWidth() == 500) {
getLayout().setWidth("100px");
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelModes.java b/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
index 4b58794a87..207a9a8de7 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelModes.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.components.label;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.ui.Label;
@@ -23,17 +24,17 @@ public class LabelModes extends ComponentTestCase<Label> {
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\npreformatted mode");
- l.setContentMode(Label.CONTENT_PREFORMATTED);
+ l.setContentMode(ContentMode.PREFORMATTED);
l.setWidth(null);
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\nhtml mode");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setWidth(null);
addTestComponent(l);
l = createLabel("This label contains\nnewlines and spaces\nand is in\nraw mode");
- l.setContentMode(Label.CONTENT_RAW);
+ l.setContentMode(ContentMode.RAW);
l.setWidth(null);
addTestComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
index 5c71046404..186b3deeb3 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelTest.java
@@ -5,6 +5,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.AbstractComponentTest;
import com.vaadin.ui.Label;
@@ -13,12 +14,14 @@ public class LabelTest extends AbstractComponentTest<Label> implements
private Command<Label, Object> setValueCommand = new Command<Label, Object>() {
+ @Override
public void execute(Label c, Object value, Object data) {
c.setValue(value);
}
};
private Command<Label, Boolean> valueChangeListenerCommand = new Command<Label, Boolean>() {
+ @Override
public void execute(Label c, Boolean value, Object data) {
if (value) {
c.addListener(LabelTest.this);
@@ -29,8 +32,9 @@ public class LabelTest extends AbstractComponentTest<Label> implements
}
};
- private Command<Label, Integer> contentModeCommand = new Command<Label, Integer>() {
- public void execute(Label c, Integer value, Object data) {
+ private Command<Label, ContentMode> contentModeCommand = new Command<Label, ContentMode>() {
+ @Override
+ public void execute(Label c, ContentMode value, Object data) {
c.setContentMode(value);
}
};
@@ -68,13 +72,14 @@ public class LabelTest extends AbstractComponentTest<Label> implements
@SuppressWarnings("deprecation")
private void createContentModeSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Text", Label.CONTENT_TEXT);
- options.put("Preformatted", Label.CONTENT_PREFORMATTED);
- options.put("Raw", Label.CONTENT_RAW);
- options.put("UIDL", Label.CONTENT_UIDL);
- options.put("XHTML", Label.CONTENT_XHTML);
- options.put("XML", Label.CONTENT_XML);
+ LinkedHashMap<String, ContentMode> options = new LinkedHashMap<String, ContentMode>();
+ options.put("Text", ContentMode.TEXT);
+ options.put("Preformatted", ContentMode.PREFORMATTED);
+ options.put("Raw", ContentMode.RAW);
+ options.put("UIDL", ContentMode.XML); // Deprecated UIDL mode still used
+ // to avoid breaking old tests
+ options.put("XHTML", ContentMode.XHTML);
+ options.put("XML", ContentMode.XML);
createSelectAction("Content mode", category, options, "Text",
contentModeCommand);
@@ -85,6 +90,7 @@ public class LabelTest extends AbstractComponentTest<Label> implements
valueChangeListenerCommand);
}
+ @Override
public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
Object o = event.getProperty().getValue();
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-chameleon.html b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-chameleon.html
index 8d2744c5b7..4a724795b3 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-chameleon.html
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-chameleon.html
@@ -23,7 +23,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[1]</td>
<td>0,0</td>
</tr>
<tr>
@@ -33,7 +33,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[3]</td>
<td>0,0</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-runo.html b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-runo.html
index fcd0169928..9877493b3b 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-runo.html
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip-runo.html
@@ -23,7 +23,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[1]</td>
<td>0,0</td>
</tr>
<tr>
@@ -33,7 +33,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[3]</td>
<td>0,0</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.html b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.html
index 0fbd3353c9..05da9195ef 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.html
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.html
@@ -23,7 +23,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[1]</td>
<td>0,0</td>
</tr>
<tr>
@@ -33,7 +33,7 @@
</tr>
<tr>
<td>showTooltip</td>
- <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentslabelLabelTooltip::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]/VLabel[3]</td>
<td>0,0</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelWrapping.java b/tests/testbench/com/vaadin/tests/components/label/LabelWrapping.java
index 166d0bda77..82969fdb08 100644
--- a/tests/testbench/com/vaadin/tests/components/label/LabelWrapping.java
+++ b/tests/testbench/com/vaadin/tests/components/label/LabelWrapping.java
@@ -28,6 +28,7 @@ public class LabelWrapping extends TestBase {
Button changeLength = new Button("Change length");
changeLength.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (longLabel.getValue().equals(longString)) {
longLabel.setValue("");
diff --git a/tests/testbench/com/vaadin/tests/components/label/Labels.java b/tests/testbench/com/vaadin/tests/components/label/Labels.java
index ad648e7404..1da588576b 100644
--- a/tests/testbench/com/vaadin/tests/components/label/Labels.java
+++ b/tests/testbench/com/vaadin/tests/components/label/Labels.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.components.label;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.ComponentTestCase;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.Label;
@@ -37,13 +38,13 @@ public class Labels extends ComponentTestCase<Label> {
l = createLabel(
"<div style='border: 1px solid red'><h1>Hello\n\n\n</h1><p/><h2>I am a rich Label</h3></div>",
"This is an XHTML label with rich content");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
addTestComponent(l);
l = createLabel(
"<div style='border: 1px solid blue'><h1>Hello</h1><p/><h2>I am a rich Label</h3></div>",
"This is an XHTML label with fixed 200px width and rich content");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setWidth("200px");
addTestComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.html b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.html
new file mode 100644
index 0000000000..080200092d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.html
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head profile="http://selenium-ide.openqa.org/profiles/test-case"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><link rel="selenium.base" href="" /><title>com.vaadin.tests.components.accordion.AccordionInactiveTabSize</title></head><body><table cellpadding="1" cellspacing="1" border="1"><thead><tr><td rowspan="1" colspan="3">com.vaadin.tests.components.accordion.AccordionInactiveTabSize</td></tr></thead><tbody><tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.label.MarginsInLabels?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td></td>
+</tr>
+</tbody></table></body></html> \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java
new file mode 100644
index 0000000000..b1cf2957be
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java
@@ -0,0 +1,50 @@
+package com.vaadin.tests.components.label;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.AbstractLayout;
+import com.vaadin.ui.Accordion;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.VerticalLayout;
+
+public class MarginsInLabels extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ AbstractLayout layout = new VerticalLayout();
+ layout.addComponent(new Label("<h1>Vertical layout</h1>",
+ ContentMode.XHTML));
+ layout.addComponent(new Label("Next row"));
+ addComponent(layout);
+
+ layout = new GridLayout(1, 2);
+ layout.setWidth("100%");
+ layout.addComponent(new Label("<h1>Grid layout</h1>", ContentMode.XHTML));
+ layout.addComponent(new Label("Next row"));
+ addComponent(layout);
+
+ TabSheet tabSheet = new TabSheet();
+ tabSheet.addTab(new Label("<h1>Tabsheet</h1>", ContentMode.XHTML),
+ "Label");
+ addComponent(tabSheet);
+
+ Accordion accordion = new Accordion();
+ accordion.addTab(new Label("<h1>Accordion</h1>", ContentMode.XHTML),
+ "Label");
+ addComponent(accordion);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Margins inside labels should not be allowed to collapse out of the label as it causes problems with layotus measuring the label.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8671);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java b/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java
index ce8626444c..f14e1afd8c 100644
--- a/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java
+++ b/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java
@@ -15,6 +15,7 @@ public class LinkToPercentage extends TestBase {
protected void setup() {
String filename = "110% Vaadin";
ApplicationResource resource = new StreamResource(new StreamSource() {
+ @Override
public InputStream getStream() {
return new InputStream() {
boolean first = true;
diff --git a/tests/testbench/com/vaadin/tests/components/listselect/ListSelects.java b/tests/testbench/com/vaadin/tests/components/listselect/ListSelects.java
index 3bab03287c..a3fa973bc2 100644
--- a/tests/testbench/com/vaadin/tests/components/listselect/ListSelects.java
+++ b/tests/testbench/com/vaadin/tests/components/listselect/ListSelects.java
@@ -8,12 +8,14 @@ import com.vaadin.ui.ListSelect;
public class ListSelects extends AbstractSelectTestCase<ListSelect> {
private Command<ListSelect, Integer> rowsCommand = new Command<ListSelect, Integer>() {
+ @Override
public void execute(ListSelect c, Integer value, Object data) {
c.setRows(value);
}
};
private Command<ListSelect, Integer> colsCommand = new Command<ListSelect, Integer>() {
+ @Override
public void execute(ListSelect c, Integer value, Object data) {
c.setColumns(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormTest.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormTest.java
index bbc7d2ca7e..629edc2130 100644
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormTest.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormTest.java
@@ -31,6 +31,7 @@ public class LoginFormTest extends TestBase {
*/
private static final long serialVersionUID = 1L;
+ @Override
public void onLogin(LoginEvent event) {
login((LoginForm) event.getSource(),
event.getLoginParameter("username"),
@@ -43,6 +44,7 @@ public class LoginFormTest extends TestBase {
Button changeWidth = new Button("Change width", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (loginForm.getWidth() < 0) {
loginForm.setWidth("300px");
@@ -55,6 +57,7 @@ public class LoginFormTest extends TestBase {
Button changeHeight = new Button("Change height", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (loginForm.getHeight() < 0) {
loginForm.setHeight("200px");
@@ -88,6 +91,7 @@ public class LoginFormTest extends TestBase {
+ "' logged in");
Button logoutButton = new Button("Log out", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
loginFormLayout.replaceComponent(b.getParent(),
diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
index 341caecc9f..83f89f0214 100644
--- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java
@@ -1,37 +1,22 @@
package com.vaadin.tests.components.loginform;
import com.vaadin.Application;
+import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.LoginForm.LoginEvent;
import com.vaadin.ui.LoginForm.LoginListener;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
public class LoginFormWithMultipleWindows extends Application {
- /**
- * =======================================================================
- * Comment out this to make the LoginForm work as expected
- * =======================================================================
- */
@Override
- public Window getWindow(String name) {
- Window w = super.getWindow(name);
- if (w == null) {
- w = new LoginFormWindow();
- w.setName(name);
- addWindow(w);
- }
- return w;
-
- }
-
- @Override
- public void init() {
- setMainWindow(new LoginFormWindow());
+ protected Root getRoot(WrappedRequest request) {
+ return new LoginFormWindow();
}
- public class LoginFormWindow extends Window {
+ public class LoginFormWindow extends LegacyWindow {
public LoginFormWindow() {
super();
@@ -42,6 +27,7 @@ public class LoginFormWithMultipleWindows extends Application {
private static final long serialVersionUID = 1L;
+ @Override
public void onLogin(LoginEvent event) {
showNotification(event.getLoginParameter("username") + ":"
+ event.getLoginParameter("password"));
diff --git a/tests/testbench/com/vaadin/tests/components/media/Media.java b/tests/testbench/com/vaadin/tests/components/media/Media.java
index 84b6974293..a1977c6ba1 100644
--- a/tests/testbench/com/vaadin/tests/components/media/Media.java
+++ b/tests/testbench/com/vaadin/tests/components/media/Media.java
@@ -27,6 +27,7 @@ public class Media extends TestBase {
addComponent(v);
addComponent(new Button("Play video", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
v.play();
}
@@ -34,6 +35,7 @@ public class Media extends TestBase {
}));
addComponent(new Button("Pause video", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
v.pause();
}
@@ -50,6 +52,7 @@ public class Media extends TestBase {
addComponent(new Button("Play audio", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
a.play();
}
@@ -57,6 +60,7 @@ public class Media extends TestBase {
}));
addComponent(new Button("Pause audio", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
a.pause();
}
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java
index ba22bcb7a4..d7585af8ac 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java
@@ -44,6 +44,7 @@ public class MenuBarHtmlItems extends ComponentTestCase<MenuBar> {
private Component createSwitchHtmlAction() {
return createBooleanAction("Html content allowed", false,
new Command<MenuBar, Boolean>() {
+ @Override
public void execute(MenuBar c, Boolean value, Object data) {
c.setHtmlContentAllowed(value.booleanValue());
}
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
index 4a41f8d8dc..2a6f952c0a 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarInSplitPanel.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class MenuBarInSplitPanel extends AbstractTestCase {
@@ -22,7 +22,7 @@ public class MenuBarInSplitPanel extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("MenuBar in SplitPanel",
+ LegacyWindow mainWindow = new LegacyWindow("MenuBar in SplitPanel",
new HorizontalSplitPanel());
VerticalLayout left = new VerticalLayout();
mainWindow.addComponent(left);
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarNavigation.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarNavigation.java
index ede0c0c5a5..3af07645d6 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarNavigation.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarNavigation.java
@@ -47,6 +47,7 @@ public class MenuBarNavigation extends TestBase implements Command {
return 5174;
}
+ @Override
public void menuSelected(MenuItem selectedItem) {
log.log("MenuItem " + getName(selectedItem) + " selected");
}
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java
index f162386336..c093a61812 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRootItemSelectWithKeyboard.java
@@ -10,6 +10,7 @@ public class MenuBarRootItemSelectWithKeyboard extends TestBase {
@Override
protected void setup() {
Command c = new Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
getMainWindow().showNotification(selectedItem.getText());
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
index b05dbbd074..33e6c0b4a9 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java
@@ -4,15 +4,15 @@ import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.MenuBar;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class MenuBarRunsOutOfBrowser extends AbstractTestCase {
@Override
public void init() {
setTheme("runo");
- Window main = new Window("Test");
+ LegacyWindow main = new LegacyWindow("Test");
main.setSizeFull();
setMainWindow(main);
main.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java
index 2dc119bf43..5ab2b2145f 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java
@@ -141,6 +141,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
/* COMMANDS */
Command<MenuBar, Integer> createRootMenuItems = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
rootItems = value;
createRootItems(c);
@@ -149,6 +150,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
Command<MenuBar, Integer> createSubMenuItems = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
subItems = value;
createSubItems(c);
@@ -157,6 +159,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
Command<MenuBar, Integer> setSubMenuLevels = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
subLevels = value;
createSubItems(c);
@@ -164,6 +167,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
};
private Command<MenuBar, Integer> setMenuIcons = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
iconInterval = value;
updateIcons(c);
@@ -172,6 +176,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> setSubMenuDensity = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
subMenuDensity = value;
createSubItems(c);
@@ -180,6 +185,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> setMenuItemDisabledDensity = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
disabledDensity = value;
createRootItems(c);
@@ -188,6 +194,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> setMenuItemInvisibleDensity = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
invisibleDensity = value;
createRootItems(c);
@@ -196,6 +203,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> setMenuItemCheckableDensity = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
checkableDensity = value;
createRootItems(c);
@@ -204,6 +212,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> setSubMenuSeparatorDensity = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
subMenuSeparatorDensity = value;
createSubItems(c);
@@ -212,6 +221,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Boolean> setOpenRootOnHover = new Command<MenuBar, Boolean>() {
+ @Override
public void execute(MenuBar c, Boolean value, Object data) {
openRootMenuOnHover = value;
c.setAutoOpen(value);
@@ -221,6 +231,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private Command<MenuBar, Integer> selectIcon = new Command<MenuBar, Integer>() {
+ @Override
public void execute(MenuBar c, Integer value, Object data) {
iconSize = value;
updateIcons(c);
@@ -231,6 +242,7 @@ public class MenuBarTest extends AbstractComponentTest<MenuBar> {
private MenuBar.Command menuCommand = new MenuBar.Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
log("Menu item '" + selectedItem.getText() + "' selected");
diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarToolTips.html b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarToolTips.html
index 28bcc3a221..f7c57baf1f 100644
--- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarToolTips.html
+++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarToolTips.html
@@ -63,7 +63,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarToolTips::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarToolTips::/VVerticalLayout[0]/domChild[1]</td>
<td>830,200</td>
</tr>
<tr>
@@ -88,7 +88,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarToolTips::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsmenubarMenuBarToolTips::/VVerticalLayout[0]/domChild[1]</td>
<td>625,184</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
index 75eab71892..5f80004c7c 100644
--- a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
+++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonDisableOnClick.html
@@ -16,7 +16,7 @@
<td>/run/com.vaadin.tests.components.nativebutton.NativeButtonTest?restartApplication</td>
<td></td>
</tr>
-<!--value change listener-->
+<!-- click listener-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::PID_Smenu#item0</td>
@@ -29,7 +29,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item4</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
<td>35,8</td>
</tr>
<!--disable on click-->
@@ -45,7 +45,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>22,4</td>
</tr>
<tr>
@@ -133,7 +133,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item1</td>
+ <td>vaadin=runcomvaadintestscomponentsnativebuttonNativeButtonTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
<td>36,3</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
index 011439f810..94023db2d0 100644
--- a/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
+++ b/tests/testbench/com/vaadin/tests/components/nativebutton/NativeButtonHtml.java
@@ -20,6 +20,7 @@ public class NativeButtonHtml extends TestBase {
final NativeButton swapButton = new NativeButton("<i>Swap button<i>");
swapButton.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
swapButton.setHtmlContentAllowed(!swapButton
.isHtmlContentAllowed());
diff --git a/tests/testbench/com/vaadin/tests/components/nativeselect/NativeSelects.java b/tests/testbench/com/vaadin/tests/components/nativeselect/NativeSelects.java
index ec46757106..80b088f03a 100644
--- a/tests/testbench/com/vaadin/tests/components/nativeselect/NativeSelects.java
+++ b/tests/testbench/com/vaadin/tests/components/nativeselect/NativeSelects.java
@@ -35,6 +35,7 @@ public class NativeSelects extends AbstractSelectTestCase<NativeSelect> {
private Command<NativeSelect, Integer> columnsAction = new Command<NativeSelect, Integer>() {
+ @Override
public void execute(NativeSelect c, Integer value, Object data) {
c.setColumns(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
index 0e054eba3b..ab632a2a57 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
+++ b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java
@@ -1,23 +1,24 @@
package com.vaadin.tests.components.notification;
+import com.vaadin.terminal.Page;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.TextArea;
public class Notifications extends TestBase implements ClickListener {
private static final String CAPTION = "CAPTION";
- private TextField tf;
+ private TextArea tf;
private NativeSelect type;
@SuppressWarnings("deprecation")
@Override
protected void setup() {
- tf = new TextField("Text", "Hello world");
+ tf = new TextArea("Text", "Hello world");
tf.setRows(10);
addComponent(tf);
type = new NativeSelect();
@@ -49,10 +50,11 @@ public class Notifications extends TestBase implements ClickListener {
return null;
}
+ @Override
public void buttonClick(ClickEvent event) {
- Notification n = new Notification((String) tf.getValue(),
+ Notification n = new Notification(tf.getValue(),
(Integer) type.getValue());
- event.getButton().getWindow().showNotification(n);
-
+ n.setHtmlContentAllowed(true);
+ n.show(Page.getCurrent());
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java b/tests/testbench/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java
index 562e8095f2..25bc05c771 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsAndModalWindow.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.notification;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
public class NotificationsAndModalWindow extends TestBase {
@@ -17,14 +17,12 @@ public class NotificationsAndModalWindow extends TestBase {
Button b = new Button("Button");
b.addListener(new Button.ClickListener() {
-
+ @Override
public void buttonClick(ClickEvent event) {
-
Window w = new Window("This is a window");
w.setModal(true);
getMainWindow().addWindow(w);
}
-
});
addComponent(b);
}
diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
index b4d76edae9..455952fb71 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
+++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -28,17 +28,17 @@
</tr>
<tr>
<td>closeNotification</td>
- <td>//body/div[4]</td>
+ <td>//body/div[2]</td>
<td>0,0</td>
</tr>
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>60,0</td>
+ <td>63,3</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -46,51 +46,6 @@
<td></td>
<td>view-plain</td>
</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
- <td>51,7</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>window-plain</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VCheckBox[0]/domChild[0]</td>
- <td>80,2</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentsnotificationNotificationsHtmlAllowed::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>window-html</td>
-</tr>
-<tr>
- <td>closeNotification</td>
- <td>//body/div[4]</td>
- <td>0,0</td>
-</tr>
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
index 60db11f1df..767d16b6da 100644
--- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
+++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java
@@ -1,22 +1,20 @@
package com.vaadin.tests.components.notification;
+import com.vaadin.terminal.Page;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
public class NotificationsHtmlAllowed extends TestBase implements ClickListener {
private TextArea messageField;
private CheckBox htmlAllowedBox;
private TextField captionField;
- private Window subwindow;
- private CheckBox showInSubwindow;
@Override
protected void setup() {
@@ -32,16 +30,8 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
htmlAllowedBox = new CheckBox("Html content allowed", true);
addComponent(htmlAllowedBox);
- showInSubwindow = new CheckBox("Show in subwindow", false);
- addComponent(showInSubwindow);
-
Button showNotification = new Button("Show notification", this);
addComponent(showNotification);
-
- subwindow = new Window("Sub window");
- subwindow.setPositionX(400);
- subwindow.setPositionY(0);
- getMainWindow().addWindow(subwindow);
}
@Override
@@ -54,23 +44,16 @@ public class NotificationsHtmlAllowed extends TestBase implements ClickListener
return 6097;
}
+ @Override
public void buttonClick(ClickEvent event) {
Notification n = makeNotification();
- Window window;
- if (showInSubwindow.booleanValue()) {
- window = subwindow;
- } else {
- window = event.getButton().getWindow();
- }
- window.showNotification(n);
-
+ n.show(Page.getCurrent());
}
private Notification makeNotification() {
- Notification n = new Notification((String) captionField.getValue(),
- (String) messageField.getValue(),
- Notification.TYPE_HUMANIZED_MESSAGE,
- htmlAllowedBox.booleanValue());
+ Notification n = new Notification(captionField.getValue(),
+ messageField.getValue(), Notification.TYPE_HUMANIZED_MESSAGE,
+ htmlAllowedBox.getValue());
return n;
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java b/tests/testbench/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java
index 4668ef5ab8..877f9aa675 100644
--- a/tests/testbench/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java
+++ b/tests/testbench/com/vaadin/tests/components/optiongroup/DisabledOptionGroupItems.java
@@ -52,6 +52,7 @@ public class DisabledOptionGroupItems extends ComponentTestCase<OptionGroup> {
return createButtonAction("Toggle selection mode",
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup og, Boolean value,
Object data) {
if (og.isMultiSelect()) {
@@ -69,6 +70,7 @@ public class DisabledOptionGroupItems extends ComponentTestCase<OptionGroup> {
return createButtonAction("Invert disabled items",
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup c, Boolean value,
Object data) {
for (Object itemId : c.getItemIds()) {
diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java b/tests/testbench/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java
index 0f6ae8917a..179d1aa5ff 100644
--- a/tests/testbench/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java
+++ b/tests/testbench/com/vaadin/tests/components/optiongroup/HtmlOptionGroupItems.java
@@ -54,6 +54,7 @@ public class HtmlOptionGroupItems extends ComponentTestCase<OptionGroup> {
private Component createInvertHtmlItemsAction() {
return createButtonAction("Toggle html mode",
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup og, Boolean value,
Object data) {
og.setHtmlContentAllowed(!og.isHtmlContentAllowed());
@@ -65,6 +66,7 @@ public class HtmlOptionGroupItems extends ComponentTestCase<OptionGroup> {
return createButtonAction("Toggle selection mode",
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup og, Boolean value,
Object data) {
if (og.isMultiSelect()) {
@@ -82,6 +84,7 @@ public class HtmlOptionGroupItems extends ComponentTestCase<OptionGroup> {
return createButtonAction("Invert disabled items",
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup c, Boolean value,
Object data) {
for (Object itemId : c.getItemIds()) {
diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
index 29a81720c7..213258ed29 100644
--- a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java
@@ -2,6 +2,7 @@ package com.vaadin.tests.components.optiongroup;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.OptionGroup;
@@ -26,12 +27,13 @@ public class OptionGroupMultipleValueChange extends TestBase {
og.setImmediate(true);
addComponent(og);
- final Label events = new Label("", Label.CONTENT_PREFORMATTED);
+ final Label events = new Label("", ContentMode.PREFORMATTED);
events.setWidth(null);
addComponent(events);
og.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String s = "ValueChange: " + event.getProperty().getValue();
events.setValue(events.getValue() + "\n" + s);
diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java
index f8af6b07e4..c20de87ec7 100644
--- a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java
+++ b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java
@@ -21,6 +21,7 @@ public class OptionGroups extends AbstractSelectTestCase<OptionGroup> {
createDisabledItemsMultiToggle("Disabled items");
createBooleanAction("HTML content allowed", CATEGORY_STATE, false,
new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup og, Boolean value,
Object data) {
og.setHtmlContentAllowed(value.booleanValue());
@@ -39,6 +40,7 @@ public class OptionGroups extends AbstractSelectTestCase<OptionGroup> {
createSelectAction(string, CATEGORY_DECORATIONS, options, options
.keySet().iterator().next(),
new Command<OptionGroup, ThemeResource>() {
+ @Override
public void execute(OptionGroup c, ThemeResource icon,
Object data) {
Collection<?> itemIds = c.getItemIds();
@@ -58,6 +60,7 @@ public class OptionGroups extends AbstractSelectTestCase<OptionGroup> {
private Command<OptionGroup, Boolean> enabledItemCommand = new Command<OptionGroup, Boolean>() {
+ @Override
public void execute(OptionGroup c, Boolean value, Object data) {
c.setItemEnabled(data, value);
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.html b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.html
index 4d33294dca..f0fd1568b1 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.html
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.html
@@ -3,7 +3,7 @@
<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="" />
+<link rel="selenium.base" href="http://localhost:8070" />
<title>LayoutClickListenerTest</title>
</head>
<body>
@@ -78,7 +78,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsorderedlayoutLayoutClickListenerTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentsorderedlayoutLayoutClickListenerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VGridLayout[0]</td>
<td>1135,146</td>
</tr>
<tr>
@@ -86,6 +86,7 @@
<td></td>
<td>everything_clicked</td>
</tr>
+
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.java
index 4f4faf15bb..821a5dbb93 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutClickListenerTest.java
@@ -59,6 +59,7 @@ public class LayoutClickListenerTest extends TestBase {
// Listen for layout click events
layout.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
// Get the deepest nested component which was clicked
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
new file mode 100644
index 0000000000..07562b7cfe
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java
@@ -0,0 +1,142 @@
+package com.vaadin.tests.components.orderedlayout;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Alignment;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Embedded;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.JavaScript;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.VerticalSplitPanel;
+import com.vaadin.ui.themes.Reindeer;
+
+public class LayoutResizeTest extends TestBase {
+
+ @Override
+ protected void setup() {
+ getLayout().setSizeFull();
+
+ HorizontalSplitPanel split1 = new HorizontalSplitPanel();
+ split1.setSizeFull();
+ addComponent(split1);
+
+ VerticalLayout left = new VerticalLayout();
+ left.setSizeFull();
+ split1.setFirstComponent(left);
+
+ left.setSpacing(true);
+ left.setMargin(true);
+
+ left.addComponent(new Label("<h2>Layout resize test</h2>",
+ ContentMode.XHTML));
+
+ Button resize = new Button("Resize to 700x400",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ JavaScript
+ .getCurrent()
+ .execute(
+ "setTimeout(function() {window.resizeTo(700,400)}, 500)");
+ }
+ });
+ left.addComponent(resize);
+
+ resize = new Button("Resize to 900x600", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ JavaScript
+ .getCurrent()
+ .execute(
+ "setTimeout(function() {window.resizeTo(900,600)}, 500)");
+ }
+ });
+ left.addComponent(resize);
+
+ left.addComponent(new Label(
+ "Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin vel ante a orci tempus eleifend ut et magna. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus luctus urna sed urna ultricies."));
+
+ Table table1 = new Table();
+ table1.setSizeFull();
+ table1.addContainerProperty("Column", String.class, "");
+ for (int i = 1; i <= 100; i++) {
+ table1.addItem(new Object[] { "Value " + i }, i);
+ }
+ left.addComponent(table1);
+ left.setExpandRatio(table1, 1);
+
+ VerticalSplitPanel split2 = new VerticalSplitPanel();
+ split2.setSizeFull();
+ split1.setSecondComponent(split2);
+
+ Table table2 = new Table();
+ table2.setSizeFull();
+ table2.addContainerProperty("Column 1", String.class, "");
+ table2.addContainerProperty("Column 2", String.class, "");
+ table2.addContainerProperty("Column 3", String.class, "");
+ table2.addContainerProperty("Column 4", String.class, "");
+ for (int i = 1; i <= 100; i++) {
+ table2.addItem(new Object[] { "Value " + i, "Value " + i,
+ "Value " + i, "Value " + i }, i);
+ }
+ split2.setFirstComponent(table2);
+
+ VerticalLayout rows = new VerticalLayout();
+ rows.setWidth("100%");
+ rows.setSpacing(true);
+ rows.setMargin(true);
+ for (int i = 1; i <= 100; i++) {
+ rows.addComponent(getRow(i));
+ }
+ split2.setSecondComponent(rows);
+ }
+
+ private HorizontalLayout getRow(int i) {
+ HorizontalLayout row = new HorizontalLayout();
+ row.setWidth("100%");
+ row.setSpacing(true);
+
+ Embedded icon = new Embedded(null, new ThemeResource(
+ "../runo/icons/32/document.png"));
+ row.addComponent(icon);
+ row.setComponentAlignment(icon, Alignment.MIDDLE_LEFT);
+
+ Label text = new Label(
+ "Row content #"
+ + i
+ + ". In pellentesque faucibus vestibulum. Nulla at nulla justo, eget luctus tortor. Nulla facilisi. Duis aliquet.");
+ row.addComponent(text);
+ row.setExpandRatio(text, 1);
+
+ Button button = new Button("Edit");
+ button.addStyleName(Reindeer.BUTTON_SMALL);
+ row.addComponent(button);
+ row.setComponentAlignment(button, Alignment.MIDDLE_LEFT);
+
+ button = new Button("Delete");
+ button.addStyleName(Reindeer.BUTTON_SMALL);
+ row.addComponent(button);
+ row.setComponentAlignment(button, Alignment.MIDDLE_LEFT);
+
+ return row;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
index a9f53bf996..46fd6ee852 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java
@@ -7,7 +7,8 @@ import java.util.List;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
-import com.vaadin.tests.components.TestBase;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
@@ -19,7 +20,7 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.VerticalLayout;
-public class OrderedLayoutCases extends TestBase {
+public class OrderedLayoutCases extends AbstractTestRoot {
private static final String[] dimensionValues = { "-1px", "5px", "350px",
"800px", "100%", "50%" };
@@ -28,18 +29,21 @@ public class OrderedLayoutCases extends TestBase {
setStyleName("sampleChild");
addComponent(createSimpleSelector("Child width",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setWidth(event.getProperty().getValue().toString());
}
}, dimensionValues));
addComponent(createSimpleSelector("Child height",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setHeight(event.getProperty().getValue().toString());
}
}, dimensionValues));
addComponent(createSimpleSelector("Caption",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String value = event.getProperty().getValue()
.toString();
@@ -55,6 +59,7 @@ public class OrderedLayoutCases extends TestBase {
addComponent(createSimpleSelector("Expand ratio",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
AbstractOrderedLayout parent = (AbstractOrderedLayout) getParent();
if (parent == null) {
@@ -78,6 +83,7 @@ public class OrderedLayoutCases extends TestBase {
}
addComponent(createSimpleSelector("Alignment",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String value = event.getProperty().getValue()
.toString();
@@ -108,14 +114,14 @@ public class OrderedLayoutCases extends TestBase {
private HorizontalLayout sizeBar;
@Override
- protected void setup() {
+ protected void setup(WrappedRequest request) {
TestUtils
.injectCSS(
- getMainWindow(),
+ getRoot(),
".sampleChild, .theLayout {border: 1px solid black;}"
- + ".theLayout > div > div:first-child {background: aqua;}"
- + ".theLayout > div > div:first-child + div {background: yellow;}"
- + ".theLayout > div > div:first-child + div + div {background: lightgrey;}");
+ + ".theLayout > div:first-child {background: aqua;}"
+ + ".theLayout > div:first-child + div {background: yellow;}"
+ + ".theLayout > div:first-child + div + div {background: lightgrey;}");
currentLayout = new HorizontalLayout();
for (int i = 0; i < 3; i++) {
@@ -127,6 +133,7 @@ public class OrderedLayoutCases extends TestBase {
sizeBar.addComponent(createSimpleSelector("Layout width",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentLayout.setWidth(event.getProperty().getValue()
.toString());
@@ -134,6 +141,7 @@ public class OrderedLayoutCases extends TestBase {
}, dimensionValues));
sizeBar.addComponent(createSimpleSelector("Layout height",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentLayout.setHeight(event.getProperty().getValue()
.toString());
@@ -141,6 +149,7 @@ public class OrderedLayoutCases extends TestBase {
}, dimensionValues));
sizeBar.addComponent(createSimpleSelector("Spacing",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentLayout.setSpacing(Boolean.parseBoolean(event
.getProperty().getValue().toString()));
@@ -148,6 +157,7 @@ public class OrderedLayoutCases extends TestBase {
}, "false", "true"));
sizeBar.addComponent(createSimpleSelector("Margin",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentLayout.setMargin(Boolean.parseBoolean(event
.getProperty().getValue().toString()));
@@ -155,6 +165,7 @@ public class OrderedLayoutCases extends TestBase {
}, "false", "true"));
sizeBar.addComponent(createSimpleSelector("Direction",
new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object value = event.getProperty().getValue();
@@ -188,6 +199,7 @@ public class OrderedLayoutCases extends TestBase {
HorizontalLayout caseBar = new HorizontalLayout();
caseBar.addComponent(new Button("Undefined without relative",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
setState(sizeBar, 2, 1);
@@ -201,6 +213,7 @@ public class OrderedLayoutCases extends TestBase {
}));
caseBar.addComponent(new Button("Undefined with relative",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// width: 100% to middle child
@@ -209,6 +222,7 @@ public class OrderedLayoutCases extends TestBase {
}));
caseBar.addComponent(new Button("Fixed with overflow",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// layout width: 350px
@@ -219,6 +233,7 @@ public class OrderedLayoutCases extends TestBase {
}));
caseBar.addComponent(new Button("Fixed with extra space",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// Layout width: 800px
@@ -236,6 +251,7 @@ public class OrderedLayoutCases extends TestBase {
caseBar.addComponent(new Button("Expand with alignment",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// Layout width: 800px
@@ -253,6 +269,7 @@ public class OrderedLayoutCases extends TestBase {
caseBar.addComponent(new Button("Multiple expands",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// Layout width: 800px
@@ -275,6 +292,7 @@ public class OrderedLayoutCases extends TestBase {
caseBar.addComponent(new Button("Fixed + relative height",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// Layout height: 100%
@@ -292,6 +310,7 @@ public class OrderedLayoutCases extends TestBase {
caseBar.addComponent(new Button("Undefined + relative height",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
resetState();
// Height: 350px to left child
@@ -312,7 +331,7 @@ public class OrderedLayoutCases extends TestBase {
addComponent(currentLayout);
getLayout().setSpacing(true);
- getLayout().getParent().setSizeFull();
+ getContent().setSizeFull();
getLayout().setSizeFull();
getLayout().setExpandRatio(currentLayout, 1);
}
@@ -368,7 +387,7 @@ public class OrderedLayoutCases extends TestBase {
}
@Override
- protected String getDescription() {
+ protected String getTestDescription() {
return "Tester application for exploring how Horizontal/VerticalLayout reacts to various settings ";
}
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java
index 501c377ab7..a18400ce08 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java
@@ -26,6 +26,7 @@ public class ReplaceComponentNPE extends TestBase {
Button changer = new Button("ReplaceComponent");
changer.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getLayout().replaceComponent(button, outer);
outer.addComponent(button);
diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
index f59b940353..945ccf0e28 100644
--- a/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
+++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/VerticalLayoutWidthCalculation.java
@@ -4,6 +4,7 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -11,7 +12,8 @@ import com.vaadin.ui.Window;
public class VerticalLayoutWidthCalculation extends AbstractTestCase {
@Override
public void init() {
- final Window mainWindow = new Window("Vaadintest Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Vaadintest Application");
mainWindow.addWindow(createSubWindow());
setMainWindow(mainWindow);
@@ -41,6 +43,7 @@ public class VerticalLayoutWidthCalculation extends AbstractTestCase {
Button btn = new Button("Show/hide");
btn.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tf2.setVisible(!tf2.isVisible());
}
diff --git a/tests/testbench/com/vaadin/tests/components/panel/BasicPanelTest.java b/tests/testbench/com/vaadin/tests/components/panel/BasicPanelTest.java
new file mode 100644
index 0000000000..b3eac5c82e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/panel/BasicPanelTest.java
@@ -0,0 +1,88 @@
+package com.vaadin.tests.components.panel;
+
+import java.util.Map;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.themes.Reindeer;
+
+public class BasicPanelTest extends TestBase {
+ private final Label scrollPosition = new Label();
+ private final Panel panel = new Panel("Panel caption") {
+ @Override
+ public void changeVariables(Object source, Map<String, Object> variables) {
+ super.changeVariables(source, variables);
+ updateLabelText();
+ }
+ };
+
+ @Override
+ protected void setup() {
+ getLayout().setWidth("600px");
+ getLayout().setHeight("100%");
+
+ HorizontalLayout actions = new HorizontalLayout();
+ actions.setSpacing(true);
+
+ actions.addComponent(scrollPosition);
+ actions.addComponent(new Button("Sync"));
+
+ final CheckBox heightSelection = new CheckBox("Undefined height");
+ heightSelection.setImmediate(true);
+ heightSelection.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (heightSelection.getValue() == Boolean.TRUE) {
+ panel.setHeight(null);
+ } else {
+ panel.setHeight("100%");
+ }
+ }
+ });
+ actions.addComponent(heightSelection);
+
+ panel.setWidth("200px");
+ panel.setHeight("100%");
+ panel.setStyleName(Reindeer.PANEL_LIGHT);
+
+ panel.getContent().setCaption("Content caption");
+
+ TextArea textArea = new TextArea("TextArea caption");
+ textArea.setWidth("300px");
+ textArea.setHeight("500px");
+ panel.addComponent(textArea);
+
+ getLayout().addComponent(actions);
+ getLayout().addComponent(panel);
+ getLayout().setExpandRatio(panel, 1);
+
+ panel.setScrollTop(50);
+ panel.setScrollLeft(50);
+ panel.setImmediate(true);
+
+ updateLabelText();
+ }
+
+ private void updateLabelText() {
+ scrollPosition.setValue("Scrolled to " + panel.getScrollTop());
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Simple test for basic panel functionality";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.html b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.html
new file mode 100644
index 0000000000..bff19c4846
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.html
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.panel.PanelChangeContents?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>stats</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>companies</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>settings</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>stats</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>companies</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VHorizontalLayout[0]/VButton[2]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspanelPanelChangeContents::/VVerticalLayout[0]/VPanel[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>settings</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java
new file mode 100644
index 0000000000..7722e182ff
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java
@@ -0,0 +1,74 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.panel;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.VerticalLayout;
+
+public class PanelChangeContents extends AbstractTestRoot implements
+ ClickListener {
+
+ VerticalLayout stats = new VerticalLayout();
+ VerticalLayout companies = new VerticalLayout();
+ VerticalLayout settings = new VerticalLayout();
+
+ Button statsButton = new Button("Stats", this);
+ Button companiesButton = new Button("Companies", this);
+ Button settingsButton = new Button("Settings", this);
+
+ private Panel panel;
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ VerticalLayout content = new VerticalLayout();
+ setSizeFull();
+ HorizontalLayout buttons = new HorizontalLayout();
+ stats.addComponent(new Label("stats"));
+ companies.addComponent(new Label("companies"));
+ settings.addComponent(new Label("settings"));
+ buttons.addComponent(statsButton);
+ buttons.addComponent(companiesButton);
+ buttons.addComponent(settingsButton);
+ panel = new Panel();
+ panel.setSizeFull();
+ panel.setContent(stats);
+ content.addComponent(buttons);
+ content.addComponent(panel);
+ content.setMargin(true);
+ content.setSpacing(true);
+ content.setExpandRatio(panel, 1);
+ setContent(content);
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ if (event.getButton() == statsButton) {
+ panel.setContent(stats);
+ } else if (event.getButton() == companiesButton) {
+ panel.setContent(companies);
+ } else if (event.getButton() == settingsButton) {
+ panel.setContent(settings);
+ }
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8735;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelClickListenerRelativeCoordinates.java b/tests/testbench/com/vaadin/tests/components/panel/PanelClickListenerRelativeCoordinates.java
index 65a185b160..40f6d5ea33 100644
--- a/tests/testbench/com/vaadin/tests/components/panel/PanelClickListenerRelativeCoordinates.java
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelClickListenerRelativeCoordinates.java
@@ -12,6 +12,7 @@ public class PanelClickListenerRelativeCoordinates extends TestBase {
Panel panel = new Panel("Panel's caption");
panel.addListener(new ClickListener() {
+ @Override
public void click(ClickEvent event) {
getMainWindow()
.showNotification(
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
index 7c537fe710..a4cba89732 100644
--- a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldNotScroll.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.components.panel;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -17,12 +18,12 @@ public class PanelShouldNotScroll extends TestBase {
@Override
protected void setup() {
final Panel p = new Panel(new CssLayout());
- p.setScrollable(true);
p.setSizeFull();
p.setHeight("600px");
p.addComponent(foo());
addMore = new Button("Add");
addMore.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.removeComponent(addMore);
p.addComponent(foo());
@@ -39,7 +40,7 @@ public class PanelShouldNotScroll extends TestBase {
panel.addComponent(new Label(
"fooooooooo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>"
+ "foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>foo<br/>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return panel;
}
diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java
index eec39359aa..5ca5c5135f 100644
--- a/tests/testbench/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java
+++ b/tests/testbench/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java
@@ -34,6 +34,7 @@ public class PanelShouldRemoveActionHandler extends TestBase {
Button add = new Button("Add an action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
add();
}
@@ -42,6 +43,7 @@ public class PanelShouldRemoveActionHandler extends TestBase {
Button addAnother = new Button("Add another action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addAnother();
}
@@ -50,6 +52,7 @@ public class PanelShouldRemoveActionHandler extends TestBase {
Button remove = new Button("Remove an action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
remove();
}
@@ -73,12 +76,14 @@ public class PanelShouldRemoveActionHandler extends TestBase {
panel.setCaption(panel.getCaption() + " - Added handler");
Handler actionHandler = new Handler() {
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { new ShortcutAction("Ctrl+Left",
ShortcutAction.KeyCode.ARROW_LEFT,
new int[] { ModifierKey.CTRL }) };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification(
"Handling action " + action.getCaption());
@@ -92,12 +97,14 @@ public class PanelShouldRemoveActionHandler extends TestBase {
public void addAnother() {
Handler actionHandler = new Handler() {
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { new ShortcutAction("Ctrl+Right",
ShortcutAction.KeyCode.ARROW_RIGHT,
new int[] { ModifierKey.CTRL }) };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification(
"Handling action " + action.getCaption());
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java
index c8d4ee9858..6461d10277 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewClickShortcut.java
@@ -50,6 +50,7 @@ public class PopupViewClickShortcut extends TestBase {
new Button.ClickListener() {
private int i = 5;
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Submitted from "
+ event.getButton().getParent().getCaption());
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
index ff71f2f381..75f95977bd 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewNullValues.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class PopupViewNullValues extends TestBase {
@@ -20,6 +20,7 @@ public class PopupViewNullValues extends TestBase {
addComponent(pv[0]);
b[0] = new Button("Open popupview 1", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
pv[0].setPopupVisible(true);
}
@@ -38,6 +39,7 @@ public class PopupViewNullValues extends TestBase {
addComponent(pv[1]);
b[1] = new Button("Open popupview 2", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
pv[1].setPopupVisible(true);
}
@@ -55,6 +57,7 @@ public class PopupViewNullValues extends TestBase {
addComponent(pv[2]);
b[2] = new Button("Open popupview 3", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
pv[2].setPopupVisible(true);
}
@@ -72,6 +75,7 @@ public class PopupViewNullValues extends TestBase {
addComponent(pv[3]);
b[3] = new Button("Open popupview 4", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
pv[3].setPopupVisible(true);
}
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
index 7067281fa2..01ed34a13f 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewOffScreen.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.popupview;
import java.util.ArrayList;
import java.util.List;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.LoremIpsum;
import com.vaadin.ui.Button;
@@ -14,6 +15,7 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.BaseTheme;
public class PopupViewOffScreen extends TestBase {
@@ -40,6 +42,7 @@ public class PopupViewOffScreen extends TestBase {
Button showall = new Button("Popup all", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
for (PopupView pv : popupViews) {
pv.setPopupVisible(true);
@@ -61,6 +64,7 @@ public class PopupViewOffScreen extends TestBase {
vl.setSpacing(false);
vl.setMargin(false);
vl.setSizeFull();
+ vl.addStyleName(BaseTheme.CLIP);
Panel p = new Panel(vl);
p.setWidth("400px");
@@ -69,7 +73,7 @@ public class PopupViewOffScreen extends TestBase {
Label l = new Label(
"<div style='width: 100%; height: 100%; background: " + bg
+ "'>" + LoremIpsum.get(2000) + "</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
l.setSizeFull();
p.addComponent(l);
PopupView pv = new PopupView("Click here to popup", p);
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewShouldCloseOnTabOut.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewShouldCloseOnTabOut.java
index 7e917630c8..271a7eea2a 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewShouldCloseOnTabOut.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewShouldCloseOnTabOut.java
@@ -24,10 +24,12 @@ public class PopupViewShouldCloseOnTabOut extends TestBase {
protected void setup() {
PopupView pv = new PopupView(new Content() {
+ @Override
public String getMinimizedValueAsHTML() {
return "<b>click me</b>";
}
+ @Override
public Component getPopupComponent() {
VerticalLayout vl = new VerticalLayout();
TextField field1 = new TextField();
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
index 1123f217b7..069ccef2bb 100644
--- a/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
+++ b/tests/testbench/com/vaadin/tests/components/popupview/PopupViewWithRTE.java
@@ -27,8 +27,9 @@ public class PopupViewWithRTE extends TestBase {
VerticalLayout vl = new VerticalLayout();
+ @Override
public String getMinimizedValueAsHTML() {
- Object value = rte.getValue();
+ String value = rte.getValue();
if (value == null || "".equals(value)) {
value = "Initial <b>content</b> for <h3>rte</h3>.";
rte.setValue(value);
@@ -40,6 +41,7 @@ public class PopupViewWithRTE extends TestBase {
return value.toString();
}
+ @Override
public Component getPopupComponent() {
return vl;
}
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.html b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.html
new file mode 100644
index 0000000000..a8d1407005
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.html
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.popupview.ReopenPopupView?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupView[0]</td>
+ <td>42,5</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//span/span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>1. Button clicked</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//span/span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>2. Button clicked</td>
+</tr>
+<!--Click outside to close PopupView-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::</td>
+ <td>304,229</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<!--Open PopupView again and click button-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::/VVerticalLayout[0]/VVerticalLayout[0]/VPopupView[0]</td>
+ <td>33,6</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>//span/span</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentspopupviewReopenPopupView::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>3. Button clicked</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java
new file mode 100644
index 0000000000..bef3cfced8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java
@@ -0,0 +1,38 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.popupview;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.PopupView;
+
+public class ReopenPopupView extends AbstractTestRoot {
+ private final Log log = new Log(5);
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(log);
+ addComponent(new PopupView("PopupView", new Button("Button",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log.log("Button clicked");
+ }
+ })));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Clicking a button in a PopupView should work every time";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8804);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java b/tests/testbench/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java
index 62dba61191..9f632ac806 100644
--- a/tests/testbench/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java
+++ b/tests/testbench/com/vaadin/tests/components/progressindicator/ProgressIndicatorInvisible.java
@@ -22,6 +22,7 @@ public class ProgressIndicatorInvisible extends TestBase {
addComponent(b);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
// If we skip hiding the layout, hiding the ProgressIndicator
// will stop the polling
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaTest.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaTest.java
index cb7b991bda..4155dd8a07 100644
--- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaTest.java
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaTest.java
@@ -14,6 +14,7 @@ public class RichTextAreaTest extends AbstractFieldTest<RichTextArea> {
private Command<RichTextArea, Boolean> nullSelectionAllowedCommand = new Command<RichTextArea, Boolean>() {
+ @Override
public void execute(RichTextArea c, Boolean value, Object data) {
c.setNullSettingAllowed(value);
@@ -21,6 +22,7 @@ public class RichTextAreaTest extends AbstractFieldTest<RichTextArea> {
};
private Command<RichTextArea, String> nullRepresentationCommand = new Command<RichTextArea, String>() {
+ @Override
public void execute(RichTextArea c, String value, Object data) {
c.setNullRepresentation(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
index 2e26d3e2c4..73d7a95e9f 100644
--- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
+++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java
@@ -3,9 +3,11 @@ package com.vaadin.tests.components.richtextarea;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
+import com.vaadin.terminal.Page;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.RichTextArea;
import com.vaadin.ui.Window;
@@ -18,22 +20,26 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
ShortcutAction save = new ShortcutAction("^Save");
private Action[] actions = new Action[] { save };
+ @Override
public void handleAction(Action action, Object sender, Object target) {
String msg = "Action: " + action.getCaption();
msg += " From : " + sender.getClass().getSimpleName() + " '"
+ ((Component) sender).getCaption() + "'";
- AbstractField f = (AbstractField) target;
+ AbstractField<String> f = (AbstractField<String>) target;
msg += " Target:" + target.getClass().getSimpleName() + " '"
+ f.getCaption() + "'";
String string = f.getValue().toString();
msg += " Value: " + string;
- f.getWindow().showNotification(msg);
+ Notification notification = new Notification(msg);
+ notification.setHtmlContentAllowed(true);
+ notification.show(Page.getCurrent());
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
@@ -42,7 +48,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
@Override
protected void setup() {
- getLayout().getWindow().addActionHandler(actionHandler);
+ getLayout().getRoot().addActionHandler(actionHandler);
getLayout().addComponent(createRichTextArea("InMainLayout"));
Panel panel = new Panel("RTA Panel");
@@ -55,7 +61,7 @@ public class RichTextAreaWithKeyboardShortcuts extends TestBase {
w.addComponent(createRichTextArea("InSubWindow"));
w.getContent().setSizeUndefined();
- getLayout().getWindow().addWindow(w);
+ getLayout().getRoot().addWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html
new file mode 100644
index 0000000000..5448a24816
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.html
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/normalPath?restartApplication#normalFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>NormalRoot<br />pathInfo: /normalPath<br />parameters: [restartApplication]<br />uri fragment: normalFragment</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/lazyCreatePath?lazyCreate#lazyCreateFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>LazyCreateRoot<br />pathInfo: /lazyCreatePath<br />parameters: [lazyCreate]<br />uri fragment: lazyCreateFragment</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.LazyInitRoots/eagerPath/?eagerInit#eagerFragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootLazyInitRoots::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>EagerInitRoot<br />pathInfo: /eagerPath/<br />parameters: [eagerInit]<br />uri fragment: null</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
new file mode 100644
index 0000000000..254410a549
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/LazyInitRoots.java
@@ -0,0 +1,89 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.annotations.EagerInit;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedRequest.BrowserDetails;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.Root;
+
+public class LazyInitRoots extends AbstractTestApplication {
+
+ @EagerInit
+ private static class EagerInitRoot extends Root {
+ @Override
+ public void init(WrappedRequest request) {
+ addComponent(getRequestInfo("EagerInitRoot", request));
+ }
+ }
+
+ @Override
+ public Root getRoot(WrappedRequest request)
+ throws RootRequiresMoreInformationException {
+ if (request.getParameter("lazyCreate") != null) {
+ // Root created on second request
+ BrowserDetails browserDetails = request.getBrowserDetails();
+ if (browserDetails == null
+ || browserDetails.getUriFragment() == null) {
+ throw new RootRequiresMoreInformationException();
+ } else {
+ Root root = new Root() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("LazyCreateRoot", request));
+ }
+ };
+ return root;
+ }
+ } else if (request.getParameter("eagerInit") != null) {
+ // Root inited on first request
+ return new EagerInitRoot();
+ } else {
+ // The standard root
+ Root root = new Root() {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(getRequestInfo("NormalRoot", request));
+
+ Link lazyCreateLink = new Link("Open lazyCreate root",
+ new ExternalResource(getURL()
+ + "?lazyCreate#lazyCreate"));
+ lazyCreateLink.setTargetName("_blank");
+ addComponent(lazyCreateLink);
+
+ Link lazyInitLink = new Link("Open eagerInit root",
+ new ExternalResource(getURL()
+ + "?eagerInit#eagerInit"));
+ lazyInitLink.setTargetName("_blank");
+ addComponent(lazyInitLink);
+ }
+ };
+
+ return root;
+ }
+ }
+
+ public static Label getRequestInfo(String name, WrappedRequest request) {
+ String info = name;
+ info += "<br />pathInfo: " + request.getRequestPathInfo();
+ info += "<br />parameters: " + request.getParameterMap().keySet();
+ info += "<br />uri fragment: "
+ + request.getBrowserDetails().getUriFragment();
+ return new Label(info, ContentMode.XHTML);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "BrowserDetails should be available in Application.getRoot if RootRequiresMoreInformation has been thrown and in Root.init if the root has the @RootInitRequiresBrowserDetals annotation";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7883); // + #7882 + #7884
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitException.java b/tests/testbench/com/vaadin/tests/components/root/RootInitException.java
new file mode 100644
index 0000000000..b4cfa2a28d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootInitException.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+
+public class RootInitException extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ throw new RuntimeException("Catch me if you can");
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Throwing an exception in application code during a browser details request should show a sensible message in the client";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8243);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java b/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
new file mode 100644
index 0000000000..16fecc62d2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootInitTest.java
@@ -0,0 +1,27 @@
+/*
+@ITMillApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+public class RootInitTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new Label("Hello root"));
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "Testing basic root creation";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(3067);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
new file mode 100644
index 0000000000..c9b83fdc4e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.html
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 1</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 2</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.RootsInMultipleTabs?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootRootsInMultipleTabs::/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>This is root number 1</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
new file mode 100644
index 0000000000..c3b20c5e7c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/RootsInMultipleTabs.java
@@ -0,0 +1,36 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestApplication;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+public class RootsInMultipleTabs extends AbstractTestApplication {
+ private int numberOfRootsOpened;
+
+ public static class TabRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ RootsInMultipleTabs application = (RootsInMultipleTabs) getApplication();
+ String message = "This is root number "
+ + ++application.numberOfRootsOpened;
+
+ addComponent(new Label(message));
+ }
+ }
+
+ @Override
+ protected String getRootClassName(WrappedRequest request) {
+ return TabRoot.class.getName();
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Opening the same application again (e.g. in a new tab) should create a new Root.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7894);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
new file mode 100644
index 0000000000..7d0f638325
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.html
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.TestRootTheme?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>themeLoaded</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
new file mode 100644
index 0000000000..77c0bdb150
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootTheme.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+@Theme("tests-tickets")
+public class TestRootTheme extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Label label = new Label("A red label");
+ label.setStyleName("red");
+ addComponent(label);
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "Root with @RootTheme(\"tests-tickets\")";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html
new file mode 100644
index 0000000000..c91d742581
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.html
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>Ticket4607</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">Ticket4607</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.TestRootWidgetset</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootTestRootWidgetset::/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>This component is available in TestingWidgetset, but not in DefaultWidgetset</td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.TestRootWidgetset2</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootTestRootWidgetset2::/VVerticalLayout[0]/VVerticalLayout[0]/VUnknownComponent[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Widgetset does not contain implementation for com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent. Check its component connector's @Connect mapping, widgetsets GWT module description file and re-compile your widgetset. In case you have downloaded a vaadin add-on package, you might want to refer to add-on instructions.</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
new file mode 100644
index 0000000000..b92815eeed
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset.java
@@ -0,0 +1,26 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class TestRootWidgetset extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new MissingFromDefaultWidgetsetComponent());
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "This contents if this root should work as the component is present in TestingWidgetSet";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java
new file mode 100644
index 0000000000..d3be29215e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/TestRootWidgetset2.java
@@ -0,0 +1,24 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+public class TestRootWidgetset2 extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(new MissingFromDefaultWidgetsetComponent());
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "This contents if this root should not work as the component is not present in DefaultWidgetSet";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(7885);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
new file mode 100644
index 0000000000..d4704fea65
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.html
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.root.UriFragmentTest?restartApplication#urifragment</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: urifragment</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: test</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.back()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: urifragment</td>
+</tr>
+<tr>
+ <td>runScript</td>
+ <td>history.forward()</td>
+ <td></td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td></td>
+ <td>1000</td>
+</tr>
+<tr>
+ <td>waitForVaadin</td>
+ <td></td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentsrootUriFragmentTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>Current URI fragment: test</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
new file mode 100644
index 0000000000..d34c7718ce
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/root/UriFragmentTest.java
@@ -0,0 +1,53 @@
+package com.vaadin.tests.components.root;
+
+import com.vaadin.terminal.Page;
+import com.vaadin.terminal.Page.FragmentChangedEvent;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+
+public class UriFragmentTest extends AbstractTestRoot {
+
+ private final Label fragmentLabel = new Label();
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(fragmentLabel);
+ updateLabel();
+ getPage().addListener(new Page.FragmentChangedListener() {
+ @Override
+ public void fragmentChanged(FragmentChangedEvent event) {
+ updateLabel();
+ }
+ });
+ addComponent(new Button("Navigate to #test",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getPage().setFragment("test");
+ }
+ }));
+ }
+
+ private void updateLabel() {
+ String fragment = getPage().getFragment();
+ if (fragment == null) {
+ fragmentLabel.setValue("No URI fragment set");
+ } else {
+ fragmentLabel.setValue("Current URI fragment: " + fragment);
+ }
+ }
+
+ @Override
+ public String getTestDescription() {
+ return "URI fragment status should be known when the page is loaded and retained while navigating to different fragments or using the back and forward buttons.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8048);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java b/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java
index 0565811e15..7c2d8dd243 100644
--- a/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java
+++ b/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java
@@ -146,6 +146,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Boolean> nullSelectionAllowedCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
(c).setNullSelectionAllowed(value);
}
@@ -153,6 +154,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Boolean> multiselectCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setMultiSelect(value);
}
@@ -160,6 +162,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Object> nullSelectItemIdCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object value, Object data) {
c.setNullSelectionItemId(value);
}
@@ -167,6 +170,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Integer> itemsInContainerCommand = new Command<T, Integer>() {
+ @Override
public void execute(T t, Integer value, Object data) {
items = value;
updateContainer();
@@ -175,6 +179,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Integer> propertiesInContainerCommand = new Command<T, Integer>() {
+ @Override
public void execute(T t, Integer value, Object data) {
properties = value;
updateContainer();
@@ -183,6 +188,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
protected Command<T, Boolean> itemClickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
((ItemClickNotifier) c)
@@ -206,6 +212,7 @@ public abstract class AbstractSelectTestCase<T extends AbstractSelect> extends
/* COMMANDS END */
+ @Override
public void itemClick(ItemClickEvent event) {
String type = event.getButtonName();
if (event.isDoubleClick()) {
diff --git a/tests/testbench/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java b/tests/testbench/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java
index 931686003a..470c97442f 100644
--- a/tests/testbench/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java
+++ b/tests/testbench/com/vaadin/tests/components/select/ComboBoxAddWhileFiltering.java
@@ -22,6 +22,7 @@ public class ComboBoxAddWhileFiltering extends TestBase {
Button b = new Button("add item (^N)");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addItem(comboBox);
}
diff --git a/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java b/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
index dd2a8bb1a8..6f203bf8c9 100644
--- a/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
+++ b/tests/testbench/com/vaadin/tests/components/select/FocusListenerBreaksDropdownMenu.java
@@ -14,6 +14,7 @@ public class FocusListenerBreaksDropdownMenu extends TestBase {
}
comboBox.addListener(new FieldEvents.FocusListener() {
+ @Override
public void focus(FieldEvents.FocusEvent event) {
comboBox.addItem();
}
diff --git a/tests/testbench/com/vaadin/tests/components/select/MultiSelect.java b/tests/testbench/com/vaadin/tests/components/select/MultiSelect.java
deleted file mode 100644
index d823d1fd10..0000000000
--- a/tests/testbench/com/vaadin/tests/components/select/MultiSelect.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.vaadin.tests.components.select;
-
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Select;
-
-public class MultiSelect extends TestBase {
-
- @SuppressWarnings("deprecation")
- @Override
- protected void setup() {
- Select selectComponent = new Select();
- selectComponent.setMultiSelect(true);
-
- String[] selection = { "One", "Hund", "Three" };
- for (String word : selection) {
- selectComponent.addItem(word);
- }
-
- addComponent(selectComponent);
- }
-
- @Override
- protected String getDescription() {
- return "The select is in multi select mode and should be rendered as such";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 4553;
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/components/select/NativeSelects.java b/tests/testbench/com/vaadin/tests/components/select/NativeSelects.java
index d5577e213c..75a3f1b751 100644
--- a/tests/testbench/com/vaadin/tests/components/select/NativeSelects.java
+++ b/tests/testbench/com/vaadin/tests/components/select/NativeSelects.java
@@ -108,6 +108,7 @@ public class NativeSelects extends ComponentTestCase<NativeSelect> {
actions.add(createBooleanAction("Null selection allowed", false,
new Command<NativeSelect, Boolean>() {
+ @Override
public void execute(NativeSelect c, Boolean value,
Object data) {
c.setNullSelectionAllowed(value);
diff --git a/tests/testbench/com/vaadin/tests/components/select/NullSelectionItemId.java b/tests/testbench/com/vaadin/tests/components/select/NullSelectionItemId.java
index 74ebb08826..984bab5b34 100644
--- a/tests/testbench/com/vaadin/tests/components/select/NullSelectionItemId.java
+++ b/tests/testbench/com/vaadin/tests/components/select/NullSelectionItemId.java
@@ -36,6 +36,7 @@ public class NullSelectionItemId extends TestBase implements ClickListener {
button = new Button(
"Select null with select(NULL_ITEM_ID) (should make value null)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mySelect.select(NULL_ITEM_ID);
}
@@ -46,6 +47,7 @@ public class NullSelectionItemId extends TestBase implements ClickListener {
button = new Button(
"Select null with setValue(null) (should make value null)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mySelect.setValue(null);
}
@@ -55,6 +57,7 @@ public class NullSelectionItemId extends TestBase implements ClickListener {
}
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification(
"mySelect.getValue() returns: " + mySelect.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.html b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.html
index 4594130bda..122e90e140 100644
--- a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.html
+++ b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.html
@@ -131,7 +131,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentsselectSelectDisplaysOldValue::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentsselectSelectDisplaysOldValue::/VVerticalLayout[0]/domChild[1]</td>
<td>58,163</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java
index 743dc071c9..b9ae958a03 100644
--- a/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java
+++ b/tests/testbench/com/vaadin/tests/components/select/SelectDisplaysOldValue.java
@@ -143,6 +143,7 @@ public class SelectDisplaysOldValue extends TestBase {
private class ControllerUpdatedListener implements
Property.ValueChangeListener {
+ @Override
public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
refreshSlaveDropdown((Integer) valueChangeEvent.getProperty()
.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/select/StylingPopupOpener.java b/tests/testbench/com/vaadin/tests/components/select/StylingPopupOpener.java
index b3911f19c7..b97231ae8e 100644
--- a/tests/testbench/com/vaadin/tests/components/select/StylingPopupOpener.java
+++ b/tests/testbench/com/vaadin/tests/components/select/StylingPopupOpener.java
@@ -19,6 +19,7 @@ public class StylingPopupOpener extends TestBase {
addComponent(select);
addComponent(new Button("Update style", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
select.setStyleName("mystyle");
}
diff --git a/tests/testbench/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java b/tests/testbench/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java
index cf33e2c7ff..789174260f 100644
--- a/tests/testbench/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java
+++ b/tests/testbench/com/vaadin/tests/components/select/TwinColSelectCaptionStyles.java
@@ -20,6 +20,7 @@ public class TwinColSelectCaptionStyles extends TestBase {
Button b = new Button("Set height and width to 500px",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
sel.setHeight("500px");
sel.setWidth("500px");
diff --git a/tests/testbench/com/vaadin/tests/components/select/TwinColSelectTest.java b/tests/testbench/com/vaadin/tests/components/select/TwinColSelectTest.java
index fef9c4172d..b27dfa0ec8 100644
--- a/tests/testbench/com/vaadin/tests/components/select/TwinColSelectTest.java
+++ b/tests/testbench/com/vaadin/tests/components/select/TwinColSelectTest.java
@@ -7,12 +7,14 @@ import com.vaadin.ui.TwinColSelect;
public class TwinColSelectTest extends AbstractSelectTestCase<TwinColSelect> {
private Command<TwinColSelect, Integer> rowsCommand = new Command<TwinColSelect, Integer>() {
+ @Override
public void execute(TwinColSelect c, Integer value, Object data) {
c.setRows(value);
}
};
private Command<TwinColSelect, Integer> colsCommand = new Command<TwinColSelect, Integer>() {
+ @Override
public void execute(TwinColSelect c, Integer value, Object data) {
c.setColumns(value);
}
@@ -20,6 +22,7 @@ public class TwinColSelectTest extends AbstractSelectTestCase<TwinColSelect> {
private Command<TwinColSelect, String> leftColumnCaptionCommand = new Command<TwinColSelect, String>() {
+ @Override
public void execute(TwinColSelect c, String value, Object data) {
c.setLeftColumnCaption(value);
}
@@ -27,12 +30,12 @@ public class TwinColSelectTest extends AbstractSelectTestCase<TwinColSelect> {
private Command<TwinColSelect, String> rightColumnCaptionCommand = new Command<TwinColSelect, String>() {
+ @Override
public void execute(TwinColSelect c, String value, Object data) {
c.setRightColumnCaption(value);
}
};
-
@Override
protected Class<TwinColSelect> getTestClass() {
return TwinColSelect.class;
diff --git a/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java b/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java
index e34a294740..9be1fea987 100644
--- a/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java
+++ b/tests/testbench/com/vaadin/tests/components/slider/SliderTest.java
@@ -8,23 +8,27 @@ import com.vaadin.ui.Slider;
public class SliderTest extends AbstractFieldTest<Slider> {
private Command<Slider, Double> minCommand = new Command<Slider, Double>() {
+ @Override
public void execute(Slider c, Double value, Object data) {
c.setMin(value);
}
};
private Command<Slider, Double> maxCommand = new Command<Slider, Double>() {
+ @Override
public void execute(Slider c, Double value, Object data) {
c.setMax(value);
}
};
private Command<Slider, Integer> orientationCommand = new Command<Slider, Integer>() {
+ @Override
public void execute(Slider c, Integer value, Object data) {
c.setOrientation(value);
}
};
private Command<Slider, Integer> resolutionCommand = new Command<Slider, Integer>() {
+ @Override
public void execute(Slider c, Integer value, Object data) {
c.setResolution(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
index d633618ef4..dc361b1b27 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java
@@ -1,16 +1,19 @@
package com.vaadin.tests.components.splitpanel;
import com.vaadin.terminal.Sizeable;
-import com.vaadin.tests.components.AbstractLayoutTest;
+import com.vaadin.terminal.Sizeable.Unit;
+import com.vaadin.tests.components.AbstractComponentContainerTest;
import com.vaadin.ui.AbstractSplitPanel;
import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent;
import com.vaadin.ui.AbstractSplitPanel.SplitterClickListener;
public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
- extends AbstractLayoutTest<T> implements SplitterClickListener {
+ extends AbstractComponentContainerTest<T> implements
+ SplitterClickListener {
private Command<T, Boolean> splitterClickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((SplitterClickListener) AbstractSplitPanelTest.this);
@@ -21,12 +24,14 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
}
};
private Command<T, SplitPosition> setSplitPositionCommand = new Command<T, AbstractSplitPanelTest.SplitPosition>() {
+ @Override
public void execute(T c, SplitPosition value, Object data) {
value.apply(c);
}
};
private Command<T, Boolean> splitterLockCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setLocked(value);
}
@@ -55,7 +60,7 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
private boolean reverse = false;
private int position;
- private int unit;
+ private Unit unit;
private String posString;
public SplitPosition(String pos) {
@@ -67,10 +72,10 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
if (pos.endsWith("px")) {
position = Integer.parseInt(pos.substring(0, pos.length() - 2));
- unit = Sizeable.UNITS_PIXELS;
+ unit = Sizeable.Unit.PIXELS;
} else if (pos.endsWith("%")) {
position = Integer.parseInt(pos.substring(0, pos.length() - 1));
- unit = Sizeable.UNITS_PERCENTAGE;
+ unit = Sizeable.Unit.PERCENTAGE;
} else {
throw new RuntimeException("Could not parse " + pos);
}
@@ -120,6 +125,7 @@ public abstract class AbstractSplitPanelTest<T extends AbstractSplitPanel>
}
+ @Override
public void splitterClick(SplitterClickEvent event) {
log(event.getClass().getSimpleName() + ": " + event.getButtonName()
+ " at " + event.getRelativeX() + "," + event.getRelativeY());
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
index 8e829b2d7a..82229773d0 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelBasicStates.html
@@ -86,7 +86,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item3</td>
<td>38,9</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelSplitterClick.html b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelSplitterClick.html
index 3d3fcc5939..d91b3d8c4a 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelSplitterClick.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/HorizontalSplitPanelSplitterClick.html
@@ -46,7 +46,7 @@
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::PID_SLog_row_0</td>
- <td>1. SplitterClickEvent: left at -1,-1</td>
+ <td>1. SplitterClickEvent: left at 0,0</td>
</tr>
<tr>
<td>screenCapture</td>
@@ -61,7 +61,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[0]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::Root/VOverlay[0]/VMenuBar[0]#item5</td>
<td>73,7</td>
</tr>
<tr>
@@ -78,12 +78,12 @@
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::PID_StestComponent/domChild[0]/domChild[2]/domChild[0]</td>
- <td>0,0</td>
+ <td>5,5</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelHorizontalSplitPanels::PID_SLog_row_0</td>
- <td>3. SplitterClickEvent: left at -1,-1</td>
+ <td>3. SplitterClickEvent: left at 5,5</td>
</tr>
<tr>
<td>screenCapture</td>
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
index a7cb1a857a..05e10397ac 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java
@@ -8,7 +8,7 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class SplitPanelExtraScrollbars extends AbstractTestCase implements
ClickListener {
@@ -32,7 +32,7 @@ public class SplitPanelExtraScrollbars extends AbstractTestCase implements
sp.setSecondComponent(hl);
hl.addComponent(b);
- Window w = new Window("Test", sp);
+ LegacyWindow w = new LegacyWindow("Test", sp);
setMainWindow(w);
}
@@ -53,6 +53,7 @@ public class SplitPanelExtraScrollbars extends AbstractTestCase implements
return 3458;
}
+ @Override
public void buttonClick(ClickEvent event) {
if (b.getHeight() == 200) {
b.setHeight("1200px");
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
index 107635e989..a86d209f65 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java
@@ -8,7 +8,7 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.TextField;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalSplitPanel;
public class SplitPanelReversePosition extends TestBase {
@@ -26,20 +26,22 @@ public class SplitPanelReversePosition extends TestBase {
hsplit.setImmediate(true);
hsplit.setSplitPosition(100, Sizeable.UNITS_PIXELS, hsplitReversed);
hsplit.addListener(new HorizontalSplitPanel.SplitterClickListener() {
+ @Override
public void splitterClick(SplitterClickEvent event) {
getMainWindow().showNotification("Horizontal Splitter Clicked");
}
});
- TextField field = new TextField("");
- field.setSizeFull();
- hsplit.addComponent(field);
+ TextArea area = new TextArea("");
+ area.setSizeFull();
+ hsplit.addComponent(area);
final VerticalSplitPanel vsplit = new VerticalSplitPanel();
vsplit.setSizeFull();
vsplit.setImmediate(true);
vsplit.setSplitPosition(10, Sizeable.UNITS_PERCENTAGE, vsplitReversed);
vsplit.addListener(new SplitterClickListener() {
+ @Override
public void splitterClick(SplitterClickEvent event) {
getMainWindow().showNotification("Vertical Splitter Clicked");
}
@@ -48,19 +50,20 @@ public class SplitPanelReversePosition extends TestBase {
addComponent(hsplit);
- field = new TextField("");
- field.setSizeFull();
- vsplit.addComponent(field);
+ area = new TextArea("");
+ area.setSizeFull();
+ vsplit.addComponent(area);
- field = new TextField("");
- field.setSizeFull();
- vsplit.addComponent(field);
+ area = new TextArea("");
+ area.setSizeFull();
+ vsplit.addComponent(area);
HorizontalLayout buttons = new HorizontalLayout();
buttons.setSpacing(true);
buttons.addComponent(new Button("Swap horizontal positioning",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
hsplitReversed = !hsplitReversed;
hsplit.setSplitPosition(100, Sizeable.UNITS_PIXELS,
@@ -71,6 +74,7 @@ public class SplitPanelReversePosition extends TestBase {
buttons.addComponent(new Button("Swap vertical positioning",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
vsplitReversed = !vsplitReversed;
vsplit.setSplitPosition(10, Sizeable.UNITS_PERCENTAGE,
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
index 49a5915999..08e602241f 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java
@@ -4,9 +4,9 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window.Notification;
public class SplitPanelSplitterWidth extends TestBase {
@@ -47,6 +47,7 @@ public class SplitPanelSplitterWidth extends TestBase {
getLayout().addComponent(
new Button("Unlock", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
split.setLocked(false);
split2.setLocked(false);
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSwapComponents.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSwapComponents.java
index 470a47f160..26abd0a782 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSwapComponents.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelSwapComponents.java
@@ -19,6 +19,7 @@ public class SplitPanelSwapComponents extends TestBase {
getLayout().addComponent(hsplit);
Button swap = new Button("Swap components", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Component first = hsplit.getFirstComponent();
hsplit.removeComponent(first);
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
index 4e6a7730e7..e80ad29426 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java
@@ -5,9 +5,9 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class SplitPanelWidthOnResize extends AbstractTestCase {
@@ -15,7 +15,7 @@ public class SplitPanelWidthOnResize extends AbstractTestCase {
public void init() {
VerticalLayout layout = new VerticalLayout();
layout.setSizeFull();
- Window w = new Window("", layout);
+ LegacyWindow w = new LegacyWindow("", layout);
setMainWindow(w);
HorizontalSplitPanel splitPanel = new HorizontalSplitPanel();
Button button = new NativeButton("A huge button");
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java
index f7c3dd84e4..2a730da9be 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java
@@ -276,6 +276,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase {
Button disableMinimum = new Button("Disable min limit",
new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
togglableSplitPanel.setMinSplitPosition(0,
Sizeable.UNITS_PERCENTAGE);
@@ -284,6 +285,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase {
});
Button enableMinimum = new Button("Enable min limit",
new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
togglableSplitPanel.setMinSplitPosition(10,
Sizeable.UNITS_PERCENTAGE);
@@ -292,6 +294,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase {
});
Button disableMaximum = new Button("Disable max limit",
new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
togglableSplitPanel.setMaxSplitPosition(100,
Sizeable.UNITS_PERCENTAGE);
@@ -300,6 +303,7 @@ public class SplitPanelWithMinimumAndMaximum extends TestBase {
});
Button enableMaximum = new Button("Enable max limit",
new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
togglableSplitPanel.setMaxSplitPosition(80,
Sizeable.UNITS_PERCENTAGE);
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java
deleted file mode 100644
index e0a4c19836..0000000000
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanels.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package com.vaadin.tests.components.splitpanel;
-
-import java.util.LinkedHashMap;
-
-import com.vaadin.ui.SplitPanel;
-
-@SuppressWarnings("deprecation")
-public class SplitPanels extends AbstractSplitPanelTest<SplitPanel> {
-
- private Command<SplitPanel, Integer> orientationCommand = new Command<SplitPanel, Integer>() {
-
- public void execute(SplitPanel c, Integer value, Object data) {
- c.setOrientation(value);
- }
- };
-
- @Override
- protected Class<SplitPanel> getTestClass() {
- return SplitPanel.class;
- }
-
- @Override
- protected void createActions() {
- super.createActions();
- createOrientationSelect(CATEGORY_FEATURES);
-
- }
-
- private void createOrientationSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Horizontal", SplitPanel.ORIENTATION_HORIZONTAL);
- options.put("Vertical", SplitPanel.ORIENTATION_VERTICAL);
- createSelectAction("Orientation", category, options, "Horizontal",
- orientationCommand);
-
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
index 6e651adcda..cf67caccb7 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelBasicStates.html
@@ -86,7 +86,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item2</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[2]/VMenuBar[0]#item3</td>
<td>38,9</td>
</tr>
<tr>
@@ -208,7 +208,6 @@
<td></td>
<td>enabled</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelSplitterClick.html b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelSplitterClick.html
index ed5f191a65..cc384b6de6 100644
--- a/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelSplitterClick.html
+++ b/tests/testbench/com/vaadin/tests/components/splitpanel/VerticalSplitPanelSplitterClick.html
@@ -46,7 +46,7 @@
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::PID_SLog_row_0</td>
- <td>1. SplitterClickEvent: left at -1,-1</td>
+ <td>1. SplitterClickEvent: left at 0,0</td>
</tr>
<tr>
<td>screenCapture</td>
@@ -61,7 +61,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[0]/VMenuBar[0]#item6</td>
+ <td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::Root/VOverlay[0]/VMenuBar[0]#item5</td>
<td>73,7</td>
</tr>
<tr>
@@ -78,12 +78,12 @@
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::PID_StestComponent/domChild[0]/domChild[2]/domChild[0]</td>
- <td>0,0</td>
+ <td>5,5</td>
</tr>
<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestscomponentssplitpanelVerticalSplitPanels::PID_SLog_row_0</td>
- <td>3. SplitterClickEvent: left at -1,-1</td>
+ <td>3. SplitterClickEvent: left at 5,5</td>
</tr>
<tr>
<td>screenCapture</td>
diff --git a/tests/testbench/com/vaadin/tests/components/table/AddItemToEmptyTable.java b/tests/testbench/com/vaadin/tests/components/table/AddItemToEmptyTable.java
index e8445f8422..bde50af013 100644
--- a/tests/testbench/com/vaadin/tests/components/table/AddItemToEmptyTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/AddItemToEmptyTable.java
@@ -20,6 +20,7 @@ public class AddItemToEmptyTable extends TestBase {
cb.setImmediate(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if ((Boolean) event.getProperty().getValue()) {
rightTable.setColumnWidth("name", 150);
@@ -36,6 +37,7 @@ public class AddItemToEmptyTable extends TestBase {
cb.setImmediate(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if ((Boolean) event.getProperty().getValue()) {
rightTable.setColumnWidth("info", 20);
@@ -71,6 +73,7 @@ public class AddItemToEmptyTable extends TestBase {
Button b = new Button("Add item", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object id = rightTable.addItem();
Item item = rightTable.getItem(id);
@@ -83,6 +86,7 @@ public class AddItemToEmptyTable extends TestBase {
b = new Button("Clear", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
rightTable.removeAllItems();
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.java b/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.java
index 5486d6248d..80b136d2ab 100644
--- a/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.java
+++ b/tests/testbench/com/vaadin/tests/components/table/AddNonRenderedRow.java
@@ -22,6 +22,7 @@ public class AddNonRenderedRow extends TestBase {
Button addrowButton = new Button("Add row");
addrowButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent pEvent) {
addRow();
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/CellStyleGeneratorTest.java b/tests/testbench/com/vaadin/tests/components/table/CellStyleGeneratorTest.java
index 08bbd0790f..35f35c1407 100644
--- a/tests/testbench/com/vaadin/tests/components/table/CellStyleGeneratorTest.java
+++ b/tests/testbench/com/vaadin/tests/components/table/CellStyleGeneratorTest.java
@@ -16,6 +16,7 @@ public class CellStyleGeneratorTest extends TestBase {
CellStyleGenerator g = new CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if (propertyId != null && propertyId.equals("red")) {
return "red";
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java b/tests/testbench/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java
index 95e94bcd47..08b65e2ef5 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java
@@ -30,10 +30,12 @@ public class ColumnCollapsingAndColumnExpansion extends TestBase {
final Action H = new Action("Toggle Col2");
final Action[] actions = new Action[] { H };
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
table.setColumnCollapsed("Col2",
!table.isColumnCollapsed("Col2"));
@@ -55,6 +57,7 @@ public class ColumnCollapsingAndColumnExpansion extends TestBase {
final TextField tf = new TextField("Column name (ColX)");
Button hide = new Button("Collapse", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(tf.getValue(), true);
}
@@ -63,6 +66,7 @@ public class ColumnCollapsingAndColumnExpansion extends TestBase {
Button show = new Button("Show", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(tf.getValue(), false);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java b/tests/testbench/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java
index d3dfa61ceb..2898750113 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java
@@ -23,6 +23,7 @@ public class ColumnGeneratorAddingOrder extends TestBase {
Table t = new Table();
t.addGeneratedColumn("col2", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Button("generated b c2");
@@ -39,6 +40,7 @@ public class ColumnGeneratorAddingOrder extends TestBase {
t.setContainerDataSource(c);
t.addGeneratedColumn("col1", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Button("generated b c1");
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
index 0c625f1c5d..324d1a63cf 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnHeaderAlignments.java
@@ -4,8 +4,6 @@ import com.vaadin.data.Item;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Select;
@@ -32,19 +30,21 @@ public class ColumnHeaderAlignments extends TestBase {
theme.setNullSelectionAllowed(false);
theme.setImmediate(true);
theme.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setTheme(String.valueOf(event.getProperty().getValue()));
}
});
addComponent(theme);
- CheckBox footers = new CheckBox("Show footers", new ClickListener() {
- public void buttonClick(ClickEvent event) {
- fooTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
- barTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
- bazTable.setFooterVisible((Boolean) event.getButton()
- .getValue());
+ CheckBox footers = new CheckBox("Show footers");
+ footers.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean visible = (Boolean) event.getProperty().getValue();
+ fooTable.setFooterVisible(visible);
+ barTable.setFooterVisible(visible);
+ bazTable.setFooterVisible(visible);
}
});
footers.setImmediate(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnReorderEvent.java b/tests/testbench/com/vaadin/tests/components/table/ColumnReorderEvent.java
index 4c1fc70e5e..f32633eece 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnReorderEvent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnReorderEvent.java
@@ -83,6 +83,7 @@ public class ColumnReorderEvent extends TestBase {
table.setColumnHeader("lastname", "LastName");
table.addListener(new Table.ColumnReorderListener() {
+ @Override
public void columnReorder(
com.vaadin.ui.Table.ColumnReorderEvent event) {
order.setValue(aToString(table.getVisibleColumns()));
diff --git a/tests/testbench/com/vaadin/tests/components/table/ColumnResizeEvent.java b/tests/testbench/com/vaadin/tests/components/table/ColumnResizeEvent.java
index 29131b8d7a..f092ba8bca 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ColumnResizeEvent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ColumnResizeEvent.java
@@ -84,6 +84,7 @@ public class ColumnResizeEvent extends TestBase {
column3Width.setValue(table.getColumnWidth("150pxfixedCol") + "px");
table.addListener(new ColumnResizeListener() {
+ @Override
public void columnResize(com.vaadin.ui.Table.ColumnResizeEvent event) {
if (event.getPropertyId().equals("firstname")) {
diff --git a/tests/testbench/com/vaadin/tests/components/table/ContainerChangeWithPartlySamePropertyIds.java b/tests/testbench/com/vaadin/tests/components/table/ContainerChangeWithPartlySamePropertyIds.java
index b8e9226ad2..c76edca40d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ContainerChangeWithPartlySamePropertyIds.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ContainerChangeWithPartlySamePropertyIds.java
@@ -68,6 +68,7 @@ public class ContainerChangeWithPartlySamePropertyIds extends TestBase {
Button switchContainerButton = new Button("switch container");
switchContainerButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (testTable.getContainerDataSource() == containerA) {
testTable.setContainerDataSource(containerB);
@@ -80,6 +81,7 @@ public class ContainerChangeWithPartlySamePropertyIds extends TestBase {
Button clearButton = new Button("clear (click twice)");
clearButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
me.removeComponent(testTable);
diff --git a/tests/testbench/com/vaadin/tests/components/table/ContainerSizeChange.java b/tests/testbench/com/vaadin/tests/components/table/ContainerSizeChange.java
index 84e98deffb..c24be6de96 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ContainerSizeChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ContainerSizeChange.java
@@ -32,6 +32,7 @@ public class ContainerSizeChange extends TestBase {
Button b = new Button("Decrease size", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ds.decreaseSize();
}
@@ -42,6 +43,7 @@ public class ContainerSizeChange extends TestBase {
b = new Button("Increase size", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ds.increaseSize();
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java b/tests/testbench/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java
index 86646f522f..c52f57358c 100644
--- a/tests/testbench/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java
+++ b/tests/testbench/com/vaadin/tests/components/table/DisabledTableShouldNotSendPageLengthUpdates.java
@@ -16,6 +16,7 @@ public class DisabledTableShouldNotSendPageLengthUpdates extends TestBase {
HorizontalSplitPanel split = new HorizontalSplitPanel();
table.addContainerProperty("name", Integer.class, 0);
Button button = new Button("Add items", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
for (int i = 0; i < 5; i++) {
Object id = table.addItem();
diff --git a/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java
new file mode 100644
index 0000000000..920ccc2038
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/DoublesInTable.java
@@ -0,0 +1,297 @@
+package com.vaadin.tests.components.table;
+
+import java.math.BigDecimal;
+import java.text.NumberFormat;
+import java.util.Date;
+import java.util.Locale;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.StringToNumberConverter;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Table;
+
+public class DoublesInTable extends TestBase {
+ BeanItemContainer<Person> personBeanItemContainer = new BeanItemContainer<Person>(
+ Person.class);
+
+ private Table table;
+
+ private Log log = new Log(5);
+
+ private ComboBox localeSelect;
+
+ private CheckBox useCustomConverters;
+
+ private CheckBox editMode;
+
+ @Override
+ protected void setup() {
+ editMode = new CheckBox("Edit mode");
+ editMode.setImmediate(true);
+ editMode.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setEditable(editMode.getValue());
+
+ }
+ });
+
+ useCustomConverters = new CheckBox("Use custom converters");
+ useCustomConverters.setImmediate(true);
+ useCustomConverters.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ recreateTable();
+ }
+ });
+
+ localeSelect = createLocaleSelect();
+ personBeanItemContainer = createContainer(100);
+ addComponent(log);
+ addComponent(localeSelect);
+ addComponent(useCustomConverters);
+ addComponent(editMode);
+ recreateTable();
+
+ }
+
+ private ComboBox createLocaleSelect() {
+ ComboBox cb = new ComboBox();
+ cb.setNullSelectionAllowed(false);
+ for (Locale l : Locale.getAvailableLocales()) {
+ cb.addItem(l);
+ }
+ cb.setImmediate(true);
+ cb.setValue(Locale.US);
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ recreateTable();
+ }
+ });
+ return cb;
+ }
+
+ protected void recreateTable() {
+ Table newTable = createTable(useCustomConverters.getValue(),
+ (Locale) localeSelect.getValue());
+ newTable.setEditable(editMode.getValue());
+ if (table == null) {
+ addComponent(newTable);
+ } else {
+ replaceComponent(table, newTable);
+ }
+ table = newTable;
+ }
+
+ private static BeanItemContainer<Person> createContainer(int nr) {
+ BeanItemContainer<Person> bic = new BeanItemContainer<Person>(
+ Person.class);
+ for (int i = 1; i <= nr; i++) {
+ Person p = new Person();
+ p.setFirstName("First " + i);
+ p.setLastName("Last " + i);
+ p.setAge(i);
+ p.setDeceased((i % 5 - 2) == 0);
+ p.setEmail("person" + i + "@mail.com");
+ p.setRent(new BigDecimal(i * 1250.25));
+ p.setSalary(3000 + i);
+ p.setSex((i % 4) == 0 ? Sex.MALE : Sex.FEMALE);
+ p.setBirthDate(new Date(2011 - 1900 - p.getAge(), 11 - 1, 24));
+ if (i % 42 == 0) {
+ p.setSex(Sex.UNKNOWN);
+ }
+ String city = "City " + (i / 10);
+ Country country = Country.FINLAND;
+ Address address = new Address("Street " + i, 12345 + i * 2, city,
+ country);
+ p.setAddress(address);
+ bic.addBean(p);
+ }
+
+ return bic;
+ }
+
+ protected Table createTable(boolean useCustomConverters, Locale locale) {
+ Table t = new Table("Persons");
+ t.setLocale(locale);
+ t.setContainerDataSource(personBeanItemContainer);
+ t.setSortDisabled(false);
+ if (useCustomConverters) {
+ addConverters(t);
+ }
+ t.setSelectable(true);
+ t.setImmediate(true);
+ t.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ log.log("Value is now: " + event.getProperty().getValue());
+
+ }
+ });
+ return t;
+ }
+
+ private void addConverters(Table t) {
+ t.setConverter("sex", new Converter<String, Sex>() {
+
+ @Override
+ public Sex convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // not used in this test - Table only converts to presentation
+ return null;
+ }
+
+ @Override
+ public String convertToPresentation(Sex value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ value = Sex.UNKNOWN;
+ }
+ return value.getStringRepresentation();
+ }
+
+ @Override
+ public Class<Sex> getModelType() {
+ return Sex.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("deceased", new Converter<String, Boolean>() {
+
+ @Override
+ public Boolean convertToModel(String value, Locale locale) {
+ // not used in this test - Table only converts from source to
+ // target
+ return null;
+ }
+
+ @Override
+ public String convertToPresentation(Boolean value, Locale locale) {
+ if (value == null || value) {
+ return "YES, DEAD!";
+ } else {
+ return "-";
+ }
+ }
+
+ @Override
+ public Class<Boolean> getModelType() {
+ return Boolean.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("age", new Converter<String, Integer>() {
+
+ @Override
+ public Integer convertToModel(String value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ // not used in this test - Table only converts from source to
+ // target
+ return null;
+ }
+
+ @Override
+ public String convertToPresentation(Integer value, Locale locale)
+ throws com.vaadin.data.util.converter.Converter.ConversionException {
+ if (value == null) {
+ return null;
+ }
+ if (value < 3) {
+ return value + " (baby)";
+ } else if (value < 7) {
+ return value + " (kid)";
+ } else if (value < 18) {
+ return value + " (young)";
+ } else {
+ return value + "";
+ }
+ }
+
+ @Override
+ public Class<Integer> getModelType() {
+ return Integer.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+ });
+ t.setConverter("address", new Converter<String, Address>() {
+
+ @Override
+ public Address convertToModel(String value, Locale locale)
+ throws ConversionException {
+ // not used in this test - Table only converts to presentation
+ return null;
+ }
+
+ @Override
+ public String convertToPresentation(Address value, Locale locale)
+ throws ConversionException {
+ return value.getStreetAddress() + ", " + value.getCity() + " ("
+ + value.getCountry() + ")";
+ }
+
+ @Override
+ public Class<Address> getModelType() {
+ return Address.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+
+ });
+
+ t.setConverter("rent", new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getCurrencyInstance(locale);
+ // DecimalFormat df = new DecimalFormat();
+ // df.setDecimalSeparatorAlwaysShown(true);
+ // df.setGroupingUsed(true);
+ // df.setMinimumFractionDigits(2);
+ // df.setMaximumFractionDigits(2);
+ // return df;
+ }
+ });
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
index 5f64dec443..5db294088a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableModeChange.java
@@ -44,6 +44,7 @@ public class EditableModeChange extends TestBase {
items.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
if (event.isDoubleClick()) {
selectionEvent = event;
@@ -74,7 +75,7 @@ public class EditableModeChange extends TestBase {
private class ItemFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (selectionEvent != null) {
if ((selectionEvent.getItemId().equals(itemId))
diff --git a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
index 6561ff0076..88c7c76889 100644
--- a/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
+++ b/tests/testbench/com/vaadin/tests/components/table/EditableTableLeak.java
@@ -7,6 +7,9 @@ import java.io.Serializable;
import java.util.HashMap;
import com.vaadin.data.Container;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.Button;
@@ -23,7 +26,7 @@ public class EditableTableLeak extends TestBase {
private final Table table = new Table("ISO-3166 Country Codes and flags");
private final CheckBox useFieldFactory = new CheckBox(
"Use a caching TableFieldFactory");
- private final Label sizeLabel = new Label("", Label.CONTENT_XHTML);
+ private final Label sizeLabel = new Label("", ContentMode.XHTML);
private long size = 0;
@@ -57,10 +60,10 @@ public class EditableTableLeak extends TestBase {
}
private static class CachingFieldFactory extends DefaultFieldFactory {
- private final HashMap<Object, HashMap<Object, Field>> cache = new HashMap<Object, HashMap<Object, Field>>();
+ private final HashMap<Object, HashMap<Object, Field<?>>> cache = new HashMap<Object, HashMap<Object, Field<?>>>();
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (cache.containsKey(itemId)) {
if (cache.get(itemId) != null
@@ -68,10 +71,10 @@ public class EditableTableLeak extends TestBase {
return cache.get(itemId).get(propertyId);
}
}
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (!cache.containsKey(itemId)) {
- cache.put(itemId, new HashMap<Object, Field>());
+ cache.put(itemId, new HashMap<Object, Field<?>>());
}
cache.get(itemId).put(propertyId, f);
return f;
@@ -83,10 +86,11 @@ public class EditableTableLeak extends TestBase {
protected void setup() {
addComponent(useFieldFactory);
useFieldFactory.setImmediate(true);
- useFieldFactory.addListener(new Button.ClickListener() {
+ useFieldFactory.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- if ((Boolean) useFieldFactory.getValue()) {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (useFieldFactory.getValue()) {
table.setTableFieldFactory(new CachingFieldFactory());
} else {
table.setTableFieldFactory(DefaultFieldFactory.get());
@@ -108,6 +112,7 @@ public class EditableTableLeak extends TestBase {
addComponent(sizeLabel);
addComponent(new Button("Show size of the table", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.requestRepaintAll();
updateSize();
@@ -116,6 +121,7 @@ public class EditableTableLeak extends TestBase {
}));
addComponent(new Button("Select the second row", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.select("AL");
updateSize();
diff --git a/tests/testbench/com/vaadin/tests/components/table/Footer.java b/tests/testbench/com/vaadin/tests/components/table/Footer.java
index d6a9853fff..7fd8d3563f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/Footer.java
+++ b/tests/testbench/com/vaadin/tests/components/table/Footer.java
@@ -50,8 +50,9 @@ public class Footer extends TestBase {
final CheckBox visible = new CheckBox("Footers Visible", true);
visible.setImmediate(true);
visible.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- table.setFooterVisible(visible.booleanValue());
+ table.setFooterVisible((Boolean) visible.getValue());
}
});
@@ -61,6 +62,7 @@ public class Footer extends TestBase {
final TextField footer1Value = new TextField(null, "Footer1");
footer1Value.setImmediate(true);
Button footer1Btn = new Button("Change", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnFooter("col1",
footer1Value.getValue() == null ? "" : footer1Value
@@ -75,6 +77,7 @@ public class Footer extends TestBase {
final TextField footer2Value = new TextField(null, "Footer2");
footer2Value.setImmediate(true);
Button footer2Btn = new Button("Change", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnFooter("col2",
footer2Value.getValue() == null ? "" : footer2Value
@@ -89,6 +92,7 @@ public class Footer extends TestBase {
final TextField footer3Value = new TextField(null, "Footer3");
footer3Value.setImmediate(true);
Button footer3Btn = new Button("Change", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnFooter("col3",
footer3Value.getValue() == null ? "" : footer3Value
diff --git a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
index b92d6ef362..08dc47908a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
+++ b/tests/testbench/com/vaadin/tests/components/table/FooterClick.java
@@ -2,11 +2,11 @@ package com.vaadin.tests.components.table;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.FooterClickEvent;
@@ -42,8 +42,9 @@ public class FooterClick extends TestBase {
// Add a footer click listener
table.addListener(new Table.FooterClickListener() {
+ @Override
public void footerClick(FooterClickEvent event) {
- columnField.setValue(event.getPropertyId());
+ columnField.setValue(String.valueOf(event.getPropertyId()));
log.log("Clicked on footer: " + event.getPropertyId());
}
});
@@ -51,10 +52,11 @@ public class FooterClick extends TestBase {
CheckBox immediateCheckbox = new CheckBox("Immediate");
immediateCheckbox.setImmediate(true);
immediateCheckbox.setValue(table.isImmediate());
- immediateCheckbox.addListener(new ClickListener() {
+ immediateCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setImmediate(event.getButton().booleanValue());
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setImmediate((Boolean) event.getProperty().getValue());
}
});
@@ -62,13 +64,15 @@ public class FooterClick extends TestBase {
"Column reordering allowed");
columnReorderingCheckbox.setImmediate(true);
columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
- columnReorderingCheckbox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- table.setColumnReorderingAllowed(event.getButton()
- .booleanValue());
- }
- });
+ columnReorderingCheckbox
+ .addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setColumnReorderingAllowed((Boolean) event
+ .getProperty().getValue());
+ }
+ });
addComponent(immediateCheckbox);
addComponent(columnReorderingCheckbox);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
index 3cb11781b1..b335e34d84 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderClick.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.components.table;
import com.vaadin.data.Container;
import com.vaadin.data.Item;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.HeaderClickEvent;
@@ -28,28 +28,31 @@ public class HeaderClick extends TestBase {
// Add a header click listener
table.addListener(new Table.HeaderClickListener() {
+ @Override
public void headerClick(HeaderClickEvent event) {
- columnField.setValue(event.getPropertyId());
+ columnField.setValue(String.valueOf(event.getPropertyId()));
}
});
CheckBox immediateCheckbox = new CheckBox("Immediate");
immediateCheckbox.setImmediate(true);
immediateCheckbox.setValue(table.isImmediate());
- immediateCheckbox.addListener(new ClickListener() {
+ immediateCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setImmediate(event.getButton().booleanValue());
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setImmediate((Boolean) event.getProperty().getValue());
}
});
CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
sortEnabledCheckbox.setImmediate(true);
- sortEnabledCheckbox.setValue(!table.isSortDisabled());
- sortEnabledCheckbox.addListener(new ClickListener() {
+ sortEnabledCheckbox.setValue(table.isSortEnabled());
+ sortEnabledCheckbox.addListener(new Property.ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- table.setSortDisabled(!event.getButton().booleanValue());
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setSortDisabled(!(Boolean) event.getProperty().getValue());
}
});
@@ -57,13 +60,15 @@ public class HeaderClick extends TestBase {
"Column reordering allowed");
columnReorderingCheckbox.setImmediate(true);
columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
- columnReorderingCheckbox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- table.setColumnReorderingAllowed(event.getButton()
- .booleanValue());
- }
- });
+ columnReorderingCheckbox
+ .addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ table.setColumnReorderingAllowed((Boolean) event
+ .getProperty().getValue());
+ }
+ });
addComponent(immediateCheckbox);
addComponent(sortEnabledCheckbox);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
index 091891043f..ec82b36575 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderFooterClickLeftRightMiddle.java
@@ -33,6 +33,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
immediateCheckbox.setValue(table.isImmediate());
immediateCheckbox.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
table.setImmediate((Boolean) event.getProperty().getValue());
}
@@ -45,6 +46,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
private HeaderClickListener headerClickListener = new HeaderClickListener() {
+ @Override
public void headerClick(HeaderClickEvent event) {
String type = event.isDoubleClick() ? "Double click"
: "Click";
@@ -55,6 +57,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
};
+ @Override
public void valueChange(ValueChangeEvent event) {
if (table.getListeners(HeaderClickEvent.class).isEmpty()) {
table.addListener(headerClickListener);
@@ -72,6 +75,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
private FooterClickListener footerClickListener = new FooterClickListener() {
+ @Override
public void footerClick(FooterClickEvent event) {
String type = event.isDoubleClick() ? "Double click"
: "Click";
@@ -81,6 +85,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
}
};
+ @Override
public void valueChange(ValueChangeEvent event) {
if (table.getListeners(FooterClickEvent.class).isEmpty()) {
table.addListener(footerClickListener);
@@ -93,10 +98,11 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
CheckBox sortEnabledCheckbox = new CheckBox("Sortable");
sortEnabledCheckbox.setImmediate(true);
- sortEnabledCheckbox.setValue(!table.isSortDisabled());
+ sortEnabledCheckbox.setValue(table.isSortEnabled());
sortEnabledCheckbox.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- table.setSortDisabled(!(Boolean) event.getProperty().getValue());
+ table.setSortEnabled((Boolean) event.getProperty().getValue());
}
});
@@ -106,6 +112,7 @@ public class HeaderFooterClickLeftRightMiddle extends TestBase {
columnReorderingCheckbox.setValue(table.isColumnReorderingAllowed());
columnReorderingCheckbox.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
table.setColumnReorderingAllowed((Boolean) event.getProperty()
.getValue());
diff --git a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
index bf1f9ca883..6dafdd3dd5 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HeaderUpdateWhenNoRows.java
@@ -1,7 +1,8 @@
package com.vaadin.tests.components.table;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Table;
@@ -16,16 +17,18 @@ public class HeaderUpdateWhenNoRows extends TestBase {
table.setHeight("100px");
table.setImmediate(true);
- CheckBox showHeaders = new CheckBox("Show headers",
- new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- } else {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
- }
- }
- });
+ final CheckBox showHeaders = new CheckBox("Show headers");
+ showHeaders.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (showHeaders.getValue()) {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ } else {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
+ }
+ }
+ });
showHeaders.setImmediate(true);
showHeaders.setValue(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java b/tests/testbench/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java
index 007c93573f..4a729d221f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HiddenColumnsExpandRatios.java
@@ -35,12 +35,14 @@ public class HiddenColumnsExpandRatios extends TestBase {
}
addComponent(new Button("All", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setVisibleColumns(table.getContainerPropertyIds()
.toArray());
}
}));
addComponent(new Button("Some", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setWidth("100px");
table.setWidth("800px");
diff --git a/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java b/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
index 5cd9f964a3..434d650d6d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
+++ b/tests/testbench/com/vaadin/tests/components/table/HugeRowCount.java
@@ -20,8 +20,9 @@ public class HugeRowCount extends TestBase {
container.setSize(100000);
final TextField tf = new TextField("Rows");
- tf.setValue(100000);
+ tf.setValue(String.valueOf(100000));
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
container.setSize(Integer.parseInt(tf.getValue().toString()));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.html b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.html
index 2c40672c0d..1d7b2b6bf9 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.html
+++ b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.html
@@ -130,12 +130,12 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableItemClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[5]</td>
+ <td>vaadin=runcomvaadintestscomponentstableItemClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[5]</td>
<td>195,142</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableItemClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[5]</td>
+ <td>vaadin=runcomvaadintestscomponentstableItemClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[5]</td>
<td>582,1</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java
index 537461ce0f..4bdb20adea 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java
@@ -27,6 +27,7 @@ public class ItemClickEvents extends TestBase {
HorizontalLayout ol = createHorizontalLayout(tree);
Button b = new Button("icon", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (tree.getItemIconPropertyId() == null) {
tree.setItemIconPropertyId("icon");
@@ -55,6 +56,7 @@ public class ItemClickEvents extends TestBase {
"http://www.itmill.com/res/images/itmill_logo.gif"));
tree.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
logEvent(event, "tree");
}
@@ -73,6 +75,7 @@ public class ItemClickEvents extends TestBase {
}
table.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
logEvent(event, "table");
}
@@ -82,6 +85,7 @@ public class ItemClickEvents extends TestBase {
addComponent(log);
addComponent(new Button("Clear log", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.clear();
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/KeyControl.java b/tests/testbench/com/vaadin/tests/components/table/KeyControl.java
index e662db338c..2998940db1 100644
--- a/tests/testbench/com/vaadin/tests/components/table/KeyControl.java
+++ b/tests/testbench/com/vaadin/tests/components/table/KeyControl.java
@@ -41,6 +41,7 @@ public class KeyControl extends TestBase {
layout1.addComponent(table1);
table1.addListener(new Table.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
@SuppressWarnings("unchecked")
Set<String> value = (Set<String>) table1.getValue();
@@ -63,6 +64,7 @@ public class KeyControl extends TestBase {
layout2.addComponent(table2);
table2.addListener(new Table.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String value = table2.getValue() == null ? "No selected items"
: table2.getValue().toString();
@@ -86,6 +88,7 @@ public class KeyControl extends TestBase {
layout3.addComponent(table3);
table3.addListener(new Table.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
@SuppressWarnings("unchecked")
Set<String> value = (Set<String>) table3.getValue();
diff --git a/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java b/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java
index 44a2dcd9a9..bc0601684f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java
@@ -35,6 +35,7 @@ public class KeyboardNavigationWithChangingContent extends TestBase {
new Button("Change elements and selection",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
bic.removeAllItems();
diff --git a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
index a54c3ce447..b9e7fde17a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.table;
import com.vaadin.data.Item;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
@@ -36,7 +37,7 @@ public class LabelEmbeddedClickThroughForTable extends TestBase {
item.getItemProperty("Column 1").setValue("String A");
item.getItemProperty("Column 2").setValue(new Label("Label A"));
item.getItemProperty("Column 3").setValue(
- new Label("<b>Label A</b>", Label.CONTENT_XHTML));
+ new Label("<b>Label A</b>", ContentMode.XHTML));
item.getItemProperty("Column 4").setValue(
new Embedded("An embedded image", new ThemeResource(
"../runo/icons/32/ok.png")));
@@ -48,13 +49,14 @@ public class LabelEmbeddedClickThroughForTable extends TestBase {
.setValue(
new Label(
"<a style=\"color: blue\" href=\"javascript:false\">Label A</a>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
item.getItemProperty("Column 4").setValue(
new Embedded("", new ThemeResource(
"../runo/icons/32/cancel.png")));
table.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
System.out.println("Clickevent on item " + event.getItemId()
+ ", column: " + event.getPropertyId());
diff --git a/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java b/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java
index 2100d3852e..b7379b4f2c 100644
--- a/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java
+++ b/tests/testbench/com/vaadin/tests/components/table/LastColumnNegative.java
@@ -16,6 +16,7 @@ public class LastColumnNegative extends TestBase {
Button addButton = new Button("Add a table",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
wrapper.addComponent(table);
}
@@ -24,6 +25,7 @@ public class LastColumnNegative extends TestBase {
Button removeButton = new Button("Remove a table",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
wrapper.removeComponent(table);
}
@@ -31,6 +33,7 @@ public class LastColumnNegative extends TestBase {
Button shrinkWrapper = new Button("Shrink wrapper",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
wrapper.setWidth("400px");
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java
index 4db9b69070..43a89e4211 100644
--- a/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java
+++ b/tests/testbench/com/vaadin/tests/components/table/LongMultiselect.java
@@ -2,33 +2,29 @@ package com.vaadin.tests.components.table;
import java.util.Collection;
-import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class LongMultiselect extends TestBase {
-
+
private enum ItemProperty {
- COLUMN1,
- COLUMN2
+ COLUMN1, COLUMN2
}
-
+
@Override
protected void setup() {
- VerticalLayout layout = generateLayout();
- addComponent(layout);
- layout.setSizeFull();
+ VerticalLayout layout = generateLayout();
+ addComponent(layout);
+ layout.setSizeFull();
}
- private VerticalLayout generateLayout() {
- VerticalLayout layout = new VerticalLayout();
+ private VerticalLayout generateLayout() {
+ VerticalLayout layout = new VerticalLayout();
- final Table table = new Table("Ticket #8264 table");
+ final Table table = new Table("Ticket #8264 table");
layout.addComponent(table);
table.setWidth("200px");
table.setHeight("170px");
@@ -39,17 +35,19 @@ public class LongMultiselect extends TestBase {
// Create example data
table.addContainerProperty(ItemProperty.COLUMN1, String.class, null);
table.addContainerProperty(ItemProperty.COLUMN2, String.class, null);
- for (int i=1;i<100;i++) {
- table.addItem(new String[]{"Item " + i, null}, i);
+ for (int i = 1; i < 100; i++) {
+ table.addItem(new String[] { "Item " + i, null }, i);
}
- //Add action button
+ // Add action button
layout.addComponent(new Button("Do It", new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
// Set ItemProperty.COLUMN2 for all selected values of table
- Collection selectedIds = (Collection)table.getValue();
+ Collection selectedIds = (Collection) table.getValue();
for (final Object itemId : selectedIds) {
- final Property p = table.getItem(itemId).getItemProperty(ItemProperty.COLUMN2);
+ final Property p = table.getItem(itemId).getItemProperty(
+ ItemProperty.COLUMN2);
if (p.getValue() instanceof String) {
p.setValue(null);
} else {
@@ -58,17 +56,17 @@ public class LongMultiselect extends TestBase {
}
}
}));
-
+
return layout;
- }
+ }
- @Override
- protected String getDescription() {
- return "Multiselecting 94 rows (from \"item 5\" to \"item 98\") and modifying second column of each row selected (press Do It). This should work (update the 2nd column) and not cause JS exception.";
- }
+ @Override
+ protected String getDescription() {
+ return "Multiselecting 94 rows (from \"item 5\" to \"item 98\") and modifying second column of each row selected (press Do It). This should work (update the 2nd column) and not cause JS exception.";
+ }
- @Override
- protected Integer getTicketNumber() {
- return 8264;
- }
+ @Override
+ protected Integer getTicketNumber() {
+ return 8264;
+ }
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/MissingScrollbar.java b/tests/testbench/com/vaadin/tests/components/table/MissingScrollbar.java
index 5f65b40f2f..e51cec2a6d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/MissingScrollbar.java
+++ b/tests/testbench/com/vaadin/tests/components/table/MissingScrollbar.java
@@ -43,6 +43,7 @@ public class MissingScrollbar extends TestBase {
Button b = new Button("Set items to 2", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setContainerDataSource(container2);
}
@@ -51,6 +52,7 @@ public class MissingScrollbar extends TestBase {
b = new Button("Set items to 50", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setContainerDataSource(container50);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
index 93d97cd698..33318c9a95 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
+++ b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.html
@@ -22,9 +22,9 @@
<td></td>
</tr>
<tr>
- <td>assertTextNotPresent</td>
- <td>bar</td>
+ <td>screenCapture</td>
<td></td>
+ <td>bar-hidden</td>
</tr>
<tr>
<td>click</td>
diff --git a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.java b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.java
index a472b43ce7..00965220db 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ModifyContainerProperty.java
@@ -26,12 +26,14 @@ public class ModifyContainerProperty extends TestBase {
table.setContainerDataSource(ic);
addComponent(new Button("Remove container property",
new Button.ClickListener() {
+ @Override
public void buttonClick(com.vaadin.ui.Button.ClickEvent arg0) {
ic.removeContainerProperty("one");
}
}));
addComponent(new Button("Add container property",
new Button.ClickListener() {
+ @Override
public void buttonClick(com.vaadin.ui.Button.ClickEvent arg0) {
boolean added = ic.addContainerProperty("three",
String.class, "three");
diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java b/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java
index d437ab7a04..0e440a95d0 100644
--- a/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/MultiClickingItemThatDetachesTable.java
@@ -21,6 +21,7 @@ public class MultiClickingItemThatDetachesTable extends TestBase {
item.getItemProperty("p1").setValue(i + "");
}
table.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
if (event.isDoubleClick()) {
try {
diff --git a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
index 62fd53d769..06deb98f7f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
+++ b/tests/testbench/com/vaadin/tests/components/table/MultiSelectWithNotIdentityEqualIds.java
@@ -5,6 +5,7 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Table;
@SuppressWarnings("serial")
@@ -19,9 +20,9 @@ public class MultiSelectWithNotIdentityEqualIds extends TestBase {
t.setSelectable(true);
t.setImmediate(true);
t.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- t.getWindow().showNotification(
- "Selected: " + event.getProperty());
+ Notification.show("Selected: " + event.getProperty());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/ProgrammaticUnselectInRange.java b/tests/testbench/com/vaadin/tests/components/table/ProgrammaticUnselectInRange.java
index 758fa4bf1a..0b5b1d139c 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ProgrammaticUnselectInRange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ProgrammaticUnselectInRange.java
@@ -29,6 +29,7 @@ public class ProgrammaticUnselectInRange extends TestBase {
table.addItem(new Object[] { value }, value);
}
table.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateSelectionLabel();
}
@@ -37,6 +38,7 @@ public class ProgrammaticUnselectInRange extends TestBase {
addComponent(table);
addComponent(selectionLabel);
addComponent(new Button("Deselect item 2", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.unselect(Integer.valueOf(2));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
index 5975137976..1bc9cf525d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/table/PropertyValueChange.java
@@ -39,25 +39,28 @@ public class PropertyValueChange extends TestBase {
// Also use column generator in test, to ensure it is possible to build
// columns that update automatically.
ColumnGenerator multiplier = new ColumnGenerator() {
- private int getMultipliedValue(Property p) {
- int i = ((Integer) p.getValue()).intValue();
+ private int getMultipliedValue(Property<Integer> p) {
+ int i = p.getValue().intValue();
return i * 3;
}
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
final Label l = new Label();
- final Property integer = source.getContainerProperty(itemId,
- "integer");
- l.setValue(getMultipliedValue(integer));
+ @SuppressWarnings("unchecked")
+ final Property<Integer> integer = (Property<Integer>) source
+ .getContainerProperty(itemId, "integer");
+ l.setValue(String.valueOf(getMultipliedValue(integer)));
// we must hook value change listener to ensure updates in all use
// cases (eg. edit mode)
if (integer instanceof Property.ValueChangeNotifier) {
Property.ValueChangeNotifier notifier = (Property.ValueChangeNotifier) integer;
notifier.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- l.setValue(getMultipliedValue(integer));
+ l.setValue(String.valueOf(getMultipliedValue(integer)));
}
});
}
@@ -134,7 +137,7 @@ class MyFieldFactory extends DefaultFieldFactory {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (propertyId.equals("text")) {
// replace text fields with comboboxes
@@ -143,6 +146,7 @@ class MyFieldFactory extends DefaultFieldFactory {
cb.setContainerDataSource(texts);
cb.setNewItemsAllowed(true);
cb.setNewItemHandler(new NewItemHandler() {
+ @Override
public void addNewItem(String newItemCaption) {
texts.addItem(newItemCaption);
cb.setValue(newItemCaption);
diff --git a/tests/testbench/com/vaadin/tests/components/table/RowAdditionTest.java b/tests/testbench/com/vaadin/tests/components/table/RowAdditionTest.java
index 82d5508c72..c6d071f34c 100644
--- a/tests/testbench/com/vaadin/tests/components/table/RowAdditionTest.java
+++ b/tests/testbench/com/vaadin/tests/components/table/RowAdditionTest.java
@@ -33,6 +33,7 @@ public class RowAdditionTest extends TestBase {
HorizontalLayout hl = new HorizontalLayout();
hl.addComponent(new Button("Add first", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Item item = container.addItemAt(0, new Object());
item.getItemProperty("column1").setValue("0");
@@ -40,6 +41,7 @@ public class RowAdditionTest extends TestBase {
}));
hl.addComponent(new Button("Add at position 50",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Item item = container.addItemAt(50, new Object());
item.getItemProperty("column1").setValue("50");
@@ -47,6 +49,7 @@ public class RowAdditionTest extends TestBase {
}));
hl.addComponent(new Button("Add at position 100",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Item item = container.addItemAt(100, new Object());
item.getItemProperty("column1").setValue("100");
diff --git a/tests/testbench/com/vaadin/tests/components/table/RowGenerators.java b/tests/testbench/com/vaadin/tests/components/table/RowGenerators.java
index 1ddb03c316..c3bf46c12d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/RowGenerators.java
+++ b/tests/testbench/com/vaadin/tests/components/table/RowGenerators.java
@@ -34,6 +34,7 @@ public class RowGenerators extends TestBase implements RowGenerator {
return c;
}
+ @Override
public GeneratedRow generateRow(Table table, Object itemId) {
if ((Integer) itemId % 5 == 0) {
if ((Integer) itemId % 10 == 0) {
diff --git a/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java
index d3ba232f79..a9d5869e5f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java
+++ b/tests/testbench/com/vaadin/tests/components/table/RowUpdateShouldRetainContextMenu.java
@@ -18,6 +18,7 @@ public class RowUpdateShouldRetainContextMenu extends TestBase {
protected void setup() {
indicator.setWidth("200px");
indicator.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
// Do some changes to the table
table.setColumnHeader("Column", "Column " + ctr);
@@ -49,9 +50,11 @@ public class RowUpdateShouldRetainContextMenu extends TestBase {
table.setHeight("200px");
table.addActionHandler(new Action.Handler() {
+ @Override
public void handleAction(Action action, Object sender, Object target) {
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { new Action("Action 1"),
new Action("Action 2"), };
diff --git a/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java b/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java
index 133a5e83a5..dffab6dbad 100644
--- a/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java
+++ b/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java
@@ -33,6 +33,7 @@ public class SafariRenderingBugWhiteSpace extends TestBase {
table.setSizeFull();
table.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (table.getValue() == null) {
split.setSplitPosition(100, Sizeable.UNITS_PERCENTAGE);
diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
index b4c46a2ca6..75468af247 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ScrollCausesRequestLoop.java
@@ -7,14 +7,14 @@ import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.tests.util.Person;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class ScrollCausesRequestLoop extends AbstractTestCase {
@Override
public void init() {
- setMainWindow(new Window("", new TestView()));
+ setMainWindow(new LegacyWindow("", new TestView()));
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java b/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
index 07a2974052..5cc77f23d9 100644
--- a/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
+++ b/tests/testbench/com/vaadin/tests/components/table/ScrollDetachSynchronization.java
@@ -1,21 +1,18 @@
package com.vaadin.tests.components.table;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class ScrollDetachSynchronization extends AbstractTestCase {
+public class ScrollDetachSynchronization extends TestBase {
@Override
- public void init() {
- Window mainWindow = new Window("Synctest Application");
- mainWindow.setContent(buildLayout());
- setMainWindow(mainWindow);
+ public void setup() {
+ getMainWindow().setContent(buildLayout());
}
@Override
@@ -49,6 +46,8 @@ public class ScrollDetachSynchronization extends AbstractTestCase {
mainLayout.setExpandRatio(firstLayout, 1);
first.addListener(new Button.ClickListener() {
+
+ @Override
public void buttonClick(ClickEvent event) {
if (mainLayout.getComponent(1).equals(secondLayout)) {
mainLayout.replaceComponent(secondLayout, firstLayout);
@@ -57,6 +56,8 @@ public class ScrollDetachSynchronization extends AbstractTestCase {
}
});
second.addListener(new Button.ClickListener() {
+
+ @Override
public void buttonClick(ClickEvent event) {
if (mainLayout.getComponent(1).equals(firstLayout)) {
mainLayout.replaceComponent(firstLayout, secondLayout);
diff --git a/tests/testbench/com/vaadin/tests/components/table/SelectingItemScrollsRight.java b/tests/testbench/com/vaadin/tests/components/table/SelectingItemScrollsRight.java
index cfe0301775..d9401c21b4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/SelectingItemScrollsRight.java
+++ b/tests/testbench/com/vaadin/tests/components/table/SelectingItemScrollsRight.java
@@ -14,6 +14,7 @@ public class SelectingItemScrollsRight extends TestBase {
table.setWidth("300px");
table.setColumnWidth("Column", 500);
table.addGeneratedColumn("Column", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Label(
diff --git a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java
index 536348a393..aebb494247 100644
--- a/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java
+++ b/tests/testbench/com/vaadin/tests/components/table/SetCurrentPageFirstItemId.java
@@ -30,6 +30,7 @@ public class SetCurrentPageFirstItemId extends TestBase {
Button addrowButton = new Button("Add row");
addrowButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent pEvent) {
Object id = addRow();
table.setCurrentPageFirstItemId(id);
diff --git a/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.html b/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.html
new file mode 100644
index 0000000000..51f13af004
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.html
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.table.SortLabelsInTable?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Text 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td>
+ <td>Label 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[14]/domChild[0]/domChild[0]</td>
+ <td>Text 14</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td>
+ <td>Label 14</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td>22,11</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Text 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>Text 10</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[14]/domChild[0]/domChild[0]</td>
+ <td>Text 4</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td>
+ <td>Label 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td>
+ <td>Label 10</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td>
+ <td>Label 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td>
+ <td>Label 4</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]</td>
+ <td>14,3</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Text 9</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[0]/domChild[0]</td>
+ <td>Text 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[14]/domChild[0]/domChild[0]</td>
+ <td>Text 13</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td>
+ <td>Label 9</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td>
+ <td>Label 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td>
+ <td>Label 13</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td>
+ <td>28,13</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Text 9</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[8]/domChild[0]/domChild[0]</td>
+ <td>Text 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[14]/domChild[0]/domChild[0]</td>
+ <td>Text 13</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td>
+ <td>Label 9</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[8]/VLabel[0]</td>
+ <td>Label 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td>
+ <td>Label 13</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[2]</td>
+ <td>26,9</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>Text 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>Text 10</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[14]/domChild[0]/domChild[0]</td>
+ <td>Text 4</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[0]/VLabel[0]</td>
+ <td>Label 0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[2]/VLabel[0]</td>
+ <td>Label 10</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[11]/VLabel[0]</td>
+ <td>Label 19</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentstableSortLabelsInTable::/VVerticalLayout[0]/VVerticalLayout[0]/VScrollTable[0]/FocusableScrollPanel[0]/VScrollTable$VScrollTableBody[0]/VScrollTable$VScrollTableBody$VScrollTableRow[14]/VLabel[0]</td>
+ <td>Label 4</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.java b/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.java
new file mode 100644
index 0000000000..d46b9bf01d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/SortLabelsInTable.java
@@ -0,0 +1,38 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Item;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Table;
+
+public class SortLabelsInTable extends TestBase {
+
+ @Override
+ protected void setup() {
+ Table t = new Table("A table with a text column and a Label column");
+ t.addContainerProperty("text", String.class, null);
+ t.addContainerProperty("label", Label.class, null);
+
+ for (int i = 0; i < 20; i++) {
+ Item item = t.addItem("" + i);
+ item.getItemProperty("text").setValue("Text " + i);
+ item.getItemProperty("label").setValue(new Label("Label " + i));
+ }
+ addComponent(t);
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8845;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
index cc9dec0965..15872aa849 100644
--- a/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
+++ b/tests/testbench/com/vaadin/tests/components/table/SortLongTable.java
@@ -1,9 +1,9 @@
package com.vaadin.tests.components.table;
import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class SortLongTable extends AbstractTestCase {
@@ -11,7 +11,7 @@ public class SortLongTable extends AbstractTestCase {
public void init() {
final int NUMBER_OF_ROWS = 100; // Works with 10
- Window mainWindow = new Window("Table Sort Test");
+ LegacyWindow mainWindow = new LegacyWindow("Table Sort Test");
mainWindow.setSizeFull();
setMainWindow(mainWindow);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java
index a616d4dfb3..18eec814bc 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java
@@ -25,6 +25,7 @@ public class TableAndBrowserContextMenu extends TestBase implements
cb.setImmediate(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (((Boolean) event.getProperty().getValue())) {
table.addListener(TableAndBrowserContextMenu.this);
@@ -40,6 +41,7 @@ public class TableAndBrowserContextMenu extends TestBase implements
cbActionHandler.setImmediate(true);
cbActionHandler.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (((Boolean) event.getProperty().getValue())) {
table.addActionHandler(TableAndBrowserContextMenu.this);
@@ -55,6 +57,7 @@ public class TableAndBrowserContextMenu extends TestBase implements
cbActionHasActions.setImmediate(true);
cbActionHasActions.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
actionHandlerHasActions = ((Boolean) event.getProperty()
.getValue());
@@ -80,6 +83,7 @@ public class TableAndBrowserContextMenu extends TestBase implements
// Add a generated column with a link to Google
table.addGeneratedColumn("Search", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -131,11 +135,13 @@ public class TableAndBrowserContextMenu extends TestBase implements
return 5924;
}
+ @Override
public void itemClick(ItemClickEvent event) {
getMainWindow()
.showNotification("Click using " + event.getButtonName());
}
+ @Override
public Action[] getActions(Object target, Object sender) {
if (!actionHandlerHasActions) {
return null;
@@ -144,6 +150,7 @@ public class TableAndBrowserContextMenu extends TestBase implements
return new Action[] { new Action("test") };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification("Action: " + action.getCaption());
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
index 220d5e8192..75f2679234 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableCacheBuildEfficiency.java
@@ -28,7 +28,7 @@ public class TableCacheBuildEfficiency extends TestBase {
final Table table = new Table() {
@Override
- public Property getContainerProperty(Object itemId,
+ public Property<?> getContainerProperty(Object itemId,
Object propertyId) {
log("Fetched container property \"" + propertyId
+ "\" for item \"" + itemId + "\"");
@@ -45,6 +45,7 @@ public class TableCacheBuildEfficiency extends TestBase {
Button b = new Button("Click to add row", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.addItem();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java b/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java
index ee04813ce6..1a8fc37634 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java
@@ -43,6 +43,7 @@ public class TableClickAndDragOnIconAndComponents extends TestBase {
private static final long serialVersionUID = -5042109683675242407L;
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -53,6 +54,7 @@ public class TableClickAndDragOnIconAndComponents extends TestBase {
private static final long serialVersionUID = -5042109683675242407L;
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -66,6 +68,7 @@ public class TableClickAndDragOnIconAndComponents extends TestBase {
private static final long serialVersionUID = -5042109683675242407L;
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -80,6 +83,7 @@ public class TableClickAndDragOnIconAndComponents extends TestBase {
private static final long serialVersionUID = -5042109683675242407L;
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Embedded embedded = new Embedded(null, new ThemeResource(
@@ -91,10 +95,12 @@ public class TableClickAndDragOnIconAndComponents extends TestBase {
table.setDragMode(TableDragMode.ROW);
table.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent event) {
DataBoundTransferable t = (DataBoundTransferable) event
.getTransferable();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
index 83a02ec44b..5b50eeba23 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
+++ b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.html
@@ -18,82 +18,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>38,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>35,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>24,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>39,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>37,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>51,16</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>19,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>43,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>36,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>27,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>13,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>43,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>27,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>53,16</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>40,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>45,10</td>
</tr>
<tr>
@@ -103,82 +103,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>39,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>37,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>33,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>17,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>49,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>53,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>21,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>32,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>45,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>28,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>15,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>35,5</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>26,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>55,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,7</td>
</tr>
<tr>
@@ -188,82 +188,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>41,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>28,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>16,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>38,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>47,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>30,7</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>16,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>68,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>36,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>48,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>27,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>19,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>22,10</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>39,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>35,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
<td>19,15</td>
</tr>
<tr>
@@ -273,82 +273,82 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>30,8</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>20,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>19,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[3]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>43,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[4]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>44,15</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[5]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>62,12</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[6]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>29,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[7]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>25,13</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[8]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>22,9</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[9]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>30,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[10]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>21,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[11]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>32,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[12]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>34,14</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[13]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>45,11</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[14]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>31,6</td>
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableClickValueChangeInteraction::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[15]/VVerticalLayout[0]/ChildComponentContainer[0]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
<td>45,10</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
index 63c6c753ca..00df9fa3c3 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableClickValueChangeInteraction.java
@@ -4,31 +4,28 @@ import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TableClickValueChangeInteraction extends AbstractTestCase {
-
- final Window mainWindow = new Window();
+public class TableClickValueChangeInteraction extends TestBase {
@Override
- public void init() {
- setMainWindow(mainWindow);
+ public void setup() {
+ GridLayout grid = new GridLayout(4, 4);
+ grid.setSpacing(true);
+ grid.setMargin(true);
- GridLayout layout = new GridLayout(4, 4);
- layout.setSpacing(true);
- layout.setMargin(true);
- mainWindow.setContent(layout);
+ getLayout().removeAllComponents();
+ getLayout().addComponent(grid);
for (int i = 0; i < 16; ++i) {
- mainWindow.addComponent(makeTable((i & 8) > 0, (i & 4) > 0,
- (i & 2) > 0, (i & 1) > 0));
+ grid.addComponent(makeTable((i & 8) > 0, (i & 4) > 0, (i & 2) > 0,
+ (i & 1) > 0));
}
}
@@ -63,6 +60,8 @@ public class TableClickValueChangeInteraction extends AbstractTestCase {
table.setHeight("100px");
if (listenClicks) {
table.addListener(new ItemClickListener() {
+
+ @Override
public void itemClick(ItemClickEvent event) {
table.requestRepaint();
clickLabel.setValue("Click " + event.getItemId());
@@ -71,8 +70,11 @@ public class TableClickValueChangeInteraction extends AbstractTestCase {
}
if (listenValueChanges) {
table.addListener(new ValueChangeListener() {
+
+ @Override
public void valueChange(ValueChangeEvent event) {
- valueChangeLabel.setValue("Value " + event.getProperty());
+ valueChangeLabel.setValue("Value "
+ + event.getProperty().getValue());
}
});
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java b/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java
index fbe7ed88ef..1895191cc4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableColumnResizeContentsWidth.java
@@ -15,6 +15,7 @@ public class TableColumnResizeContentsWidth extends TestBase {
protected void setup() {
final Table table = new Table();
table.addGeneratedColumn(COL1, new ColumnGenerator() {
+ @Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
TextField textField = new TextField();
@@ -30,12 +31,14 @@ public class TableColumnResizeContentsWidth extends TestBase {
addComponent(table);
addComponent(new Button("Increase width", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnWidth(COL1, table.getColumnWidth(COL1) + 20);
table.requestRepaint();
}
}));
addComponent(new Button("Decrease width", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnWidth(COL1, table.getColumnWidth(COL1) - 40);
table.requestRepaint();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java
index 20e198a138..9416ffe70c 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableContextMenu.java
@@ -2,6 +2,7 @@ package com.vaadin.tests.components.table;
import com.vaadin.event.Action;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Table;
public class TableContextMenu extends TestBase {
@@ -15,10 +16,12 @@ public class TableContextMenu extends TestBase {
table.setMultiSelect(true);
table.addActionHandler(new Action.Handler() {
+ @Override
public void handleAction(Action action, Object sender, Object target) {
- getLayout().getWindow().showNotification("Done that :-)");
+ Notification.show("Done that :-)");
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { ACTION_MYACTION };
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableContextMenuOnField.java b/tests/testbench/com/vaadin/tests/components/table/TableContextMenuOnField.java
index 4c6f658a24..3b639be21f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableContextMenuOnField.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableContextMenuOnField.java
@@ -22,11 +22,13 @@ public class TableContextMenuOnField extends TestBase {
table.setMultiSelect(true);
table.addActionHandler(new Action.Handler() {
+ @Override
public void handleAction(Action action, Object sender, Object target) {
// TODO Auto-generated method stub
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { ACTION_MYACTION };
}
@@ -34,6 +36,7 @@ public class TableContextMenuOnField extends TestBase {
table.addGeneratedColumn("layout", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
@@ -42,6 +45,7 @@ public class TableContextMenuOnField extends TestBase {
layout.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
getMainWindow().showNotification("HELLO");
@@ -53,6 +57,7 @@ public class TableContextMenuOnField extends TestBase {
});
table.addGeneratedColumn("textfield", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new TextField();
@@ -60,6 +65,7 @@ public class TableContextMenuOnField extends TestBase {
});
table.addGeneratedColumn("link", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Link("Link", null);
@@ -67,6 +73,7 @@ public class TableContextMenuOnField extends TestBase {
});
table.addGeneratedColumn("button", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Button("Button");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
index 8fde820749..010093bf8f 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableExtraScrollbars.java
@@ -4,9 +4,9 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TableExtraScrollbars extends AbstractTestCase {
@@ -16,7 +16,7 @@ public class TableExtraScrollbars extends AbstractTestCase {
@Override
public void init() {
setTheme("runo");
- Window w = new Window("Table scrollbars bug example");
+ LegacyWindow w = new LegacyWindow("Table scrollbars bug example");
setMainWindow(w);
VerticalLayout vl = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java b/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java
index 776e7956bf..3101615cfd 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableFirstRowFlicker.java
@@ -1,23 +1,23 @@
package com.vaadin.tests.components.table;
-import com.vaadin.Application;
+import com.vaadin.Application.LegacyApplication;
import com.vaadin.data.Container;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Label;
import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class TableFirstRowFlicker extends Application {
+public class TableFirstRowFlicker extends LegacyApplication {
Table t;
@Override
public void init() {
- Window mainWindow = new Window("Table Row Flicker");
- mainWindow.getContent().setSizeFull();
+ LegacyWindow mainWindow = new LegacyWindow(getClass().getName());
setMainWindow(mainWindow);
+ mainWindow.getContent().setSizeFull();
t = new Table();
t.setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
index f7d85f1a3c..bce96ebced 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableHeaderZoom.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.components.table;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class TableHeaderZoom extends TestBase {
@@ -19,7 +19,7 @@ public class TableHeaderZoom extends TestBase {
table.addItem(new Object[] { "" + i, "foo" }, i);
}
- Window main = getMainWindow();
+ LegacyWindow main = getMainWindow();
main.setContent(new CssLayout());
main.addComponent(table);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
index d0b7631f10..0173f928dd 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableHeightWhenHidingHeaders.java
@@ -1,10 +1,11 @@
package com.vaadin.tests.components.table;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.AbstractTestCase;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
* Setting table height and setting column header mode as hidden leaves the body
@@ -17,7 +18,7 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
final Table table = new Table("Test table");
@@ -30,24 +31,26 @@ public class TableHeightWhenHidingHeaders extends AbstractTestCase {
table.addItem("1").getItemProperty("Name").setValue("Item 1");
table.addItem("2").getItemProperty("Name").setValue("Item 2");
- CheckBox showHeaders = new CheckBox("Show headers",
- new CheckBox.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
- // table body height is now 77px, which together
- // with header makes 100px
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- } else {
- table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
- // header disappears, but table body height stays at
- // 77px
- // and below the body is an empty area (same height
- // as header would
- // have)
+ CheckBox showHeaders = new CheckBox("Show headers");
+ showHeaders.addListener(new ValueChangeListener() {
- }
- }
- });
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
+ // table body height is now 77px, which together
+ // with header makes 100px
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ } else {
+ table.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_HIDDEN);
+ // header disappears, but table body height stays at
+ // 77px
+ // and below the body is an empty area (same height
+ // as header would
+ // have)
+
+ }
+ }
+ });
showHeaders.setValue(true);
showHeaders.setImmediate(true);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
new file mode 100644
index 0000000000..136dcfe9a5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java
@@ -0,0 +1,114 @@
+package com.vaadin.tests.components.table;
+
+import java.net.MalformedURLException;
+
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.AbsoluteLayout;
+import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.Align;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.themes.Reindeer;
+
+public class TableInTabsheet extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ getRoot().setCaption("test");
+ VerticalLayout vPrinc = new VerticalLayout();
+ vPrinc.setStyleName(Reindeer.LAYOUT_BLUE);
+
+ vPrinc.addComponent(title());
+ vPrinc.addComponent(page());
+ vPrinc.addComponent(new Label("Dvlop Tecnologia."));
+ setContent(vPrinc);
+ }
+
+ private VerticalLayout title() {
+
+ VerticalLayout vP = new VerticalLayout();
+ vP.setStyleName(Reindeer.LAYOUT_BLACK);
+ Label tit = new Label("<h1> Tab/Table Test</h1>", ContentMode.XHTML);
+ vP.addComponent(tit);
+ return vP;
+
+ }
+
+ private VerticalLayout page() {
+
+ VerticalLayout vP = new VerticalLayout();
+ vP.setStyleName(Reindeer.LAYOUT_BLUE);
+ TabSheet t = new TabSheet();
+ t.setWidth(1000, Unit.PIXELS);
+
+ HorizontalLayout hP = new HorizontalLayout();
+ t.addTab(Ranking(), "Ranking");
+ try {
+
+ t.addTab(GDocs(""), "Dez 2011");
+ t.addTab(GDocs(""), "Jan 2012");
+ t.addTab(GDocs(""), "Abr 2012");
+
+ } catch (MalformedURLException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ hP.addComponent(t);
+ vP.addComponent(hP);
+ return vP;
+
+ }
+
+ private AbsoluteLayout Ranking() {
+
+ AbsoluteLayout vT = new AbsoluteLayout();
+ vT.setHeight(500, Unit.PIXELS);
+ vT.setWidth(900, Unit.PIXELS);
+ vT.setStyleName(Reindeer.LAYOUT_BLUE);
+
+ final Table table = new Table("Ranking Oficial");
+
+ table.addContainerProperty("Atleta", String.class, null);
+ table.addContainerProperty("P", String.class, null);
+ table.addContainerProperty("Dez/11", Integer.class, null);
+ table.setColumnAlignment("Dez/11", Align.CENTER);
+ table.addContainerProperty("Jan/12", Integer.class, null);
+ table.setColumnAlignment("Jan/12", Align.CENTER);
+ table.addContainerProperty("Abr/12", String.class, null);
+ table.addContainerProperty("Total", Integer.class, null);
+ table.setColumnAlignment("Total", Align.CENTER);
+
+ table.addItem(new Object[] { "Araujo", "D.1", 8, 8, " ", 16 }, 1);
+ table.addItem(new Object[] { "Claudio", "D.2", 2, 10, " ", 12 }, 2);
+ table.setPageLength(12);
+
+ vT.addComponent(table, "left: 50px; top: 50px;");
+ return vT;
+
+ }
+
+ private VerticalLayout GDocs(String end) throws MalformedURLException {
+
+ VerticalLayout vT = new VerticalLayout();
+ vT.setHeight(500, Unit.PIXELS);
+ vT.setWidth(900, Unit.PIXELS);
+
+ return vT;
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Chaning to a different tab and then back to the first tab should properly render the table.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8714);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
index 2f53b91107..0d5d6802d7 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableItemDescriptionGeneratorTest.java
@@ -4,69 +4,72 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
+import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.Component;
-import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
-import com.vaadin.ui.AbstractSelect.ItemDescriptionGenerator;
import com.vaadin.ui.TextField;
public class TableItemDescriptionGeneratorTest extends TestBase {
- private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
- private final String COLUMN2_PROPERTY_ID = "Text - Row description";
- private final String COLUMN3_PROPERTY_ID = "Widget";
-
- @Override
- protected void setup() {
- final Table table = new Table();
- table.setDebugId("table");
- table.setContainerDataSource(createContainer());
- addComponent(table);
-
- table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
- public String generateDescription(Component source, Object itemId,
- Object propertyId) {
- if(propertyId == null){
- return "Row description "+ itemId;
- } else if(propertyId == COLUMN1_PROPERTY_ID) {
- return "Cell description " + itemId +","+propertyId;
- }
- return null;
- }
- });
-
- table.addGeneratedColumn(COLUMN3_PROPERTY_ID, new Table.ColumnGenerator() {
-
- public Component generateCell(Table source, Object itemId, Object columnId) {
- TextField lbl = new TextField();
- lbl.setDescription("Textfields own description");
- return lbl;
- }
- });
- }
+ private final String COLUMN1_PROPERTY_ID = "Text - Cell description";
+ private final String COLUMN2_PROPERTY_ID = "Text - Row description";
+ private final String COLUMN3_PROPERTY_ID = "Widget";
+
+ @Override
+ protected void setup() {
+ final Table table = new Table();
+ table.setDebugId("table");
+ table.setContainerDataSource(createContainer());
+ addComponent(table);
+
+ table.setItemDescriptionGenerator(new ItemDescriptionGenerator() {
+ @Override
+ public String generateDescription(Component source, Object itemId,
+ Object propertyId) {
+ if (propertyId == null) {
+ return "Row description " + itemId;
+ } else if (propertyId == COLUMN1_PROPERTY_ID) {
+ return "Cell description " + itemId + "," + propertyId;
+ }
+ return null;
+ }
+ });
+
+ table.addGeneratedColumn(COLUMN3_PROPERTY_ID,
+ new Table.ColumnGenerator() {
- @Override
- protected String getDescription() {
- return "Cells and rows should have tooltips";
- }
+ @Override
+ public Component generateCell(Table source, Object itemId,
+ Object columnId) {
+ TextField lbl = new TextField();
+ lbl.setDescription("Textfields own description");
+ return lbl;
+ }
+ });
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Cells and rows should have tooltips";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 5414;
+ }
- @Override
- protected Integer getTicketNumber() {
- return 5414;
- }
-
- private Container createContainer() {
+ private Container createContainer() {
IndexedContainer container = new IndexedContainer();
container.addContainerProperty(COLUMN1_PROPERTY_ID, String.class, "");
container.addContainerProperty(COLUMN2_PROPERTY_ID, String.class, "");
- // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class, "");
+ // container.addContainerProperty(COLUMN3_PROPERTY_ID, String.class,
+ // "");
for (int i = 0; i < 5; i++) {
Item item = container.addItem("item " + i);
item.getItemProperty(COLUMN1_PROPERTY_ID).setValue("first" + i);
item.getItemProperty(COLUMN2_PROPERTY_ID).setValue("middle" + i);
- // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
+ // item.getItemProperty(COLUMN3_PROPERTY_ID).setValue("last" + i);
}
return container;
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableModifcationsWhenScrolledRight.java b/tests/testbench/com/vaadin/tests/components/table/TableModifcationsWhenScrolledRight.java
index 91ca8256c8..74a5089a84 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableModifcationsWhenScrolledRight.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableModifcationsWhenScrolledRight.java
@@ -28,6 +28,7 @@ public class TableModifcationsWhenScrolledRight extends TestBase {
btn.addListener(new ClickListener() {
Integer row = 2;
+ @Override
public void buttonClick(ClickEvent event) {
t.addItem(row).getItemProperty("name").setValue("Row" + row);
row++;
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
index 76415844be..88d20b9eb0 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableMultiSelectSimple.java
@@ -28,9 +28,10 @@ public class TableMultiSelectSimple extends TestBase {
t.setImmediate(true);
t.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- TreeSet sorted = new TreeSet((Set) event.getProperty()
- .getValue());
+ TreeSet<?> sorted = new TreeSet<Object>((Set<?>) event
+ .getProperty().getValue());
log.log("Selected value: " + sorted);
}
});
@@ -40,7 +41,7 @@ public class TableMultiSelectSimple extends TestBase {
for (int i = 0; i < 10; i++) {
t.addItem(i);
- t.getContainerProperty(i, "string").setValue(i);
+ t.getContainerProperty(i, "string").setValue(String.valueOf(i));
t.getContainerProperty(i, "button")
.setValue(new Button("Click me"));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java b/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
index 71dc987e56..75b672a277 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TablePageLengthUpdate.java
@@ -1,7 +1,6 @@
package com.vaadin.tests.components.table;
import com.vaadin.data.util.MethodProperty;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -48,6 +47,7 @@ public class TablePageLengthUpdate extends TestBase {
Button updateButton = new Button("Update pageLength",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
updatePageLengthLabel();
}
@@ -62,7 +62,7 @@ public class TablePageLengthUpdate extends TestBase {
public String getTableHeight() {
return "" + (int) table.getHeight()
- + Sizeable.UNIT_SYMBOLS[table.getHeightUnits()];
+ + table.getHeightUnits().getSymbol();
}
public void setTableHeight(String height) {
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisibile.java b/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisibile.java
index 5354525f1e..2b02e89c80 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisibile.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisibile.java
@@ -17,6 +17,7 @@ public class TableRepaintWhenMadeVisibile extends TestBase {
Button show = new Button("show", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setVisible(true);
}
@@ -24,6 +25,7 @@ public class TableRepaintWhenMadeVisibile extends TestBase {
addComponent(show);
Button hide = new Button("hide", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setVisible(false);
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisible.html b/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisible.html
index 0563acd4a5..e523a89df3 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisible.html
+++ b/tests/testbench/com/vaadin/tests/components/table/TableRepaintWhenMadeVisible.html
@@ -28,7 +28,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentstableTableRepaintWhenMadeVisibile::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableRepaintWhenMadeVisibile::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -36,7 +36,6 @@
<td></td>
<td>hidden-then-shown</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableRowHeight.java b/tests/testbench/com/vaadin/tests/components/table/TableRowHeight.java
index b3864ae0e4..eb5efbc4f3 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableRowHeight.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableRowHeight.java
@@ -89,6 +89,7 @@ public class TableRowHeight extends TestBase {
public class LabelColumnGenerator implements ColumnGenerator {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -104,6 +105,7 @@ public class TableRowHeight extends TestBase {
public class LayoutColumnGenerator implements ColumnGenerator {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.html b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.html
index 1a91211040..93e5a802ee 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.html
+++ b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.html
@@ -28,7 +28,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentstableTableScrollOnFocus::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[1]</td>
<td>391,141</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
index 2c7193956a..4782ca94f7 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableScrollOnFocus.java
@@ -14,8 +14,9 @@ public class TableScrollOnFocus extends TestBase {
chkSelectable.setImmediate(true);
chkSelectable.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- table.setSelectable(chkSelectable.booleanValue());
+ table.setSelectable((Boolean) chkSelectable.getValue());
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java b/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
index 21e26b64b8..030a4ee259 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableShouldNotEatValueChanges.java
@@ -3,10 +3,10 @@ package com.vaadin.tests.components.table;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.TableDragMode;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window.Notification;
public class TableShouldNotEatValueChanges extends TestBase {
@@ -26,11 +26,10 @@ public class TableShouldNotEatValueChanges extends TestBase {
tf.setTabIndex(1);
ItemClickListener l = new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
- tf.getWindow().showNotification(
- "TF Value on the server:" + tf.getValue(),
+ Notification.show("TF Value on the server:" + tf.getValue(),
Notification.TYPE_WARNING_MESSAGE);
-
}
};
t.addListener(l);
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java b/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
index 911c59b5c5..827593cd91 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableSingleSelect.java
@@ -22,6 +22,7 @@ public class TableSingleSelect extends TestBase {
t.setImmediate(true);
t.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
log.log("Selected value: " + event.getProperty().getValue());
}
@@ -32,7 +33,7 @@ public class TableSingleSelect extends TestBase {
for (int i = 0; i < 10; i++) {
t.addItem(i);
- t.getContainerProperty(i, "string").setValue(i);
+ t.getContainerProperty(i, "string").setValue(String.valueOf(i));
t.getContainerProperty(i, "button")
.setValue(new Button("Click me"));
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableSorting.java b/tests/testbench/com/vaadin/tests/components/table/TableSorting.java
index a0d9b8e69d..6417e8e853 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableSorting.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableSorting.java
@@ -32,6 +32,7 @@ public class TableSorting extends TestBase {
// Handle selection change.
testTable.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.out.println("ValueChanged: "
+ testTable.getValue().toString());
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
index f5f87599d9..0465d2f886 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableToggleVisibility.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TableToggleVisibility extends AbstractTestCase {
@@ -112,7 +112,8 @@ public class TableToggleVisibility extends AbstractTestCase {
mainLayout.addComponent(split);
mainLayout.setExpandRatio(split, 1.0f);
- Window mainWindow = new Window("Visibilitybug Application", mainLayout);
+ LegacyWindow mainWindow = new LegacyWindow("Visibilitybug Application",
+ mainLayout);
mainWindow.setSizeFull();
setMainWindow(mainWindow);
@@ -139,6 +140,7 @@ public class TableToggleVisibility extends AbstractTestCase {
addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
boolean wasVisible = ToggleButton.this.table.isVisible();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
index 73b80f62f4..544fe9bb67 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUndefinedSize.java
@@ -39,6 +39,7 @@ public class TableUndefinedSize extends TestBase {
controls.addComponent(new Button("Fixed size (200x200)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setWidth("200px");
tbl.setHeight("200px");
@@ -48,6 +49,7 @@ public class TableUndefinedSize extends TestBase {
controls.addComponent(new Button("Fixed size (600x200)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setWidth("600px");
tbl.setHeight("200px");
@@ -57,6 +59,7 @@ public class TableUndefinedSize extends TestBase {
controls.addComponent(new Button("Undefined size",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tbl.setSizeUndefined();
log.log("Size undefined");
@@ -68,6 +71,7 @@ public class TableUndefinedSize extends TestBase {
pageLength.setImmediate(true);
pageLength.setNullSelectionAllowed(false);
pageLength.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
int pageLength = Integer.valueOf(event.getProperty().getValue()
.toString());
@@ -81,6 +85,7 @@ public class TableUndefinedSize extends TestBase {
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
tbl.setColumnCollapsed("Column 1", !value);
@@ -98,6 +103,7 @@ public class TableUndefinedSize extends TestBase {
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
tbl.setColumnCollapsed("Column 2", !value);
@@ -116,6 +122,7 @@ public class TableUndefinedSize extends TestBase {
cb.setValue(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Boolean value = (Boolean) event.getProperty().getValue();
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
index 91f5aec1ca..11f450baf2 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableUnregisterComponent.java
@@ -49,10 +49,10 @@ public class TableUnregisterComponent extends TestBase {
table.setColumnCollapsingAllowed(true);
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
if (COL_B.equals(propertyId)) {
- Field field = new TextField() {
+ Field<String> field = new TextField() {
@Override
public void setPropertyDataSource(Property newDataSource) {
super.setPropertyDataSource(newDataSource);
@@ -76,12 +76,14 @@ public class TableUnregisterComponent extends TestBase {
addComponent(table);
addComponent(new Button("Switch column collapse", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(COL_A, !table.isColumnCollapsed(COL_A));
}
}));
addComponent(new Button("Switch editable", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setEditable(!table.isEditable());
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java b/tests/testbench/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java
index ad8eacb4b7..98cd4e0aaa 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java
@@ -46,6 +46,7 @@ public class TableVisibleColumnsUpdate extends TestBase {
Button updateButton = new Button("Change columns", new ClickListener() {
private boolean one = true;
+ @Override
public void buttonClick(ClickEvent event) {
table.setVisibleColumns((one ? cols2 : cols1));
one = !one;
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithChildComponents.java b/tests/testbench/com/vaadin/tests/components/table/TableWithChildComponents.java
new file mode 100644
index 0000000000..7eb9c3239c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithChildComponents.java
@@ -0,0 +1,68 @@
+package com.vaadin.tests.components.table;
+
+import com.vaadin.data.Item;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.NativeButton;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.ColumnGenerator;
+
+public class TableWithChildComponents extends TestBase implements ClickListener {
+
+ private static final String COL2 = "Column 2 - generated";
+ private static final String COL1 = "Column 1 - components";
+ private Log log = new Log(10);
+
+ @Override
+ protected void setup() {
+ Table table = new Table();
+ table.setWidth("500px");
+ table.setPageLength(10);
+ table.addContainerProperty(COL1, Component.class, null);
+ table.addContainerProperty(COL2, Component.class, null);
+
+ table.addGeneratedColumn(COL2, new ColumnGenerator() {
+
+ @Override
+ public Object generateCell(Table source, Object itemId,
+ Object columnId) {
+ return new Button(
+ "Item id: " + itemId + " column: " + columnId,
+ TableWithChildComponents.this);
+ }
+ });
+
+ for (int i = 0; i < 100; i++) {
+ Item item = table.addItem("Row " + i);
+ item.getItemProperty(COL1).setValue(
+ new NativeButton("Row " + i + " native", this));
+ }
+
+ addComponent(table);
+ addComponent(log);
+
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log.log("Click on " + event.getButton().getCaption());
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java b/tests/testbench/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java
index 1b0335b673..733f46959a 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithContainerRequiringEqualsForItemId.java
@@ -23,6 +23,7 @@ public class TableWithContainerRequiringEqualsForItemId extends TestBase {
super(MyEntity.class);
setBeanIdResolver(new BeanIdResolver<Long, TableWithContainerRequiringEqualsForItemId.MyEntity>() {
+ @Override
public Long getIdForBean(MyEntity bean) {
// Return a new instance every time to ensure Table can
// handle it
@@ -46,10 +47,12 @@ public class TableWithContainerRequiringEqualsForItemId extends TestBase {
protected void setup() {
Table t = new Table("Table with 1000 item");
t.addGeneratedColumn("Actions", new Table.ColumnGenerator() {
+ @Override
public Component generateCell(final Table source,
final Object itemId, final Object columnId) {
Button tripFolderLink = new Button("Button" + itemId);
tripFolderLink.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
log.log("Button " + event.getButton().getCaption()
+ " clicked");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
index 7040391721..e0ae38a8b9 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithManyColumns.java
@@ -20,7 +20,7 @@ public class TableWithManyColumns extends TestBase {
for (int row = 0; row < ROWS; row++) {
Item i = t.addItem(String.valueOf(row));
for (int col = 0; col < COLS; col++) {
- Property p = i.getItemProperty("COLUMN_" + col);
+ Property<?> p = i.getItemProperty("COLUMN_" + col);
p.setValue("item " + row + "/" + col);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java b/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java
index 404ba5d779..226fde3b29 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TableWithNoncollapsibleColumns.java
@@ -30,6 +30,7 @@ public class TableWithNoncollapsibleColumns extends TestBase {
final Button button1 = new Button("Column 1: collapse/show",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(
"Column 1 - noncollapsible",
@@ -38,6 +39,7 @@ public class TableWithNoncollapsibleColumns extends TestBase {
});
final Button button2 = new Button("Column 2: collapse/show",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(
"Column 2 - collapsible",
@@ -47,6 +49,7 @@ public class TableWithNoncollapsibleColumns extends TestBase {
final Button button3 = new Button("Column 3: collapse/show",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed(
"Column 3 - toggle collapsing",
@@ -56,6 +59,7 @@ public class TableWithNoncollapsibleColumns extends TestBase {
final Button button4 = new Button(
"Column 3: make noncollapsible/collapsible",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsible(
"Column 3 - toggle collapsing",
diff --git a/tests/testbench/com/vaadin/tests/components/table/Tables.java b/tests/testbench/com/vaadin/tests/components/table/Tables.java
index 9d409c5df8..79a5fb367d 100644
--- a/tests/testbench/com/vaadin/tests/components/table/Tables.java
+++ b/tests/testbench/com/vaadin/tests/components/table/Tables.java
@@ -8,14 +8,17 @@ import java.util.List;
import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.Resource;
import com.vaadin.tests.components.select.AbstractSelectTestCase;
import com.vaadin.ui.AbstractSelect.MultiSelectMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Table;
+import com.vaadin.ui.Table.Align;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
+import com.vaadin.ui.Table.ColumnHeaderMode;
import com.vaadin.ui.Table.ColumnResizeEvent;
import com.vaadin.ui.Table.ColumnResizeListener;
import com.vaadin.ui.Table.FooterClickEvent;
@@ -24,6 +27,7 @@ import com.vaadin.ui.Table.GeneratedRow;
import com.vaadin.ui.Table.HeaderClickEvent;
import com.vaadin.ui.Table.HeaderClickListener;
import com.vaadin.ui.Table.RowGenerator;
+import com.vaadin.ui.Table.RowHeaderMode;
public class Tables<T extends Table> extends AbstractSelectTestCase<T>
implements ItemClickListener, HeaderClickListener, FooterClickListener,
@@ -34,21 +38,24 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private static final String CATEGORY_FOOTER = "Footer";
private static final String CATEGORY_COLUMNS = "Columns";
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
- return (Class) Table.class;
+ return (Class<T>) Table.class;
}
/* COMMANDS */
- private Command<T, String> columnAlignmentCommand = new Command<T, String>() {
+ private Command<T, Align> columnAlignmentCommand = new Command<T, Align>() {
- public void execute(T c, String alignment, Object propertyId) {
+ @Override
+ public void execute(T c, Align alignment, Object propertyId) {
c.setColumnAlignment(propertyId, alignment);
}
};
private Command<T, Boolean> columnVisibleCommand = new Command<T, Boolean>() {
+ @Override
public void execute(Table c, Boolean visible, Object propertyId) {
List<Object> visibleColumns = new ArrayList<Object>(Arrays.asList(c
.getVisibleColumns()));
@@ -67,6 +74,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, Boolean> columnCollapsed = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean collapsed, Object propertyId) {
c.setColumnCollapsed(propertyId, collapsed);
@@ -75,6 +83,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, Boolean> columnCollapsibleCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean collapsible, Object propertyId) {
c.setColumnCollapsible(propertyId, collapsible);
@@ -83,6 +92,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, Boolean> columnResizeListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(Table c, Boolean value, Object data) {
if (value) {
c.addListener((ColumnResizeListener) Tables.this);
@@ -94,6 +104,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, Boolean> headerClickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((HeaderClickListener) Tables.this);
@@ -105,6 +116,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, Boolean> footerClickListenerCommand = new Command<T, Boolean>() {
+ @Override
public void execute(Table c, Boolean value, Object data) {
if (value) {
c.addListener((FooterClickListener) Tables.this);
@@ -114,10 +126,11 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
};
- protected Command<T, Integer> rowHeaderModeCommand = new Command<T, Integer>() {
+ protected Command<T, RowHeaderMode> rowHeaderModeCommand = new Command<T, RowHeaderMode>() {
- public void execute(Table c, Integer value, Object data) {
- if (value == Table.ROW_HEADER_MODE_PROPERTY) {
+ @Override
+ public void execute(Table c, RowHeaderMode value, Object data) {
+ if (value == RowHeaderMode.PROPERTY) {
c.setItemCaptionPropertyId("Property 3");
}
c.setRowHeaderMode(value);
@@ -126,6 +139,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, String> footerTextCommand = new Command<T, String>() {
+ @Override
public void execute(Table c, String value, Object data) {
for (Object propertyId : c.getContainerPropertyIds()) {
if (value != null) {
@@ -140,24 +154,28 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
protected Command<T, Object> alignColumnLeftCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object propertyId, Object data) {
- c.setColumnAlignment(propertyId, (String) data);
+ c.setColumnAlignment(propertyId, (Align) data);
}
};
private Command<T, ContextMenu> contextMenuCommand = new Command<T, ContextMenu>() {
+ @Override
public void execute(T c, final ContextMenu value, Object data) {
c.removeAllActionHandlers();
if (value != null) {
c.addActionHandler(new Handler() {
+ @Override
public void handleAction(Action action, Object sender,
Object target) {
log("Action " + action.getCaption() + " performed on "
+ target);
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return value.getActions(target, sender);
}
@@ -167,6 +185,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
};
private Command<T, Integer> columnWidthCommand = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer width, Object propertyId) {
c.setColumnWidth(propertyId, width);
@@ -175,20 +194,23 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, Resource> columnIconCommand = new Command<T, Resource>() {
+ @Override
public void execute(T c, Resource icon, Object propertyId) {
c.setColumnIcon(propertyId, icon);
}
};
- private Command<T, Integer> columnHeaderModeCommand = new Command<T, Integer>() {
+ private Command<T, ColumnHeaderMode> columnHeaderModeCommand = new Command<T, ColumnHeaderMode>() {
- public void execute(T c, Integer columnHeaderMode, Object data) {
+ @Override
+ public void execute(T c, ColumnHeaderMode columnHeaderMode, Object data) {
c.setColumnHeaderMode(columnHeaderMode);
}
};
private Command<T, String> columnHeaderCommand = new Command<T, String>() {
+ @Override
public void execute(T c, String header, Object propertyId) {
c.setColumnHeader(propertyId, header);
@@ -196,6 +218,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
};
private Command<T, Float> columnExpandRatioCommand = new Command<T, Float>() {
+ @Override
public void execute(T c, Float expandRatio, Object propertyId) {
c.setColumnExpandRatio(propertyId, expandRatio);
}
@@ -219,6 +242,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, GeneratedColumn> addGeneratedColumnCommand = new Command<T, GeneratedColumn>() {
+ @Override
public void execute(T c, final GeneratedColumn col, Object data) {
while (c.getColumnGenerator(generatedColumnId
+ generatedColumnNextNr) != null) {
@@ -228,6 +252,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
c.addGeneratedColumn(generatedColumnId + generatedColumnNextNr,
new ColumnGenerator() {
+ @Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
String value = "";
@@ -247,7 +272,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
l.setWidth(col.width);
if (col.html) {
l.setValue(value);
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
} else {
l.setValue(value);
}
@@ -268,6 +293,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
};
private Command<T, Object> removeGeneratedColumnsCommand = new Command<T, Object>() {
+ @Override
public void execute(T c, Object value, Object data) {
for (int i = 0; i < generatedColumnNextNr; i++) {
String columnId = generatedColumnId + i;
@@ -301,12 +327,14 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, CellStyleInfo> cellStyleCommand = new Command<T, CellStyleInfo>() {
+ @Override
public void execute(T c, final CellStyleInfo cellStyleInfo, Object data) {
if (cellStyleInfo == null) {
c.setCellStyleGenerator(null);
} else {
c.setCellStyleGenerator(new CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if (cellStyleInfo.appliesTo(itemId, propertyId)) {
return cellStyleInfo.styleName;
@@ -344,6 +372,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, GeneratedRowInfo> rowGeneratorCommand = new Command<T, GeneratedRowInfo>() {
+ @Override
public void execute(T c, final GeneratedRowInfo generatedRowInfo,
Object data) {
if (generatedRowInfo == null) {
@@ -351,6 +380,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
} else {
c.setRowGenerator(new RowGenerator() {
+ @Override
public GeneratedRow generateRow(Table table, Object itemId) {
if (generatedRowInfo.appliesTo(itemId)) {
GeneratedRow generatedRow = new GeneratedRow(
@@ -368,6 +398,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private Command<T, Boolean> setSortEnabledCommand = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setSortDisabled(!value);
@@ -483,13 +514,12 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
private void createColumnHeaderMode(String category) {
- LinkedHashMap<String, Integer> columnHeaderModeOptions = new LinkedHashMap<String, Integer>();
- columnHeaderModeOptions.put("Hidden", Table.COLUMN_HEADER_MODE_HIDDEN);
- columnHeaderModeOptions.put("Id", Table.COLUMN_HEADER_MODE_ID);
- columnHeaderModeOptions.put("Explicit",
- Table.COLUMN_HEADER_MODE_EXPLICIT);
+ LinkedHashMap<String, ColumnHeaderMode> columnHeaderModeOptions = new LinkedHashMap<String, ColumnHeaderMode>();
+ columnHeaderModeOptions.put("Hidden", ColumnHeaderMode.HIDDEN);
+ columnHeaderModeOptions.put("Id", ColumnHeaderMode.ID);
+ columnHeaderModeOptions.put("Explicit", ColumnHeaderMode.EXPLICIT);
columnHeaderModeOptions.put("Explicit defaults id",
- Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
+ ColumnHeaderMode.EXPLICIT_DEFAULTS_ID);
createSelectAction("Column header mode", category,
columnHeaderModeOptions, "Explicit defaults id",
@@ -542,6 +572,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private void createColumnReorderingAllowedCheckbox(String category) {
createBooleanAction("Column reordering allowed", category, true,
new Command<T, Boolean>() {
+ @Override
public void execute(Table c, Boolean value, Object data) {
c.setColumnReorderingAllowed(value);
}
@@ -551,6 +582,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
private void createColumnCollapsingAllowedCheckbox(String category) {
createBooleanAction("Column collapsing allowed", category, true,
new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setColumnCollapsingAllowed(value);
}
@@ -609,10 +641,10 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createBooleanAction("Collapsed", category, false, columnCollapsed,
propertyId);
t.log("Collapsed");
- LinkedHashMap<String, String> options = new LinkedHashMap<String, String>();
- options.put("Left", Table.ALIGN_LEFT);
- options.put("Center", Table.ALIGN_CENTER);
- options.put("Right", Table.ALIGN_RIGHT);
+ LinkedHashMap<String, Align> options = new LinkedHashMap<String, Align>();
+ options.put("Left", Align.LEFT);
+ options.put("Center", Align.CENTER);
+ options.put("Right", Align.RIGHT);
createSelectAction("Alignment", category, options, "Left",
columnAlignmentCommand, propertyId);
@@ -661,16 +693,15 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
private void createRowHeaderModeSelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Explicit", Table.ROW_HEADER_MODE_EXPLICIT);
- options.put("Explicit defaults id",
- Table.ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- options.put("Hidden", Table.ROW_HEADER_MODE_HIDDEN);
- options.put("Icon only", Table.ROW_HEADER_MODE_ICON_ONLY);
- options.put("Id", Table.ROW_HEADER_MODE_ID);
- options.put("Index", Table.ROW_HEADER_MODE_INDEX);
- options.put("Item", Table.ROW_HEADER_MODE_ITEM);
- options.put("'Property 3' property", Table.ROW_HEADER_MODE_PROPERTY);
+ LinkedHashMap<String, RowHeaderMode> options = new LinkedHashMap<String, RowHeaderMode>();
+ options.put("Explicit", RowHeaderMode.EXPLICIT);
+ options.put("Explicit defaults id", RowHeaderMode.EXPLICIT_DEFAULTS_ID);
+ options.put("Hidden", RowHeaderMode.HIDDEN);
+ options.put("Icon only", RowHeaderMode.ICON_ONLY);
+ options.put("Id", RowHeaderMode.ID);
+ options.put("Index", RowHeaderMode.INDEX);
+ options.put("Item", RowHeaderMode.ITEM);
+ options.put("'Property 3' property", RowHeaderMode.PROPERTY);
createSelectAction("Row header mode", category, options, "Hidden",
rowHeaderModeCommand);
@@ -694,6 +725,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createSelectAction("Texts in header", category, options, "None",
new Command<T, String>() {
+ @Override
public void execute(T c, String value, Object data) {
int nr = 0;
for (Object propertyId : c.getContainerPropertyIds()) {
@@ -743,6 +775,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createBooleanAction("Footer visible", category, true,
new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.setFooterVisible(value);
}
@@ -750,17 +783,18 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
}
protected void createHeaderVisibilitySelect(String category) {
- LinkedHashMap<String, Integer> options = new LinkedHashMap<String, Integer>();
- options.put("Explicit", Table.COLUMN_HEADER_MODE_EXPLICIT);
+ LinkedHashMap<String, ColumnHeaderMode> options = new LinkedHashMap<String, ColumnHeaderMode>();
+ options.put("Explicit", ColumnHeaderMode.EXPLICIT);
options.put("Explicit defaults id",
- Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID);
- options.put("Id", Table.COLUMN_HEADER_MODE_ID);
- options.put("Hidden", Table.COLUMN_HEADER_MODE_HIDDEN);
+ ColumnHeaderMode.EXPLICIT_DEFAULTS_ID);
+ options.put("Id", ColumnHeaderMode.ID);
+ options.put("Hidden", ColumnHeaderMode.HIDDEN);
createSelectAction("Header mode", category, options,
- "Explicit defaults id", new Command<T, Integer>() {
+ "Explicit defaults id", new Command<T, ColumnHeaderMode>() {
- public void execute(T c, Integer value, Object data) {
+ @Override
+ public void execute(T c, ColumnHeaderMode value, Object data) {
c.setColumnHeaderMode(value);
}
@@ -778,6 +812,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createSelectAction("PageLength", category, options, "10",
new Command<T, Integer>() {
+ @Override
public void execute(Table t, Integer value, Object data) {
t.setPageLength(value);
}
@@ -798,6 +833,7 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
createSelectAction("Selection Mode", category, options,
"Multi - ctrl/shift", new Command<T, SelectMode>() {
+ @Override
public void execute(Table t, SelectMode value, Object data) {
switch (value) {
case NONE:
@@ -822,16 +858,19 @@ public class Tables<T extends Table> extends AbstractSelectTestCase<T>
});
}
+ @Override
public void columnResize(ColumnResizeEvent event) {
log("ColumnResize on " + event.getPropertyId() + " from "
+ event.getPreviousWidth() + " to " + event.getCurrentWidth());
}
+ @Override
public void footerClick(FooterClickEvent event) {
log("FooterClick on " + event.getPropertyId() + " using "
+ event.getButtonName());
}
+ @Override
public void headerClick(HeaderClickEvent event) {
log("HeaderClick on " + event.getPropertyId() + " using "
+ event.getButtonName());
diff --git a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
index 2bc03f9814..d629c9a917 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java
@@ -7,8 +7,10 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Table;
+import com.vaadin.ui.VerticalLayout;
public class TestCurrentPageFirstItem extends TestBase implements ClickListener {
@@ -48,6 +50,7 @@ public class TestCurrentPageFirstItem extends TestBase implements ClickListener
baseLayout.addComponent(buttonItem);
}
+ @Override
public void buttonClick(ClickEvent event) {
Item item = container.addItem(++counter);
item.getItemProperty("row").setValue(counter + "");
diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldRelativeWidth.java b/tests/testbench/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
index 865a50c5f7..ae3f4c42a4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldRelativeWidth.java
@@ -55,6 +55,7 @@ public class TextFieldRelativeWidth extends TestBase {
addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = 448896474865195605L;
+ @Override
public void valueChange(
com.vaadin.data.Property.ValueChangeEvent event) {
// IndexedContainer idc = (IndexedContainer)
@@ -99,6 +100,7 @@ public class TextFieldRelativeWidth extends TestBase {
addButton.setCaption(caption);
}
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
if (b == addButton) {
diff --git a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
index f3ff5e983e..9ffad7f1e4 100644
--- a/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
+++ b/tests/testbench/com/vaadin/tests/components/table/TextFieldValueGoesMissing.java
@@ -20,6 +20,7 @@ public class TextFieldValueGoesMissing extends TestBase {
Button button = new Button("Replace label");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (verticalLayout.getComponentIndex(label1) > -1) {
verticalLayout.replaceComponent(label1, label2);
diff --git a/tests/testbench/com/vaadin/tests/components/table/UncollapsedCollumnWidth.java b/tests/testbench/com/vaadin/tests/components/table/UncollapsedCollumnWidth.java
index 99b954fa63..8e623499cf 100644
--- a/tests/testbench/com/vaadin/tests/components/table/UncollapsedCollumnWidth.java
+++ b/tests/testbench/com/vaadin/tests/components/table/UncollapsedCollumnWidth.java
@@ -23,6 +23,7 @@ public class UncollapsedCollumnWidth extends TestBase {
addComponent(table);
addComponent(new Button("Uncollapse col2", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
table.setColumnCollapsed("Col2", false);
}
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java b/tests/testbench/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java
index 3b5166a21e..4b5d216906 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java
@@ -20,6 +20,7 @@ public class AddAndRemoveTabs extends TestBase {
Button addTabBtn = new Button("Add new tab",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addTab();
}
@@ -34,6 +35,7 @@ public class AddAndRemoveTabs extends TestBase {
Button closeTab = new Button("Close tab", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tabSheet.removeComponent(layout);
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/PreventTabChange.java b/tests/testbench/com/vaadin/tests/components/tabsheet/PreventTabChange.java
index f1faecb711..434c73f778 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/PreventTabChange.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/PreventTabChange.java
@@ -46,6 +46,7 @@ public class PreventTabChange extends TestBase implements
addComponent(tabSheet);
}
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
TabSheet tabsheet = event.getTabSheet();
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/RemoveTabs.java b/tests/testbench/com/vaadin/tests/components/tabsheet/RemoveTabs.java
index 1cd96c5c4c..2b37c4358e 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/RemoveTabs.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/RemoveTabs.java
@@ -49,6 +49,7 @@ public class RemoveTabs extends TestBase {
closeCurrent = new Button("Close current tab");
closeCurrent.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeCurrentTab();
@@ -57,6 +58,7 @@ public class RemoveTabs extends TestBase {
closeCurrentWithTab = new Button("Close current tab with Tab");
closeCurrentWithTab.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeCurrentTabWithTab();
@@ -65,6 +67,7 @@ public class RemoveTabs extends TestBase {
closeFirst = new Button("close first tab");
closeFirst.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeFirstTab();
@@ -73,6 +76,7 @@ public class RemoveTabs extends TestBase {
closeLast = new Button("close last tab");
closeLast.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeLastTab();
@@ -81,6 +85,7 @@ public class RemoveTabs extends TestBase {
reorderTabs = new Button("reorder");
reorderTabs.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
reorder();
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java
index c49133dd7c..0d4f1fe562 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabGetAndReplaceComponent.java
@@ -25,6 +25,7 @@ public class TabGetAndReplaceComponent extends TestBase {
Button replace2 = new Button("Replace Content 2",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Iterator<Component> iter = tabs.getComponentIterator();
iter.next();
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java
index a3886853ff..ba737f1df8 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabKeyboardNavigation.java
@@ -32,12 +32,14 @@ public class TabKeyboardNavigation extends TestBase {
ts.setHeight("500px");
ts.addListener(new FocusListener() {
+ @Override
public void focus(FocusEvent event) {
focusblur.log("Tabsheet focused!");
}
});
ts.addListener(new BlurListener() {
+ @Override
public void blur(BlurEvent event) {
focusblur.log("Tabsheet blurred!");
}
@@ -48,11 +50,13 @@ public class TabKeyboardNavigation extends TestBase {
}
Button addTab = new Button("Add a tab", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addTab();
}
});
Button focus = new Button("Focus tabsheet", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ts.focus();
}
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java
index 3d8d02b8b6..e3867cff9f 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java
@@ -42,6 +42,7 @@ public class TabSheetCaptions extends TestBase {
Button button = new Button("Update tab caption");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tabSheet.getTab(panel1).setCaption(
"This is a new tab caption "
@@ -51,6 +52,7 @@ public class TabSheetCaptions extends TestBase {
Button button2 = new Button("Update panel caption");
button2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
panel1.setCaption("This is a new panel caption "
+ dateFormatter.format(date));
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java
index bdce3e83d0..dfe37f2e27 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java
@@ -20,6 +20,7 @@ public class TabSheetDisabling extends TestBase {
buttons[i] = new Button("Disable this tab",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
tabSheet.getTab(b).setEnabled(false);
@@ -30,6 +31,7 @@ public class TabSheetDisabling extends TestBase {
} else {
buttons[i] = new Button("Hide this tab", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
tabSheet.getTab(b).setVisible(false);
@@ -41,6 +43,7 @@ public class TabSheetDisabling extends TestBase {
}
Button button = new Button("Enable/disable", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tabSheet.setEnabled(!tabSheet.isEnabled());
}
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDiscardsMovedComponents.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDiscardsMovedComponents.java
index 410172ddb0..8d312f0cd8 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDiscardsMovedComponents.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetDiscardsMovedComponents.java
@@ -32,6 +32,7 @@ public class TabSheetDiscardsMovedComponents extends TestBase {
private void addTestComponent(final Component component) {
grid.addComponent(component);
grid.addComponent(new Button("Move to tab", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tabSheet.addTab(component);
grid.removeComponent(event.getButton());
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java
index c106144144..de637bbed7 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIndexOperations.java
@@ -14,16 +14,18 @@ public class TabSheetIndexOperations extends TestBase {
@Override
protected void setup() {
final TabSheet tabs = new TabSheet();
-
+
// Add some tabs
tabs.addTab(new Label("Content 1"), "Tab 1", null);
tabs.addTab(new Label("Content 2"), "Tab 2", null);
tabs.addTab(new Label("Content 3"), "Tab 3", null);
-
+
addComponent(tabs);
-
- Button addTab = new Button("Add tab at index 2", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+
+ Button addTab = new Button("Add tab at index 2",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
tabs.addTab(new Label("Content " + tabCounter),
"Added Tab " + tabCounter, null, 2);
tabCounter++;
@@ -33,32 +35,36 @@ public class TabSheetIndexOperations extends TestBase {
Button setCaption = new Button("Invert tab caption at index 2",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Tab tab = tabs.getTab(2);
tab.setCaption(new StringBuffer(tab.getCaption())
.reverse().toString());
- }
- });
+ }
+ });
addComponent(setCaption);
Button move = new Button("Move selected tab to index 2",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tabs.setTabPosition(tabs.getTab(tabs.getSelectedTab()),
2);
}
});
addComponent(move);
-
- Button getIndex = new Button("Get selected tab index", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+
+ Button getIndex = new Button("Get selected tab index",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
getMainWindow().showNotification(
"Index: "
+ tabs.getTabPosition(tabs.getTab(tabs
.getSelectedTab())));
-
- }
- });
+
+ }
+ });
addComponent(getIndex);
}
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetMinimal.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetMinimal.java
index 105b4149a1..b6cf27f6bb 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetMinimal.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetMinimal.java
@@ -16,6 +16,7 @@ public class TabSheetMinimal extends TestBase {
ts.setStyleName("minimal");
Button b = new Button("Add a tab", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ts.addTab(new Label("" + index), "Tab " + index, null);
index++;
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java
index 3c3dec478c..54a5ed4857 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabStyleNames.java
@@ -25,6 +25,7 @@ public class TabSheetTabStyleNames extends TestBase {
new Button.ClickListener() {
int counter = 0;
+ @Override
public void buttonClick(ClickEvent event) {
if (tab1.getStyleName() == null) {
tab1.setStyleName(STYLE_NAME);
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java
index 7d9a65b868..a2c75d6e79 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTabTheming.java
@@ -1,4 +1,5 @@
package com.vaadin.tests.components.tabsheet;
+
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
index 1c5c63dcd4..fea255a98d 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java
@@ -16,6 +16,7 @@ public class TabSheetTest<T extends TabSheet> extends
private Command<T, Integer> setTabCaption = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.getTab(value).setCaption((String) data);
@@ -23,6 +24,7 @@ public class TabSheetTest<T extends TabSheet> extends
};
private Command<T, Integer> setTabIcon = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.getTab(value).setIcon((Resource) data);
@@ -30,15 +32,18 @@ public class TabSheetTest<T extends TabSheet> extends
};
private Command<T, Integer> setTabClosable = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer value, Object data) {
c.getTab(value).setClosable((Boolean) data);
}
};
private Command<T, Boolean> setCloseHandlerListener = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.setCloseHandler(new CloseHandler() {
+ @Override
public void onTabClose(TabSheet tabsheet, Component c) {
tabClosed(tabsheet, tabsheet.getTab(c));
tabsheet.removeComponent(c);
@@ -47,6 +52,7 @@ public class TabSheetTest<T extends TabSheet> extends
});
} else {
c.setCloseHandler(new CloseHandler() {
+ @Override
public void onTabClose(TabSheet tabsheet, Component c) {
tabsheet.removeComponent(c);
}
@@ -57,6 +63,7 @@ public class TabSheetTest<T extends TabSheet> extends
};
private Command<T, Boolean> setSelectedTabListener = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
if (value) {
c.addListener((SelectedTabChangeListener) TabSheetTest.this);
@@ -68,18 +75,21 @@ public class TabSheetTest<T extends TabSheet> extends
};
private Command<T, Integer> selectTab = new Command<T, Integer>() {
+ @Override
public void execute(T c, Integer index, Object data) {
c.setSelectedTab(c.getTab(index).getComponent());
}
};
private Command<T, Boolean> hideTabs = new Command<T, Boolean>() {
+ @Override
public void execute(T c, Boolean value, Object data) {
c.hideTabs(value);
}
};
+ @SuppressWarnings("unchecked")
@Override
protected Class<T> getTestClass() {
return (Class<T>) TabSheet.class;
@@ -193,6 +203,7 @@ public class TabSheetTest<T extends TabSheet> extends
log("Tab " + tabSheet.getTabPosition(tab) + " closed");
}
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
TabSheet ts = event.getTabSheet();
log("Tab " + ts.getTabPosition(ts.getTab(ts.getSelectedTab()))
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetWithDisappearingContent.html b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetWithDisappearingContent.html
index b01a4a16ae..d61a2cbc62 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetWithDisappearingContent.html
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetWithDisappearingContent.html
@@ -3,7 +3,7 @@
<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="" />
+<link rel="selenium.base" href="http://localhost:8070" />
<title>TabSheetWithDisappearingContent</title>
</head>
<body>
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithDisappearingContent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithDisappearingContent::/VVerticalLayout[0]/VVerticalLayout[0]/VTabsheet[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]/domChild[2]/domChild[0]/domChild[0]/domChild[0]</td>
<td>14,7</td>
</tr>
<tr>
@@ -31,6 +31,7 @@
<td>vaadin=runcomvaadintestscomponentstabsheetTabSheetWithDisappearingContent::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTabsheet[0]/VTabsheetPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td></td>
</tr>
+
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
index 2b1669bff0..8e4c4d40fb 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetNPE.java
@@ -5,10 +5,10 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TabsheetNPE extends AbstractTestCase implements ClickListener {
@@ -29,7 +29,7 @@ public class TabsheetNPE extends AbstractTestCase implements ClickListener {
@Override
public void init() {
- setMainWindow(new Window("TabSheet Demo", createMainLayout()));
+ setMainWindow(new LegacyWindow("TabSheet Demo", createMainLayout()));
}
private VerticalLayout createMainLayout() {
@@ -49,6 +49,7 @@ public class TabsheetNPE extends AbstractTestCase implements ClickListener {
return layout;
}
+ @Override
public void buttonClick(ClickEvent event) {
for (int i = 0; i < TABS_COUNT; i++) {
tab[i].setEnabled(true);
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java
index 5321b51f9c..da449a2461 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java
@@ -22,6 +22,7 @@ public class TabsheetScrolling extends TestBase {
Button b = new Button("Hide this tab (" + i + ")",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
fixedSizeTabSheet.getTab(event.getButton())
.setVisible(false);
@@ -44,6 +45,7 @@ public class TabsheetScrolling extends TestBase {
Button b = new Button("Hide this tab (" + i + ")",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
autoWideTabSheet.getTab(event.getButton())
.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java b/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
index 66d19f6935..110f26d478 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java
@@ -3,7 +3,6 @@ package com.vaadin.tests.components.tabsheet;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TextArea;
-import com.vaadin.ui.TextField;
public class VerticalScrollbarPosition extends TestBase {
@@ -28,9 +27,9 @@ public class VerticalScrollbarPosition extends TestBase {
tf.setWidth("200px");
tabsheet.addTab(
tf,
- "A text field that is 200px wide, the tab bar for the tabsheet is wider",
+ "A text area that is 200px wide, the tab bar for the tabsheet is wider",
null);
- TextField tf2 = new TextField("Another tab", "b");
+ TextArea tf2 = new TextArea("Another tab", "b");
tf2.setWidth("1000px");
tf2.setHeight("50px");
tabsheet.addTab(tf2);
diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/WrapTabSheetInTabSheet.java b/tests/testbench/com/vaadin/tests/components/tabsheet/WrapTabSheetInTabSheet.java
index 869b981ac1..7a676c63fb 100644
--- a/tests/testbench/com/vaadin/tests/components/tabsheet/WrapTabSheetInTabSheet.java
+++ b/tests/testbench/com/vaadin/tests/components/tabsheet/WrapTabSheetInTabSheet.java
@@ -1,6 +1,5 @@
package com.vaadin.tests.components.tabsheet;
-import com.vaadin.Application;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -8,7 +7,6 @@ import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.Label;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class WrapTabSheetInTabSheet extends TestBase {
@Override
@@ -19,6 +17,7 @@ public class WrapTabSheetInTabSheet extends TestBase {
Button b = new Button("Wrap main layout in a TabSheet");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
TabSheet tabsheet = new TabSheet();
ComponentContainer mainParent = (ComponentContainer) mainLayout
diff --git a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java
index 0fc63860e1..992f20843b 100644
--- a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java
+++ b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaCursorPosition.java
@@ -33,6 +33,7 @@ public class TextAreaCursorPosition extends TestBase {
newTextField.setTextChangeEventMode(TextChangeEventMode.EAGER);
newTextField.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
AbstractTextField component = (AbstractTextField) event
.getComponent();
diff --git a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaNullRepresentation.html b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaNullRepresentation.html
index eb62d30374..6b29b634db 100644
--- a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaNullRepresentation.html
+++ b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaNullRepresentation.html
@@ -61,7 +61,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>176,130</td>
</tr>
<tr>
@@ -98,7 +98,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextareaTextAreaTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>176,130</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaTest.java b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaTest.java
index 278d14e43d..e071bdd8fb 100644
--- a/tests/testbench/com/vaadin/tests/components/textarea/TextAreaTest.java
+++ b/tests/testbench/com/vaadin/tests/components/textarea/TextAreaTest.java
@@ -8,12 +8,14 @@ import com.vaadin.ui.TextArea;
public class TextAreaTest extends AbstractTextFieldTest<TextArea> {
private Command<TextArea, Boolean> wordwrapCommand = new Command<TextArea, Boolean>() {
+ @Override
public void execute(TextArea c, Boolean value, Object data) {
c.setWordwrap(value);
}
};
private Command<TextArea, Integer> rowsCommand = new Command<TextArea, Integer>() {
+ @Override
public void execute(TextArea c, Integer value, Object data) {
c.setRows(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/textarea/Wordwrap.java b/tests/testbench/com/vaadin/tests/components/textarea/Wordwrap.java
index b33a1a4765..8672d4019e 100644
--- a/tests/testbench/com/vaadin/tests/components/textarea/Wordwrap.java
+++ b/tests/testbench/com/vaadin/tests/components/textarea/Wordwrap.java
@@ -31,6 +31,7 @@ public class Wordwrap extends TestBase {
CheckBox onoff = new CheckBox("Wrap state for the right field");
onoff.setValue(false);
onoff.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
boolean wrap = (Boolean) event.getProperty().getValue();
area2.setWordwrap(wrap);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java b/tests/testbench/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java
index bf9924cdbb..938ecf60ce 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java
@@ -31,10 +31,12 @@ public class EnterShortcutMaySendInputPromptAsValue extends TestBase {
final Action enter = new ShortcutAction("enter",
ShortcutAction.KeyCode.ENTER, null);
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { enter };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
if (action == enter) {
@@ -43,6 +45,7 @@ public class EnterShortcutMaySendInputPromptAsValue extends TestBase {
});
testField.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String value = event.getProperty().getValue().toString();
addComponent(new Label("TextField sent value: " + value));
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java b/tests/testbench/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java
index 62d3a1679a..58bc4c5383 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/MultipleTextChangeEvents.java
@@ -20,6 +20,7 @@ public class MultipleTextChangeEvents extends TestBase {
tf.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
tf.setTextChangeTimeout(500);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
log.log("TextChangeEvent: " + event.getText());
}
@@ -35,10 +36,12 @@ public class MultipleTextChangeEvents extends TestBase {
Action actionenter = new ShortcutAction("Enter",
ShortcutAction.KeyCode.ENTER, null);
+ @Override
public Action[] getActions(Object theTarget, Object theSender) {
return new Action[] { actionenter };
}
+ @Override
public void handleAction(Action theAction, Object theSender,
Object theTarget) {
log.log("Enter");
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java b/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java
index cf59a9d7f4..89f9ffda40 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/OutOfSyncIssueWithKeyboardShortcut.java
@@ -82,6 +82,7 @@ public class OutOfSyncIssueWithKeyboardShortcut extends TestBase {
saveButton.setClickShortcut(KeyCode.ENTER);
table.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object value = event.getProperty().getValue();
if (value != null) {
@@ -96,6 +97,7 @@ public class OutOfSyncIssueWithKeyboardShortcut extends TestBase {
});
saveButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.commit();
Topping entity = getEntityForItem(form.getItemDataSource());
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java b/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
index d362a3050d..f6368f0c78 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/SelectionAndCursorPosition.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.AbstractTextField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
@@ -10,42 +11,41 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
public class SelectionAndCursorPosition extends TestBase {
- TextField tf = new TextField();
+ TextField textField = createTextField();
+ TextArea textArea = createTextArea();
+ AbstractTextField activeComponent = textField;
@Override
protected void setup() {
-
- tf.setCaption("Text field");
- tf.setValue("So we have some text to select");
- tf.setWidth("400px");
-
FormLayout fl = new FormLayout();
Panel panel = new Panel(fl);
panel.setCaption("Hackers panel");
CheckBox ml = new CheckBox("Multiline");
ml.setImmediate(true);
ml.addListener(new Property.ValueChangeListener() {
- @SuppressWarnings("deprecation")
+ @Override
public void valueChange(ValueChangeEvent event) {
- if (tf.getHeight() < 0) {
- tf.setHeight("50px");
+ if (textField.getApplication() == null) {
+ replaceComponent(textArea, textField);
+ activeComponent = textField;
} else {
- tf.setSizeUndefined();
- tf.setRows(0);
+ replaceComponent(textField, textArea);
+ activeComponent = textArea;
}
- tf.setWidth("400px");
}
});
fl.addComponent(ml);
Button b = new Button("Select all ( selectAll() )");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- tf.selectAll();
+ activeComponent.selectAll();
}
});
fl.addComponent(b);
@@ -57,10 +57,12 @@ public class SelectionAndCursorPosition extends TestBase {
final TextField length = new TextField("Selection length:");
b = new Button("select");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- int startPos = Integer.parseInt((String) start.getValue());
- int lenght = Integer.parseInt((String) length.getValue());
- tf.setSelectionRange(startPos, lenght);
+ int startPos = Integer.parseInt(start.getValue());
+ int lenght = Integer.parseInt(length.getValue());
+
+ activeComponent.setSelectionRange(startPos, lenght);
}
});
@@ -73,9 +75,10 @@ public class SelectionAndCursorPosition extends TestBase {
final TextField pos = new TextField("Position:");
b = new Button("set");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- int startPos = Integer.parseInt((String) pos.getValue());
- tf.setCursorPosition(startPos);
+ int startPos = Integer.parseInt(pos.getValue());
+ activeComponent.setCursorPosition(startPos);
}
});
@@ -85,11 +88,30 @@ public class SelectionAndCursorPosition extends TestBase {
.setCaption("Set cursor position ( setCursorPosition(int pos) )");
fl.addComponent(setCursorPosition);
- getLayout().addComponent(tf);
+ getLayout().addComponent(textField);
getLayout().addComponent(panel);
}
+ private static TextField createTextField() {
+ TextField tf = new TextField();
+ tf.setCaption("Text field");
+ tf.setValue("So we have some text to select");
+ tf.setWidth("400px");
+
+ return tf;
+ }
+
+ private static TextArea createTextArea() {
+ TextArea ta = new TextArea();
+ ta.setCaption("Text area");
+ ta.setValue("So we have some text to select");
+ ta.setWidth("400px");
+ ta.setHeight("50px");
+
+ return ta;
+ }
+
@Override
protected String getDescription() {
return "For usability reasons it is often essential that developer "
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/SetTabIndex.java b/tests/testbench/com/vaadin/tests/components/textfield/SetTabIndex.java
index d81d26591a..da4ea9de0b 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/SetTabIndex.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/SetTabIndex.java
@@ -28,6 +28,7 @@ public class SetTabIndex extends TestBase {
final CheckBox readonly = new CheckBox("Readonly");
readonly.setImmediate(true);
readonly.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
boolean readonly = Boolean.valueOf(event.getProperty()
.getValue().toString());
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java b/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
index 93ab80b88a..7d993682fd 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/SizedTextFields.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -37,10 +38,10 @@ public class SizedTextFields extends TestBase {
vl.setHeight("40px");
vl.setWidth("200px");
- tf = new TextField();
- tf.setRows(2); // make it text area, instead of oneliner
- tf.setSizeFull();
- vl.addComponent(tf);
+ TextArea ta = new TextArea();
+ ta.setRows(2); // make it text area, instead of oneliner
+ ta.setSizeFull();
+ vl.addComponent(ta);
vl.setCaption("Fullsize textarea in 100px height 200px width box");
cssLayout.addComponent(vl);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
index f0f0a52237..a12a5a8836 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents.java
@@ -19,6 +19,7 @@ public class TextChangeEvents extends TestBase {
TextChangeListener inputEventListener = new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
l.log("Text change event for "
+ event.getComponent().getCaption()
@@ -87,10 +88,11 @@ public class TextChangeEvents extends TestBase {
@Override
public void attach() {
super.attach();
- TestUtils.injectCSS(getWindow(), ".match { background:green ;} "
+ TestUtils.injectCSS(getRoot(), ".match { background:green ;} "
+ ".nomatch {background:red;}");
}
+ @Override
public void textChange(TextChangeEvent event) {
boolean atTheEndOfText = event.getText().length() == getCursorPosition();
String match = findMatch(event.getText());
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents2.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents2.java
index b40ebb2434..363e9d448d 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents2.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEvents2.java
@@ -23,12 +23,14 @@ public class TextChangeEvents2 extends TestBase {
getLayout().addComponent(tf);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
System.err.println(tf.getCaption() + " textChange");
}
});
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err.println(tf.getCaption() + " valueChange");
}
@@ -36,12 +38,14 @@ public class TextChangeEvents2 extends TestBase {
tf.addListener(new BlurListener() {
+ @Override
public void blur(BlurEvent event) {
System.err.println(tf.getCaption() + " blur");
}
});
tf.addListener(new FocusListener() {
+ @Override
public void focus(FocusEvent event) {
System.err.println(tf.getCaption() + " focus");
}
@@ -55,12 +59,14 @@ public class TextChangeEvents2 extends TestBase {
final Label l = new Label();
getLayout().addComponent(l);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
l.setValue(event.getText());
}
});
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err.println(tf.getCaption() + " valueChange");
}
@@ -77,12 +83,14 @@ public class TextChangeEvents2 extends TestBase {
getLayout().addComponent(l);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
l.setValue(event.getText());
}
});
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err.println(tf.getCaption() + " valueChange");
}
@@ -98,12 +106,14 @@ public class TextChangeEvents2 extends TestBase {
getLayout().addComponent(l);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
tf.setValue(event.getText().toUpperCase());
}
});
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
System.err.println(tf.getCaption() + " valueChange");
}
@@ -124,6 +134,7 @@ public class TextChangeEvents2 extends TestBase {
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
String txt = event.getText();
int len = txt.length();
@@ -149,6 +160,7 @@ public class TextChangeEvents2 extends TestBase {
});
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
TextField tf = (TextField) event.getProperty();
String val = (String) tf.getValue();
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java
index 22348bb5b5..1a49729b6f 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsEternalLoop.java
@@ -13,6 +13,7 @@ public class TextChangeEventsEternalLoop extends TestBase {
getLayout().addComponent(tf);
tf.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
tf.setValue(event.getText());
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
index df5b275a8e..ebb8b88411 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeEventsWithNonImmediateValueChange.java
@@ -18,6 +18,7 @@ public class TextChangeEventsWithNonImmediateValueChange extends TestBase {
TextChangeListener inputEventListener = new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
l.log("Text change event, text content currently:'"
+ event.getText() + "' Cursor at index:"
@@ -31,8 +32,9 @@ public class TextChangeEventsWithNonImmediateValueChange extends TestBase {
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- l.log("Value change: '" + event.getProperty().toString() + "'");
+ l.log("Value change: '" + event.getProperty().getValue() + "'");
}
});
@@ -52,4 +54,4 @@ public class TextChangeEventsWithNonImmediateValueChange extends TestBase {
return 6866;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
index e0fcb1dde8..5b84ff20f2 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeListenerChangingNonTextProperties.java
@@ -10,29 +10,33 @@ import com.vaadin.ui.TextField;
public class TextChangeListenerChangingNonTextProperties extends TestBase {
int index = 0;
- String[] styles = {"red","green","blue","cyan", "magenta"};
-
+ String[] styles = { "red", "green", "blue", "cyan", "magenta" };
+
private String getNextStyle() {
- return styles[++index%styles.length];
+ return styles[++index % styles.length];
}
-
+
@Override
protected void setup() {
final TextField tf2 = new TextField("Updates width") {
@Override
public void attach() {
super.attach();
- TestUtils.injectCSS(getWindow(), ".red { background:red;} "
- + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}");
+ TestUtils
+ .injectCSS(
+ getRoot(),
+ ".red { background:red;} "
+ + ".green { background:green;} .blue { background:blue;} .cyan { background:cyan;} .magenta { background:magenta;}");
}
};
tf2.setTextChangeEventMode(TextChangeEventMode.EAGER);
tf2.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
tf2.setStyleName(getNextStyle());
}
- }) ;
+ });
tf2.setImmediate(true);
addComponent(tf2);
@@ -47,6 +51,5 @@ public class TextChangeListenerChangingNonTextProperties extends TestBase {
protected Integer getTicketNumber() {
return Integer.valueOf(6588);
}
-
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java
index d1f856f40c..00783e0106 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextChangeTimeoutAfterDetach.java
@@ -18,20 +18,22 @@ public class TextChangeTimeoutAfterDetach extends TestBase {
field.setTextChangeTimeout(2000);
field.setTextChangeEventMode(TextChangeEventMode.TIMEOUT);
field.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
// Need to add a listener for events to occur
}
});
addComponent(field);
-
+
Button detachBtn = new Button("detach field",
new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ @Override
+ public void buttonClick(ClickEvent event) {
removeComponent(field);
getLayout().addComponentAsFirst(
new Label("Field detached!"));
- }
- });
+ }
+ });
addComponent(detachBtn);
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldEagerRepaint.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldEagerRepaint.java
index 08751a59fd..e103afbe62 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldEagerRepaint.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldEagerRepaint.java
@@ -14,6 +14,7 @@ public class TextFieldEagerRepaint extends TestBase {
final TextField tf1 = new TextField("Updates value");
tf1.setTextChangeEventMode(TextChangeEventMode.EAGER);
tf1.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
String text = event.getText();
if (!text.matches("[a-z]*")) {
@@ -26,6 +27,7 @@ public class TextFieldEagerRepaint extends TestBase {
final TextField tf2 = new TextField("Updates width");
tf2.setTextChangeEventMode(TextChangeEventMode.EAGER);
tf2.addListener(new TextChangeListener() {
+ @Override
public void textChange(TextChangeEvent event) {
String text = event.getText();
if (!text.matches("[a-z]*")) {
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
index e2f5c45b72..21dba6a196 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldFocusAndBlurListeners.java
@@ -40,12 +40,14 @@ public class TextFieldFocusAndBlurListeners extends TestBase implements
tf2.setWidth("300px");
tf2.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
TextFieldFocusAndBlurListeners.this.valueChange(event);
}
});
tf2.addListener(new FocusListener() {
+ @Override
public void focus(FocusEvent event) {
TextFieldFocusAndBlurListeners.this.focus(event);
}
@@ -53,6 +55,7 @@ public class TextFieldFocusAndBlurListeners extends TestBase implements
});
tf2.addListener(new BlurListener() {
+ @Override
public void blur(BlurEvent event) {
TextFieldFocusAndBlurListeners.this.blur(event);
}
@@ -76,11 +79,13 @@ public class TextFieldFocusAndBlurListeners extends TestBase implements
addComponent(tf4);
}
+ @Override
public void focus(FocusEvent event) {
log.log(event.getComponent().getCaption() + ": Focus");
}
+ @Override
public void blur(BlurEvent event) {
TextField tf = (TextField) event.getComponent();
log.log(tf.getCaption() + ": Blur. Value is: "
@@ -88,6 +93,7 @@ public class TextFieldFocusAndBlurListeners extends TestBase implements
}
+ @Override
public void valueChange(ValueChangeEvent event) {
TextField tf = (TextField) event.getProperty();
log.log(tf.getCaption() + ": ValueChange: " + tf.getValue().toString());
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
index 4fb91db973..3e1a709243 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInLayoutInTable.java
@@ -3,18 +3,18 @@ package com.vaadin.tests.components.textfield;
import com.vaadin.Application;
import com.vaadin.ui.Component;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-@SuppressWarnings("serial")
-public class TextFieldInLayoutInTable extends Application {
+public class TextFieldInLayoutInTable extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window(this.getClass().getName());
+ final LegacyWindow mainWindow = new LegacyWindow(this.getClass()
+ .getName());
setMainWindow(mainWindow);
final Table table = new Table();
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
index 6aac7caddd..d52efa0572 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldInputPromptAndClickShortcut.java
@@ -1,5 +1,7 @@
package com.vaadin.tests.components.textfield;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
@@ -17,24 +19,26 @@ public class TextFieldInputPromptAndClickShortcut extends TestBase {
final TextField textField = new TextField();
Button button = new Button("Show Text", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Field value: " + textField.getValue());
}
});
button.setClickShortcut(KeyCode.ESCAPE);
- final CheckBox inputPromptSelection = new CheckBox("Input prompt",
- new ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().getValue() == Boolean.TRUE) {
- textField.setInputPrompt("Input prompt");
- } else {
- textField.setInputPrompt(null);
- }
- log.log("Set input prompt: "
- + textField.getInputPrompt());
- }
- });
+ final CheckBox inputPromptSelection = new CheckBox("Input prompt");
+ inputPromptSelection.setImmediate(true);
+ inputPromptSelection.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (event.getProperty().getValue() == Boolean.TRUE) {
+ textField.setInputPrompt("Input prompt");
+ } else {
+ textField.setInputPrompt(null);
+ }
+ log.log("Set input prompt: " + textField.getInputPrompt());
+ }
+ });
inputPromptSelection.setImmediate(true);
addComponent(textField);
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentation.html b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentation.html
index 5506351d34..c4a887d764 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentation.html
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentation.html
@@ -61,7 +61,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>176,130</td>
</tr>
<tr>
@@ -98,7 +98,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>176,130</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentationAndSelection.html b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentationAndSelection.html
index 7923f5acfd..cfd397b4f2 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentationAndSelection.html
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldNullRepresentationAndSelection.html
@@ -87,7 +87,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>114,149</td>
</tr>
<tr>
@@ -129,7 +129,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>120,102</td>
</tr>
<tr>
@@ -154,7 +154,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[2]</td>
+ <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]</td>
<td>163,129</td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html
deleted file mode 100644
index 6a51103fe5..0000000000
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldSecret.html
+++ /dev/null
@@ -1,196 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.textfield.TextFieldTest?restartApplication</td>
- <td></td>
-</tr>
-<!--Disable event log-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>24,1</td>
-</tr>
-<!--Enter "s3cr3t" in the TextField-->
-<tr>
- <td>enterCharacter</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>s3cr3t</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>normal</td>
-</tr>
-<!--Change to secret-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>secret</td>
-</tr>
-<!--Change to normal-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td>normal</td>
-</tr>
-<!--Change to secret-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<!--ValueChangeListener-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,13</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item3</td>
- <td>30,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item2</td>
- <td>62,12</td>
-</tr>
-<!--Enable and clear event log-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item0</td>
- <td>24,1</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item1</td>
- <td>19,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item1</td>
- <td>24,1</td>
-</tr>
-<!--Value -> Test-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>21,2</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item4</td>
- <td>24,7</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item0</td>
- <td>37,8</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[2]/VMenuBar[0]#item2</td>
- <td>37,4</td>
-</tr>
-<tr>
- <td>pause</td>
- <td>100</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>1. ValueChangeEvent, new value: 'Test'</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>Test</td>
-</tr>
-<!--Change to normal-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_Smenu#item0</td>
- <td>38,11</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[0]/VMenuBar[0]#item5</td>
- <td>51,10</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::Root/VOverlay[1]/VMenuBar[0]#item6</td>
- <td>25,12</td>
-</tr>
-<tr>
- <td>assertValue</td>
- <td>vaadin=runcomvaadintestscomponentstextfieldTextFieldTest::PID_StestComponent</td>
- <td>Test</td>
-</tr>
-<!---->
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
index bc7a6fcf76..10793a8bad 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldTest.java
@@ -1,7 +1,5 @@
package com.vaadin.tests.components.textfield;
-import java.util.LinkedHashMap;
-
import com.vaadin.event.FieldEvents.TextChangeListener;
import com.vaadin.tests.components.abstractfield.AbstractTextFieldTest;
import com.vaadin.ui.TextField;
@@ -9,27 +7,6 @@ import com.vaadin.ui.TextField;
public class TextFieldTest extends AbstractTextFieldTest<TextField> implements
TextChangeListener {
- private Command<TextField, Boolean> secretCommand = new Command<TextField, Boolean>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Boolean value, Object data) {
- c.setSecret(value);
- }
- };
-
- private Command<TextField, Boolean> wordwrapCommand = new Command<TextField, Boolean>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Boolean value, Object data) {
- c.setWordwrap(value);
- }
- };
-
- private Command<TextField, Integer> rowsCommand = new Command<TextField, Integer>() {
- @SuppressWarnings("deprecation")
- public void execute(TextField c, Integer value, Object data) {
- c.setRows(value);
- }
- };
-
@Override
protected Class<TextField> getTestClass() {
return TextField.class;
@@ -38,22 +15,6 @@ public class TextFieldTest extends AbstractTextFieldTest<TextField> implements
@Override
protected void createActions() {
super.createActions();
- createSecretAction(CATEGORY_FEATURES);
- createWordwrapAction(CATEGORY_FEATURES);
- createRowsAction(CATEGORY_FEATURES);
- }
-
- private void createRowsAction(String category) {
- LinkedHashMap<String, Integer> options = createIntegerOptions(20);
- createSelectAction("Rows", category, options, "0", rowsCommand);
- }
-
- private void createSecretAction(String category) {
- createBooleanAction("Secret", category, false, secretCommand);
- }
-
- private void createWordwrapAction(String category) {
- createBooleanAction("Wordwrap", category, false, wordwrapCommand);
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithProperty.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithProperty.java
index 7d0bd12359..747301f4e4 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithProperty.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithProperty.java
@@ -12,23 +12,25 @@ public class TextFieldWithProperty extends TestBase {
@Override
protected void setup() {
-
+
final TextField tf1 = new TextField();
-
+
final ObjectProperty<String> op = new ObjectProperty<String>("FOO");
-
+
tf1.setPropertyDataSource(op);
addComponent(tf1);
- Button b = new Button("Set BAR to underlaying property (should propagate to UI)");
+ Button b = new Button(
+ "Set BAR to underlaying property (should propagate to UI)");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
op.setValue("BAR");
}
});
- addComponent(b );
-
+ addComponent(b);
+
}
@Override
diff --git a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
index 1fbe6ffc55..4184892545 100644
--- a/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
+++ b/tests/testbench/com/vaadin/tests/components/textfield/TextFieldWithPropertyFormatter.java
@@ -13,11 +13,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.TextField;
-@SuppressWarnings("unchecked")
public class TextFieldWithPropertyFormatter extends TestBase {
- private PropertyFormatter formatter;
- private Property property;
+ private PropertyFormatter<BigDecimal> formatter;
+ private Property<BigDecimal> property;
@Override
protected void setup() {
@@ -26,38 +25,43 @@ public class TextFieldWithPropertyFormatter extends TestBase {
* digits - rounds half up
*/
// Property containing BigDecimal
- property = new Property() {
+ property = new Property<BigDecimal>() {
private BigDecimal value;
- public Object getValue() {
+ @Override
+ public BigDecimal getValue() {
return value;
}
- public void setValue(Object newValue) throws ReadOnlyException,
- ConversionException {
+ @Override
+ public void setValue(Object newValue) throws ReadOnlyException {
if (newValue == null) {
value = null;
} else if (newValue instanceof BigDecimal) {
value = (BigDecimal) newValue;
} else {
- throw new ConversionException();
+ throw new IllegalArgumentException(
+ "Value must be of type BigDecimal");
}
}
- public Class<?> getType() {
+ @Override
+ public Class<BigDecimal> getType() {
return BigDecimal.class;
}
+ @Override
public boolean isReadOnly() {
return false;
}
+ @Override
public void setReadOnly(boolean newStatus) {
// ignore
}
};
- formatter = new PropertyFormatter(property) {
+ formatter = new PropertyFormatter<BigDecimal>(property) {
private final DecimalFormat df = new DecimalFormat("#,##0.00",
new DecimalFormatSymbols(new Locale("en", "UK")));
@@ -67,7 +71,7 @@ public class TextFieldWithPropertyFormatter extends TestBase {
}
@Override
- public String format(Object value) {
+ public String format(BigDecimal value) {
final String retVal;
if (value == null) {
@@ -79,7 +83,7 @@ public class TextFieldWithPropertyFormatter extends TestBase {
}
@Override
- public Object parse(String formattedValue) throws Exception {
+ public BigDecimal parse(String formattedValue) throws Exception {
if (formattedValue != null
&& formattedValue.trim().length() != 0) {
BigDecimal value = (BigDecimal) df.parse(formattedValue);
@@ -99,12 +103,14 @@ public class TextFieldWithPropertyFormatter extends TestBase {
Button b = new Button(
"Sync (typing 12345.6789 and clicking this should format field)");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
}
});
addComponent(b);
b = new Button("Set '12345.6789' to textfield on the server side");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tf1.setValue("12345.6789");
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/CtrlShiftMultiselect.java b/tests/testbench/com/vaadin/tests/components/tree/CtrlShiftMultiselect.java
index 69956e4d2c..03645557f2 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/CtrlShiftMultiselect.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/CtrlShiftMultiselect.java
@@ -30,6 +30,7 @@ public class CtrlShiftMultiselect extends TestBase {
tree.expandItemsRecursively("Item 4");
tree.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (tree.getValue() instanceof Set) {
@SuppressWarnings("unchecked")
diff --git a/tests/testbench/com/vaadin/tests/components/tree/ExpandCollapseTree.java b/tests/testbench/com/vaadin/tests/components/tree/ExpandCollapseTree.java
index e23213fafc..d5c3654b4e 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/ExpandCollapseTree.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/ExpandCollapseTree.java
@@ -30,6 +30,7 @@ public class ExpandCollapseTree extends TestBase {
tree.expandItemsRecursively("Item 4");
tree.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if (tree.getValue() instanceof Set) {
@SuppressWarnings("unchecked")
diff --git a/tests/testbench/com/vaadin/tests/components/tree/ItemStyleGenerator.java b/tests/testbench/com/vaadin/tests/components/tree/ItemStyleGenerator.java
index f2ca2a85bd..33bd4cef65 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/ItemStyleGenerator.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/ItemStyleGenerator.java
@@ -32,6 +32,7 @@ public class ItemStyleGenerator extends TestBase {
Tree tree = new Tree();
tree.setItemStyleGenerator(new Tree.ItemStyleGenerator() {
+ @Override
public String getStyle(Object itemId) {
// simple return itemId as css style name
return itemId.toString();
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java b/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java
index b37d371b17..4072610996 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java
@@ -27,6 +27,7 @@ public class TreeConnectors extends TestBase {
cb.setImmediate(true);
cb.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if ((Boolean) event.getProperty().getValue()) {
tree.addStyleName(BaseTheme.TREE_CONNECTORS);
@@ -50,11 +51,13 @@ public class TreeConnectors extends TestBase {
tree.setDragMode(TreeDragMode.NODE);
tree.setDropHandler(new DropHandler() {
+ @Override
public void drop(DragAndDropEvent event) {
// TODO Auto-generated method stub
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeContainerChange.java b/tests/testbench/com/vaadin/tests/components/tree/TreeContainerChange.java
index df2682a14c..f4374ca2ee 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeContainerChange.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeContainerChange.java
@@ -57,6 +57,7 @@ public class TreeContainerChange extends TestBase {
Button b = new Button("Use ds1");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tree.setContainerDataSource(ds1);
currentDS.setValue("ds1");
@@ -72,6 +73,7 @@ public class TreeContainerChange extends TestBase {
b = new Button("Use ds2");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tree.setContainerDataSource(ds2);
currentDS.setValue("ds2");
@@ -82,6 +84,7 @@ public class TreeContainerChange extends TestBase {
addComponent(hl);
tree.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
currentValue.setValue(event.getProperty().getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeDragAndDropFromTable.java b/tests/testbench/com/vaadin/tests/components/tree/TreeDragAndDropFromTable.java
index 1525d43ede..7aa3933752 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeDragAndDropFromTable.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeDragAndDropFromTable.java
@@ -38,10 +38,12 @@ public class TreeDragAndDropFromTable extends TestBase {
final Tree tree = new Tree();
tree.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return TargetItemAllowsChildren.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
// criteria verify that this is safe
DataBoundTransferable t = (DataBoundTransferable) dropEvent
@@ -115,5 +117,4 @@ public class TreeDragAndDropFromTable extends TestBase {
return 7687;
}
-
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
index e69e5f50f9..bd7984cdeb 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFiltering.java
@@ -47,15 +47,17 @@ public class TreeFiltering extends TestBase {
filterType.setImmediate(true);
filterType.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- cont.setIncludeParentsWhenFiltering(((CheckBox) event
- .getProperty()).booleanValue());
+ cont.setIncludeParentsWhenFiltering((Boolean) ((CheckBox) event
+ .getProperty()).getValue());
ccTree.requestRepaint();
}
});
addComponent(filterType);
final Button b = new Button("Add filter 'foo'", new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.addContainerFilter("caption", "foo", true, false);
@@ -63,6 +65,7 @@ public class TreeFiltering extends TestBase {
});
addComponent(b);
final Button b2 = new Button("Add filter 'Num'", new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.addContainerFilter("caption", "Num", true, false);
@@ -71,6 +74,7 @@ public class TreeFiltering extends TestBase {
addComponent(b2);
final Button num = new Button("Add filter '0'", new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.addContainerFilter("caption", "0", true, false);
@@ -79,6 +83,7 @@ public class TreeFiltering extends TestBase {
addComponent(num);
final Button num2 = new Button("Add filter '0-'", new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.addContainerFilter("caption", "0-", true, false);
@@ -88,6 +93,7 @@ public class TreeFiltering extends TestBase {
addComponent(num2);
final Button num3 = new Button("Add filter 'Number 4'",
new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.addContainerFilter("caption", "Number 4", true,
false);
@@ -98,6 +104,7 @@ public class TreeFiltering extends TestBase {
addComponent(num3);
final Button p1 = new Button("Set Number 3 parent to Number 0",
new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.setParent(3, 0);
@@ -105,6 +112,7 @@ public class TreeFiltering extends TestBase {
});
addComponent(p1);
final Button r = new Button("Remove filters", new ClickListener() {
+ @Override
public void buttonClick(final ClickEvent event) {
cont.removeAllContainerFilters();
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java b/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
index e784009bce..dd407fd62a 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeFocusGaining.java
@@ -20,8 +20,9 @@ public class TreeFocusGaining extends TestBase {
addComponent(textField);
textField.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- log.log("TF value now:" + event.getProperty());
+ log.log("TF value now:" + event.getProperty().getValue());
}
});
@@ -30,8 +31,9 @@ public class TreeFocusGaining extends TestBase {
addComponent(tree);
tree.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- log.log("Tree value now:" + event.getProperty());
+ log.log("Tree value now:" + event.getProperty().getValue());
}
});
tree.setImmediate(true);
@@ -39,6 +41,7 @@ public class TreeFocusGaining extends TestBase {
tree = new Tree("Simple tree with itemm click listener");
tree.addItem("Item1");
tree.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
log.log("Item click event");
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickListening.java b/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickListening.java
index e772be7cde..182bc97c44 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickListening.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeItemClickListening.java
@@ -28,6 +28,7 @@ public class TreeItemClickListening extends TestBase {
tree.setItemCaptionPropertyId("caption");
tree.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
clickCounter++;
switch (event.getButton()) {
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
index 86d419c2b3..bad6359889 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationScrolls.java
@@ -5,8 +5,8 @@ package com.vaadin.tests.components.tree;
import com.vaadin.data.Container;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Tree;
public class TreeKeyboardNavigationScrolls extends TestBase {
@@ -16,12 +16,7 @@ public class TreeKeyboardNavigationScrolls extends TestBase {
Tree tree = new Tree();
tree.setContainerDataSource(generateHierarchicalContainer());
tree.setImmediate(true);
- tree.addValidator(new AbstractValidator("failed") {
- public boolean isValid(Object value) {
- return false;
- }
-
- });
+ tree.addValidator(new AlwaysFailValidator("failed"));
addComponent(tree);
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
index 2a545065c4..9204f0495b 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeKeyboardNavigationValidators.java
@@ -2,8 +2,8 @@ package com.vaadin.tests.components.tree;
import com.vaadin.data.Container;
import com.vaadin.data.util.HierarchicalContainer;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Tree;
public class TreeKeyboardNavigationValidators extends TestBase {
@@ -18,12 +18,7 @@ public class TreeKeyboardNavigationValidators extends TestBase {
tree.setSizeFull();
tree.setContainerDataSource(generateHierarchicalContainer());
tree.setImmediate(true);
- tree.addValidator(new AbstractValidator("failed") {
- public boolean isValid(Object value) {
- return false;
- }
-
- });
+ tree.addValidator(new AlwaysFailValidator("failed"));
return tree;
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
index de72a6efeb..9d58762f60 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreePerformanceTest.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.components.tree;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreePerformanceTest extends AbstractTestCase {
@@ -20,7 +20,7 @@ public class TreePerformanceTest extends AbstractTestCase {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Layout layout = null;
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
index c17855996e..abc9a5385d 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeScrolling.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.components.tree;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreeScrolling extends AbstractTestCase {
@@ -13,7 +13,7 @@ public class TreeScrolling extends AbstractTestCase {
public void init() {
VerticalLayout layout = new VerticalLayout();
layout.setSizeUndefined();
- Window w = new Window("", layout);
+ LegacyWindow w = new LegacyWindow("", layout);
setMainWindow(w);
TextField filler1 = new TextField();
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java b/tests/testbench/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
index 42c9087fc3..b3ab5c2b01 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeScrollingOnSelection.java
@@ -29,6 +29,7 @@ public class TreeScrollingOnSelection extends TestBase {
private static final long serialVersionUID = 5955518276555388126L;
+ @Override
public void itemClick(ItemClickEvent event) {
charLabel.setValue(event.getItemId().toString());
}
@@ -36,7 +37,6 @@ public class TreeScrollingOnSelection extends TestBase {
tree.setImmediate(true);
Panel panel = new Panel();
- panel.setScrollable(true);
panel.addComponent(tree);
panel.setWidth("200px");
panel.setHeight("300px");
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeToolTips.java b/tests/testbench/com/vaadin/tests/components/tree/TreeToolTips.java
index c6e29bc3b8..4b892c2150 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeToolTips.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeToolTips.java
@@ -13,6 +13,7 @@ public class TreeToolTips extends TestBase {
protected void setup() {
final Tree tree = new Tree(null, createContainer());
tree.setItemDescriptionGenerator(new AbstractSelect.ItemDescriptionGenerator() {
+ @Override
public String generateDescription(Component source, Object itemId,
Object propertyId) {
return "This is a tooltip for item id '" + itemId + "'";
diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeWithPreselectedItemNotShown.java b/tests/testbench/com/vaadin/tests/components/tree/TreeWithPreselectedItemNotShown.java
index 92c82a6ccf..8da6759b20 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/TreeWithPreselectedItemNotShown.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/TreeWithPreselectedItemNotShown.java
@@ -11,6 +11,7 @@ public class TreeWithPreselectedItemNotShown extends TestBase {
protected void setup() {
Button open = new Button("Open modal window with tree",
new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
getMainWindow().addWindow(new SubwindowWithTree());
}
diff --git a/tests/testbench/com/vaadin/tests/components/tree/Trees.java b/tests/testbench/com/vaadin/tests/components/tree/Trees.java
index 79de4de412..3ee1d7b0de 100644
--- a/tests/testbench/com/vaadin/tests/components/tree/Trees.java
+++ b/tests/testbench/com/vaadin/tests/components/tree/Trees.java
@@ -26,6 +26,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private ItemStyleGenerator rootGreenSecondLevelRed = new com.vaadin.ui.Tree.ItemStyleGenerator() {
+ @Override
public String getStyle(Object itemId) {
Hierarchical c = (Container.Hierarchical) getComponent()
.getContainerDataSource();
@@ -50,6 +51,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private ItemStyleGenerator evenItemsBold = new com.vaadin.ui.Tree.ItemStyleGenerator() {
+ @Override
public String getStyle(Object itemId) {
Hierarchical c = (Container.Hierarchical) getComponent()
.getContainerDataSource();
@@ -80,17 +82,20 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private Command<Tree, ContextMenu> contextMenuCommand = new Command<Tree, ContextMenu>() {
+ @Override
public void execute(Tree c, final ContextMenu value, Object data) {
c.removeAllActionHandlers();
if (value != null) {
c.addActionHandler(new Handler() {
+ @Override
public void handleAction(Action action, Object sender,
Object target) {
log("Action " + action.getCaption() + " performed on "
+ target);
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return value.getActions(target, sender);
}
@@ -176,6 +181,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
createSelectAction("Selection Mode", category, options,
"Multi - ctrl/shift", new Command<Tree, SelectMode>() {
+ @Override
public void execute(Tree t, SelectMode value, Object data) {
switch (value) {
case NONE:
@@ -318,6 +324,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
*/
private Command<Tree, Integer> rootItemIdsCommand = new Command<Tree, Integer>() {
+ @Override
public void execute(Tree c, Integer value, Object data) {
rootItemIds = value;
updateContainer();
@@ -326,12 +333,14 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private Command<Tree, Object> expandItemCommand = new Command<Tree, Object>() {
+ @Override
public void execute(Tree c, Object itemId, Object data) {
c.expandItem(itemId);
}
};
private Command<Tree, Object> expandItemRecursivelyCommand = new Command<Tree, Object>() {
+ @Override
public void execute(Tree c, Object itemId, Object data) {
c.expandItemsRecursively(itemId);
}
@@ -339,6 +348,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private Command<Tree, Object> collapseItemCommand = new Command<Tree, Object>() {
+ @Override
public void execute(Tree c, Object itemId, Object data) {
c.collapseItem(itemId);
}
@@ -346,12 +356,14 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private Command<Tree, Boolean> setChildrenAllowedCommand = new Command<Tree, Boolean>() {
+ @Override
public void execute(Tree c, Boolean areChildrenAllowed, Object itemId) {
c.setChildrenAllowed(itemId, areChildrenAllowed);
}
};
private Command<Tree, Boolean> expandListenerCommand = new Command<Tree, Boolean>() {
+ @Override
public void execute(Tree c, Boolean value, Object data) {
if (value) {
c.addListener((ExpandListener) Trees.this);
@@ -362,6 +374,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
};
private Command<Tree, Boolean> collapseListenerCommand = new Command<Tree, Boolean>() {
+ @Override
public void execute(Tree c, Boolean value, Object data) {
if (value) {
c.addListener((CollapseListener) Trees.this);
@@ -373,6 +386,7 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
private Command<Tree, com.vaadin.ui.Tree.ItemStyleGenerator> itemStyleGeneratorCommand = new Command<Tree, com.vaadin.ui.Tree.ItemStyleGenerator>() {
+ @Override
public void execute(Tree c,
com.vaadin.ui.Tree.ItemStyleGenerator value, Object data) {
c.setItemStyleGenerator(value);
@@ -380,10 +394,12 @@ public class Trees extends AbstractSelectTestCase<Tree> implements
}
};
+ @Override
public void nodeCollapse(CollapseEvent event) {
log(event.getClass().getSimpleName() + ": " + event.getItemId());
}
+ @Override
public void nodeExpand(ExpandEvent event) {
log(event.getClass().getSimpleName() + ": " + event.getItemId());
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java
index 60ef551b44..f6b32aa4a9 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/AddNodesOnExpand.java
@@ -18,6 +18,7 @@ public class AddNodesOnExpand extends TestBase {
treetable.setPageLength(0);
treetable.addContainerProperty("foo", String.class, "");
treetable.addListener(new Tree.ExpandListener() {
+ @Override
public void nodeExpand(ExpandEvent event) {
Object openedItemId = event.getItemId();
if (!treetable.hasChildren(openedItemId)) {
@@ -31,6 +32,7 @@ public class AddNodesOnExpand extends TestBase {
}
});
treetable.addListener(new Tree.CollapseListener() {
+ @Override
public void nodeCollapse(CollapseEvent event) {
/* Uncomment this to "fix" the TreeTable */
// orgTree.refreshRowCache();
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
index 9cb60efd74..0fe8a3d1b9 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java
@@ -21,12 +21,14 @@ public class ChangeDataSourcePageLengthZero extends TestBase {
addComponent(tt);
Button page1 = new Button("Set new data source (20 items)");
page1.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
setupContainer(tt, 20);
}
});
Button page2 = new Button("Set new data source (10 items)");
page2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
setupContainer(tt, 10);
}
@@ -35,6 +37,7 @@ public class ChangeDataSourcePageLengthZero extends TestBase {
addButton.addListener(new Button.ClickListener() {
private int i = 1;
+ @Override
public void buttonClick(ClickEvent event) {
HierarchicalContainer container = (HierarchicalContainer) tt
.getContainerDataSource();
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
index becae955ab..329e5d291d 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.components.treetable;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Link;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TreeTable;
-import com.vaadin.ui.Window;
public class DisappearingComponents extends AbstractTestCase {
@Override
public void init() {
- Window mainWindow = new Window("Application");
+ LegacyWindow mainWindow = new LegacyWindow("Application");
final TreeTable tt = new TreeTable();
tt.setSizeUndefined();
tt.setWidth("100%");
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/DynamicallyModified.java b/tests/testbench/com/vaadin/tests/components/treetable/DynamicallyModified.java
index 89211dbecc..6dc5417d28 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/DynamicallyModified.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/DynamicallyModified.java
@@ -87,6 +87,7 @@ public class DynamicallyModified extends TestBase implements
private int newChild = 1;
+ @Override
public void nodeExpand(ExpandEvent event) {
Object expandedItemId = event.getItemId();
// 7 == "Customer Project 1"
@@ -100,6 +101,7 @@ public class DynamicallyModified extends TestBase implements
treetable.setChildrenAllowed(newChildId, false);
}
+ @Override
public void nodeCollapse(CollapseEvent event) {
Object collapsedItemId = event.getItemId();
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java b/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java
index ad0255a2da..799537f923 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/KeepAllItemsVisible.java
@@ -37,6 +37,7 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener,
tt.addListener((CollapseListener) this);
tt.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
recalculatePageLength(tt);
tt.requestRepaint();
@@ -49,6 +50,7 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener,
Button b = new Button("Set pagelength to 10",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tt.setPageLength(10);
}
@@ -56,6 +58,7 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener,
addComponent(b);
b = new Button("Set pagelength to 20", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tt.setPageLength(20);
}
@@ -63,6 +66,7 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener,
addComponent(b);
b = new Button("Set pagelength to 0", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tt.setPageLength(0);
}
@@ -121,11 +125,13 @@ public class KeepAllItemsVisible extends TestBase implements ExpandListener,
return 7292;
}
+ @Override
public void nodeCollapse(CollapseEvent event) {
recalculatePageLength((TreeTable) event.getSource());
}
+ @Override
public void nodeExpand(ExpandEvent event) {
recalculatePageLength((TreeTable) event.getSource());
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
index 6f2e507ce3..ea76a9639a 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticCollapse.java
@@ -4,6 +4,7 @@ import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TreeTable;
import com.vaadin.ui.VerticalLayout;
@@ -29,19 +30,19 @@ public class ProgrammaticCollapse extends TestBase {
layout.addComponent(table);
layout.addComponent(new Button("Expand / Collapse",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
boolean collapsed = !table.isCollapsed(1);
- table.getWindow().showNotification(
- "set collapsed: " + collapsed);
+ Notification.show("set collapsed: " + collapsed);
table.setCollapsed(1, collapsed);
}
}));
layout.addComponent(new Button("Expand / Collapse last",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
boolean collapsed = !table.isCollapsed(100);
- table.getWindow().showNotification(
- "set collapsed: " + collapsed);
+ Notification.show("set collapsed: " + collapsed);
table.setCollapsed(100, collapsed);
}
}));
@@ -49,10 +50,10 @@ public class ProgrammaticCollapse extends TestBase {
new ClickListener() {
private boolean collapsed = true;
+ @Override
public void buttonClick(ClickEvent event) {
collapsed = !collapsed;
- table.getWindow().showNotification(
- "set collapsed: " + collapsed);
+ Notification.show("set collapsed: " + collapsed);
for (int i = 0; i < 50; ++i) {
table.setCollapsed(i * 2, collapsed);
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticSelect.java b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticSelect.java
index fc68d0be15..7088497b4e 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticSelect.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/ProgrammaticSelect.java
@@ -23,6 +23,7 @@ public class ProgrammaticSelect extends TestBase {
Button selectItem = new Button("Select first row",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object id = tt.getItemIds().iterator().next();
tt.select(id);
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java b/tests/testbench/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java
index 69198ca006..a92a9e045e 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/RemoveAllItemsRefresh.java
@@ -39,6 +39,7 @@ public class RemoveAllItemsRefresh extends TestBase {
Button cleanUp = new Button("clear");
cleanUp.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
treeContainer.removeAllItems();
}
@@ -47,6 +48,7 @@ public class RemoveAllItemsRefresh extends TestBase {
Button refresh = new Button("fill");
refresh.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
fill();
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java
index ae6a9d0c0b..c2bd3da860 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableCacheOnPartialUpdates.java
@@ -68,6 +68,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
}
public class Col3ColumnGenerator implements ColumnGenerator {
+ @Override
public Component generateCell(final com.vaadin.ui.Table source,
final Object itemId, Object columnId) {
TestBean tb = (TestBean) itemId;
@@ -78,6 +79,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
System.out.println("Generating new Button for " + identifier);
Button btnCol3 = new NativeButton(identifier);
btnCol3.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Button " + event.getButton().getCaption()
+ " clicked. Row index: "
@@ -117,6 +119,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
addComponent(b);
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("First visible item id is: "
+ treeTable.getCurrentPageFirstItemId());
@@ -131,6 +134,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
cacheRateSelect.setValue(2);
cacheRateSelect.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
treeTable
.setCacheRate((Integer) event.getProperty().getValue());
@@ -154,6 +158,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
treeTable.addGeneratedColumn("col3", new Col3ColumnGenerator());
treeTable.addListener(new ExpandListener() {
+ @Override
public void nodeExpand(ExpandEvent event) {
logExpandCollapse(event.getItemId(), "expanded");
@@ -161,6 +166,7 @@ public class TreeTableCacheOnPartialUpdates extends TestBase {
});
treeTable.addListener(new CollapseListener() {
+ @Override
public void nodeCollapse(CollapseEvent event) {
logExpandCollapse(event.getItemId(), "collapsed");
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableModifyAndSetCollapsed.java b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableModifyAndSetCollapsed.java
index 336ffb5a52..02ce397a05 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableModifyAndSetCollapsed.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableModifyAndSetCollapsed.java
@@ -26,6 +26,7 @@ public class TreeTableModifyAndSetCollapsed extends TestBase {
addComponent(tt);
Button repopulate = new Button("Repopulate", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
// repopulate the container and expand root item
container.removeAllItems();
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableNegativeArraySize.html b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableNegativeArraySize.html
index 2e69052162..b57c5f978e 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableNegativeArraySize.html
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableNegativeArraySize.html
@@ -40,6 +40,11 @@
</tr>
<!--collapse root2-->
<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentstreetableTreeTablePartialUpdates::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VTreeTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[42]/domChild[0]/domChild[0]/domChild[0]</td>
<td>11,-182</td>
@@ -49,7 +54,6 @@
<td></td>
<td>root1-expanded-scrolled-to-end</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java
index 0c1fcdbfd8..e688e039eb 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableOutOfSync.java
@@ -16,6 +16,7 @@ public class TreeTableOutOfSync extends TestBase {
TreeTable tt = new TreeTable();
tt.addContainerProperty("i", Integer.class, null);
tt.addGeneratedColumn("text", new Table.ColumnGenerator() {
+ @Override
public Object generateCell(Table source, Object itemId,
Object columnId) {
if ("text".equals(columnId)) {
@@ -23,6 +24,7 @@ public class TreeTableOutOfSync extends TestBase {
+ source.getContainerDataSource().getItem(itemId)
.getItemProperty("i").getValue());
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification("click");
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java
index 2a14c946f3..7159addb5b 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableSetCollapsed.java
@@ -12,6 +12,7 @@ public class TreeTableSetCollapsed extends TestBase {
createTreeTableAndPopulate();
addComponent(new Button("Create another TreeTable",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
createTreeTableAndPopulate();
}
diff --git a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableTest.java b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableTest.java
index d7d9c18d7e..f27a47f12b 100644
--- a/tests/testbench/com/vaadin/tests/components/treetable/TreeTableTest.java
+++ b/tests/testbench/com/vaadin/tests/components/treetable/TreeTableTest.java
@@ -27,6 +27,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
private int rootItemIds = 3;
private CellStyleGenerator rootGreenSecondLevelRed = new com.vaadin.ui.Table.CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if (propertyId != null) {
return null;
@@ -54,6 +55,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
private CellStyleGenerator evenItemsBold = new CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if (propertyId != null) {
return null;
@@ -235,6 +237,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
*/
private Command<TreeTable, Integer> rootItemIdsCommand = new Command<TreeTable, Integer>() {
+ @Override
public void execute(TreeTable c, Integer value, Object data) {
rootItemIds = value;
updateContainer();
@@ -243,6 +246,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
private Command<TreeTable, Object> expandItemCommand = new Command<TreeTable, Object>() {
+ @Override
public void execute(TreeTable c, Object itemId, Object data) {
c.setCollapsed(itemId, false);
}
@@ -250,6 +254,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
private Command<TreeTable, Object> collapseItemCommand = new Command<TreeTable, Object>() {
+ @Override
public void execute(TreeTable c, Object itemId, Object data) {
c.setCollapsed(itemId, true);
}
@@ -257,6 +262,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
private Command<TreeTable, Boolean> setChildrenAllowedCommand = new Command<TreeTable, Boolean>() {
+ @Override
public void execute(TreeTable c, Boolean areChildrenAllowed,
Object itemId) {
c.setChildrenAllowed(itemId, areChildrenAllowed);
@@ -264,6 +270,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
};
private Command<TreeTable, Boolean> expandListenerCommand = new Command<TreeTable, Boolean>() {
+ @Override
public void execute(TreeTable c, Boolean value, Object data) {
if (value) {
c.addListener((ExpandListener) TreeTableTest.this);
@@ -274,6 +281,7 @@ public class TreeTableTest extends Tables<TreeTable> implements
};
private Command<TreeTable, Boolean> collapseListenerCommand = new Command<TreeTable, Boolean>() {
+ @Override
public void execute(TreeTable c, Boolean value, Object data) {
if (value) {
c.addListener((CollapseListener) TreeTableTest.this);
@@ -285,15 +293,18 @@ public class TreeTableTest extends Tables<TreeTable> implements
protected Command<TreeTable, Boolean> animationCommand = new Command<TreeTable, Boolean>() {
+ @Override
public void execute(TreeTable c, Boolean enabled, Object data) {
c.setAnimationsEnabled(enabled);
}
};
+ @Override
public void nodeCollapse(CollapseEvent event) {
log(event.getClass().getSimpleName() + ": " + event.getItemId());
}
+ @Override
public void nodeExpand(ExpandEvent event) {
log(event.getClass().getSimpleName() + ": " + event.getItemId());
}
diff --git a/tests/testbench/com/vaadin/tests/components/twincolselect/TwinColSelects.java b/tests/testbench/com/vaadin/tests/components/twincolselect/TwinColSelects.java
index ddb418dab3..fc1b11bb94 100644
--- a/tests/testbench/com/vaadin/tests/components/twincolselect/TwinColSelects.java
+++ b/tests/testbench/com/vaadin/tests/components/twincolselect/TwinColSelects.java
@@ -51,12 +51,14 @@ public class TwinColSelects extends AbstractSelectTestCase<TwinColSelect> {
private Command<TwinColSelect, Integer> columnsAction = new Command<TwinColSelect, Integer>() {
+ @Override
public void execute(TwinColSelect c, Integer value, Object data) {
c.setColumns(value);
}
};
private Command<TwinColSelect, Integer> rowsAction = new Command<TwinColSelect, Integer>() {
+ @Override
public void execute(TwinColSelect c, Integer value, Object data) {
c.setRows(value);
}
diff --git a/tests/testbench/com/vaadin/tests/components/upload/ForceSubmit.java b/tests/testbench/com/vaadin/tests/components/upload/ForceSubmit.java
index 84e266dea2..47aad46348 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/ForceSubmit.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/ForceSubmit.java
@@ -21,6 +21,7 @@ public class ForceSubmit extends TestBase implements Receiver {
return 6630;
}
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
return new ByteArrayOutputStream();
}
@@ -40,6 +41,7 @@ public class ForceSubmit extends TestBase implements Receiver {
addComponent(u);
u.addListener(new Upload.FinishedListener() {
+ @Override
public void uploadFinished(FinishedEvent event) {
String filename = event.getFilename();
long length = event.getLength();
@@ -49,12 +51,14 @@ public class ForceSubmit extends TestBase implements Receiver {
});
u.addListener(new Upload.FailedListener() {
+ @Override
public void uploadFailed(FailedEvent event) {
getMainWindow().showNotification("Failed. No file selected?");
}
});
u.addListener(new Upload.StartedListener() {
+ @Override
public void uploadStarted(StartedEvent event) {
getMainWindow().showNotification(
"Started upload. TF value :" + textField.getValue());
@@ -64,6 +68,7 @@ public class ForceSubmit extends TestBase implements Receiver {
Button button = new Button(
"I'm an external button (not the uploads builtin), hit me to start upload.");
button.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
u.submitUpload();
}
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java b/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java
index 4f1e8358f4..529a977ede 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/TestFileUpload.java
@@ -21,6 +21,7 @@ public class TestFileUpload extends TestBase implements Receiver {
protected void setup() {
Upload u = new Upload("Upload", new Upload.Receiver() {
+ @Override
public OutputStream receiveUpload(String filename, String mimeType) {
return baos;
}
@@ -28,6 +29,7 @@ public class TestFileUpload extends TestBase implements Receiver {
u.setDebugId("UPL");
u.addListener(new Upload.FinishedListener() {
+ @Override
public void uploadFinished(FinishedEvent event) {
String hash = DigestUtils.md5Hex(baos.toByteArray());
log.log("Upload finished. Name: " + event.getFilename()
@@ -40,6 +42,7 @@ public class TestFileUpload extends TestBase implements Receiver {
addComponent(u);
}
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
getMainWindow().showNotification("Receiving upload");
return new ByteArrayOutputStream();
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java b/tests/testbench/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java
index b6126f41da..7607536357 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/TestImmediateUploadInFormLayout.java
@@ -46,6 +46,7 @@ public class TestImmediateUploadInFormLayout extends
return Collections.emptyList();
}
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
getMainWindow().showNotification("Receiving upload");
return new ByteArrayOutputStream();
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestUpload.java b/tests/testbench/com/vaadin/tests/components/upload/TestUpload.java
index 535372f710..9ca0cb9c38 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/TestUpload.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/TestUpload.java
@@ -32,6 +32,7 @@ public class TestUpload extends ComponentTestCase<Upload> implements Receiver {
addTestComponent(u);
u.addListener(new Upload.FinishedListener() {
+ @Override
public void uploadFinished(FinishedEvent event) {
getMainWindow().showNotification("Done");
}
@@ -51,6 +52,7 @@ public class TestUpload extends ComponentTestCase<Upload> implements Receiver {
return actions;
}
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
getMainWindow().showNotification("Receiving upload");
return new ByteArrayOutputStream();
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java b/tests/testbench/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java
index 0aa8e809c4..516ca2d7c9 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/TestUploadAndDisableOnSuccess.java
@@ -51,6 +51,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload>
u.addListener(new Upload.StartedListener() {
+ @Override
public void uploadStarted(StartedEvent event) {
/*
* Remove component before upload from the same vertical layout.
@@ -63,6 +64,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload>
});
u.addListener(new Upload.FinishedListener() {
+ @Override
public void uploadFinished(FinishedEvent event) {
getMainWindow().showNotification("Done");
l.setValue(getUploadcount());
@@ -81,6 +83,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload>
actions.add(createButtonAction("Toggle Enabled",
new Command<Upload, Boolean>() {
+ @Override
public void execute(Upload c, Boolean value, Object data) {
c.setEnabled(!c.isEnabled());
}
@@ -89,6 +92,7 @@ public class TestUploadAndDisableOnSuccess extends ComponentTestCase<Upload>
return actions;
}
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
// sleep to ensure change before upload is complete
try {
diff --git a/tests/testbench/com/vaadin/tests/components/upload/TestUploadFilename.java b/tests/testbench/com/vaadin/tests/components/upload/TestUploadFilename.java
index 12006412f2..de0cca5009 100644
--- a/tests/testbench/com/vaadin/tests/components/upload/TestUploadFilename.java
+++ b/tests/testbench/com/vaadin/tests/components/upload/TestUploadFilename.java
@@ -23,6 +23,7 @@ public class TestUploadFilename extends TestBase {
addComponent(result);
upload.addListener(new Upload.FinishedListener() {
+ @Override
public void uploadFinished(FinishedEvent event) {
result.setValue("Got file (should not contain path): "
+ receiver.getFilename());
@@ -35,6 +36,7 @@ public class TestUploadFilename extends TestBase {
private String filename;
+ @Override
public OutputStream receiveUpload(String filename, String MIMEType) {
this.filename = filename;
return new ByteArrayOutputStream();
diff --git a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
index ea04c3ad30..52a94daec7 100644
--- a/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/window/AttachShouldBeCalledForSubWindows.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
@@ -25,7 +26,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
@Override
public void init() {
- Window mainWindow = new Window() {
+ Root.LegacyWindow mainWindow = new Root.LegacyWindow() {
@Override
public void attach() {
log(this);
@@ -83,6 +84,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
};
okButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
log.log("Button clicked");
@@ -113,6 +115,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
return 8170;
}
+ @Override
public void onRequestStart(HttpServletRequest request,
HttpServletResponse response) {
if (request.getParameter("attachMainFirst") != null) {
@@ -121,6 +124,7 @@ public class AttachShouldBeCalledForSubWindows extends AbstractTestCase
}
+ @Override
public void onRequestEnd(HttpServletRequest request,
HttpServletResponse response) {
// TODO Auto-generated method stub
diff --git a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
index 36e9134566..6e3eb906b7 100644
--- a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
+++ b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.html
@@ -23,9 +23,10 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopennative</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
<td></td>
</tr>
+<!--Close from click handler-->
<tr>
<td>click</td>
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
@@ -38,12 +39,13 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopennative</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Sopensub/domChild[0]/domChild[0]</td>
<td></td>
</tr>
+<!--Click close in title bar-->
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VWindow[0]/domChild[0]/domChild[0]/domChild[1]</td>
<td></td>
</tr>
<tr>
@@ -51,41 +53,6 @@
<td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
<td>2. Window 'Sub-window' closed</td>
</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForPopUp</td>
- <td>nativewindow</td>
- <td>30000</td>
-</tr>
-<tr>
- <td>selectWindow</td>
- <td>name=nativewindow</td>
- <td></td>
-</tr>
-<tr>
- <td>close</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>selectWindow</td>
- <td>title=com.vaadin.tests.components.window.CloseSubWindow</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_Spoll/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowCloseSubWindow::PID_SLog/ChildComponentContainer[0]/VLabel[0]</td>
- <td>3. Browser window closed</td>
-</tr>
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
index c1104836a8..e618cd38b5 100644
--- a/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
+++ b/tests/testbench/com/vaadin/tests/components/window/CloseSubWindow.java
@@ -1,8 +1,5 @@
package com.vaadin.tests.components.window;
-import java.net.URL;
-
-import com.vaadin.terminal.ExternalResource;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.Button;
@@ -14,7 +11,6 @@ import com.vaadin.ui.Window.CloseListener;
public class CloseSubWindow extends TestBase {
- private Window browserWindow;
private Log log = new Log(5);
@Override
@@ -22,6 +18,7 @@ public class CloseSubWindow extends TestBase {
Button openWindowButton = new Button("Open sub-window");
openWindowButton.setDebugId("opensub");
openWindowButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Window sub = createClosableSubWindow("Sub-window");
getMainWindow().addWindow(sub);
@@ -30,54 +27,6 @@ public class CloseSubWindow extends TestBase {
addComponent(log);
addComponent(openWindowButton);
-
- Button openBrowserWindowButton = new Button("Open browser window");
- openWindowButton.setDebugId("opennative");
- openBrowserWindowButton.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- browserWindow = new Window("Window");
- Button closeButton = new Button("Close this window",
- new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- event.getButton().getWindow()
- .executeJavaScript("window.close();");
-
- }
- });
- browserWindow.addComponent(closeButton);
-
- browserWindow.addListener(new CloseListener() {
- public void windowClose(CloseEvent e) {
- logBrowserWindowClosed();
- // there is no push, so the user needs to click a button
- // to see the notification
-
- // Opera does not send a notification about the window
- // having been closed
- }
-
- });
-
- addWindow(browserWindow);
- URL windowUrl = browserWindow.getURL();
- // named for easier access by test tools
- getMainWindow().open(new ExternalResource(windowUrl),
- "nativewindow");
- if (getBrowser().isOpera()) {
- // Immediately log a close event in Opera so this test can
- // be run for all browsers. Vaadin ticket #5687.
- logBrowserWindowClosed();
- }
- }
- });
-
- addComponent(openBrowserWindowButton);
-
- Button pollButton = new Button("Poll server");
- pollButton.setDebugId("poll");
- addComponent(pollButton);
-
}
private Window createClosableSubWindow(final String title) {
@@ -88,21 +37,24 @@ public class CloseSubWindow extends TestBase {
Button closeButton = new Button("Close");
closeButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- window.getParent().removeWindow(window);
+ event.getButton().findAncestor(Window.class).close();
}
});
window.addComponent(closeButton);
Button removeButton = new Button("Remove from parent");
removeButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- window.getParent().removeWindow(window);
+ window.close();
}
});
window.addComponent(closeButton);
window.addListener(new CloseListener() {
+ @Override
public void windowClose(CloseEvent e) {
log.log("Window '" + title + "' closed");
}
@@ -120,10 +72,4 @@ public class CloseSubWindow extends TestBase {
protected Integer getTicketNumber() {
return 3865;
}
-
- private void logBrowserWindowClosed() {
- log.log("Browser window closed");
-
- }
-
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java b/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java
index ca9c31513f..76b93cae56 100644
--- a/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java
+++ b/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java
@@ -12,6 +12,7 @@ public class DownloadAndUpdate extends TestBase {
protected void setup() {
addComponent(new Button("Download and update",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
downloadAndUpdate();
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
index dfa0e80368..a9744b2c06 100644
--- a/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
+++ b/tests/testbench/com/vaadin/tests/components/window/ExecuteJavaScript.java
@@ -4,13 +4,13 @@ import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class ExecuteJavaScript extends AbstractTestCase {
@Override
public void init() {
- final Window mainWindow = new Window("Test");
+ final LegacyWindow mainWindow = new LegacyWindow("Test");
setMainWindow(mainWindow);
for (final String script : new String[] { "alert('foo');",
@@ -26,6 +26,7 @@ public class ExecuteJavaScript extends AbstractTestCase {
Button b = new Button(script);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().executeJavaScript(script);
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
index 284a63543a..fc8d7474af 100644
--- a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
+++ b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java
@@ -13,23 +13,23 @@ public class ExtraWindowShown extends TestBase {
protected void setup() {
Button b = new Button("Open window", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window w = new Window("Sub window");
w.center();
w.addComponent(new Button("Close", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- Window main = w.getParent();
- // main = w.getWindow();
- main.removeWindow(w);
+ w.close();
}
}));
Button iconButton = new Button("A button with icon");
iconButton
.setIcon(new ThemeResource("../runo/icons/16/ok.png"));
w.addComponent(iconButton);
- event.getButton().getWindow().addWindow(w);
+ event.getButton().getRoot().addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
index 6c051f4b1e..eb4803630f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
+++ b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java
@@ -1,37 +1,44 @@
package com.vaadin.tests.components.window;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.shared.ui.label.ContentMode;
+import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
+import com.vaadin.terminal.Page.BrowserWindowResizeListener;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.tests.util.Log;
import com.vaadin.tests.util.LoremIpsum;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
import com.vaadin.ui.Window.ResizeEvent;
import com.vaadin.ui.Window.ResizeListener;
public class LazyWindowResize extends AbstractTestCase {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Window subWindow;
- private Button lazyMode;
+ private CheckBox lazyMode;
private Log log = new Log(5);
private CheckBox resizeListenerCheckBox;
protected ResizeListener resizeListener = new ResizeListener() {
+ @Override
public void windowResized(ResizeEvent e) {
- if (e.getWindow() == mainWindow) {
- log.log("Main window resized");
- } else {
- log.log("Sub window resized");
- }
+ log.log("Sub window resized");
+ }
+ };
+ protected BrowserWindowResizeListener browserWindowResizeListener = new BrowserWindowResizeListener() {
+ @Override
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ log.log("Main window resized");
}
};
- private CheckBox immediateCheckBox;;;
+
+ private CheckBox immediateCheckBox;
@Override
protected String getDescription() {
@@ -45,7 +52,7 @@ public class LazyWindowResize extends AbstractTestCase {
@Override
public void init() {
- mainWindow = new Window("Resize test");
+ mainWindow = new LegacyWindow("Resize test");
setMainWindow(mainWindow);
subWindow = new Window("Sub window");
subWindow.setHeight("50%");
@@ -56,24 +63,26 @@ public class LazyWindowResize extends AbstractTestCase {
lazyMode = new CheckBox("Lazy resize");
lazyMode.setImmediate(true);
- lazyMode.addListener(new ClickListener() {
+ lazyMode.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- setLazy(lazyMode.booleanValue());
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ setLazy(lazyMode.getValue());
}
});
resizeListenerCheckBox = new CheckBox("Resize listener");
resizeListenerCheckBox.setImmediate(true);
- resizeListenerCheckBox.addListener(new ClickListener() {
+ resizeListenerCheckBox.addListener(new ValueChangeListener() {
- public void buttonClick(ClickEvent event) {
- if (resizeListenerCheckBox.booleanValue()) {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if (resizeListenerCheckBox.getValue()) {
subWindow.addListener(resizeListener);
- mainWindow.addListener(resizeListener);
+ mainWindow.addListener(browserWindowResizeListener);
} else {
subWindow.removeListener(resizeListener);
- mainWindow.removeListener(resizeListener);
+ mainWindow.removeListener(browserWindowResizeListener);
}
}
@@ -81,12 +90,12 @@ public class LazyWindowResize extends AbstractTestCase {
});
immediateCheckBox = new CheckBox("Windows immediate");
immediateCheckBox.setImmediate(true);
- immediateCheckBox.addListener(new ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- mainWindow.setImmediate(immediateCheckBox.booleanValue());
- subWindow.setImmediate(immediateCheckBox.booleanValue());
+ immediateCheckBox.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ mainWindow.setImmediate(immediateCheckBox.getValue());
+ subWindow.setImmediate(immediateCheckBox.getValue());
}
});
@@ -94,7 +103,7 @@ public class LazyWindowResize extends AbstractTestCase {
mainWindow.addComponent(resizeListenerCheckBox);
mainWindow.addComponent(immediateCheckBox);
mainWindow.addComponent(log);
- mainWindow.addComponent(new Label("<br/><br/>", Label.CONTENT_XHTML));
+ mainWindow.addComponent(new Label("<br/><br/>", ContentMode.XHTML));
mainWindow.addComponent(new Label(LoremIpsum.get(10000)));
setLazy(false);
diff --git a/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java b/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
index c70c14e08e..be67cfe9a0 100644
--- a/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
+++ b/tests/testbench/com/vaadin/tests/components/window/LongNotifications.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.components.window;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
public class LongNotifications extends TestBase {
private final String text = "This is a veeeery large notification in the main window which should definitly not exist at all, in any app. But they finally do in real world applications, no matter what you do. People have small screens and desperatly try to run web apps in their iphones.";
@@ -25,6 +25,7 @@ public class LongNotifications extends TestBase {
Button b = new Button("Show loooong notification",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification(
@@ -38,6 +39,7 @@ public class LongNotifications extends TestBase {
b = new Button("Show notifications", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification("Example failed",
@@ -51,6 +53,7 @@ public class LongNotifications extends TestBase {
b = new Button("Show loooong notification (error)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow()
@@ -65,6 +68,7 @@ public class LongNotifications extends TestBase {
b = new Button("Show notification (error)", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().showNotification("Example failed",
diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html
new file mode 100644
index 0000000000..9cbcf1d5ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.html
@@ -0,0 +1,57 @@
+<?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.window.RepaintWindowContents?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>Button 1</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>Button 2</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>Button 1</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowRepaintWindowContents::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>Button 2</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java
new file mode 100644
index 0000000000..59cd35c2cb
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java
@@ -0,0 +1,58 @@
+package com.vaadin.tests.components.window;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Layout;
+import com.vaadin.ui.VerticalLayout;
+import com.vaadin.ui.Window;
+
+public class RepaintWindowContents extends AbstractTestRoot {
+ private static final long serialVersionUID = 1L;
+
+ @SuppressWarnings("serial")
+ @Override
+ protected void setup(WrappedRequest request) {
+ final Window window = new Window("Test window");
+ addWindow(window);
+
+ final Layout layout1 = new VerticalLayout();
+ Button button1 = new Button("Button 1");
+ layout1.addComponent(button1);
+
+ final Layout layout2 = new VerticalLayout();
+ Button button2 = new Button("Button 2");
+ layout2.addComponent(button2);
+
+ window.setContent(layout1);
+
+ button1.addListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ window.setContent(layout2);
+ }
+ });
+
+ button2.addListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ window.setContent(layout1);
+ }
+ });
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Clicking the button switches the content between content1 and content2";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8832;
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
deleted file mode 100644
index 1b2e91617d..0000000000
--- a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.html
+++ /dev/null
@@ -1,42 +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>ReplacingComponentsInHandleParameters</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">ReplacingComponentsInHandleParameters</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.components.window.ReplacingComponentsInHandleParameters</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowReplacingComponentsInHandleParameters::PID_STestId/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>screenCapture</td>
- <td></td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java b/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
deleted file mode 100644
index 1f87c3c563..0000000000
--- a/tests/testbench/com/vaadin/tests/components/window/ReplacingComponentsInHandleParameters.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package com.vaadin.tests.components.window;
-
-import java.util.Map;
-
-import com.vaadin.tests.components.AbstractTestCase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-
-public class ReplacingComponentsInHandleParameters extends AbstractTestCase {
-
- @Override
- protected String getDescription() {
- return "Reusing debug IDs when replacing components in handleParameters() causes out of sync";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 8090;
- }
-
- @Override
- public void init() {
- final ClickListener clickListener = new ClickListener() {
- public void buttonClick(ClickEvent event) {
- event.getButton().setCaption("Clicked!");
- }
- };
- final Window main = new Window() {
- @Override
- public void handleParameters(Map<String, String[]> parameters) {
- super.handleParameters(parameters);
- removeAllComponents();
- addComponent(new Label(
- "Reload window (without ?restartApplication), then click the button twice."));
-
- Button btn = new Button("Click me", clickListener);
- btn.setDebugId("TestId");
- addComponent(btn);
- }
- };
- setMainWindow(main);
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocus.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocus.java
index f0dccda66c..389c926986 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocus.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocus.java
@@ -41,6 +41,7 @@ public class SubWindowFocus extends TestBase {
addComponent(tf);
Button b = new Button("new", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window win = new Window("Subwin");
win.getContent().setWidth(null);
@@ -56,10 +57,12 @@ public class SubWindowFocus extends TestBase {
ShortcutAction spc = new ShortcutAction("Space",
ShortcutAction.KeyCode.SPACEBAR, null);
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { esc, spc };
}
+ @Override
public void handleAction(Action action, Object sender,
Object target) {
if (action == esc) {
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
index 2d9d7bd5b2..061ee7900f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowFocusAndBlurListeners.java
@@ -10,6 +10,8 @@ import com.vaadin.event.ShortcutAction;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
@@ -34,16 +36,16 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
window.addComponent(new TextField());
window.addListener(new FocusListener() {
+ @Override
public void focus(FocusEvent event) {
- event.getComponent().getWindow()
- .showNotification("Focused window");
+ Notification.show("Focused window");
}
});
window.addListener(new BlurListener() {
+ @Override
public void blur(BlurEvent event) {
- event.getComponent().getWindow()
- .showNotification("Blurred window");
+ Notification.show("Blurred window");
}
});
@@ -51,16 +53,18 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
private Action[] s = new Action[] { new ShortcutAction("^Save") };
+ @Override
public Action[] getActions(Object target, Object sender) {
return s;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
- window.showNotification("Action!");
+ Notification.show("Action!");
}
});
- Window main = getLayout().getWindow();
+ Root main = getLayout().getRoot();
main.addWindow(window);
@@ -68,6 +72,7 @@ public class SubWindowFocusAndBlurListeners extends TestBase {
Button button = new Button("Bring to front (should focus too)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
window.bringToFront();
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.html b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.html
index 6461960c92..0476de6c35 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.html
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.html
@@ -65,10 +65,16 @@
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VButton[1]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
-<!--Make dialog 5 modal and centered-->
+<!--Bring dialog 4 to front-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/FocusableScrollPanel[0]/VVerticalLayout[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VButton[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<!--Make dialog 5 modal and centered. Dialog 4 still stays on top-->
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VFilterSelect[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/FocusableScrollPanel[0]/VVerticalLayout[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VFilterSelect[0]/domChild[1]</td>
<td>11,11</td>
</tr>
<tr>
@@ -78,28 +84,27 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VButton[1]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/FocusableScrollPanel[0]/VVerticalLayout[0]/VCssLayout[0]/VCssLayout$FlowPane[0]/VButton[1]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
-<!--Close window 5, which is not the topmost window (???)-->
+<!--Close window 4, which is the topmost window-->
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[4]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[1]</td>
<td>11,15</td>
</tr>
-<!--The screenshot should really be ...-window-4-modal-->
<tr>
<td>screenCapture</td>
<td></td>
- <td>window5closed-window-5-modal</td>
+ <td>window4-closed-window-3-modal</td>
</tr>
-<!--Close Dialog 4 (topmost)-->
+<!--Close Dialog 3 (topmost)-->
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[3]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
<td>6,8</td>
</tr>
-<!--Make Dialog 3 (topmost) non-modal-->
+<!--Make Dialog 5 (topmost) non-modal-->
<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VFilterSelect[0]/domChild[1]</td>
@@ -107,7 +112,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item3</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item5</td>
<td>97,6</td>
</tr>
<tr>
@@ -131,10 +136,10 @@
<td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/FocusableScrollPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
-<!--Close dialog 3-->
+<!--Close dialog 5-->
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowSubWindowOrder::/VWindow[2]/domChild[0]/domChild[0]/domChild[1]</td>
<td>10,5</td>
</tr>
<tr>
@@ -142,7 +147,6 @@
<td></td>
<td>window2-on-top-of-window1-others-closed</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
index c34f32f275..02241476d5 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowOrder.java
@@ -10,6 +10,7 @@ import com.vaadin.ui.ComboBox;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class SubWindowOrder extends TestBase {
@@ -19,7 +20,7 @@ public class SubWindowOrder extends TestBase {
@Override
protected void setup() {
- Window mainWindow = getMainWindow();
+ Root mainWindow = getMainWindow();
HorizontalLayout controlpanels = new HorizontalLayout();
for (int i = 1; i <= 5; i++) {
Window dialog = new Window("Dialog " + i);
@@ -63,6 +64,7 @@ public class SubWindowOrder extends TestBase {
toggleModality.addListener(this);
}
+ @Override
public void buttonClick(ClickEvent event) {
if (event.getButton() == bf) {
getCurWindow().bringToFront();
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.java b/tests/testbench/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.java
index dbe5eda9af..5bda762d3f 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindowWithUndefinedHeight.java
@@ -1,10 +1,10 @@
package com.vaadin.tests.components.window;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Window;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Table;
import com.vaadin.ui.TabSheet;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.Window;
public class SubWindowWithUndefinedHeight extends TestBase {
@@ -33,13 +33,13 @@ public class SubWindowWithUndefinedHeight extends TestBase {
table.setCaption("tab 2");
table.setWidth("100%");
table.setHeight("100%");
-
+
final TabSheet tabsheet = new TabSheet();
tabsheet.addComponent(tabButton);
tabsheet.addComponent(table);
tabsheet.addListener(new TabSheet.SelectedTabChangeListener() {
- public void selectedTabChange(
- TabSheet.SelectedTabChangeEvent event) {
+ @Override
+ public void selectedTabChange(TabSheet.SelectedTabChangeEvent event) {
if (tabsheet.getSelectedTab() == tabButton) {
tabsheet.setSizeUndefined();
subwindow.getContent().setSizeUndefined();
@@ -55,6 +55,7 @@ public class SubWindowWithUndefinedHeight extends TestBase {
subwindow.addComponent(tabsheet);
Button button = new Button("click me", new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
getMainWindow().addWindow(subwindow);
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubWindows.java b/tests/testbench/com/vaadin/tests/components/window/SubWindows.java
index e939f0b9a4..c39bfdb713 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubWindows.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubWindows.java
@@ -32,6 +32,7 @@ public class SubWindows extends TestBase {
Button b = new Button("Remove");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
ComponentContainer cc = (ComponentContainer) b.getParent();
@@ -51,6 +52,7 @@ public class SubWindows extends TestBase {
autoWideWindow.addComponent(new TextField("Field 2"));
autoWideWindow.addComponent(new Button("Add", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
autoWideWindow.addComponent(createRemoveButton());
diff --git a/tests/testbench/com/vaadin/tests/components/window/SubwindowDraggability.java b/tests/testbench/com/vaadin/tests/components/window/SubwindowDraggability.java
index e1927982cd..45fb343b45 100644
--- a/tests/testbench/com/vaadin/tests/components/window/SubwindowDraggability.java
+++ b/tests/testbench/com/vaadin/tests/components/window/SubwindowDraggability.java
@@ -21,6 +21,7 @@ public class SubwindowDraggability extends TestBase {
Button b = new Button("Swap", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
boolean b = draggableSubWindow.isDraggable();
diff --git a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.html b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.html
new file mode 100644
index 0000000000..d734cab9ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.html
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>TooltipInWindow</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">TooltipInWindow</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.components.window.TooltipInWindow?restartApplication</td>
+ <td></td>
+</tr>
+<!--Show tooltip in Root-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VVerticalLayout[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>5,5</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>My tooltip</td>
+</tr>
+<!--Hide the tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VVerticalLayout[0]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]</td>
+ <td></td>
+</tr>
+<!--Show tooltip in Window-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::/VWindow[0]/FocusableScrollPanel[0]/VVerticalLayout[0]/VTextField[0]</td>
+ <td>5,5</td>
+</tr>
+<tr>
+ <td>pause</td>
+ <td>1000</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestscomponentswindowTooltipInWindow::Root/VTooltip[0]/FlowPanel[0]/domChild[1]</td>
+ <td>My tooltip</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java
new file mode 100644
index 0000000000..184bde9b14
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java
@@ -0,0 +1,41 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.components.window;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.TextField;
+import com.vaadin.ui.Window;
+
+public class TooltipInWindow extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Window window = new Window("Window");
+ window.getContent().setSizeUndefined();
+ window.center();
+ window.addComponent(createTextField());
+
+ addWindow(window);
+ addComponent(createTextField());
+ }
+
+ private TextField createTextField() {
+ TextField tf = new TextField("TextField with a tooltip");
+ tf.setDescription("My tooltip");
+ return tf;
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Tooltips should also work in a Window (as well as in other overlays)";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(9172);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.java b/tests/testbench/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.java
index ed259b2f4c..715d089f57 100644
--- a/tests/testbench/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.java
+++ b/tests/testbench/com/vaadin/tests/components/window/UndefinedHeightSubWindowAndContent.java
@@ -28,6 +28,7 @@ public class UndefinedHeightSubWindowAndContent extends TestBase {
field1.setImmediate(true);
field1.addValidator(new Validator() {
+ @Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException("FAIL!");
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowCaptionTest.html b/tests/testbench/com/vaadin/tests/components/window/WindowCaptionTest.html
index 83889aedb8..a9a6fd621e 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowCaptionTest.html
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowCaptionTest.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>Short</td>
</tr>
<tr>
@@ -43,7 +43,7 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>This is a semi-long text that might wrap.</td>
</tr>
<tr>
@@ -68,7 +68,7 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[1]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowTest::PID_StestComponent/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
index a7dc524d6d..af5b9ec180 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.html
@@ -3,13 +3,13 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head profile="http://selenium-ide.openqa.org/profiles/test-case">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>New Test</title>
+<link rel="selenium.base" href="http://localhost:8070" />
+<title>WindowClickEvents</title>
</head>
<body>
<table cellpadding="1" cellspacing="1" border="1">
<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
+<tr><td rowspan="1" colspan="3">WindowClickEvents</td></tr>
</thead><tbody>
<tr>
<td>setSpeed</td>
@@ -23,17 +23,17 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
- <td>154,150</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/VLabel[0]</td>
+ <td>150,5</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>1. Click using left on Main window layout</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_0</td>
<td>2. Click using left on Main window</td>
</tr>
<tr>
@@ -43,12 +43,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>3. Click using left on Sub window layout</td>
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_0</td>
<td>4. Click using left on Sub window</td>
</tr>
<!--Clicking on the button should not produce a window click event-->
@@ -72,6 +72,7 @@
<td>vaadin=runcomvaadintestscomponentswindowWindowClickEvents::PID_SLog_row_1</td>
<td>4. Click using left on Sub window</td>
</tr>
+
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.java b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.java
index 041ccaaf30..a4120b7d42 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowClickEvents.java
@@ -29,6 +29,7 @@ public class WindowClickEvents extends TestBase {
protected void setup() {
VerticalLayout layout = new VerticalLayout();
layout.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
WindowClickEvents.this.click("Sub window layout", event);
}
@@ -36,6 +37,7 @@ public class WindowClickEvents extends TestBase {
((VerticalLayout) getMainWindow().getContent())
.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
WindowClickEvents.this.click("Main window layout",
event);
@@ -45,6 +47,7 @@ public class WindowClickEvents extends TestBase {
Window centered = new Window("A window with a click listener", layout);
centered.addListener(new ClickListener() {
+ @Override
public void click(ClickEvent event) {
WindowClickEvents.this.click("Sub window", event);
}
@@ -60,6 +63,7 @@ public class WindowClickEvents extends TestBase {
"Clicking here should not produce a layout click event");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
log.log("Click on button");
}
@@ -73,6 +77,7 @@ public class WindowClickEvents extends TestBase {
addComponent(log);
getMainWindow().addListener(new ClickListener() {
+ @Override
public void click(ClickEvent event) {
WindowClickEvents.this.click("Main window", event);
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
index 62f998e20e..74d7b564db 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.components.window;
-import com.vaadin.terminal.Sizeable;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.terminal.Page;
+import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.ResizeEvent;
-import com.vaadin.ui.Window.ResizeListener;
public class WindowResizeListener extends TestBase {
@@ -33,19 +33,22 @@ public class WindowResizeListener extends TestBase {
final Label l = new Label();
getLayout().addComponent(l);
- getMainWindow().addListener(new ResizeListener() {
- public void windowResized(ResizeEvent e) {
- l.setValue("Current main window size: "
- + getMainWindow().getWidth() + " x "
- + getMainWindow().getHeight());
+ getMainWindow().addListener(new Page.BrowserWindowResizeListener() {
+ @Override
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ l.setValue("Current browser window size: "
+ + getMainWindow().getBrowserWindowWidth() + " x "
+ + getMainWindow().getBrowserWindowHeight());
}
});
CheckBox subwindow = new CheckBox("show subwindow");
subwindow.setImmediate(true);
- subwindow.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (event.getButton().booleanValue()) {
+ subwindow.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
getMainWindow().addWindow(subwin);
} else {
getMainWindow().removeWindow(subwin);
@@ -55,9 +58,11 @@ public class WindowResizeListener extends TestBase {
getLayout().addComponent(subwindow);
CheckBox immediate = new CheckBox("immediate");
- immediate.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean booleanValue = event.getButton().booleanValue();
+ immediate.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ boolean booleanValue = (Boolean) event.getProperty().getValue();
getMainWindow().setImmediate(booleanValue);
subwin.setImmediate(booleanValue);
}
@@ -85,6 +90,7 @@ class ResizeListenerWindow extends Window {
hl.addComponent(sizeLabel);
addListener(new ResizeListener() {
+ @Override
public void windowResized(ResizeEvent e) {
updateLabel();
}
@@ -94,9 +100,7 @@ class ResizeListenerWindow extends Window {
}
public void updateLabel() {
- sizeLabel
- .setValue(getWidth() + Sizeable.UNIT_SYMBOLS[getWidthUnits()]
- + " x " + getHeight()
- + Sizeable.UNIT_SYMBOLS[getHeightUnits()]);
+ sizeLabel.setValue(getWidth() + getWidthUnits().getSymbol() + " x "
+ + getHeight() + getHeightUnits().getSymbol());
}
}
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
index 200d52a389..fdeb21d29c 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingComponentIntoView.java
@@ -8,6 +8,7 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
@@ -29,15 +30,7 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
Table table = new Table();
table.setPageLength(50);
- final Button up = new Button("up");
- up.addListener(new Button.ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- up.getWindow().setScrollTop(0);
- }
- });
-
- setMainWindow(new Window(""));
+ setMainWindow(new LegacyWindow(""));
getMainWindow().getContent().setSizeUndefined();
Component l2 = null;
@@ -67,6 +60,7 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
window.addComponent(new Button("Scroll mainwin to X9",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().scrollIntoView(x9);
@@ -74,6 +68,7 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
}));
window.addComponent(new Button("Scroll mainwin to Y9",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().scrollIntoView(y9);
@@ -82,7 +77,6 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
Panel panel = new Panel("scrollable panel");
panel.setHeight(400, Panel.UNITS_PIXELS);
- panel.setScrollable(true);
panel.setScrollLeft(50);
panel.setScrollTop(50);
panel.getContent().setSizeUndefined();
@@ -108,14 +102,18 @@ public class WindowScrollingComponentIntoView extends AbstractTestCase {
((VerticalLayout) getMainWindow().getContent()).addComponent(
new Button("Scroll win to X9", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- window.scrollIntoView(x29);
+ throw new RuntimeException("Currently not implemented");
+ // window.scrollIntoView(x29);
}
}), 0);
((VerticalLayout) getMainWindow().getContent()).addComponent(
new Button("Scroll win to Y9", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- window.scrollIntoView(y29);
+ throw new RuntimeException("Currently not implemented");
+ // window.scrollIntoView(y29);
}
}), 0);
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
index 44e5bf0d35..43f8297a5d 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowScrollingUp.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.components.window;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class WindowScrollingUp extends AbstractTestCase {
@@ -26,12 +26,13 @@ public class WindowScrollingUp extends AbstractTestCase {
final Button up = new Button("up");
up.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- up.getWindow().setScrollTop(0);
+ up.getRoot().setScrollTop(0);
}
});
- setMainWindow(new Window(""));
+ setMainWindow(new LegacyWindow(""));
getMainWindow().addComponent(table);
getMainWindow().addComponent(up);
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java b/tests/testbench/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java
index 88fb014690..fa01706c56 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java
@@ -30,6 +30,7 @@ public class WindowShouldRemoveActionHandler extends TestBase {
Button add = new Button("Add an action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
add();
}
@@ -38,6 +39,7 @@ public class WindowShouldRemoveActionHandler extends TestBase {
Button addAnother = new Button("Add another action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addAnother();
}
@@ -46,6 +48,7 @@ public class WindowShouldRemoveActionHandler extends TestBase {
Button remove = new Button("Remove an action handler",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
remove();
}
@@ -71,12 +74,14 @@ public class WindowShouldRemoveActionHandler extends TestBase {
getMainWindow().getCaption() + " - Added handler");
Handler actionHandler = new Handler() {
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { new ShortcutAction("Ctrl+Left",
ShortcutAction.KeyCode.ARROW_LEFT,
new int[] { ModifierKey.CTRL }) };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification(
"Handling action " + action.getCaption());
@@ -90,12 +95,14 @@ public class WindowShouldRemoveActionHandler extends TestBase {
public void addAnother() {
Handler actionHandler = new Handler() {
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { new ShortcutAction("Ctrl+Right",
ShortcutAction.KeyCode.ARROW_RIGHT,
new int[] { ModifierKey.CTRL }) };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification(
"Handling action " + action.getCaption());
diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowStyleNames.java b/tests/testbench/com/vaadin/tests/components/window/WindowStyleNames.java
index 3a36926b42..615f391613 100644
--- a/tests/testbench/com/vaadin/tests/components/window/WindowStyleNames.java
+++ b/tests/testbench/com/vaadin/tests/components/window/WindowStyleNames.java
@@ -22,6 +22,7 @@ public class WindowStyleNames extends TestBase {
setWindowStyle("old");
addComponent(new Button("Set style to 'new'", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
setWindowStyle("new");
}
@@ -30,6 +31,7 @@ public class WindowStyleNames extends TestBase {
addComponent(new Button("Set style to 'custom'", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
setWindowStyle("custom");
}
@@ -38,6 +40,7 @@ public class WindowStyleNames extends TestBase {
addComponent(new Button("Add 'foo' style", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().addStyleName("foo");
}
diff --git a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
index 24ff586b7b..4f41410ba3 100644
--- a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
+++ b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java
@@ -1,6 +1,8 @@
package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.BeanItemContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -84,17 +86,18 @@ public class BeanItemContainerFilteringTest extends TestBase {
filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter on value",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
- container.addContainerFilter("value",
- filterString.getValue().toString(),
- false, false);
- }
- }
- });
+ final CheckBox cb = new CheckBox("Filter on value");
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ container.removeAllContainerFilters();
+ if (((CheckBox) event.getProperty()).getValue()) {
+ container.addContainerFilter("value", filterString
+ .getValue().toString(), false, false);
+ }
+ }
+ });
cb.setImmediate(true);
vl.addComponent(cb);
@@ -106,6 +109,7 @@ public class BeanItemContainerFilteringTest extends TestBase {
final Button addItemButton = new Button("addItem()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
container.addItem(new TestBean("addItem() "
+ nextToAdd, "value " + nextToAdd));
@@ -118,6 +122,7 @@ public class BeanItemContainerFilteringTest extends TestBase {
final Button addItemAfterButton = new Button("addItemAfter()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object selection = table.getValue();
if (selection == null) {
@@ -143,6 +148,7 @@ public class BeanItemContainerFilteringTest extends TestBase {
final Button addItemAtButton = new Button("addItemAt()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
int index = Integer.parseInt(position.getValue()
.toString());
diff --git a/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java b/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
index fb5fe8c27a..eba8ded705 100644
--- a/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
+++ b/tests/testbench/com/vaadin/tests/containers/HierarchicalWrapperOrdering.java
@@ -94,11 +94,13 @@ public class HierarchicalWrapperOrdering extends TestBase {
new ClickListener() {
private static final long serialVersionUID = 1L;
+ @Override
public void buttonClick(ClickEvent event) {
// Get first item
Object itemId = indexedContainer.getIdByIndex(0);
Item item = indexedContainer.getItem(itemId);
- Property property = item.getItemProperty("name");
+ Property<String> property = (Property<String>) item
+ .getItemProperty("name");
// Prepend with Z so item should get sorted later
property.setValue("Z " + property.getValue());
// this does not work alone, requires extraneous
diff --git a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
index bfa9ed5512..b30ef3e616 100644
--- a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
+++ b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java
@@ -1,6 +1,8 @@
package com.vaadin.tests.containers;
import com.vaadin.data.Item;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.TestBase;
@@ -51,10 +53,13 @@ public class IndexedContainerFilteringTest extends TestBase {
filterString = new TextField("Filter string:", "1");
vl.addComponent(filterString);
- final CheckBox cb = new CheckBox("Filter", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ final CheckBox cb = new CheckBox("Filter");
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
container.removeAllContainerFilters();
- if (((CheckBox) event.getSource()).booleanValue()) {
+ if (((CheckBox) event.getProperty()).getValue()) {
container.addContainerFilter("column1", filterString
.getValue().toString(), false, false);
}
@@ -71,6 +76,7 @@ public class IndexedContainerFilteringTest extends TestBase {
final Button addItemButton = new Button("addItem()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Item item = container.addItem("addItem() " + nextToAdd);
if (item != null) {
@@ -86,6 +92,7 @@ public class IndexedContainerFilteringTest extends TestBase {
final Button addItemAfterButton = new Button("addItemAfter()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Object selection = table.getValue();
if (selection == null) {
@@ -113,6 +120,7 @@ public class IndexedContainerFilteringTest extends TestBase {
final Button addItemAtButton = new Button("addItemAt()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
int index = Integer.parseInt(position.getValue()
.toString());
diff --git a/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java b/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
index bedb2a735e..25d0053fb2 100644
--- a/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
+++ b/tests/testbench/com/vaadin/tests/containers/TableWithFileSystemContainer.java
@@ -3,17 +3,15 @@ package com.vaadin.tests.containers;
import java.io.File;
import com.vaadin.data.util.FilesystemContainer;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class TableWithFileSystemContainer extends AbstractTestCase {
+public class TableWithFileSystemContainer extends TestBase {
private String testPath = "C:/temp/img";
@Override
- public void init() {
- setMainWindow(new Window(""));
+ public void setup() {
Table table = new Table("Documents", new FilesystemContainer(new File(
testPath)));
table.setWidth("100%");
diff --git a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
index bf7ce6175a..46c4e004c1 100644
--- a/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
+++ b/tests/testbench/com/vaadin/tests/containers/TestItemSorter.java
@@ -27,10 +27,11 @@ public class TestItemSorter extends TestBase {
populateContainer(container);
container.setItemSorter(new DefaultItemSorter(new Comparator<Object>() {
+ @Override
public int compare(Object o1, Object o2) {
if (o1 instanceof CheckBox && o2 instanceof CheckBox) {
- Boolean b1 = ((CheckBox) o1).booleanValue();
- return b1.compareTo(((CheckBox) o2).booleanValue());
+ Boolean b1 = (Boolean) ((CheckBox) o1).getValue();
+ return b1.compareTo((Boolean) ((CheckBox) o2).getValue());
} else if (o1 instanceof Button && o2 instanceof Button) {
String caption1 = ((Button) o1).getCaption().toLowerCase();
String caption2 = ((Button) o2).getCaption().toLowerCase();
diff --git a/tests/testbench/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java b/tests/testbench/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java
index 91403f54d6..0afaf2c15f 100644
--- a/tests/testbench/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java
+++ b/tests/testbench/com/vaadin/tests/containers/filesystemcontainer/FileSystemContainerInTreeTable.java
@@ -51,6 +51,7 @@ public class FileSystemContainerInTreeTable extends TestBase {
treeTable.setColumnWidth("Name", 400);
treeTable.addListener(new ExpandListener() {
+ @Override
public void nodeExpand(ExpandEvent event) {
logExpandCollapse(event.getItemId(), "expanded");
@@ -58,6 +59,7 @@ public class FileSystemContainerInTreeTable extends TestBase {
});
treeTable.addListener(new CollapseListener() {
+ @Override
public void nodeCollapse(CollapseEvent event) {
logExpandCollapse(event.getItemId(), "collapsed");
@@ -71,6 +73,7 @@ public class FileSystemContainerInTreeTable extends TestBase {
buttonLayout.setSpacing(true);
buttonLayout.addComponent(new Button("Create dir11",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
new File(folder, "dir11").mkdir();
log.log("Row dir11 created");
@@ -78,6 +81,7 @@ public class FileSystemContainerInTreeTable extends TestBase {
}));
buttonLayout.addComponent(new Button("Delete dir11",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
new File(folder, "dir11").delete();
log.log("Row dir11 deleted");
@@ -86,6 +90,7 @@ public class FileSystemContainerInTreeTable extends TestBase {
// to clean up explicitly before ending an automated test
buttonLayout.addComponent(new Button("Clean all files",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
folder.delete();
}
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
index e06db94589..f34c12607a 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/CheckboxUpdateProblem.java
@@ -10,14 +10,13 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class CheckboxUpdateProblem extends Application implements
- Property.ValueChangeListener {
+public class CheckboxUpdateProblem extends Application.LegacyApplication
+ implements Property.ValueChangeListener {
private final DatabaseHelper databaseHelper = new DatabaseHelper();
private Table testList;
private final HorizontalSplitPanel horizontalSplit = new HorizontalSplitPanel();
@@ -26,7 +25,7 @@ public class CheckboxUpdateProblem extends Application implements
@Override
public void init() {
- setMainWindow(new Window("Test window"));
+ setMainWindow(new LegacyWindow("Test window"));
horizontalSplit.setSizeFull();
testList = new Table();
@@ -39,6 +38,7 @@ public class CheckboxUpdateProblem extends Application implements
databaseHelper.getTestContainer().addListener(
new ItemSetChangeListener() {
+ @Override
public void containerItemSetChange(ItemSetChangeEvent event) {
Object selected = testList.getValue();
if (selected != null) {
@@ -56,9 +56,10 @@ public class CheckboxUpdateProblem extends Application implements
getMainWindow().setContent(horizontalSplit);
}
+ @Override
public void valueChange(ValueChangeEvent event) {
- Property property = event.getProperty();
+ Property<?> property = event.getProperty();
if (property == testList) {
Item item = testList.getItem(testList.getValue());
@@ -78,11 +79,12 @@ public class CheckboxUpdateProblem extends Application implements
setWriteThrough(false);
setInvalidCommitted(false);
- save = new Button("Save", (ClickListener) this);
+ save = new Button("Save", this);
getFooter().addComponent(save);
getFooter().setVisible(false);
}
+ @Override
public void buttonClick(ClickEvent event) {
if (event.getSource() == save) {
super.commit();
@@ -109,4 +111,4 @@ public class CheckboxUpdateProblem extends Application implements
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java
index ed6d39bb62..b7d1b8c37e 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/ComboBoxUpdateProblem.java
@@ -3,17 +3,17 @@ package com.vaadin.tests.containers.sqlcontainer;
import com.vaadin.Application;
import com.vaadin.ui.AbstractSelect.Filtering;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
/**
* See http://dev.vaadin.com/ticket/9155 .
*/
-public class ComboBoxUpdateProblem extends Application {
+public class ComboBoxUpdateProblem extends Application.LegacyApplication {
private final DatabaseHelper databaseHelper = new DatabaseHelper();
@Override
public void init() {
- setMainWindow(new Window("Test window"));
+ setMainWindow(new Root.LegacyWindow("Test window"));
ComboBox combo = new ComboBox("Names",
databaseHelper.getTestContainer());
diff --git a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
index 419e606bfc..dc919fdb12 100644
--- a/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
+++ b/tests/testbench/com/vaadin/tests/containers/sqlcontainer/MassInsertMemoryLeakTestApp.java
@@ -12,8 +12,8 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.ComponentContainer;
import com.vaadin.ui.ProgressIndicator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
// author table in testdb (MySQL) is set out as follows
// +-------------+-------------+------+-----+---------+----------------+
@@ -25,16 +25,17 @@ import com.vaadin.ui.Window;
// +-------------+-------------+------+-----+---------+----------------+
@SuppressWarnings("serial")
-public class MassInsertMemoryLeakTestApp extends Application {
+public class MassInsertMemoryLeakTestApp extends Application.LegacyApplication {
ProgressIndicator proggress = new ProgressIndicator();
Button process = new Button("Mass insert");
@Override
public void init() {
- setMainWindow(new Window("SQLContainer Test", buildLayout()));
+ setMainWindow(new LegacyWindow("SQLContainer Test", buildLayout()));
process.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
MassInsert mi = new MassInsert();
mi.start();
diff --git a/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java b/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java
new file mode 100644
index 0000000000..59aa45dc36
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/converter/ConverterThatEnforcesAFormat.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.converter;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.TextField;
+
+public class ConverterThatEnforcesAFormat extends TestBase {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup() {
+ final TextField tf = new TextField(
+ "This field should always be formatted with 3 digits");
+ tf.setConverter(new StringToDoubleConverterWithThreeFractionDigits());
+ tf.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ log.log("Value changed to "
+ + event.getProperty().getValue()
+ + "(converted value is "
+ + tf.getConvertedValue()
+ + "). Two-way conversion gives: "
+ + tf.getConverter().convertToPresentation(
+ tf.getConverter().convertToModel(tf.getValue(),
+ tf.getLocale()), tf.getLocale()) + ")");
+ }
+ });
+ tf.setImmediate(true);
+ addComponent(log);
+ addComponent(tf);
+ tf.setConvertedValue(50.0);
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Entering a valid double in the field should always cause the field contents to be formatted to contain 3 digits after the decimal point";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return 8191;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java b/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java
new file mode 100644
index 0000000000..23c22a7026
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/converter/StringToDoubleConverterWithThreeFractionDigits.java
@@ -0,0 +1,19 @@
+package com.vaadin.tests.converter;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToDoubleConverter;
+
+public class StringToDoubleConverterWithThreeFractionDigits extends
+ StringToDoubleConverter {
+
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ NumberFormat format = super.getFormat(locale);
+ format.setGroupingUsed(false);
+ format.setMaximumFractionDigits(3);
+ format.setMinimumFractionDigits(3);
+ return format;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/dd/AcceptAnythingWindow.java b/tests/testbench/com/vaadin/tests/dd/AcceptAnythingWindow.java
index 308f002e4f..5d57de388c 100644
--- a/tests/testbench/com/vaadin/tests/dd/AcceptAnythingWindow.java
+++ b/tests/testbench/com/vaadin/tests/dd/AcceptAnythingWindow.java
@@ -7,7 +7,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.AbsoluteLayout.ComponentPosition;
import com.vaadin.ui.Component;
@@ -28,10 +28,12 @@ public class AcceptAnythingWindow extends Window {
final DragAndDropWrapper wrapper = new DragAndDropWrapper(layout);
wrapper.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent event) {
WrapperTargetDetails ed = (WrapperTargetDetails) event
.getTargetDetails();
diff --git a/tests/testbench/com/vaadin/tests/dd/AcceptFromComponent.java b/tests/testbench/com/vaadin/tests/dd/AcceptFromComponent.java
index 43bdce2ad4..99dd069142 100644
--- a/tests/testbench/com/vaadin/tests/dd/AcceptFromComponent.java
+++ b/tests/testbench/com/vaadin/tests/dd/AcceptFromComponent.java
@@ -7,7 +7,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.AbsoluteLayout.ComponentPosition;
import com.vaadin.ui.Component;
@@ -37,6 +37,7 @@ public class AcceptFromComponent extends Window {
final ServerSideCriterion serverSideCriterion = new ServerSideCriterion() {
+ @Override
public boolean accept(DragAndDropEvent dragEvent) {
Transferable transferable = dragEvent.getTransferable();
if (transferable instanceof TransferableImpl) {
@@ -51,10 +52,12 @@ public class AcceptFromComponent extends Window {
wrapper.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return serverSideCriterion;
}
+ @Override
public void drop(DragAndDropEvent event) {
WrapperTargetDetails ed = (WrapperTargetDetails) event
diff --git a/tests/testbench/com/vaadin/tests/dd/ActiveDragSourceClassName.java b/tests/testbench/com/vaadin/tests/dd/ActiveDragSourceClassName.java
index 889c6bb47b..9ef1b4029b 100644
--- a/tests/testbench/com/vaadin/tests/dd/ActiveDragSourceClassName.java
+++ b/tests/testbench/com/vaadin/tests/dd/ActiveDragSourceClassName.java
@@ -23,27 +23,29 @@ public class ActiveDragSourceClassName extends TestBase {
private static final String GREENBOXES = ".greenblock {float:left; width:60px;height:60px;background: green !important; padding:0; margin:2px;-webkit-transition: width 0.3s ease-in-out;}";
private static final String HIDEDRAGSOURCE = ".v-active-drag-source { overflow:hidden; width:0px !important;}";
+ @Override
protected void setup() {
TestUtils.injectCSS(getMainWindow(), GREENBOXES + HIDEDRAGSOURCE);
-
+
VerticalLayout l = new VerticalLayout();
l.setWidth("400px");
l.setHeight("100px");
DragAndDropWrapper pane = new DragAndDropWrapper(cssLayout);
pane.setSizeFull();
l.addComponent(pane);
-
+
addComponent(l);
-
+
for (int i = 0; i < 4; i++) {
cssLayout.addComponent(new WrappedLabel("Block"));
}
-
+
}
-
+
static int count;
- private CssLayout cssLayout = new CssLayout() {};
+ private CssLayout cssLayout = new CssLayout() {
+ };
class WrappedLabel extends DragAndDropWrapper {
@@ -68,10 +70,12 @@ public class ActiveDragSourceClassName extends TestBase {
private DropHandler dh = new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
Transferable transferable = dropEvent.getTransferable();
if (transferable instanceof TransferableImpl) {
diff --git a/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java b/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
index c789ead113..f6e196761e 100644
--- a/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
+++ b/tests/testbench/com/vaadin/tests/dd/CustomDDImplementation.java
@@ -9,7 +9,6 @@ import com.vaadin.event.dd.TargetDetails;
import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.ui.AbstractComponent;
-import com.vaadin.ui.ClientWidget;
import com.vaadin.ui.Component;
import com.vaadin.ui.CssLayout;
import com.vaadin.ui.CustomComponent;
@@ -38,16 +37,18 @@ public class CustomDDImplementation extends CustomComponent {
* Check the @ClientWidget
*
*/
- @ClientWidget(VMyDropTarget.class)
class MyDropTarget extends AbstractComponent implements DropTarget {
+ @Override
public DropHandler getDropHandler() {
return new DropHandler() {
+ @Override
public void drop(DragAndDropEvent event) {
// Do something with data
return;
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
@@ -55,6 +56,7 @@ public class CustomDDImplementation extends CustomComponent {
};
}
+ @Override
public TargetDetails translateDropTargetDetails(
Map<String, Object> clientVariables) {
// If component has some special drop details that it needs to
@@ -76,7 +78,6 @@ public class CustomDDImplementation extends CustomComponent {
* operations that are controlled via server side api.
*
*/
- @ClientWidget(VMyDragSource.class)
public class MyDragSource extends AbstractComponent implements Component {
}
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest1.java b/tests/testbench/com/vaadin/tests/dd/DDTest1.java
index 0d709844e9..2067d559d7 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest1.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest1.java
@@ -10,8 +10,8 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractSelect.AcceptItem;
import com.vaadin.ui.Component;
@@ -62,6 +62,7 @@ public class DDTest1 extends TestBase {
*/
private static final long serialVersionUID = 1L;
+ @Override
public boolean accept(DragAndDropEvent dragEvent) {
Transferable transferable = dragEvent.getTransferable();
// System.out.println("Simulating 500ms processing...");
@@ -188,6 +189,7 @@ public class DDTest1 extends TestBase {
}
+ @Override
public void drop(DragAndDropEvent event) {
TreeTargetDetails details = (TreeTargetDetails) event
.getTargetDetails();
@@ -224,6 +226,7 @@ public class DDTest1 extends TestBase {
return;
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
// TODO should actually check that source is same as target
return AcceptItem.ALL;
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest2.java b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
index 69af2d3f1d..272be53034 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest2.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest2.java
@@ -24,6 +24,7 @@ import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.AbstractSelect.AcceptItem;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.TableTransferable;
import com.vaadin.ui.Tree;
@@ -44,7 +45,7 @@ public class DDTest2 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
/* darn reindeer has no icons */
/* Make all trees (their nodes actually) draggable */
@@ -87,6 +88,7 @@ public class DDTest2 extends TestBase {
};
tree3.setDropHandler(new DropHandler() {
+ @Override
public void drop(DragAndDropEvent dropEvent) {
Transferable transferable = dropEvent.getTransferable();
@@ -94,12 +96,13 @@ public class DDTest2 extends TestBase {
if (transferable instanceof TableTransferable) {
TableTransferable tr = (TableTransferable) transferable;
System.out.println("From table row" + tr.getPropertyId());
- data = tr.getSourceContainer().getItem(tr.getItemId())
- .getItemProperty(tr.getPropertyId()).toString();
-
+ Object value = tr.getSourceContainer()
+ .getItem(tr.getItemId())
+ .getItemProperty(tr.getPropertyId()).getValue();
+ data = (null != value) ? value.toString() : null;
}
if (data == null) {
- data = "-no Text data flawor-";
+ data = "-no Text data flavor-";
}
tree3.addItem(data);
AbstractSelect.AbstractSelectTargetDetails dropTargetData = (AbstractSelect.AbstractSelectTargetDetails) dropEvent
@@ -108,6 +111,7 @@ public class DDTest2 extends TestBase {
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit;
}
@@ -134,10 +138,11 @@ public class DDTest2 extends TestBase {
DropHandler dropHandler = new DropHandler() {
+ @Override
public void drop(DragAndDropEvent event) {
/*
* We know transferrable is from table, so it is of type
- * DataBindedTransferrable
+ * DataBoundTransferrable
*/
DataBoundTransferable tr = (DataBoundTransferable) event
.getTransferable();
@@ -147,8 +152,10 @@ public class DDTest2 extends TestBase {
// if the source is from table (not from tree1 itself),
// transfer Name property and use it as an identifier in
// tree1
- String name = sourceContainer.getItem(itemId)
- .getItemProperty("Name").toString();
+ Object nameValue = sourceContainer.getItem(itemId)
+ .getItemProperty("Name").getValue();
+ String name = (null != nameValue) ? nameValue.toString()
+ : null;
tree1.addItem(name);
tree1.setChildrenAllowed(name, false);
@@ -173,6 +180,7 @@ public class DDTest2 extends TestBase {
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return and;
}
@@ -190,6 +198,7 @@ public class DDTest2 extends TestBase {
*/
dropHandler = new DropHandler() {
+ @Override
public void drop(DragAndDropEvent event) {
AbstractSelectTargetDetails details = (AbstractSelectTargetDetails) event
.getTargetDetails();
@@ -229,6 +238,7 @@ public class DDTest2 extends TestBase {
}
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptItem.ALL;
}
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest4.java b/tests/testbench/com/vaadin/tests/dd/DDTest4.java
index b4da141ce2..c7f0c6960b 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest4.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest4.java
@@ -9,15 +9,15 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.SourceIs;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Person;
import com.vaadin.tests.util.PersonContainer;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class DDTest4 extends TestBase {
@@ -28,7 +28,7 @@ public class DDTest4 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
TestUtils
.injectCSS(
@@ -64,10 +64,12 @@ public class DDTest4 extends TestBase {
// accept only drags from this table
AcceptCriterion crit = new SourceIs(table);
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit;
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dropEvent
.getTargetDetails();
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest5.java b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
index e4f3d5335d..63d1e9e3c2 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest5.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest5.java
@@ -15,7 +15,7 @@ import com.vaadin.ui.DragAndDropWrapper.DragStartMode;
import com.vaadin.ui.DragAndDropWrapper.WrapperTransferable;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
public class DDTest5 extends TestBase {
@@ -47,7 +47,7 @@ public class DDTest5 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
HorizontalSortableCssLayoutWithWrappers verticalSortableCssLayoutWithWrappers = new HorizontalSortableCssLayoutWithWrappers();
w.addWindow(verticalSortableCssLayoutWithWrappers);
@@ -86,10 +86,12 @@ public class DDTest5 extends TestBase {
dh = new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
/*
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest6.java b/tests/testbench/com/vaadin/tests/dd/DDTest6.java
index 4299b321c3..c6ac0b1859 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest6.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest6.java
@@ -25,12 +25,12 @@ import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.Not;
import com.vaadin.event.dd.acceptcriteria.SourceIsTarget;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.StreamResource;
import com.vaadin.terminal.StreamResource.StreamSource;
import com.vaadin.terminal.StreamVariable;
import com.vaadin.terminal.ThemeResource;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbsoluteLayout;
@@ -97,10 +97,12 @@ public class DDTest6 extends TestBase {
tree1.setDragMode(TreeDragMode.NODE);
DropHandler dropHandler = new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
File file = null;
Folder folder = null;
@@ -127,12 +129,14 @@ public class DDTest6 extends TestBase {
private Action[] actions = new Action[] { new Action("Remove") };
+ @Override
public void handleAction(Action action, Object sender, Object target) {
ContainerHierarchicalWrapper containerDataSource = (ContainerHierarchicalWrapper) tree1
.getContainerDataSource();
containerDataSource.removeItemRecursively(target);
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
@@ -140,6 +144,7 @@ public class DDTest6 extends TestBase {
tree1.addActionHandler(actionHandler);
tree1.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object value = event.getProperty().getValue();
if (value != null && !(value instanceof Folder)) {
@@ -159,7 +164,7 @@ public class DDTest6 extends TestBase {
getLayout().addComponent(sp);
TestUtils
.injectCSS(
- getLayout().getWindow(),
+ getLayout().getRoot(),
""
+ ".v-tree .v-icon {height:16px;} "
+ ".v-tree-node-caption-drag-top {/*border-top: none;*/} "
@@ -215,6 +220,7 @@ public class DDTest6 extends TestBase {
public Resource getResource() {
StreamSource streamSource = new StreamSource() {
+ @Override
public InputStream getStream() {
if (bas != null) {
byte[] byteArray = bas.toByteArray();
@@ -355,6 +361,7 @@ public class DDTest6 extends TestBase {
}
+ @Override
@SuppressWarnings("static-access")
public void drop(DragAndDropEvent dropEvent) {
@@ -402,29 +409,36 @@ public class DDTest6 extends TestBase {
StreamVariable streamVariable = new StreamVariable() {
+ @Override
public OutputStream getOutputStream() {
return bas;
}
+ @Override
public boolean listenProgress() {
return false;
}
+ @Override
public void onProgress(StreamingProgressEvent event) {
}
+ @Override
public void streamingStarted(
StreamingStartEvent event) {
}
+ @Override
public void streamingFinished(
StreamingEndEvent event) {
}
+ @Override
public void streamingFailed(
StreamingErrorEvent event) {
}
+ @Override
public boolean isInterrupted() {
return false;
}
@@ -448,6 +462,7 @@ public class DDTest6 extends TestBase {
}
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
@@ -473,6 +488,7 @@ public class DDTest6 extends TestBase {
l.addComponent(new Label(name));
l.addListener(new LayoutClickListener() {
+ @Override
@SuppressWarnings("static-access")
public void layoutClick(LayoutClickEvent event) {
if (event.isDoubleClick()) {
@@ -506,10 +522,12 @@ public class DDTest6 extends TestBase {
setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return new Not(SourceIsTarget.get());
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
File f = null;
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest7.java b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
index 6027b3e499..f9be935b23 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest7.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest7.java
@@ -16,8 +16,8 @@ import com.vaadin.tests.util.PersonContainer;
import com.vaadin.tests.util.TestUtils;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
public class DDTest7 extends TestBase {
@@ -29,7 +29,7 @@ public class DDTest7 extends TestBase {
@Override
protected void setup() {
- Window w = getLayout().getWindow();
+ Root w = getLayout().getRoot();
TestUtils
.injectCSS(
@@ -95,10 +95,12 @@ public class DDTest7 extends TestBase {
}
};
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit;
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
AbstractSelectTargetDetails dropTargetData = (AbstractSelectTargetDetails) dropEvent
.getTargetDetails();
diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest8.java b/tests/testbench/com/vaadin/tests/dd/DDTest8.java
index fed889b5c1..ee7d8d9dc5 100644
--- a/tests/testbench/com/vaadin/tests/dd/DDTest8.java
+++ b/tests/testbench/com/vaadin/tests/dd/DDTest8.java
@@ -10,7 +10,7 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.Or;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Tree;
@@ -113,6 +113,7 @@ public class DDTest8 extends TestBase {
}
+ @Override
public void drop(DragAndDropEvent event) {
TreeTargetDetails details = (TreeTargetDetails) event
.getTargetDetails();
@@ -149,6 +150,7 @@ public class DDTest8 extends TestBase {
return;
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return new Or(new AbstractSelect.TargetItemIs(t, "Foo", "Bar"),
new AbstractSelect.AcceptItem(t, "Foo"),
diff --git a/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java b/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java
index ad23338bbf..bea00ae0ad 100644
--- a/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java
+++ b/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java
@@ -35,10 +35,12 @@ public class DragAndDropFiles extends TestBase {
dragAndDropWrapper.setSizeUndefined();
dragAndDropWrapper.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent event) {
WrapperTransferable transferable = (WrapperTransferable) event
.getTransferable();
@@ -59,20 +61,23 @@ public class DragAndDropFiles extends TestBase {
StreamVariable streamVariable = new StreamVariable() {
+ @Override
public OutputStream getOutputStream() {
return new NullOutputStream();
}
+ @Override
public boolean listenProgress() {
return true;
}
- public void onProgress(
- StreamingProgressEvent event) {
+ @Override
+ public void onProgress(StreamingProgressEvent event) {
System.err.println("Progress"
+ event.getBytesReceived());
}
+ @Override
public void streamingStarted(
StreamingStartEvent event) {
getMainWindow().showNotification(
@@ -80,6 +85,7 @@ public class DragAndDropFiles extends TestBase {
+ event.getFileName());
}
+ @Override
public void streamingFinished(
StreamingEndEvent event) {
getMainWindow().showNotification(
@@ -87,6 +93,7 @@ public class DragAndDropFiles extends TestBase {
+ event.getFileName());
}
+ @Override
public void streamingFailed(
StreamingErrorEvent event) {
getMainWindow().showNotification(
@@ -94,6 +101,7 @@ public class DragAndDropFiles extends TestBase {
+ event.getFileName());
}
+ @Override
public boolean isInterrupted() {
return false;
}
diff --git a/tests/testbench/com/vaadin/tests/dd/DragDropPane.java b/tests/testbench/com/vaadin/tests/dd/DragDropPane.java
index 1b7b7b997b..a94b676f2c 100644
--- a/tests/testbench/com/vaadin/tests/dd/DragDropPane.java
+++ b/tests/testbench/com/vaadin/tests/dd/DragDropPane.java
@@ -9,8 +9,8 @@ import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptAll;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
+import com.vaadin.shared.MouseEventDetails;
import com.vaadin.terminal.StreamVariable;
-import com.vaadin.terminal.gwt.client.MouseEventDetails;
import com.vaadin.ui.AbsoluteLayout;
import com.vaadin.ui.AbsoluteLayout.ComponentPosition;
import com.vaadin.ui.Component;
@@ -51,6 +51,7 @@ public class DragDropPane extends DragAndDropWrapper implements DropHandler {
this.crit = crit;
}
+ @Override
public void drop(DragAndDropEvent event) {
WrapperTargetDetails ed = (WrapperTargetDetails) event
@@ -135,28 +136,35 @@ public class DragDropPane extends DragAndDropWrapper implements DropHandler {
html5File.setStreamVariable(new StreamVariable() {
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
+ @Override
public OutputStream getOutputStream() {
return byteArrayOutputStream;
}
+ @Override
public boolean listenProgress() {
return false;
}
+ @Override
public void onProgress(StreamingProgressEvent event) {
}
+ @Override
public void streamingStarted(StreamingStartEvent event) {
}
+ @Override
public void streamingFinished(StreamingEndEvent event) {
l.setValue((new String(byteArrayOutputStream
.toByteArray()).substring(0, 80) + "..."));
}
+ @Override
public void streamingFailed(StreamingErrorEvent event) {
}
+ @Override
public boolean isInterrupted() {
return false;
}
@@ -172,6 +180,7 @@ public class DragDropPane extends DragAndDropWrapper implements DropHandler {
return;
}
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit != null ? crit : AcceptAll.get();
}
diff --git a/tests/testbench/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java b/tests/testbench/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java
index aa51dd539d..fe33bce76b 100644
--- a/tests/testbench/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java
+++ b/tests/testbench/com/vaadin/tests/dd/HorizontalLayoutSortableWithWrappers.java
@@ -54,10 +54,12 @@ public class HorizontalLayoutSortableWithWrappers extends Window {
AcceptCriterion crit = new And(new TargetDetailIs("horizontalLocation",
"LEFT"), new Not(SourceIsTarget.get()));
+ @Override
public AcceptCriterion getAcceptCriterion() {
return crit;
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
Transferable transferable = dropEvent.getTransferable();
if (transferable instanceof TransferableImpl) {
diff --git a/tests/testbench/com/vaadin/tests/dd/HorizontalSortableCssLayoutWithWrappers.java b/tests/testbench/com/vaadin/tests/dd/HorizontalSortableCssLayoutWithWrappers.java
index a77faffd2e..4e9e89add5 100644
--- a/tests/testbench/com/vaadin/tests/dd/HorizontalSortableCssLayoutWithWrappers.java
+++ b/tests/testbench/com/vaadin/tests/dd/HorizontalSortableCssLayoutWithWrappers.java
@@ -48,10 +48,12 @@ public class HorizontalSortableCssLayoutWithWrappers extends Window {
private DropHandler dh = new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent dropEvent) {
Transferable transferable = dropEvent.getTransferable();
if (transferable instanceof TransferableImpl) {
diff --git a/tests/testbench/com/vaadin/tests/dd/MyDragSourceConnector.java b/tests/testbench/com/vaadin/tests/dd/MyDragSourceConnector.java
new file mode 100644
index 0000000000..8a1921cd50
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/dd/MyDragSourceConnector.java
@@ -0,0 +1,29 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.dd;
+
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.Paintable;
+import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.tests.dd.CustomDDImplementation.MyDragSource;
+
+@Connect(MyDragSource.class)
+public class MyDragSourceConnector extends AbstractComponentConnector implements
+ Paintable {
+
+ @Override
+ public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ if (!isRealUpdate(uidl)) {
+ return;
+ }
+ }
+
+ @Override
+ public VMyDragSource getWidget() {
+ return (VMyDragSource) super.getWidget();
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/dd/MyDropTargetConnector.java b/tests/testbench/com/vaadin/tests/dd/MyDropTargetConnector.java
new file mode 100644
index 0000000000..6f7dc820ee
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/dd/MyDropTargetConnector.java
@@ -0,0 +1,30 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.dd;
+
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ApplicationConnection;
+import com.vaadin.terminal.gwt.client.Paintable;
+import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.tests.dd.CustomDDImplementation.MyDropTarget;
+
+@Connect(MyDropTarget.class)
+public class MyDropTargetConnector extends AbstractComponentConnector implements
+ Paintable {
+
+ @Override
+ public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
+ if (!isRealUpdate(uidl)) {
+ return;
+ }
+ getWidget().client = client;
+ }
+
+ @Override
+ public VMyDropTarget getWidget() {
+ return (VMyDropTarget) super.getWidget();
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.html b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.html
index fd45e7284d..03a4830584 100644
--- a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.html
+++ b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.html
@@ -41,7 +41,7 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestsddNotPaintedAcceptSource::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/domChild[0]/domChild[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestsddNotPaintedAcceptSource::/VVerticalLayout[0]/VVerticalLayout[0]/VHorizontalLayout[0]/domChild[0]/domChild[0]/domChild[0]</td>
<td>Source 2</td>
</tr>
<!--Drag value 0 from source 2 and verify-->
diff --git a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java
index 74774f09ab..abe8553267 100644
--- a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java
+++ b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSource.java
@@ -26,10 +26,12 @@ public class NotPaintedAcceptSource extends TestBase {
source2.setDragMode(TableDragMode.ROW);
target.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return new SourceIs(source1, source2);
}
+ @Override
public void drop(DragAndDropEvent event) {
TableTransferable transferable = (TableTransferable) event
.getTransferable();
@@ -55,6 +57,7 @@ public class NotPaintedAcceptSource extends TestBase {
addComponent(horizontalLayout);
addComponent(new Button("Swap sources", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (source1.getParent() != null) {
horizontalLayout.replaceComponent(source1, source2);
diff --git a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSourceInTabSheet.java b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSourceInTabSheet.java
index ac92193764..e19bbaf2c5 100644
--- a/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSourceInTabSheet.java
+++ b/tests/testbench/com/vaadin/tests/dd/NotPaintedAcceptSourceInTabSheet.java
@@ -24,10 +24,12 @@ public class NotPaintedAcceptSourceInTabSheet extends TestBase {
source2.setDragMode(TableDragMode.ROW);
target.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return new SourceIs(source1, source2);
}
+ @Override
public void drop(DragAndDropEvent event) {
TableTransferable transferable = (TableTransferable) event
.getTransferable();
diff --git a/tests/testbench/com/vaadin/tests/dd/ScrolledDropTarget.java b/tests/testbench/com/vaadin/tests/dd/ScrolledDropTarget.java
index 093e12f84a..951b9a4a57 100644
--- a/tests/testbench/com/vaadin/tests/dd/ScrolledDropTarget.java
+++ b/tests/testbench/com/vaadin/tests/dd/ScrolledDropTarget.java
@@ -3,7 +3,7 @@ package com.vaadin.tests.dd;
import com.vaadin.event.dd.DragAndDropEvent;
import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
@@ -28,10 +28,12 @@ public class ScrolledDropTarget extends TestBase {
table.setDragMode(TableDragMode.ROW);
table.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return VerticalLocationIs.MIDDLE;
}
+ @Override
public void drop(DragAndDropEvent event) {
AbstractSelectTargetDetails targetDetails = (AbstractSelectTargetDetails) event
.getTargetDetails();
@@ -44,6 +46,7 @@ public class ScrolledDropTarget extends TestBase {
addComponent(table);
addComponent(new Button("Scroll body", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().executeJavaScript(
"document.body.style.overflow = 'auto';"
diff --git a/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java b/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java
index 2cdef65d31..1a01564220 100644
--- a/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java
+++ b/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java
@@ -27,10 +27,12 @@ public class StartHtml5Drag extends TestBase {
"over here"));
dropTarget.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return AcceptAll.get();
}
+ @Override
public void drop(DragAndDropEvent event) {
getWindows()
.iterator()
diff --git a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
index 4a719bfa7f..27ac8b6586 100644
--- a/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
+++ b/tests/testbench/com/vaadin/tests/dd/TreeDragStart.java
@@ -17,7 +17,7 @@ import com.vaadin.event.dd.DropHandler;
import com.vaadin.event.dd.acceptcriteria.AcceptCriterion;
import com.vaadin.event.dd.acceptcriteria.Not;
import com.vaadin.event.dd.acceptcriteria.Or;
-import com.vaadin.terminal.gwt.client.ui.dd.VerticalDropLocation;
+import com.vaadin.shared.ui.dd.VerticalDropLocation;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails;
import com.vaadin.ui.AbstractSelect.VerticalLocationIs;
@@ -38,6 +38,7 @@ public class TreeDragStart extends TestBase {
checkBox.setImmediate(true);
checkBox.setValue(true);
checkBox.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
tree.setEnabled(!tree.isEnabled());
}
@@ -47,8 +48,9 @@ public class TreeDragStart extends TestBase {
checkBox.setImmediate(true);
checkBox.setValue(true);
checkBox.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- if (((CheckBox) event.getProperty()).booleanValue()) {
+ if ((Boolean) ((CheckBox) event.getProperty()).getValue()) {
tree.setDragMode(TreeDragMode.NODE);
} else {
tree.setDragMode(TreeDragMode.NONE);
@@ -75,6 +77,7 @@ public class TreeDragStart extends TestBase {
// Allow the tree to receive drag drops and handle them
tree.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
// Accept drops in the middle of container items
// and below and above all items.
@@ -82,6 +85,7 @@ public class TreeDragStart extends TestBase {
VerticalLocationIs.MIDDLE));
}
+ @Override
public void drop(DragAndDropEvent event) {
// Wrapper for the object that is dragged
DataBoundTransferable t = (DataBoundTransferable) event
@@ -152,10 +156,12 @@ public class TreeDragStart extends TestBase {
// Allow the table to receive drops and handle them
table.setDropHandler(new DropHandler() {
+ @Override
public AcceptCriterion getAcceptCriterion() {
return new Not(VerticalLocationIs.MIDDLE);
}
+ @Override
public void drop(DragAndDropEvent event) {
// Wrapper for the object that is dragged
DataBoundTransferable t = (DataBoundTransferable) event
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java b/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
index 350ee064f3..e6c7078e8e 100644
--- a/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDragSource.java
@@ -10,23 +10,20 @@ import com.google.gwt.event.dom.client.MouseOutHandler;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTML;
-import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
+import com.google.gwt.user.client.ui.Widget;
import com.vaadin.terminal.gwt.client.ui.dd.VDragAndDropManager;
import com.vaadin.terminal.gwt.client.ui.dd.VTransferable;
/**
* Example code to implement Component that has something to drag.
*/
-public class VMyDragSource extends Composite implements Paintable,
- MouseDownHandler, MouseMoveHandler, MouseOutHandler {
+public class VMyDragSource extends Composite implements MouseDownHandler,
+ MouseMoveHandler, MouseOutHandler {
private boolean mouseDown;
private MouseDownEvent mDownEvent;
- @SuppressWarnings("unused")
- private ApplicationConnection client;
+ @SuppressWarnings("unused")
public VMyDragSource() {
FlowPanel fp = new FlowPanel();
initWidget(fp);
@@ -41,18 +38,12 @@ public class VMyDragSource extends Composite implements Paintable,
}
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- if (client.updateComponent(this, uidl, true)) {
- return;
- }
- this.client = client;
- }
-
/*
* Below a sophisticated drag start implementation. Drag event is started if
* mouse is moved 5 pixels with left mouse key down.
*/
+ @Override
public void onMouseDown(MouseDownEvent event) {
if (event.getNativeButton() == NativeEvent.BUTTON_LEFT) {
mouseDown = true;
@@ -60,6 +51,7 @@ public class VMyDragSource extends Composite implements Paintable,
}
}
+ @Override
public void onMouseMove(MouseMoveEvent event) {
if (mouseDown) {
int deltaX = Math.abs(mDownEvent.getClientX() - event.getClientX());
@@ -84,9 +76,14 @@ public class VMyDragSource extends Composite implements Paintable,
}
+ @Override
public void onMouseOut(MouseOutEvent event) {
mouseDown = false;
mDownEvent = null;
}
+ public Widget getWidgetForPaintable() {
+ return this;
+ }
+
}
diff --git a/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java b/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
index 743cce3095..627f0554f6 100644
--- a/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
+++ b/tests/testbench/com/vaadin/tests/dd/VMyDropTarget.java
@@ -2,51 +2,52 @@ package com.vaadin.tests.dd;
import com.google.gwt.user.client.ui.Composite;
import com.vaadin.terminal.gwt.client.ApplicationConnection;
-import com.vaadin.terminal.gwt.client.Paintable;
-import com.vaadin.terminal.gwt.client.UIDL;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
import com.vaadin.terminal.gwt.client.ui.dd.VDragEvent;
import com.vaadin.terminal.gwt.client.ui.dd.VDropHandler;
import com.vaadin.terminal.gwt.client.ui.dd.VHasDropHandler;
public class VMyDropTarget extends Composite implements VHasDropHandler,
- VDropHandler, Paintable {
+ VDropHandler {
- private ApplicationConnection client;
+ ApplicationConnection client;
+ @Override
public void dragEnter(VDragEvent drag) {
}
+ @Override
public void dragLeave(VDragEvent drag) {
// TODO Auto-generated method stub
}
+ @Override
public void dragOver(VDragEvent currentDrag) {
// TODO Auto-generated method stub
}
+ @Override
public boolean drop(VDragEvent drag) {
// TODO Auto-generated method stub
// return true to tell DDManager do server visit
return false;
}
- public Paintable getPaintable() {
- // Drophandler implemented by Paintable itself
+ @Override
+ public VDropHandler getDropHandler() {
+ // Drophandler implemented by widget itself
return this;
}
- public VDropHandler getDropHandler() {
- // Drophandler implemented by Paintable itself
- return this;
+ @Override
+ public ComponentConnector getConnector() {
+ // TODO Auto-generated method stub
+ return null;
}
+ @Override
public ApplicationConnection getApplicationConnection() {
return client;
}
- public void updateFromUIDL(UIDL uidl, ApplicationConnection client) {
- this.client = client;
-
- }
-
}
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java
new file mode 100644
index 0000000000..551d24735a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java
@@ -0,0 +1,15 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.terminal.AbstractClientConnector;
+import com.vaadin.terminal.AbstractExtension;
+
+public class BasicExtension extends AbstractExtension {
+ @Override
+ public void extend(AbstractClientConnector target) {
+ super.extend(target);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html
new file mode 100644
index 0000000000..6e8a0bf97f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.html
@@ -0,0 +1,32 @@
+<?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://192.168.2.41: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.extensions.BasicExtensionTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//div[1]</td>
+ <td>BasicExtensionTestConnector extending LabelConnector</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>//div[2]</td>
+ <td>BasicExtensionTestConnector extending RootConnector</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java
new file mode 100644
index 0000000000..02bdadca34
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java
@@ -0,0 +1,34 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Label;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class BasicExtensionTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Label label = new Label();
+ addComponent(label);
+
+ new BasicExtension().extend(this);
+ new BasicExtension().extend(label);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Simple test for extending components";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(6690);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java
new file mode 100644
index 0000000000..cb26cd7a83
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java
@@ -0,0 +1,40 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.extensions;
+
+import com.vaadin.terminal.AbstractExtension;
+import com.vaadin.tests.widgetset.client.helloworldfeature.GreetAgainRpc;
+import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldRpc;
+import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldState;
+import com.vaadin.ui.Notification;
+
+public class HelloWorldExtension extends AbstractExtension {
+
+ public HelloWorldExtension() {
+ registerRpc(new HelloWorldRpc() {
+ @Override
+ public void onMessageSent(String message) {
+ Notification.show(message);
+ }
+ });
+ }
+
+ @Override
+ public HelloWorldState getState() {
+ return (HelloWorldState) super.getState();
+ }
+
+ public void setGreeting(String greeting) {
+ getState().setGreeting(greeting);
+ requestRepaint();
+ }
+
+ public String getGreeting() {
+ return getState().getGreeting();
+ }
+
+ public void greetAgain() {
+ getRpcProxy(GreetAgainRpc.class).greetAgain();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java
new file mode 100644
index 0000000000..001e913734
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java
@@ -0,0 +1,40 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.extensions;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class HelloWorldExtensionTest extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final HelloWorldExtension extension = new HelloWorldExtension();
+ extension.setGreeting("Kind words");
+ addExtension(extension);
+
+ addComponent(new Button("Greet again", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ extension.greetAgain();
+ }
+ }));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Testing basic Extension";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.html b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.html
new file mode 100644
index 0000000000..7bdb8cd50f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.html
@@ -0,0 +1,47 @@
+<?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.extensions.JavascriptManagerTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsextensionsJavascriptManagerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[4]</td>
+ <td>1. Got 4 arguments</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsextensionsJavascriptManagerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[3]</td>
+ <td>2. Argument 1 as a number: 42</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsextensionsJavascriptManagerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[2]</td>
+ <td>3. Argument 2 as a string: text</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsextensionsJavascriptManagerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td>
+ <td>4. Argument 3.p as a boolean: true</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsextensionsJavascriptManagerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>5. Argument 4 is JSONObject.NULL: true</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java
new file mode 100644
index 0000000000..a16f131475
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java
@@ -0,0 +1,51 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.external.json.JSONArray;
+import com.vaadin.external.json.JSONException;
+import com.vaadin.external.json.JSONObject;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.JavaScript;
+import com.vaadin.ui.JavaScriptCallback;
+
+public class JavascriptManagerTest extends AbstractTestRoot {
+
+ private Log log = new Log(5);
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ addComponent(log);
+ final JavaScript js = JavaScript.getCurrent();
+ js.addCallback("testing.doTest", new JavaScriptCallback() {
+ @Override
+ public void call(JSONArray arguments) throws JSONException {
+ log.log("Got " + arguments.length() + " arguments");
+ log.log("Argument 1 as a number: " + arguments.getInt(0));
+ log.log("Argument 2 as a string: " + arguments.getString(1));
+ log.log("Argument 3.p as a boolean: "
+ + arguments.getJSONObject(2).getBoolean("p"));
+ log.log("Argument 4 is JSONObject.NULL: "
+ + (arguments.get(3) == JSONObject.NULL));
+ js.removeCallback("testing.doTest");
+ }
+ });
+ js.execute("window.testing.doTest(42, 'text', {p: true}, null)");
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test javascript callback handling by adding a callback and invoking the javascript.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java
new file mode 100644
index 0000000000..cb05bde493
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java
@@ -0,0 +1,122 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.extensions;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.annotations.StyleSheet;
+import com.vaadin.external.json.JSONArray;
+import com.vaadin.external.json.JSONException;
+import com.vaadin.shared.JavaScriptExtensionState;
+import com.vaadin.shared.communication.ClientRpc;
+import com.vaadin.shared.communication.ServerRpc;
+import com.vaadin.terminal.AbstractJavaScriptExtension;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.JavaScriptCallback;
+import com.vaadin.ui.Notification;
+
+public class SimpleJavaScriptExtensionTest extends AbstractTestRoot {
+
+ public static class SimpleJavaScriptExtensionState extends
+ JavaScriptExtensionState {
+ private String prefix;
+
+ public void setPrefix(String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+ }
+
+ public static interface SimpleJavaScriptExtensionClientRpc extends
+ ClientRpc {
+ public void greet(String message);
+ }
+
+ public static interface SimpleJavaScriptExtensionServerRpc extends
+ ServerRpc {
+ public void greet(String message);
+ }
+
+ @JavaScript("/statictestfiles/jsextension.js")
+ @StyleSheet("/VAADIN/external1.css")
+ public static class SimpleJavascriptExtension extends
+ AbstractJavaScriptExtension {
+
+ public SimpleJavascriptExtension() {
+ registerRpc(new SimpleJavaScriptExtensionServerRpc() {
+ @Override
+ public void greet(String message) {
+ Notification.show(getState().getPrefix() + message);
+ }
+ });
+ registerCallback("greetToServer", new JavaScriptCallback() {
+ @Override
+ public void call(JSONArray arguments) throws JSONException {
+ Notification.show(getState().getPrefix()
+ + arguments.getString(0));
+ }
+ });
+ }
+
+ @Override
+ public SimpleJavaScriptExtensionState getState() {
+ return (SimpleJavaScriptExtensionState) super.getState();
+ }
+
+ public void setPrefix(String prefix) {
+ getState().setPrefix(prefix);
+ requestRepaint();
+ }
+
+ public void greetRpc(String message) {
+ getRpcProxy(SimpleJavaScriptExtensionClientRpc.class)
+ .greet(message);
+ }
+
+ public void greetCallback(String message) {
+ invokeCallback("greetToClient", message);
+ }
+ }
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final SimpleJavascriptExtension simpleJavascriptExtension = new SimpleJavascriptExtension();
+ simpleJavascriptExtension.setPrefix("Prefix: ");
+ addExtension(simpleJavascriptExtension);
+ addComponent(new Button("Send rpc greeting",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ simpleJavascriptExtension.greetRpc("Rpc greeting");
+ }
+ }));
+ addComponent(new Button("Send callback greeting",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ simpleJavascriptExtension
+ .greetCallback("Callback greeting");
+ }
+ }));
+ }
+
+ @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/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java b/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java
new file mode 100644
index 0000000000..894944d186
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/AbstractBeanFieldGroupTest.java
@@ -0,0 +1,99 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
+
+public abstract class AbstractBeanFieldGroupTest extends TestBase {
+
+ private Button commitButton;
+ protected Log log = new Log(5);
+
+ private Button discardButton;
+ private Button showBeanButton;
+ private BeanFieldGroup fieldBinder;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ }
+
+ protected Button getDiscardButton() {
+ if (discardButton == null) {
+ discardButton = new Button("Discard", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ getFieldBinder().discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ }
+ return discardButton;
+ }
+
+ protected Button getShowBeanButton() {
+ if (showBeanButton == null) {
+ showBeanButton = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log.log(getFieldBinder().getItemDataSource()
+ .getBean().toString());
+
+ }
+ });
+ }
+ return showBeanButton;
+ }
+
+ protected Button getCommitButton() {
+ if (commitButton == null) {
+ commitButton = new Button("Commit");
+ commitButton.addListener(new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ getFieldBinder().commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Notification.show(msg);
+ log.log(msg);
+
+ }
+ });
+ }
+ return commitButton;
+ }
+
+ protected BeanFieldGroup getFieldBinder() {
+ return fieldBinder;
+ }
+
+ protected void setFieldBinder(BeanFieldGroup beanFieldBinder) {
+ fieldBinder = beanFieldBinder;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java b/tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java
new file mode 100644
index 0000000000..b399857b3b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/BasicPersonForm.java
@@ -0,0 +1,197 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitEvent;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitHandler;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.util.converter.StringToBooleanConverter;
+import com.vaadin.data.validator.EmailValidator;
+import com.vaadin.data.validator.IntegerRangeValidator;
+import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Panel;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class BasicPersonForm extends TestBase {
+
+ private Log log = new Log(5);
+ private TextField firstName;
+ private TextArea lastName;
+ private TextField email;
+ private TextField age;
+ private Table sex;
+ private TextField deceased;
+
+ public class Configuration {
+ public boolean preCommitFails = false;
+ public boolean postCommitFails = false;
+
+ public boolean isPreCommitFails() {
+ return preCommitFails;
+ }
+
+ public void setPreCommitFails(boolean preCommitFails) {
+ this.preCommitFails = preCommitFails;
+ }
+
+ public boolean isPostCommitFails() {
+ return postCommitFails;
+ }
+
+ public void setPostCommitFails(boolean postCommitFails) {
+ this.postCommitFails = postCommitFails;
+ }
+
+ }
+
+ private Configuration configuration = new Configuration();
+
+ private class ConfigurationPanel extends Panel {
+
+ public ConfigurationPanel() {
+ super("Configuration");
+ BeanItem<Configuration> bi = new BeanItem<BasicPersonForm.Configuration>(
+ configuration);
+ FieldGroup confFieldGroup = new FieldGroup(bi);
+ confFieldGroup.setItemDataSource(bi);
+ confFieldGroup.setBuffered(false);
+
+ for (Object propertyId : bi.getItemPropertyIds()) {
+ addComponent(confFieldGroup.buildAndBind(propertyId));
+ }
+
+ }
+ }
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+ Panel confPanel = new ConfigurationPanel();
+ addComponent(confPanel);
+
+ final FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
+ fieldGroup.addCommitHandler(new CommitHandler() {
+
+ @Override
+ public void preCommit(CommitEvent commitEvent)
+ throws CommitException {
+ if (configuration.preCommitFails) {
+ throw new CommitException(
+ "Error in preCommit because first name is "
+ + getPerson(commitEvent.getFieldBinder())
+ .getFirstName());
+ }
+
+ }
+
+ @Override
+ public void postCommit(CommitEvent commitEvent)
+ throws CommitException {
+ if (configuration.postCommitFails) {
+ throw new CommitException(
+ "Error in postCommit because first name is "
+ + getPerson(commitEvent.getFieldBinder())
+ .getFirstName());
+ }
+ }
+ });
+
+ fieldGroup.setBuffered(true);
+
+ fieldGroup.buildAndBindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(email);
+ addComponent(age);
+ addComponent(sex);
+ addComponent(deceased);
+
+ Button commitButton = new Button("Commit", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ fieldGroup.commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Notification.show(msg);
+ log.log(msg);
+
+ }
+ });
+ Button discardButton = new Button("Discard",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ fieldGroup.discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ Button showBean = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log.log(getPerson(fieldGroup).toString());
+
+ }
+ });
+ addComponent(commitButton);
+ addComponent(discardButton);
+ addComponent(showBean);
+ email.addValidator(new EmailValidator("Must be a valid address"));
+ lastName.addValidator(new StringLengthValidator("Must be min 5 chars",
+ 5, null, true));
+
+ age.addValidator(new IntegerRangeValidator(
+ "Must be between 0 and 150, {0} is not", 0, 150));
+ sex.setPageLength(0);
+ deceased.setConverter(new StringToBooleanConverter() {
+ @Override
+ protected String getTrueString() {
+ return "YAY!";
+ }
+
+ @Override
+ protected String getFalseString() {
+ return "NAAAAAH";
+ }
+ });
+ Person p = new Person("John", "Doe", "john@doe.com", 64, Sex.MALE,
+ new Address("John street", 11223, "John's town", Country.USA));
+ fieldGroup.setItemDataSource(new BeanItem<Person>(p));
+ }
+
+ public static Person getPerson(FieldGroup binder) {
+ return ((BeanItem<Person>) binder.getItemDataSource()).getBean();
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html b/tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html
new file mode 100644
index 0000000000..3d5e1052c3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/BooleanTextField.html
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>screenCapture</td>
+ <td></td>
+ <td>initial</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>90,38</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Dover</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<tr>
+ <td>drag</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>108,9</td>
+</tr>
+<tr>
+ <td>drop</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]</td>
+ <td>0,587</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>-18,9</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>false</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]</td>
+ <td>239,14</td>
+</tr>
+<!--error indicator-->
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[7]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>false</td>
+</tr>
+<!--show bean values-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<!--error message in tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>0,0</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Could not convert value to Boolean</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>66,6</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>YAY!</td>
+</tr>
+<!--no error indicator-->
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/domChild[0]/domChild[7]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+</tr>
+<!--commit last name and new deceased status-->
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Person [firstName=John, lastName=Dover, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=true, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html b/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html
new file mode 100644
index 0000000000..2ad104c16c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/CommitHandlerFailures.html
@@ -0,0 +1,220 @@
+package com.vaadin.tests.fieldgroup;
+
+public class CommitHandlerFailures_html {
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+ </tr>
+ <!--assert we are starting with what we think we are starting with-->
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+ </tr>
+ <tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+ </tr>
+ <!--Make changes to fields-->
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doeve</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>Mike</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>me@me.com</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>12</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]/domChild[0]/domChild[0]</td>
+ <td>31,10</td>
+ </tr>
+ <!--show bean values-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--pre commit fails-->
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>35,6</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--post commit fails-->
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[1]/VCheckBox[0]/domChild[0]</td>
+ <td>10,7</td>
+ </tr>
+ <tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VPanel[0]/VVerticalLayout[0]/ChildComponentContainer[0]/VCheckBox[0]/domChild[0]</td>
+ <td>9,7</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>5. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--discard and ensure old values are returned as all commits have failed-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+ </tr>
+ <tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+ </tr>
+ <tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+ </tr>
+ <!--show bean values-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>7. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+
+ </tbody></table>
+ </body>
+ </html>
+
+}
+
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html b/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html
new file mode 100644
index 0000000000..2c88930077
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/CommitWithValidationOrConversionError.html
@@ -0,0 +1,150 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doev</td>
+ </tr>
+ <!--commit with invalid field must fail-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64,2</td>
+ </tr>
+ <!--commit with 2 fails-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doever</td>
+ </tr>
+ <!--1 error fixed, still 1 conversion error-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>4. Commit failed: Commit failed</td>
+ </tr>
+ <tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>123</td>
+ </tr>
+ <!--all fields ok, commit should be ok-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>closeNotification</td>
+ <td>//body/div[2]</td>
+ <td>0,0</td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>5. Commit succesful</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>6. Person [firstName=John, lastName=Doever, email=john@doe.com, age=123, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+ <!--discard should now have no effect-->
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>7. Discarded changes</td>
+ </tr>
+ <tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>8. Person [firstName=John, lastName=Doever, email=john@doe.com, age=123, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+ </tr>
+
+ </tbody></table>
+ </body>
+ </html>
+
+}
+
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java b/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java
new file mode 100644
index 0000000000..4f83f5d0fd
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FieldBinderWithBeanValidation.java
@@ -0,0 +1,109 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup.CommitException;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.PersonWithBeanValidationAnnotations;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class FieldBinderWithBeanValidation extends TestBase {
+
+ private Log log = new Log(5);
+ private TextField firstName;
+ private TextArea lastName;
+ private TextField email;
+ private TextField age;
+ private Table sex;
+ private TextField deceased;
+
+ @Override
+ protected void setup() {
+ addComponent(log);
+
+ final BeanFieldGroup<PersonWithBeanValidationAnnotations> fieldGroup = new BeanFieldGroup<PersonWithBeanValidationAnnotations>(
+ PersonWithBeanValidationAnnotations.class);
+
+ fieldGroup.buildAndBindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(email);
+ addComponent(age);
+ addComponent(sex);
+ addComponent(deceased);
+
+ Button commitButton = new Button("Commit", new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String msg = "Commit succesful";
+ try {
+ fieldGroup.commit();
+ } catch (CommitException e) {
+ msg = "Commit failed: " + e.getMessage();
+ }
+ Notification.show(msg);
+ log.log(msg);
+
+ }
+ });
+ Button discardButton = new Button("Discard",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ fieldGroup.discard();
+ log.log("Discarded changes");
+
+ }
+ });
+ Button showBean = new Button("Show bean values",
+ new Button.ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ log.log(getPerson(fieldGroup).toString());
+
+ }
+ });
+ addComponent(commitButton);
+ addComponent(discardButton);
+ addComponent(showBean);
+ sex.setPageLength(0);
+
+ PersonWithBeanValidationAnnotations p = new PersonWithBeanValidationAnnotations(
+ "John", "Doe", "john@doe.com", 64, Sex.MALE, new Address(
+ "John street", 11223, "John's town", Country.USA));
+ fieldGroup
+ .setItemDataSource(new BeanItem<PersonWithBeanValidationAnnotations>(
+ p));
+ }
+
+ public static Person getPerson(FieldGroup binder) {
+ return ((BeanItem<Person>) binder.getItemDataSource()).getBean();
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html b/tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html
new file mode 100644
index 0000000000..a2ac1b748b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FieldGroupDiscard.html
@@ -0,0 +1,164 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head profile="http://selenium-ide.openqa.org/profiles/test-case">
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<link rel="selenium.base" href="" />
+<title>New Test</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">New Test</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+</tr>
+<!--assert we are starting with what we think we are starting with-->
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+</tr>
+<!--make some changes-->
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com123</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64123</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>33,8</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>72,10</td>
+</tr>
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>-18,15</td>
+</tr>
+<tr>
+ <td>type</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>YAY!</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>1. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>2. Discarded changes</td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[10]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::PID_SLog_row_0</td>
+ <td>3. Person [firstName=John, lastName=Doe, email=john@doe.com, age=64, sex=Male, address=Address [streetAddress=John street, postalCode=11223, city=John's town, country=USA], deceased=false, salary=null, salaryDouble=null, rent=null]</td>
+</tr>
+<!--we should still be at the state we started from-->
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VTextField[0]</td>
+ <td>John</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VTextArea[0]</td>
+ <td>Doe</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VTextField[0]</td>
+ <td>john@doe.com</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[0]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertNotCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VScrollTable[0]/domChild[1]/domChild[0]/domChild[1]/domChild[0]/domChild[2]</td>
+ <td>v-selected</td>
+</tr>
+<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VTextField[0]</td>
+ <td>NAAAAAH</td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java
new file mode 100644
index 0000000000..5f25070f2e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormBuilderWithNestedProperties.java
@@ -0,0 +1,47 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.ui.TextField;
+
+public class FormBuilderWithNestedProperties extends TestBase {
+
+ private TextField firstName;
+ private TextField lastName;
+ @PropertyId("address.streetAddress")
+ private TextField streetAddress;
+
+ @Override
+ protected void setup() {
+ FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
+ fieldGroup.buildAndBindMemberFields(this);
+
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(streetAddress);
+
+ fieldGroup.setItemDataSource(new BeanItem<Person>(new Person("Who",
+ "me?", "email", 1, Sex.MALE, new Address("street name", 202020,
+ "City", Country.FINLAND))));
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java
new file mode 100644
index 0000000000..f4f612503c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormManyToMany.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.tests.components.TestBase;
+
+public class FormManyToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ // TODO implement
+
+ // TODO note that in one direction, a setter is used and automatically
+ // updates the other direction (setting the Roles of a User updates
+ // Roles), whereas in the other direction (updating the list of Users
+ // for a Role), manual updates are needed at commit time to keep the
+ // Users consistent with Roles
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Forms which allow editing of a many-to-many mapping between users and roles";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java
new file mode 100644
index 0000000000..e269a39441
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToMany.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Millionaire;
+import com.vaadin.ui.Form;
+
+public class FormOneToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createMillionaireItem());
+
+ // TODO support adding, editing and removing secondary addresses
+ }
+
+ protected BeanItem<Millionaire> createMillionaireItem() {
+ Millionaire person = new Millionaire("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Millionaire> item = new BeanItem<Millionaire>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ // TODO for now, hide secondary residences
+ item.removeItemProperty("secondaryResidences");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form with an editable list of sub-objects.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java
new file mode 100644
index 0000000000..b16cb29a8a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormOneToOne.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Form;
+
+public class FormOneToOne extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createPersonItem());
+ }
+
+ protected BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> item = new BeanItem<Person>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form where some properties come from a sub-object of the bean.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java b/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java
new file mode 100644
index 0000000000..f66d822495
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/FormWithNestedProperties.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.fieldgroup;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.tests.data.bean.Address;
+import com.vaadin.tests.data.bean.Country;
+import com.vaadin.tests.data.bean.Person;
+import com.vaadin.tests.data.bean.Sex;
+import com.vaadin.tests.util.Log;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.TextField;
+
+public class FormWithNestedProperties extends AbstractBeanFieldGroupTest {
+
+ private Log log = new Log(5);
+
+ private TextField firstName = new TextField("First name");
+ private TextField lastName = new TextField("Last name");
+ private TextField email = new TextField("Email");
+ private TextField age = new TextField("Age");
+
+ @PropertyId("address.streetAddress")
+ private TextField streetAddress = new TextField("Street address");
+ private NativeSelect country;
+
+ private CheckBox deceased = new CheckBox("Deceased");
+
+ @Override
+ protected void setup() {
+ super.setup();
+
+ setFieldBinder(new BeanFieldGroup<Person>(Person.class));
+ country = getFieldBinder().buildAndBind("country", "address.country",
+ NativeSelect.class);
+ getFieldBinder().bindMemberFields(this);
+ addComponent(firstName);
+ addComponent(lastName);
+ addComponent(streetAddress);
+ addComponent(country);
+ addComponent(email);
+ addComponent(age);
+ addComponent(deceased);
+ addComponent(getCommitButton());
+ addComponent(getDiscardButton());
+ addComponent(getShowBeanButton());
+
+ getFieldBinder().setItemDataSource(
+ new Person("First", "Last", "Email", 52, Sex.FEMALE,
+ new Address("street address", 01234, "City",
+ Country.FINLAND)));
+
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html b/tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html
new file mode 100644
index 0000000000..b7c40b4d9e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fieldgroup/IntegerRangeValidator.html
@@ -0,0 +1,101 @@
+ <?xml version="1.0" encoding="UTF-8"?>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+ <head profile="http://selenium-ide.openqa.org/profiles/test-case">
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <link rel="selenium.base" href="" />
+ <title>New Test</title>
+ </head>
+ <body>
+ <table cellpadding="1" cellspacing="1" border="1">
+ <thead>
+ <tr><td rowspan="1" colspan="3">New Test</td></tr>
+ </thead><tbody>
+ <tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.fieldgroup.BasicPersonForm?restartApplication</td>
+ <td></td>
+</tr>
+<!--64123 -> age-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64,20</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>64123</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Must be between 0 and 150, 64123 is not</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<!--Hide tooltip-->
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VVerticalLayout[0]</td>
+ <td></td>
+</tr>
+<!--10 -> age-->
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>10</td>
+</tr>
+<tr>
+ <td>assertElementNotPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<!---1-->
+<tr>
+ <td>mouseClick</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>69,11</td>
+</tr>
+<tr>
+ <td>enterCharacter</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td>-1</td>
+</tr>
+<tr>
+ <td>assertCSSClass</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/VVerticalLayout[0]/domChild[5]/domChild[0]/domChild[1]</td>
+ <td>v-errorindicator</td>
+</tr>
+<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VTextField[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>waitForElementPresent</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsfieldgroupBasicPersonForm::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]</td>
+ <td>Must be between 0 and 150, -1 is not</td>
+</tr>
+</tbody></table>
+ </body>
+ </html>
+
diff --git a/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java b/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java
new file mode 100644
index 0000000000..43fba20f33
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormManyToMany.java
@@ -0,0 +1,28 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.tests.components.TestBase;
+
+public class FormManyToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ // TODO implement
+
+ // TODO note that in one direction, a setter is used and automatically
+ // updates the other direction (setting the Roles of a User updates
+ // Roles), whereas in the other direction (updating the list of Users
+ // for a Role), manual updates are needed at commit time to keep the
+ // Users consistent with Roles
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Forms which allow editing of a many-to-many mapping between users and roles";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java b/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java
new file mode 100644
index 0000000000..a010e935ab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormOneToMany.java
@@ -0,0 +1,43 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Millionaire;
+import com.vaadin.ui.Form;
+
+public class FormOneToMany extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createMillionaireItem());
+
+ // TODO support adding, editing and removing secondary addresses
+ }
+
+ protected BeanItem<Millionaire> createMillionaireItem() {
+ Millionaire person = new Millionaire("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Millionaire> item = new BeanItem<Millionaire>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ // TODO for now, hide secondary residences
+ item.removeItemProperty("secondaryResidences");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form with an editable list of sub-objects.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java b/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java
new file mode 100644
index 0000000000..36f4dfe0ea
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/fields/FormOneToOne.java
@@ -0,0 +1,38 @@
+package com.vaadin.tests.fields;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.Person;
+import com.vaadin.ui.Form;
+
+public class FormOneToOne extends TestBase {
+
+ @Override
+ protected void setup() {
+ final Form form = new Form();
+ addComponent(form);
+ form.setItemDataSource(createPersonItem());
+ }
+
+ protected BeanItem<Person> createPersonItem() {
+ Person person = new Person("First", "Last", "foo@vaadin.com",
+ "02-111 2222", "Ruukinkatu 2-4", 20540, "Turku");
+
+ BeanItem<Person> item = new BeanItem<Person>(person);
+ // add nested properties from address
+ item.expandProperty("address");
+
+ return item;
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Form where some properties come from a sub-object of the bean.";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
index 3524b3fce3..f1345bca13 100644
--- a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
+++ b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java
@@ -1,12 +1,13 @@
package com.vaadin.tests.integration;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.terminal.Page;
+import com.vaadin.terminal.Page.BrowserWindowResizeEvent;
import com.vaadin.tests.components.TestBase;
import com.vaadin.tests.util.Log;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.ResizeEvent;
+import com.vaadin.ui.Root.LegacyWindow;
public class EmbedSizeTest extends TestBase {
@@ -14,32 +15,31 @@ public class EmbedSizeTest extends TestBase {
@Override
protected void setup() {
- Window mainWindow = getMainWindow();
+ LegacyWindow mainWindow = getMainWindow();
mainWindow.setSizeUndefined();
mainWindow.getContent().setSizeUndefined();
mainWindow.setImmediate(true);
- CheckBox lazyCheckBox = new CheckBox("Lazy resize",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- boolean resizeLazy = Boolean.TRUE == event.getButton()
- .getValue();
- getMainWindow().setResizeLazy(resizeLazy);
- log.log("Resize lazy: " + resizeLazy);
- }
- });
+ CheckBox lazyCheckBox = new CheckBox("Lazy resize");
+ lazyCheckBox.addListener(new ValueChangeListener() {
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ CheckBox cb = (CheckBox) event.getProperty();
+ Boolean resizeLazy = cb.getValue();
+ getMainWindow().setResizeLazy(resizeLazy);
+ log.log("Resize lazy: " + resizeLazy);
+ }
+ });
lazyCheckBox.setValue(Boolean.FALSE);
lazyCheckBox.setImmediate(true);
addComponent(lazyCheckBox);
addComponent(log);
- mainWindow.addListener(new Window.ResizeListener() {
- public void windowResized(ResizeEvent e) {
- Window window = e.getWindow();
- log.log("App: " + window.getWidth() + " x "
- + window.getHeight() + ", Browser window: "
- + window.getBrowserWindowWidth() + " x "
- + window.getBrowserWindowHeight());
+ mainWindow.addListener(new Page.BrowserWindowResizeListener() {
+ @Override
+ public void browserWindowResized(BrowserWindowResizeEvent event) {
+ log.log("Resize event: " + event.getWidth() + " x "
+ + event.getHeight());
}
});
}
diff --git a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
index 6bff7aca1d..c464409153 100644
--- a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
+++ b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java
@@ -7,14 +7,14 @@ import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.terminal.ClassResource;
import com.vaadin.terminal.Resource;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class IntegrationTestApplication extends Application {
+public class IntegrationTestApplication extends Application.LegacyApplication {
@Override
public void init() {
- Window window = new Window("Vaadin Application");
+ LegacyWindow window = new LegacyWindow("Vaadin Application");
setMainWindow(window);
final Table table = new Table();
@@ -37,6 +37,7 @@ public class IntegrationTestApplication extends Application {
final Label selectedLabel = new Label();
table.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
selectedLabel.setValue(table.getValue());
}
diff --git a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
index 41d02d35ae..3374342947 100644
--- a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
+++ b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java
@@ -1,5 +1,7 @@
package com.vaadin.tests.integration;
+import java.io.ByteArrayOutputStream;
+import java.io.OutputStream;
import java.util.Iterator;
import java.util.Map;
@@ -17,22 +19,32 @@ import javax.portlet.ResourceResponse;
import javax.portlet.WindowState;
import com.vaadin.Application;
+import com.vaadin.annotations.StyleSheet;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.terminal.gwt.server.PortletApplicationContext2;
import com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Upload;
+import com.vaadin.ui.Upload.Receiver;
/**
* Adapted from old PortletDemo to support integration testing.
*/
-public class JSR286PortletApplication extends Application {
+public class JSR286PortletApplication extends Application.LegacyApplication {
- Window main = new Window();
+ @StyleSheet("PortletConnectorResource.css")
+ public final class LegacyWindowWithStylesheet extends LegacyWindow {
+
+ }
+
+ LegacyWindow main = new LegacyWindowWithStylesheet();
TextField tf = new TextField("Some value");
Label userInfo = new Label();
Link portletEdit = new Link();
@@ -41,7 +53,6 @@ public class JSR286PortletApplication extends Application {
@Override
public void init() {
- main = new Window();
setMainWindow(main);
Embedded appResourceTest = new Embedded(
@@ -51,10 +62,11 @@ public class JSR286PortletApplication extends Application {
Embedded specialNameResourceTest = new Embedded(
"Test ApplicationResources with special names",
new SpecialNameResource(this));
+ specialNameResourceTest.addStyleName("hugeBorder");
main.addComponent(specialNameResourceTest);
userInfo.setCaption("User info");
- userInfo.setContentMode(Label.CONTENT_PREFORMATTED);
+ userInfo.setContentMode(ContentMode.PREFORMATTED);
main.addComponent(userInfo);
tf.setEnabled(false);
@@ -66,6 +78,15 @@ public class JSR286PortletApplication extends Application {
portletMax.setEnabled(false);
main.addComponent(portletMax);
+ Upload upload = new Upload("Upload a file", new Receiver() {
+
+ @Override
+ public OutputStream receiveUpload(String filename, String mimeType) {
+ return new ByteArrayOutputStream();
+ }
+ });
+ main.addComponent(upload);
+
if (getContext() instanceof PortletApplicationContext2) {
PortletApplicationContext2 ctx = (PortletApplicationContext2) getContext();
ctx.addPortletListener(this, new DemoPortletListener());
@@ -78,13 +99,15 @@ public class JSR286PortletApplication extends Application {
private class DemoPortletListener implements PortletListener {
+ @Override
public void handleActionRequest(ActionRequest request,
- ActionResponse response, Window window) {
+ ActionResponse response, Root window) {
main.addComponent(new Label("Action received"));
}
+ @Override
public void handleRenderRequest(RenderRequest request,
- RenderResponse response, Window window) {
+ RenderResponse response, Root window) {
// Portlet up-and-running, enable stuff
portletEdit.setEnabled(true);
portletMax.setEnabled(true);
@@ -156,13 +179,15 @@ public class JSR286PortletApplication extends Application {
}
}
+ @Override
public void handleEventRequest(EventRequest request,
- EventResponse response, Window window) {
+ EventResponse response, Root window) {
// events not used by this test
}
+ @Override
public void handleResourceRequest(ResourceRequest request,
- ResourceResponse response, Window window) {
+ ResourceResponse response, Root window) {
// nothing special to do here
}
}
diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
index 4267a7ea91..1ea800821b 100644
--- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
+++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java
@@ -5,15 +5,19 @@ import java.util.Iterator;
import java.util.Locale;
import com.vaadin.Application;
+import com.vaadin.data.Property;
+import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.Action;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.Page;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.ThemeResource;
+import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Component;
@@ -31,25 +35,27 @@ import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
import com.vaadin.ui.NativeButton;
import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Slider;
import com.vaadin.ui.Slider.ValueOutOfBoundsException;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.Tab;
import com.vaadin.ui.Table;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.TwinColSelect;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
import com.vaadin.ui.themes.LiferayTheme;
@SuppressWarnings("serial")
-public class LiferayThemeDemo extends Application {
+public class LiferayThemeDemo extends Application.LegacyApplication {
@SuppressWarnings("deprecation")
private static final Date DATE = new Date(2009 - 1900, 6 - 1, 2);
@@ -59,16 +65,18 @@ public class LiferayThemeDemo extends Application {
private static final Resource ICON_OK = new ThemeResource(
"../runo/icons/16/ok.png");
- private Window main;
+ private LegacyWindow main;
private VerticalLayout mainLayout;
private TabSheet tabs;
private Action.Handler handler = new Action.Handler() {
+ @Override
public void handleAction(Action action, Object sender, Object target) {
// NOP
}
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] {
new Action("Open"),
@@ -79,7 +87,7 @@ public class LiferayThemeDemo extends Application {
@Override
public void init() {
- main = new Window("Vaadin Liferay Theme");
+ main = new LegacyWindow("Vaadin Liferay Theme");
mainLayout = (VerticalLayout) main.getContent();
mainLayout.setMargin(false);
setMainWindow(main);
@@ -127,7 +135,7 @@ public class LiferayThemeDemo extends Application {
l.setMargin(true);
l.setCaption("Labels");
- l.addComponent(new Label("Normal Label", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal Label", ContentMode.XHTML));
l.addComponent(new Label(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit."));
return l;
@@ -139,7 +147,7 @@ public class LiferayThemeDemo extends Application {
l.setMargin(true);
l.setSpacing(true);
- Button b = new Button("Normal Button");
+ AbstractComponent b = new Button("Normal Button");
b.setDescription("This is a tooltip!");
l.addComponent(b);
@@ -208,17 +216,17 @@ public class LiferayThemeDemo extends Application {
l.setWidth("400px");
l.setColumnExpandRatio(0, 1);
- l.addComponent(new Label("Normal TextField", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal TextField", ContentMode.XHTML));
TextField tf = new TextField();
tf.setInputPrompt("Enter text");
l.addComponent(tf);
- l.addComponent(new Label("Normal TextArea", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal TextArea", ContentMode.XHTML));
- tf = new TextField();
- tf.setHeight("5em");
- tf.setInputPrompt("Enter text");
- l.addComponent(tf);
+ TextArea ta = new TextArea();
+ ta.setHeight("5em");
+ ta.setInputPrompt("Enter text");
+ l.addComponent(ta);
return l;
}
@@ -310,12 +318,15 @@ public class LiferayThemeDemo extends Application {
}
}
- closable.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ closable.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
Iterator<Component> it = ts.getComponentIterator();
for (; it.hasNext();) {
Component c = it.next();
- ts.getTab(c).setClosable(event.getButton().booleanValue());
+ ts.getTab(c).setClosable(
+ (Boolean) event.getProperty().getValue());
}
}
});
@@ -332,7 +343,7 @@ public class LiferayThemeDemo extends Application {
l.setColumnExpandRatio(0, 2);
l.setColumnExpandRatio(1, 5);
- l.addComponent(new Label("Normal Panel", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Normal Panel", ContentMode.XHTML));
Panel p = new Panel("Normal Panel");
p.setHeight("100px");
@@ -341,7 +352,7 @@ public class LiferayThemeDemo extends Application {
l.addComponent(new Label(
"Light Style (<code>LiferayTheme.PANEL_LIGHT</code>)",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
Panel p2 = new Panel("Light Style Panel");
p2.setStyleName(LiferayTheme.PANEL_LIGHT);
@@ -374,7 +385,7 @@ public class LiferayThemeDemo extends Application {
int sum = 0;
for (int j = 0; j < 100; j++) {
- t.addItem(new Object[] { j, "Bar value " + j,
+ t.addItem(new Object[] { "" + j, "Bar value " + j,
"Last column value " + j, new TextField() }, j);
sum += j;
}
@@ -404,9 +415,10 @@ public class LiferayThemeDemo extends Application {
w2.setPositionX(350);
w2.setPositionY(160);
w2.addComponent(new Label("<code>Window.setResizable(false)</code>",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
tabs.addListener(new TabSheet.SelectedTabChangeListener() {
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
if (event.getTabSheet().getSelectedTab() == l) {
getMainWindow().addWindow(w);
@@ -435,7 +447,7 @@ public class LiferayThemeDemo extends Application {
l.addComponent(lockCheckBox, 1, 0);
l.newLine();
- Label label = new Label("Normal SplitPanel", Label.CONTENT_XHTML);
+ Label label = new Label("Normal SplitPanel", ContentMode.XHTML);
label.setWidth(null);
l.addComponent(label);
final HorizontalSplitPanel sp = new HorizontalSplitPanel();
@@ -448,7 +460,7 @@ public class LiferayThemeDemo extends Application {
label = new Label(
"Small Style<br />(<code>LiferayTheme.SPLITPANEL_SMALL</code>)",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
label.setWidth(null);
l.addComponent(label);
@@ -462,12 +474,14 @@ public class LiferayThemeDemo extends Application {
sp3.setSecondComponent(sp4);
l.addComponent(sp3);
- lockCheckBox.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- sp.setLocked(event.getButton().booleanValue());
- sp2.setLocked(event.getButton().booleanValue());
- sp3.setLocked(event.getButton().booleanValue());
- sp4.setLocked(event.getButton().booleanValue());
+ lockCheckBox.addListener(new Property.ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ sp.setLocked((Boolean) event.getProperty().getValue());
+ sp2.setLocked((Boolean) event.getProperty().getValue());
+ sp3.setLocked((Boolean) event.getProperty().getValue());
+ sp4.setLocked((Boolean) event.getProperty().getValue());
}
});
@@ -507,7 +521,7 @@ public class LiferayThemeDemo extends Application {
l.setWidth("400px");
l.setColumnExpandRatio(0, 1);
- l.addComponent(new Label("Horizontal Slider", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Horizontal Slider", ContentMode.XHTML));
Slider s = new Slider();
s.setWidth("200px");
try {
@@ -518,7 +532,7 @@ public class LiferayThemeDemo extends Application {
}
l.addComponent(s);
- l.addComponent(new Label("Vertical Slider", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Vertical Slider", ContentMode.XHTML));
s = new Slider();
s.setOrientation(Slider.ORIENTATION_VERTICAL);
s.setHeight("200px");
@@ -580,56 +594,53 @@ public class LiferayThemeDemo extends Application {
message.setValue("Jumped over the lazy dog.");
message.setWidth("15em");
- l.addComponent(new Label("<h3>Type</h3>", Label.CONTENT_XHTML));
- l.addComponent(new Label("<h3>Preview</h3>", Label.CONTENT_XHTML));
+ l.addComponent(new Label("<h3>Type</h3>", ContentMode.XHTML));
+ l.addComponent(new Label("<h3>Preview</h3>", ContentMode.XHTML));
- l.addComponent(new Label("Humanized", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Humanized", ContentMode.XHTML));
Button show = new Button("Humanized Notification",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue());
-
+ Notification notification = new Notification(
+ title.getValue(), message.getValue());
+ notification.setHtmlContentAllowed(true);
+ notification.show(Page.getCurrent());
}
});
l.addComponent(show);
- l.addComponent(new Label("Warning", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Warning", ContentMode.XHTML));
show = new Button("Warning Notification", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
- Notification.TYPE_WARNING_MESSAGE);
+ new Notification(title.getValue(), message.getValue(),
+ Notification.TYPE_WARNING_MESSAGE, true).show(Page
+ .getCurrent());
}
});
l.addComponent(show);
- l.addComponent(new Label("Error", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Error", ContentMode.XHTML));
show = new Button("Error Notification", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
- Notification.TYPE_ERROR_MESSAGE);
+ new Notification(title.getValue(), message.getValue(),
+ Notification.TYPE_ERROR_MESSAGE, true).show(Page
+ .getCurrent());
}
});
l.addComponent(show);
- l.addComponent(new Label("Tray", Label.CONTENT_XHTML));
+ l.addComponent(new Label("Tray", ContentMode.XHTML));
show = new Button("Tray Notification", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- event.getButton()
- .getWindow()
- .showNotification((String) title.getValue(),
- (String) message.getValue(),
- Notification.TYPE_TRAY_NOTIFICATION);
+ new Notification(title.getValue(), message.getValue(),
+ Notification.TYPE_TRAY_NOTIFICATION, true).show(Page
+ .getCurrent());
}
});
@@ -692,6 +703,7 @@ public class LiferayThemeDemo extends Application {
final MenuBar.MenuItem find = edit.addItem("Find/Replace", null);
find.addItem("Google Search", new Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
getMainWindow().open(
new ExternalResource("http://www.google.com"));
diff --git a/tests/testbench/com/vaadin/tests/integration/PortletConnectorResource.css b/tests/testbench/com/vaadin/tests/integration/PortletConnectorResource.css
new file mode 100644
index 0000000000..7338e4708a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/integration/PortletConnectorResource.css
@@ -0,0 +1,3 @@
+.hugeBorder {
+ border: 10px solid green;
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java b/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java
index 1687bd588a..20967203bc 100644
--- a/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java
+++ b/tests/testbench/com/vaadin/tests/integration/PortletSizeInLiferayFreeformLayoutApplication.java
@@ -1,9 +1,9 @@
package com.vaadin.tests.integration;
-import com.vaadin.Application;
+import com.vaadin.Application.LegacyApplication;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* On Liferay in a freeform layout, this application should get its height from
@@ -11,10 +11,11 @@ import com.vaadin.ui.Window;
*
* See ticket #5521.
*/
-public class PortletSizeInLiferayFreeformLayoutApplication extends Application {
+public class PortletSizeInLiferayFreeformLayoutApplication extends
+ LegacyApplication {
@Override
public void init() {
- Window mainWindow = new Window("Portlet5521 Application");
+ LegacyWindow mainWindow = new LegacyWindow("Portlet5521 Application");
((VerticalLayout) mainWindow.getContent()).setMargin(false);
((VerticalLayout) mainWindow.getContent()).setSizeFull();
// ((VerticalLayout) mainWindow.getContent()).setHeight("200px");
diff --git a/tests/testbench/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java b/tests/testbench/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java
index 6193fd238e..b2cadebd02 100644
--- a/tests/testbench/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java
+++ b/tests/testbench/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java
@@ -31,6 +31,7 @@ public class AbsoluteLayoutAddRemove extends TestBase {
final Button b = new Button("Add", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (l.getParent() == null) {
al.addComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
index 7ad433e5c9..77b8e249ba 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java
@@ -37,7 +37,7 @@ public class CaptionsInLayouts extends TestBase {
private HorizontalLayout horizontalLayout;
private GridLayout gridLayout;
private FormLayout formLayout;
- private List<AbstractField> components = new ArrayList<AbstractField>();
+ private List<AbstractField<?>> components = new ArrayList<AbstractField<?>>();
private CssLayout cssLayout;
private HorizontalLayout layoutParent = new HorizontalLayout();
@@ -61,6 +61,7 @@ public class CaptionsInLayouts extends TestBase {
Button b = new Button("Add caption text");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
prependCaptions("a");
}
@@ -69,7 +70,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void prependCaptions(String prepend) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setCaption(prepend + c.getCaption());
}
@@ -81,6 +82,7 @@ public class CaptionsInLayouts extends TestBase {
requiredToggle.setCaption("Required");
requiredToggle.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setRequired((Boolean) event.getProperty().getValue());
}
@@ -94,6 +96,7 @@ public class CaptionsInLayouts extends TestBase {
iconToggle.setCaption("Icons");
iconToggle.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setIcon((Boolean) event.getProperty().getValue());
}
@@ -102,14 +105,14 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setRequired(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
c.setRequired(value);
}
}
protected void setIcon(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (!value) {
c.setIcon(null);
} else {
@@ -125,6 +128,7 @@ public class CaptionsInLayouts extends TestBase {
errorToggle.setCaption("Error");
errorToggle.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
setError((Boolean) event.getProperty().getValue());
}
@@ -133,7 +137,7 @@ public class CaptionsInLayouts extends TestBase {
}
protected void setError(boolean value) {
- for (AbstractField c : components) {
+ for (AbstractField<?> c : components) {
if (value) {
c.setComponentError(new UserError("error"));
} else {
@@ -250,6 +254,7 @@ public class CaptionsInLayouts extends TestBase {
layoutSelect.setImmediate(true);
layoutSelect.addListener(new ValueChangeListener() {
+ @Override
@SuppressWarnings("unchecked")
public void valueChange(ValueChangeEvent event) {
Item i = layoutSelect.getItem(event.getProperty().getValue());
diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.html b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.html
index 403bb32a67..6dab84d718 100644
--- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.html
+++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.html
@@ -18,7 +18,7 @@
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsComplexGLColumnExpansionWithColSpan::/VVerticalLayout[0]/ChildComponentContainer[0]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsComplexGLColumnExpansionWithColSpan::/VVerticalLayout[0]/VGridLayout[0]/VButton[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -26,7 +26,6 @@
<td></td>
<td>buttons-next-stacked-left</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
index 87b04ffcb0..51f9e2d88e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
+++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java
@@ -4,9 +4,9 @@ import com.vaadin.terminal.Sizeable;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
private int cols;
@@ -29,7 +29,7 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
mainLayout.setMargin(true);
mainLayout.setHeight(100, Sizeable.UNITS_PERCENTAGE);
mainLayout.setWidth(100, Sizeable.UNITS_PERCENTAGE);
- setMainWindow(new Window("Vaadin Test", mainLayout));
+ setMainWindow(new LegacyWindow("Vaadin Test", mainLayout));
cols = 1;
final GridLayout gl = new GridLayout(cols, 3);
@@ -45,6 +45,7 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
b1.setWidth(270, Sizeable.UNITS_PIXELS);
b2.setWidth(270, Sizeable.UNITS_PIXELS);
b1.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
cols++;
gl.setColumns(cols);
@@ -70,8 +71,9 @@ public class ComplexGLColumnExpansionWithColSpan extends AbstractTestCase {
Button restart = new Button("restart");
mainLayout.addComponent(restart);
restart.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
- mainLayout.getWindow().getApplication().close();
+ mainLayout.getRoot().getApplication().close();
}
});
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java b/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java
new file mode 100644
index 0000000000..792bcb1aab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutCustomCss.java
@@ -0,0 +1,91 @@
+package com.vaadin.tests.layouts;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.CssLayout;
+import com.vaadin.ui.NativeButton;
+
+public class CssLayoutCustomCss extends TestBase implements ClickListener {
+
+ protected Map<Component, String> css = new HashMap<Component, String>();
+ private CssLayout layout;
+
+ @Override
+ protected void setup() {
+ setTheme("tests-tickets");
+ layout = new CssLayout() {
+ @Override
+ protected String getCss(com.vaadin.ui.Component c) {
+ return css.get(c);
+ }
+ };
+ layout.setSizeFull();
+ addComponent(layout);
+
+ Button red, green;
+ layout.addComponent(red = createButton("color:red"));
+ layout.addComponent(createButton("color: blue"));
+ layout.addComponent(green = createButton("color: green"));
+
+ red.click();
+ green.click();
+ layout.addComponent(createMarginsToggle());
+ }
+
+ private Component createMarginsToggle() {
+ final CheckBox cb = new CheckBox("Margins");
+ cb.setImmediate(true);
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ layout.setMargin(cb.getValue());
+ }
+ });
+
+ return cb;
+ }
+
+ private Button createButton(String string) {
+ NativeButton button = new NativeButton(string);
+ css.put(button, string);
+ button.addListener(this);
+ return button;
+ }
+
+ @Override
+ protected String getDescription() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Button b = event.getButton();
+ if (b.getCaption().contains("not ")) {
+ b.setCaption(b.getCaption().substring(4));
+ css.put(b, b.getCaption());
+ } else {
+ css.remove(b);
+ b.setCaption("not " + b.getCaption());
+ }
+ layout.requestRepaint();
+
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
index 0c4c3ad12c..0932be5d81 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.html
@@ -22,14 +22,9 @@
<td></td>
</tr>
<tr>
- <td>verifyTextPresent</td>
- <td>Caption2</td>
- <td></td>
-</tr>
-<tr>
- <td>verifyTextNotPresent</td>
- <td>Caption1</td>
+ <td>screenCapture</td>
<td></td>
+ <td>caption1-hidden</td>
</tr>
</tbody></table>
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java
index ef07b2c5f5..093dc782fb 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponent.java
@@ -16,6 +16,7 @@ public class CssLayoutRemoveComponent extends TestBase {
final TextField tf = new TextField("Caption1");
Button b = new Button("Remove field ", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
layout.removeComponent(tf);
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java
index 4f081af347..df4fc8615d 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutRemoveComponentWithCaption.java
@@ -15,6 +15,7 @@ public class CssLayoutRemoveComponentWithCaption extends TestBase {
final TextField tf = new TextField("Caption");
Button b = new Button("Remove field and add new", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
layout.removeComponent(tf);
addComponent(new TextField("new field"));
diff --git a/tests/testbench/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java b/tests/testbench/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java
index 0be605c795..ed3c5e66d3 100644
--- a/tests/testbench/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java
+++ b/tests/testbench/com/vaadin/tests/layouts/CssLayoutSizeChangePropagation.java
@@ -35,6 +35,7 @@ public class CssLayoutSizeChangePropagation extends TestBase {
button.addListener(new ClickListener() {
boolean bool = true;
+ @Override
public void buttonClick(ClickEvent event) {
sp.setExpandRatio(cssLayout, bool ? 1 : 0);
bool = !bool;
diff --git a/tests/testbench/com/vaadin/tests/layouts/DeepComponentTrees.java b/tests/testbench/com/vaadin/tests/layouts/DeepComponentTrees.java
index 47cb095efa..e119b91b82 100644
--- a/tests/testbench/com/vaadin/tests/layouts/DeepComponentTrees.java
+++ b/tests/testbench/com/vaadin/tests/layouts/DeepComponentTrees.java
@@ -44,6 +44,7 @@ public class DeepComponentTrees extends TestBase {
final Button b = new Button("Go try your luck with " + i + " layouts!");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
FF2KILLER(i++);
b.setCaption("Go try your luck with " + i + " layouts!");
@@ -60,6 +61,7 @@ public class DeepComponentTrees extends TestBase {
s.addItem(GridLayout.class);
s.addListener(new ComboBox.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Object value = s.getValue();
if (!value.equals("-- Choose value --")) {
diff --git a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
index e29c7559b3..f596fdb77e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
+++ b/tests/testbench/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.layouts;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.FormLayout;
-import com.vaadin.ui.TextField;
+import com.vaadin.ui.TextArea;
public class FormLayoutWithInvisibleComponent extends TestBase {
- private TextField messages;
+ private TextArea messages;
@Override
protected String getDescription() {
@@ -24,19 +24,21 @@ public class FormLayoutWithInvisibleComponent extends TestBase {
@Override
protected void setup() {
FormLayout formLayout = new FormLayout();
- CheckBox control = new CheckBox("Messages On/Off",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- messages.setVisible(event.getButton().booleanValue());
- messages.setRequired(true);
- messages.setCaption("Messages visible");
- }
-
- });
+ CheckBox control = new CheckBox("Messages On/Off");
+ control.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ messages.setVisible((Boolean) event.getProperty().getValue());
+ messages.setRequired(true);
+ messages.setCaption("Messages visible");
+ }
+
+ });
control.setImmediate(true);
formLayout.addComponent(control);
- messages = new TextField("Messages hidden");
+ messages = new TextArea("Messages hidden");
messages.setRows(10);
messages.setColumns(40);
messages.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
index d851e9326f..8713208dc6 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java
@@ -3,7 +3,8 @@ package com.vaadin.tests.layouts;
import com.vaadin.data.Item;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItem;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.terminal.AbstractErrorMessage;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
@@ -14,11 +15,11 @@ import com.vaadin.ui.Form;
import com.vaadin.ui.FormFieldFactory;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class GridLayoutCaptions extends AbstractTestCase {
+public class GridLayoutCaptions extends TestBase {
class CustomForm extends Form {
private com.vaadin.ui.GridLayout layout;
@@ -27,31 +28,33 @@ public class GridLayoutCaptions extends AbstractTestCase {
private CssLayout wrapper2 = new CssLayout();
private FormFieldFactory fff = new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+
+ @Override
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals(DataPOJO.Fields.name.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the name field");
return f;
} else if (propertyId.equals(DataPOJO.Fields.hp.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the HP field, but it has a VL as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.place.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("This is a long caption for the Place field, but it has a CSSLo as a wrapper");
return f;
} else if (propertyId.equals(DataPOJO.Fields.price.name())) {
- Field f = DefaultFieldFactory.get().createField(item,
+ Field<?> f = DefaultFieldFactory.get().createField(item,
propertyId, uiContext);
f.setCaption("With size undefined the caption behaves like this...");
f.setSizeFull();
@@ -95,7 +98,9 @@ public class GridLayoutCaptions extends AbstractTestCase {
"Ipsum lipsum laarum lop... ");
for (Object propIDs : getItemDataSource().getItemPropertyIds()) {
- ((TextField) getField(propIDs)).setComponentError(ive);
+ ((TextField) getField(propIDs))
+ .setComponentError(AbstractErrorMessage
+ .getErrorMessageForException(ive));
}
@@ -173,11 +178,11 @@ public class GridLayoutCaptions extends AbstractTestCase {
}
@Override
- public void init() {
- Window mainWindow = new Window("Formlayoutcaptionboom Application");
+ protected void setup() {
+ LegacyWindow mainWindow = getMainWindow();
+
Label label = new Label("Hello Vaadin user");
mainWindow.addComponent(label);
- setMainWindow(mainWindow);
DataPOJO forDemo = new DataPOJO();
@@ -190,6 +195,8 @@ public class GridLayoutCaptions extends AbstractTestCase {
mainWindow.addComponent(aFormWithGl);
Button b = new Button("Give me an error!", new Button.ClickListener() {
+
+ @Override
public void buttonClick(ClickEvent event) {
aFormWithGl.createErrors();
@@ -199,6 +206,8 @@ public class GridLayoutCaptions extends AbstractTestCase {
Button b2 = new Button("Get rid of an error!",
new Button.ClickListener() {
+
+ @Override
public void buttonClick(ClickEvent event) {
aFormWithGl.clearErrors();
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
index fa44345dfe..84f27e5f03 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java
@@ -1,17 +1,17 @@
package com.vaadin.tests.layouts;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class GridLayoutExpandRatioModification extends AbstractTestCase
- implements ClickListener {
+public class GridLayoutExpandRatioModification extends TestBase implements
+ ClickListener {
private boolean isVisible = false;
private GridLayout mainLayout;
@@ -20,11 +20,11 @@ public class GridLayoutExpandRatioModification extends AbstractTestCase
private Button button;
@Override
- public void init() {
- Window main = new Window("The Main Window");
+ public void setup() {
+ LegacyWindow main = getMainWindow();
+
mainLayout = new GridLayout(3, 3);
main.setContent(mainLayout);
- setMainWindow(main);
// The upper layout
vl1 = new VerticalLayout();
@@ -59,6 +59,7 @@ public class GridLayoutExpandRatioModification extends AbstractTestCase
vl2.setSizeFull();
}
+ @Override
public void buttonClick(ClickEvent event) {
if (isVisible) {
mainLayout.setRowExpandRatio(2, 0);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
index 8fb42948fc..d6ea84e44e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class GridLayoutInsidePanel2 extends Application {
+public class GridLayoutInsidePanel2 extends Application.LegacyApplication {
private Layout layout;
@Override
public void init() {
- Window w = new Window("Main");
+ LegacyWindow w = new LegacyWindow("Main");
setMainWindow(w);
layout = (Layout) w.getContent();
GridLayout gl = new GridLayout(1, 1);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutMoveComponent.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutMoveComponent.java
index 1442dc3421..efd1277653 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutMoveComponent.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutMoveComponent.java
@@ -29,6 +29,7 @@ public class GridLayoutMoveComponent extends TestBase {
addComponent(new Button("Shift label right",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
// Moving component from 0,0 -> 1,0
grid.removeComponent(l);
@@ -38,6 +39,7 @@ public class GridLayoutMoveComponent extends TestBase {
addComponent(new Button("Shift button right",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
grid.removeComponent(b);
grid.addComponent(b, 1, 1);
@@ -46,6 +48,7 @@ public class GridLayoutMoveComponent extends TestBase {
addComponent(new Button("Shift text field right",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
grid.removeComponent(tf);
grid.addComponent(tf, 1, 2);
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutNPE.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutNPE.java
index 6424177fe1..3531a4e13c 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutNPE.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutNPE.java
@@ -31,6 +31,7 @@ public class GridLayoutNPE extends TestBase {
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
gl.removeComponent(toRemove);
@@ -50,6 +51,7 @@ public class GridLayoutNPE extends TestBase {
b2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toEdit.setValue("Second (edited)");
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java
index 8689503332..5d45f72142 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutRemoveFinalRow.java
@@ -26,6 +26,7 @@ public class GridLayoutRemoveFinalRow extends TestBase {
Button removeRowBtn = new Button("Remove row",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
layout.removeRow(0);
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutWidthChange.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutWidthChange.java
index 78984d33a2..c0e6b27c7d 100644
--- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutWidthChange.java
+++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutWidthChange.java
@@ -43,6 +43,7 @@ public class GridLayoutWidthChange extends TestBase {
Button testButton = new Button("Reduce GridLayout parent width",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cc.setWidth((cc.getWidth() - 10) + "px");
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
index 8de59ccf00..dc0c8958ea 100644
--- a/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/HiddenHorizontalLayout.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.layouts;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
@@ -41,11 +42,12 @@ public class HiddenHorizontalLayout extends TestBase {
+ "3. Click \"toggle layout visibility\"<br>"
+ "4. Resize browser window to full <br/>"
+ "5. Click \"toggle layout visibility\"<br/>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
vl.addComponent(l);
Button b = new Button("toggle layout visibility",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
hl.setVisible(!hl.isVisible());
}
diff --git a/tests/testbench/com/vaadin/tests/layouts/LayoutPerformanceTests.java b/tests/testbench/com/vaadin/tests/layouts/LayoutPerformanceTests.java
index 23cf868085..57c6173895 100644
--- a/tests/testbench/com/vaadin/tests/layouts/LayoutPerformanceTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/LayoutPerformanceTests.java
@@ -213,12 +213,14 @@ public class LayoutPerformanceTests extends TestBase {
controls.addComponent(childAmount);
controls.addComponent(new Button("Clear", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
setTestLayout(new Label(""));
}
}));
controls.addComponent(new Button("Apply", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
SampleType leafType = (SampleType) leafSelector.getValue();
if (leafType == null) {
diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
index 22d81ce11f..31b3985a1c 100644
--- a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
+++ b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.html
@@ -17,6 +17,11 @@
<td></td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.AbsoluteLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VAbsoluteLayout[0]/VAbsoluteLayout$AbsoluteWrapper[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -28,12 +33,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -53,6 +58,11 @@
<td>199,6</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.Accordion</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VAccordion[0]/VAccordion$StackItem[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -64,12 +74,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -89,6 +99,11 @@
<td>186,11</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.CssLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VCssLayout[0]/VCssLayout$FlowPane[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -100,12 +115,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -125,40 +140,9 @@
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item4</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.FormLayout</td>
</tr>
<tr>
<td>assertText</td>
@@ -172,12 +156,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -193,10 +177,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item5</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item4</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.GridLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -208,12 +197,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -229,10 +218,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item6</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item5</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.HorizontalLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VHorizontalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -244,12 +238,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -265,10 +259,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item7</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item6</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.HorizontalSplitPanel</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelHorizontal[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -280,12 +279,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -301,44 +300,13 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item8</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item7</td>
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VOrderedLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item9</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.Panel</td>
</tr>
<tr>
<td>assertText</td>
@@ -352,12 +320,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -373,44 +341,13 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item10</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item9</td>
<td>199,10</td>
</tr>
<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
- <td>Label outside the component container</td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
- <td>Label inside the component container</td>
-</tr>
-<!--Next component container-->
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[1]</td>
- <td>14,5</td>
-</tr>
-<tr>
- <td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item11</td>
- <td>199,10</td>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.TabSheet</td>
</tr>
<tr>
<td>assertText</td>
@@ -424,12 +361,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -445,10 +382,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item12</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item10</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.VerticalLayout</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -460,12 +402,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
@@ -481,10 +423,15 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item13</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::Root/VFilterSelect$SuggestionPopup[0]/VFilterSelect$SuggestionMenu[0]#item11</td>
<td>199,10</td>
</tr>
<tr>
+ <td>assertValue</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::PID_ScomponentContainerSelect/domChild[0]</td>
+ <td>class com.vaadin.ui.VerticalSplitPanel</td>
+</tr>
+<tr>
<td>assertText</td>
<td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VSplitPanelVertical[0]/VLabel[0]</td>
<td>Label inside the component container</td>
@@ -496,12 +443,12 @@
</tr>
<tr>
<td>assertText</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VLabel[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VLabel[0]</td>
<td>Label outside the component container</td>
</tr>
<tr>
<td>click</td>
- <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td>vaadin=runcomvaadintestslayoutsMovingComponentsWhileOldParentInvisible::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
<td></td>
</tr>
<tr>
diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
index d21ecdd575..5f91786571 100644
--- a/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
+++ b/tests/testbench/com/vaadin/tests/layouts/MovingComponentsWhileOldParentInvisible.java
@@ -14,6 +14,7 @@ import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.LoginForm;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Window;
public class MovingComponentsWhileOldParentInvisible extends TestBase {
@@ -43,7 +44,8 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase {
.getComponentContainers()) {
if (cls == LoginForm.class || cls == CustomLayout.class
|| CustomComponent.class.isAssignableFrom(cls)
- || cls == PopupView.class || cls == Window.class) {
+ || cls == PopupView.class || cls == Window.class
+ || cls == Root.class) {
// Does not support addComponent
continue;
}
@@ -51,6 +53,7 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase {
}
componentContainerSelect.addListener(new ValueChangeListener() {
+ @Override
@SuppressWarnings("unchecked")
public void valueChange(ValueChangeEvent event) {
ComponentContainer oldCC = cc;
@@ -67,6 +70,7 @@ public class MovingComponentsWhileOldParentInvisible extends TestBase {
Button but1 = new Button("Move in and out of component container",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
cc.setVisible(!cc.isVisible());
if (!cc.isVisible()) {
diff --git a/tests/testbench/com/vaadin/tests/layouts/MovingInvisibleField.java b/tests/testbench/com/vaadin/tests/layouts/MovingInvisibleField.java
index 23ae31d786..1285e5b52e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/MovingInvisibleField.java
+++ b/tests/testbench/com/vaadin/tests/layouts/MovingInvisibleField.java
@@ -23,6 +23,7 @@ public class MovingInvisibleField extends TestBase {
Button b = new Button("Move hidden textfield to other layout");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (layout1.getComponentIndex(tfHidden) != -1) {
layout2.addComponent(tfVisible);
diff --git a/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java
index 1fe11f1a92..2ceb6428ed 100644
--- a/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java
+++ b/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java
@@ -16,8 +16,8 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.ListSelect;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Select;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -116,13 +116,13 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(tf);
ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT);
- Select s = new Select("100% high select");
+ ListSelect s = new ListSelect("100% high select");
s.setMultiSelect(true);
s.setHeight("100%");
s.setWidth("");
ol.addComponent(s);
- s = new Select("200 px high select");
+ s = new ListSelect("200 px high select");
s.setMultiSelect(true);
s.setHeight("200px");
s.setWidth("");
@@ -172,7 +172,8 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(l);
ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
- Select s = new Select("100% high select, should fit into layout");
+ ListSelect s = new ListSelect(
+ "100% high select, should fit into layout");
s.setMultiSelect(true);
s.setHeight("100%");
s.setWidth("");
@@ -182,7 +183,7 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(s);
- s = new Select("200 px high select, should be partly outside");
+ s = new ListSelect("200 px high select, should be partly outside");
s.setMultiSelect(true);
s.setHeight("200px");
s.setWidth("");
@@ -224,7 +225,8 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(l);
ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
- Select s = new Select("100% high select, should fit into layout");
+ ListSelect s = new ListSelect(
+ "100% high select, should fit into layout");
s.setMultiSelect(true);
s.setHeight("100%");
s.setWidth("100%");
@@ -234,7 +236,8 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(s);
- s = new Select("200 px high select, should make the layout 200px high");
+ s = new ListSelect(
+ "200 px high select, should make the layout 200px high");
s.setMultiSelect(true);
s.setHeight("200px");
s.setWidth("100%");
@@ -277,7 +280,8 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(l);
ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT);
- Select s = new Select("100% high select, should fit into layout");
+ ListSelect s = new ListSelect(
+ "100% high select, should fit into layout");
s.setMultiSelect(true);
s.setHeight("100%");
s.setWidth("100%");
@@ -287,7 +291,8 @@ public class OrderedLayoutBasics extends TestBase {
ol.addComponent(s);
- s = new Select("200 px high select, should make the layout 200px high");
+ s = new ListSelect(
+ "200 px high select, should make the layout 200px high");
s.setMultiSelect(true);
s.setHeight("200px");
s.setWidth("100%");
@@ -1000,6 +1005,7 @@ public class OrderedLayoutBasics extends TestBase {
private Button createAddButton(AbstractOrderedLayout ol) {
Button b = new Button("Add before", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addBefore((AbstractOrderedLayout) event.getButton().getData(),
event.getButton().getParent(), "");
@@ -1014,6 +1020,7 @@ public class OrderedLayoutBasics extends TestBase {
private Button createWideAddButton(AbstractOrderedLayout ol) {
Button b = new Button("Add 100% before", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addBefore((AbstractOrderedLayout) event.getButton().getData(),
event.getButton().getParent(), "100%");
@@ -1028,6 +1035,7 @@ public class OrderedLayoutBasics extends TestBase {
private Button createRemoveButton(AbstractOrderedLayout ol, String suffix) {
Button b = new Button("Remove this " + suffix, new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
remove((AbstractOrderedLayout) event.getButton().getData(),
event.getButton().getParent());
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
index 9a98cd17bd..d2f14c114e 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestAbsoluteLayout.java
@@ -33,7 +33,7 @@ public class TestAbsoluteLayout extends TestBase {
private static class MFieldFactory extends DefaultFieldFactory {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
if (propertyId.equals("CSSString")) {
TextArea f = new TextArea();
@@ -47,10 +47,10 @@ public class TestAbsoluteLayout extends TestBase {
s.addContainerProperty("caption", String.class, "");
s.setItemCaptionPropertyId("caption");
s.setNullSelectionAllowed(false);
- for (int i = 0; i < Layout.UNIT_SYMBOLS.length; i++) {
+ for (int i = 0; i < Layout.Unit.values().length; i++) {
Item unitItem = s.addItem(i);
unitItem.getItemProperty("caption").setValue(
- Layout.UNIT_SYMBOLS[i]);
+ Layout.Unit.values()[i]);
}
return s;
}
@@ -130,6 +130,7 @@ public class TestAbsoluteLayout extends TestBase {
Button componentChooser = new Button("choose component to edit");
componentChooser.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window chooser = new Window("Choose component");
chooser.getContent().setSizeUndefined();
@@ -155,7 +156,8 @@ public class TestAbsoluteLayout extends TestBase {
+ getDebugId();
if (next instanceof Property) {
- caption += " value:" + ((Property) next).getValue();
+ caption += " value:"
+ + ((Property<?>) next).getValue();
}
item.getItemProperty("caption").setValue(caption);
@@ -165,6 +167,7 @@ public class TestAbsoluteLayout extends TestBase {
select.setImmediate(true);
select.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
editcomponent((Component) event.getProperty()
.getValue());
@@ -184,6 +187,7 @@ public class TestAbsoluteLayout extends TestBase {
Button addComp = new Button("add component");
addComp.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final Window chooser = new Window(
"Choose component type to add");
@@ -234,6 +238,7 @@ public class TestAbsoluteLayout extends TestBase {
select.setImmediate(true);
select.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Class<?> c = (Class<?>) event.getProperty()
.getValue();
@@ -278,6 +283,7 @@ public class TestAbsoluteLayout extends TestBase {
addComponent(positionEditor);
Button b = new Button("Commit changes", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
positionEditor.commit();
componentEditor.commit();
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
index 93c51d6b4a..b998abeb02 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutClickListeners.java
@@ -13,9 +13,10 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
+import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TestLayoutClickListeners extends AbstractTestCase {
@@ -23,7 +24,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
@Override
public void init() {
- Window w = new Window("main window");
+ LegacyWindow w = new LegacyWindow("main window");
setMainWindow(w);
setTheme("tests-tickets");
@@ -59,6 +60,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
al.addComponent(new Button("A button with its own click listener",
new Button.ClickListener() {
+ @Override
public void buttonClick(
com.vaadin.ui.Button.ClickEvent event) {
log.log("Button " + event.getButton().getCaption()
@@ -68,6 +70,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
}));
al.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
logLayoutClick("AbsoluteLayout", event);
}
@@ -91,6 +94,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
cl.addComponent(new Button("A button with its own click listener",
new Button.ClickListener() {
+ @Override
public void buttonClick(
com.vaadin.ui.Button.ClickEvent event) {
log.log("Button " + event.getButton().getCaption()
@@ -100,6 +104,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
}));
cl.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
logLayoutClick("CSSLayout", event);
}
@@ -117,13 +122,14 @@ public class TestLayoutClickListeners extends AbstractTestCase {
gl.setStyleName("borders");
gl.setSpacing(true);
addContent(gl, 4);
- TextField largeTextarea = new TextField("Large textarea");
+ TextArea largeTextarea = new TextArea("Large textarea");
largeTextarea.setWidth("100%");
largeTextarea.setHeight("99%");
gl.addComponent(largeTextarea, 0, 3, 3, 3);
gl.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
logLayoutClick("GridLayout", event);
}
@@ -165,6 +171,7 @@ public class TestLayoutClickListeners extends AbstractTestCase {
gl.addListener(new LayoutClickListener() {
+ @Override
public void layoutClick(LayoutClickEvent event) {
logLayoutClick("VerticalLayout", event);
diff --git a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
index c7cf89e8b6..85ecf2897b 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TestLayoutPerformance.java
@@ -1,5 +1,6 @@
package com.vaadin.tests.layouts;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
@@ -33,12 +34,12 @@ public class TestLayoutPerformance extends TestBase {
@Override
protected void setup() {
Label label = new Label("<h1>CssLayout performance test.</h1>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
getLayout().addComponent(label);
label = new Label(
"<em>Hint</em>. Use debug dialog to measure rendering times TODO: extend with size settings (to both layout and content).",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
getLayout().addComponent(label);
ns = new NativeSelect("Select component to test");
@@ -64,12 +65,13 @@ public class TestLayoutPerformance extends TestBase {
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- int components = Integer.parseInt((String) n.getValue());
+ int components = Integer.parseInt(n.getValue());
Layout layout = getCurrentLayout();
for (int i = 0; i < components; i++) {
Component component = newTestComponent();
- if (cb.booleanValue()) {
+ if (cb.getValue()) {
component.setCaption("caption " + i);
}
layout.addComponent(component);
diff --git a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
index bce30f8fea..8d506e0884 100644
--- a/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
+++ b/tests/testbench/com/vaadin/tests/layouts/TreeWithBordersInLayout.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.layouts;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class TreeWithBordersInLayout extends AbstractTestCase {
@@ -14,7 +14,7 @@ public class TreeWithBordersInLayout extends AbstractTestCase {
public void init() {
Layout mainLayout = new VerticalLayout();
mainLayout.setSizeUndefined();
- setMainWindow(new Window("main window", mainLayout));
+ setMainWindow(new LegacyWindow("main window", mainLayout));
setTheme("tests-tickets");
diff --git a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
index 5b1c7a5888..916a82bb85 100644
--- a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
+++ b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java
@@ -1,16 +1,16 @@
package com.vaadin.tests.layouts;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class VerticalLayoutExpandRatioModification extends AbstractTestCase
- implements ClickListener {
+public class VerticalLayoutExpandRatioModification extends TestBase implements
+ ClickListener {
private boolean isVisible = false;
private VerticalLayout mainLayout;
@@ -19,11 +19,11 @@ public class VerticalLayoutExpandRatioModification extends AbstractTestCase
private Button button;
@Override
- public void init() {
- Window main = new Window("The Main Window");
+ public void setup() {
+ LegacyWindow main = getMainWindow();
+
mainLayout = new VerticalLayout();
main.setContent(mainLayout);
- setMainWindow(main);
// The upper layout
vl1 = new VerticalLayout();
@@ -55,6 +55,7 @@ public class VerticalLayoutExpandRatioModification extends AbstractTestCase
vl2.setSizeFull();
}
+ @Override
public void buttonClick(ClickEvent event) {
if (isVisible) {
mainLayout.setExpandRatio(vl2, 0);
diff --git a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java
index 98c5425bc6..f3d4029663 100644
--- a/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java
+++ b/tests/testbench/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponentsInitiallyHidden.java
@@ -43,6 +43,7 @@ public class VerticalLayoutWithRelativeSizeComponentsInitiallyHidden extends
"Click to set bar visible. Button should stay visible.");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
bar.setVisible(true);
foobar.setVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html b/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html
deleted file mode 100644
index c335f5df5a..0000000000
--- a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.html
+++ /dev/null
@@ -1,182 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head profile="http://selenium-ide.openqa.org/profiles/test-case">
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-<link rel="selenium.base" href="" />
-<title>New Test</title>
-</head>
-<body>
-<table cellpadding="1" cellspacing="1" border="1">
-<thead>
-<tr><td rowspan="1" colspan="3">New Test</td></tr>
-</thead><tbody>
-<tr>
- <td>open</td>
- <td>/run/com.vaadin.tests.layouts.WidgetImplementationSwap?restartApplication</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VAbsoluteLayout[0]/VAbsoluteLayout$AbsoluteWrapper[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VVerticalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[5]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[4]/VHorizontalLayout[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[7]/VButton[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[6]/VGridLayout[0]/AbsolutePanel[0]/ChildComponentContainer[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>click</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[9]/VButton[0]/domChild[0]/domChild[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-<tr>
- <td>assertElementPresent</td>
- <td>vaadin=runcomvaadintestslayoutsWidgetImplementationSwap::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[8]/VCssLayout[0]/VCssLayout$FlowPane[0]/VTextArea[0]</td>
- <td></td>
-</tr>
-<tr>
- <td>waitForVaadin</td>
- <td></td>
- <td></td>
-</tr>
-
-</tbody></table>
-</body>
-</html>
diff --git a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java b/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java
deleted file mode 100644
index 283e9f7a54..0000000000
--- a/tests/testbench/com/vaadin/tests/layouts/WidgetImplementationSwap.java
+++ /dev/null
@@ -1,157 +0,0 @@
-package com.vaadin.tests.layouts;
-
-import com.vaadin.tests.components.TestBase;
-import com.vaadin.ui.AbsoluteLayout;
-import com.vaadin.ui.AbstractLayout;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CssLayout;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.TextField;
-import com.vaadin.ui.VerticalLayout;
-
-@SuppressWarnings("deprecation")
-public class WidgetImplementationSwap extends TestBase {
-
- @Override
- protected void setup() {
- setTheme("tests-tickets");
-
- {
- final AbstractLayout layout = new AbsoluteLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
- {
- final AbstractLayout layout = new VerticalLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new HorizontalLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new GridLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- {
- final AbstractLayout layout = new CssLayout();
- layout.setCaption(layout.getClass().getSimpleName());
- layout.setStyleName("borders");
- layout.setWidth("500px");
- layout.setHeight("50px");
- addComponent(layout);
- final TextField tf = new TextField();
- layout.addComponent(tf);
- Button b = new Button("-> TextArea", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- if (tf.getRows() == 0) {
- tf.setRows(3);
- event.getButton().setCaption("Move");
- } else {
- layout.setCaption(layout.getClass().getSimpleName()
- + " done");
- event.getButton().setCaption("done");
- }
-
- }
- });
- addComponent(b);
- }
-
- }
-
- @Override
- protected String getDescription() {
- return "First click turns TextField into a TextArea (on the client); second click modifies the layout - widget should still be a TextArea.";
- }
-
- @Override
- protected Integer getTicketNumber() {
- return 5457;
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
index 0ccff34f44..d53fda1748 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java
@@ -150,6 +150,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.addComponent(cc1);
button1.setEnabled(false);
@@ -159,6 +160,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.replaceComponent(x22, cc2);
button2.setEnabled(false);
@@ -168,6 +170,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.moveComponentsFrom(source);
button3.setEnabled(false);
@@ -177,6 +180,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.removeComponent(1, 1);
button4.setEnabled(false);
@@ -187,6 +191,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button5.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.removeRow(0);
button5.setEnabled(false);
@@ -196,6 +201,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button6.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.removeComponent(row3);
button6.setEnabled(false);
@@ -230,6 +236,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
x3.setSizeFull();
button1.setEnabled(false);
@@ -239,6 +246,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
x3.setWidth("200px");
button2.setEnabled(false);
@@ -248,6 +256,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
x22.setWidth("200px");
button3.setEnabled(false);
@@ -257,6 +266,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
x22.setSizeUndefined();
((Table) x22).addItem(new Object[] { "NEW ROW1" }, 3);
@@ -292,6 +302,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setColumnExpandRatio(3, 1);
button1.setEnabled(false);
@@ -301,6 +312,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setColumnExpandRatio(0, 0.25f);
glo.setColumnExpandRatio(1, 0.25f);
@@ -313,6 +325,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setRowExpandRatio(0, 0.5f);
button3.setEnabled(false);
@@ -322,6 +335,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setRowExpandRatio(3, 0.3f);
button4.setEnabled(false);
@@ -394,6 +408,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setHeight("350px");
button1.setEnabled(false);
@@ -403,6 +418,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setSizeUndefined();
glo.addComponent(new Label("--- NEW LABEL ---"));
@@ -413,6 +429,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setWidth("75%");
glo.setHeight("75%");
@@ -423,6 +440,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setSizeFull();
button4.setEnabled(false);
@@ -457,6 +475,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setMargin(true);
button1.setEnabled(false);
@@ -466,6 +485,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setSpacing(true);
button2.setEnabled(false);
@@ -475,6 +495,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setMargin(false);
button3.setEnabled(false);
@@ -484,6 +505,7 @@ public class GridLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
glo.setSpacing(false);
button4.setEnabled(false);
@@ -513,17 +535,17 @@ public class GridLayoutTests extends AbstractLayoutTests {
glo.replaceComponent(row2, row2 = new NativeSelect());
glo.replaceComponent(row3, row3 = getTestTabsheet());
- ((AbstractField) col1).setRequired(true);
- ((AbstractField) col1).setValidationVisible(true);
- ((AbstractField) col1).setRequiredError("required error");
+ ((AbstractField<?>) col1).setRequired(true);
+ ((AbstractField<?>) col1).setValidationVisible(true);
+ ((AbstractField<?>) col1).setRequiredError("required error");
- ((AbstractField) row1).setRequired(true);
- ((AbstractField) row1).setValidationVisible(true);
- ((AbstractField) row1).setRequiredError("required error");
+ ((AbstractField<?>) row1).setRequired(true);
+ ((AbstractField<?>) row1).setValidationVisible(true);
+ ((AbstractField<?>) row1).setRequiredError("required error");
- ((AbstractField) row2).setRequired(true);
- ((AbstractField) row2).setValidationVisible(true);
- ((AbstractField) row2).setRequiredError("required error");
+ ((AbstractField<?>) row2).setRequired(true);
+ ((AbstractField<?>) row2).setValidationVisible(true);
+ ((AbstractField<?>) row2).setRequiredError("required error");
row2.setComponentError(new UserError("component error, user error"));
row3.setComponentError(new UserError("component error, user error"));
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
index caebbc8532..ab4bb265c5 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.layouts.layouttester;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.SystemError;
import com.vaadin.terminal.ThemeResource;
@@ -114,7 +115,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
final AbstractComponent c1 = new Button("BUTTON");
final AbstractComponent c2 = new Label("<b>LABEL</b>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final AbstractComponent c3 = new Table("TABLE");
c3.setHeight("100px");
c3.setWidth("100%");
@@ -131,6 +132,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
addButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.addComponent(new TextField());
addButton.setEnabled(false);
@@ -140,6 +142,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
replaceButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.replaceComponent(c1, c3);
replaceButton.setEnabled(false);
@@ -149,6 +152,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
moveButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.moveComponentsFrom(source);
moveButton.setEnabled(false);
@@ -158,6 +162,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
removeButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.removeComponent(c1);
vlo.removeComponent(c2);
@@ -202,6 +207,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
biggerButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
c.setSizeFull();
biggerButton.setEnabled(false);
@@ -211,6 +217,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
smallerButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
c.setWidth("200px");
smallerButton.setEnabled(false);
@@ -220,6 +227,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
originalButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
originalButton.setEnabled(false);
c.setSizeUndefined();
@@ -269,6 +277,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setHeight("350px");
button1.setEnabled(false);
@@ -278,6 +287,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setSizeUndefined();
vlo.addComponent(new Label("--- NEW LABEL ---"));
@@ -288,6 +298,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setWidth("75%");
vlo.setHeight("75%");
@@ -298,6 +309,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setSizeFull();
button4.setEnabled(false);
@@ -334,6 +346,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setExpandRatio(c1, 1.0f);
button1.setEnabled(false);
@@ -343,6 +356,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setExpandRatio(c1, 0.5f);
vlo.setExpandRatio(c2, 0.5f);
@@ -353,6 +367,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setExpandRatio(c1, 0.75f);
vlo.setExpandRatio(c2, 0.25f);
@@ -441,6 +456,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setMargin(true);
button1.setEnabled(false);
@@ -450,6 +466,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setSpacing(true);
button2.setEnabled(false);
@@ -459,6 +476,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setMargin(false);
button3.setEnabled(false);
@@ -468,6 +486,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo.setSpacing(false);
button4.setEnabled(false);
@@ -489,7 +508,7 @@ public class HorizontalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[5];
+ AbstractField<?>[] fields = new AbstractField<?>[5];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
index c2e5451a3b..8408aba9fd 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.html
@@ -316,12 +316,6 @@
<td>vaadin=runcomvaadintestslayoutslayouttesterLayoutTesterApplication::/VVerticalLayout[0]/ChildComponentContainer[0]/VHorizontalLayout[0]/ChildComponentContainer[0]/VButton[0]/domChild[0]</td>
<td></td>
</tr>
-<!-- Only for IE6 so it has time to load images and adjust -->
-<tr>
- <td>pause</td>
- <td>2000</td>
- <td></td>
-</tr>
<tr>
<td>screenCapture</td>
<td></td>
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
index 6f73a42497..90193be7cc 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/LayoutTesterApplication.java
@@ -11,8 +11,8 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeSelect;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
@SuppressWarnings("serial")
@@ -22,12 +22,12 @@ public class LayoutTesterApplication extends AbstractTestCase {
private int layoutCount = 1;
private Method[] layoutGetters;
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private NativeSelect layoutSelector;
@Override
public void init() {
- mainWindow = new Window("LayoutTesterApplication");
+ mainWindow = new LegacyWindow("LayoutTesterApplication");
setMainWindow(mainWindow);
loadLayoutGetters();
nextLaytout();
@@ -35,6 +35,7 @@ public class LayoutTesterApplication extends AbstractTestCase {
nextButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = -1577298910202253538L;
+ @Override
public void buttonClick(ClickEvent event) {
nextLaytout();
}
@@ -106,6 +107,7 @@ public class LayoutTesterApplication extends AbstractTestCase {
layoutSelector.addListener(new Property.ValueChangeListener() {
private static final long serialVersionUID = -605319614765838359L;
+ @Override
public void valueChange(ValueChangeEvent event) {
layoutIndex = -1;
nextLaytout();
diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
index 941dfcd877..be32ca513b 100644
--- a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
+++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java
@@ -1,6 +1,7 @@
package com.vaadin.tests.layouts.layouttester;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.Resource;
import com.vaadin.terminal.SystemError;
import com.vaadin.terminal.ThemeResource;
@@ -46,7 +47,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
((TextField) components[i]).setValue("FIELD " + i);
vlo.addComponent(components[i]);
vlo.setComponentAlignment(components[i], alignments[i]);
- vlo.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
}
baseLayout.addComponent(vlo);
vlo = getTestLaytout();
@@ -55,7 +56,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
((TextField) components[i]).setValue("FIELD " + i);
vlo.addComponent(components[i]);
vlo.setComponentAlignment(components[i], alignments[i]);
- vlo.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo.addComponent(new Label("<hr />", ContentMode.XHTML));
}
baseLayout.addComponent(vlo);
return baseLayout;
@@ -115,7 +116,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
final AbstractComponent c1 = new Button("BUTTON");
final AbstractComponent c2 = new Label("<b>LABEL</b>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
final AbstractComponent c3 = new Table("TABLE");
c3.setHeight("100px");
c3.setWidth("100%");
@@ -132,6 +133,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
addButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.addComponent(new TextField());
addButton.setEnabled(false);
@@ -141,6 +143,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
replaceButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.replaceComponent(c1, c3);
replaceButton.setEnabled(false);
@@ -150,6 +153,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
moveButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.moveComponentsFrom(source);
moveButton.setEnabled(false);
@@ -159,6 +163,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
removeButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.removeComponent(c1);
vlo2.removeComponent(c2);
@@ -205,6 +210,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
biggerButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
c.setSizeFull();
biggerButton.setEnabled(false);
@@ -214,6 +220,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
smallerButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
c.setWidth("200px");
smallerButton.setEnabled(false);
@@ -223,6 +230,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
originalButton.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
originalButton.setEnabled(false);
c.setSizeUndefined();
@@ -268,7 +276,9 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button4.setEnabled(false);
vlo2.addComponent(c1);
- vlo2.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ vlo2.addComponent(new Label(
+ "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>",
+ ContentMode.XHTML));
vlo2.addComponent(c2);
vlo2.setExpandRatio(c1, 0.5f);
vlo2.setExpandRatio(c2, 0.5f);
@@ -277,6 +287,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setHeight("350px");
button1.setEnabled(false);
@@ -286,9 +297,12 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setSizeUndefined();
- vlo2.addComponent(new Label("--- NEW LABEL ---"));
+ Label newLabel = new Label("--- NEW LABEL ---");
+ newLabel.setSizeUndefined();
+ vlo2.addComponent(newLabel);
button2.setEnabled(false);
button3.setEnabled(true);
}
@@ -296,6 +310,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setWidth("75%");
vlo2.setHeight("75%");
@@ -306,6 +321,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setSizeFull();
button4.setEnabled(false);
@@ -346,6 +362,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setExpandRatio(c1, 1.0f);
button1.setEnabled(false);
@@ -355,6 +372,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setExpandRatio(c1, 0.5f);
vlo2.setExpandRatio(c2, 0.5f);
@@ -365,6 +383,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setExpandRatio(c1, 0.75f);
vlo2.setExpandRatio(c2, 0.25f);
@@ -453,7 +472,10 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
final VerticalLayout vlo2 = getTestLaytout();
vlo2.addComponent(c1);
- vlo2.addComponent(new Label("<hr />", Label.CONTENT_XHTML));
+ // Must add something around the hr to avoid the margins collapsing
+ vlo2.addComponent(new Label(
+ "<div style='height: 1px'></div><hr /><div style='height: 1px'></div>",
+ ContentMode.XHTML));
vlo2.addComponent(c2);
vlo2.setExpandRatio(c1, 0.5f);
vlo2.setExpandRatio(c2, 0.5f);
@@ -462,6 +484,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button1.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setMargin(true);
button1.setEnabled(false);
@@ -471,6 +494,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button2.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setSpacing(true);
button2.setEnabled(false);
@@ -480,6 +504,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button3.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setMargin(false);
button3.setEnabled(false);
@@ -489,6 +514,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
button4.addListener(new Button.ClickListener() {
private static final long serialVersionUID = 7716267156088629379L;
+ @Override
public void buttonClick(ClickEvent event) {
vlo2.setSpacing(false);
button4.setEnabled(false);
@@ -510,7 +536,7 @@ public class VerticalLayoutTests extends AbstractLayoutTests {
components[3] = getTestTabsheet();
components[3].setIcon(new ThemeResource(LOCK_16_PNG));
- AbstractField[] fields = new AbstractField[6];
+ AbstractField<?>[] fields = new AbstractField<?>[6];
fields[0] = new TextField();
fields[0].setRequired(true);
fields[0].setValidationVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java
new file mode 100644
index 0000000000..8eef5c08e8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java
@@ -0,0 +1,77 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.data.fieldgroup.BeanFieldGroup;
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Auto%20generating%20
+ * a%20form%20based%20on%20a%20bean%20-%20Vaadin%206%20style%20Form
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class AutoGeneratingForm extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ FieldGroup fieldGroup = new BeanFieldGroup<Person>(Person.class);
+
+ // We need an item data source before we create the fields to be able to
+ // find the properties, otherwise we have to specify them by hand
+ fieldGroup.setItemDataSource(new BeanItem<Person>(new Person("John",
+ "Doe", 34)));
+
+ // Loop through the properties, build fields for them and add the fields
+ // to this root
+ for (Object propertyId : fieldGroup.getUnboundPropertyIds()) {
+ addComponent(fieldGroup.buildAndBind(propertyId));
+ }
+ }
+
+}
+
+class Person {
+ private String firstName, lastName;
+ private int age;
+
+ // + setters and getters
+
+ public Person(String firstName, String lastName, int age) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java
new file mode 100644
index 0000000000..3907209097
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java
@@ -0,0 +1,28 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20basic%20application
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class BasicApplication extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ VerticalLayout view = new VerticalLayout();
+ view.addComponent(new Label("Hello Vaadin!"));
+ setContent(view);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
new file mode 100644
index 0000000000..c175fd6065
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java
@@ -0,0 +1,31 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.TextField;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20an%20application
+ * %20that%20preserves%20state%20on%20refresh
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class CreatingPreserveState extends Root {
+ private static int windowCounter = 0;
+
+ @Override
+ public void init(WrappedRequest request) {
+ TextField tf = new TextField("Window #" + (++windowCounter));
+ tf.setImmediate(true);
+ getContent().addComponent(tf);
+ getApplication().setRootPreserved(true);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java
new file mode 100644
index 0000000000..89b4a0f8db
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryRoot.java
@@ -0,0 +1,33 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.TextField;
+
+public class CustomConverterFactoryRoot extends AbstractTestRoot {
+ @Override
+ public void setup(WrappedRequest request) {
+ getApplication().setConverterFactory(new MyConverterFactory());
+
+ TextField tf = new TextField("This is my double field");
+ tf.setImmediate(true);
+ tf.setConverter(Double.class);
+ addComponent(tf);
+
+ // As we do not set the locale explicitly for the field we set the value
+ // after the field has been attached so it uses the application locale
+ // for conversion
+ tf.setConvertedValue(50.1);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Changing%20the%20default%20converters%20for%20an%20application";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
new file mode 100644
index 0000000000..3bd17547fa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineRootTheme.java
@@ -0,0 +1,31 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.annotations.Theme;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Defining%20the%20theme%20for%20a%20Root
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+@Theme("hello-theme")
+public class DefineRootTheme extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ VerticalLayout view = new VerticalLayout();
+ view.addComponent(new Label("Hello Vaadin"));
+ setContent(view);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
new file mode 100644
index 0000000000..cf4c3b9267
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java
@@ -0,0 +1,63 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.Application;
+import com.vaadin.RootRequiresMoreInformationException;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedRequest.BrowserDetails;
+import com.vaadin.terminal.gwt.server.WebBrowser;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20an%20application
+ * %20with%20different%20features%20for%20different%20clients
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class DifferentFeaturesForDifferentClients extends Application {
+
+ @Override
+ protected Root getRoot(WrappedRequest request)
+ throws RootRequiresMoreInformationException {
+ BrowserDetails browserDetails = request.getBrowserDetails();
+ // This is a limitation of 7.0.0.alpha1 that there is no better way to
+ // check if WebBrowser has been fully initialized
+ if (browserDetails.getUriFragment() == null) {
+ throw new RootRequiresMoreInformationException();
+ }
+
+ // could also use screen size, browser version etc.
+ if (browserDetails.getWebBrowser().isTouchDevice()) {
+ return new TouchRoot();
+ } else {
+ return new DefaultRoot();
+ }
+ }
+}
+
+class DefaultRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ getContent().addComponent(
+ new Label("This browser does not support touch events"));
+ }
+}
+
+class TouchRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ WebBrowser webBrowser = request.getBrowserDetails().getWebBrowser();
+ String screenSize = "" + webBrowser.getScreenWidth() + "x"
+ + webBrowser.getScreenHeight();
+ getContent().addComponent(
+ new Label("Using a touch enabled device with screen size"
+ + screenSize));
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java
new file mode 100644
index 0000000000..81f225bc63
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageRoot.java
@@ -0,0 +1,80 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import java.awt.image.BufferedImage;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Embedded;
+
+public class DynamicImageRoot extends AbstractTestRoot {
+
+ @Override
+ public void setup(WrappedRequest request) {
+ // Add the request handler that handles our dynamic image
+ getApplication().addRequestHandler(new DynamicImageRequestHandler());
+
+ // Create a URL that we can handle in DynamicImageRequestHandler
+ URL imageUrl;
+ try {
+ imageUrl = new URL(getApplication().getURL(),
+ DynamicImageRequestHandler.IMAGE_URL + "?text=Hello!");
+ } catch (MalformedURLException e) {
+ // This should never happen
+ throw new RuntimeException(e);
+ }
+
+ // Add an embedded using the created URL
+ Embedded embedded = new Embedded("A dynamically generated image",
+ new ExternalResource(imageUrl));
+ embedded.setType(Embedded.TYPE_IMAGE);
+ getContent().addComponent(embedded);
+
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Generating%20dynamic%20resources%20based%20on%20URI%20or%20parameters";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+}
+
+class DynamicImageRequestHandler implements RequestHandler {
+
+ public static final String IMAGE_URL = "myimage.png";
+
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String pathInfo = request.getRequestPathInfo();
+ if (("/" + IMAGE_URL).equals(pathInfo)) {
+ // Create an image, draw the "text" parameter to it and output it to
+ // the browser.
+ String text = request.getParameter("text");
+ BufferedImage bi = new BufferedImage(100, 30,
+ BufferedImage.TYPE_3BYTE_BGR);
+ bi.getGraphics().drawChars(text.toCharArray(), 0, text.length(),
+ 10, 20);
+ response.setContentType("image/png");
+ ImageIO.write(bi, "png", response.getOutputStream());
+
+ return true;
+ }
+ // If the URL did not match our image URL, let the other request
+ // handlers handle it
+ return false;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
new file mode 100644
index 0000000000..ed0a5ba955
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentRootAndApplication.java
@@ -0,0 +1,50 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.Application;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Finding%20the%20current
+ * %20Root%20and%20Application
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class FindCurrentRootAndApplication extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ Button helloButton = new Button("Say Hello");
+ helloButton.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String msg = "Running in ";
+ msg += Application.getCurrent().isProductionMode() ? "production"
+ : "debug";
+ Notification.show(msg);
+ }
+ });
+
+ helloButton.addListener(new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Notification.show("This Root is "
+ + Root.getCurrent().getClass().getSimpleName());
+ }
+ });
+
+ addComponent(helloButton);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java
new file mode 100644
index 0000000000..1e460b2f6e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java
@@ -0,0 +1,98 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.data.fieldgroup.FieldGroup;
+import com.vaadin.data.fieldgroup.PropertyId;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.TextArea;
+import com.vaadin.ui.TextField;
+
+public class FormUsingExistingLayout extends AbstractTestRoot {
+
+ public static class Notice {
+ String firstName;
+ String lastName;
+ String message;
+
+ public Notice(String firstName, String lastName, String message) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.message = message;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+ }
+
+ public static class MyFormLayout extends GridLayout {
+ private TextField firstName = new TextField("First name");
+ private TextField lastName = new TextField("Last name");
+
+ // The name of the property is by default the name of the member field,
+ // but it can be redefined with the @PropertyId annotation
+ @PropertyId("message")
+ private TextArea messageField = new TextArea("Your message");
+
+ public MyFormLayout() {
+ // Set up the GridLayout
+ super(2, 3);
+ setSpacing(true);
+
+ // Add the (currently unbound) fields
+ addComponent(firstName);
+ addComponent(lastName);
+
+ addComponent(messageField, 0, 1, 1, 1);
+ messageField.setWidth("100%");
+ }
+
+ }
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ // Create the layout
+ MyFormLayout myFormLayout = new MyFormLayout();
+
+ // Create a field group and use it to bind the fields in the layout
+ FieldGroup fieldGroup = new FieldGroup(new BeanItem<Notice>(new Notice(
+ "John", "Doe", "")));
+ fieldGroup.bindMemberFields(myFormLayout);
+
+ addComponent(myFormLayout);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20form%20using%20an%20existing%20layout";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java
new file mode 100644
index 0000000000..e487c6d3c4
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java
@@ -0,0 +1,60 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToNumberConverter;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Table;
+
+public class FormatTableValue extends AbstractTestRoot {
+
+ private static final String PERCENT_PROPERTY = "percent";
+ private static final String CURRENCY_PROPERTY = "currency";
+ private static final String DEFAULT_PROPERTY = "default";
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Table table = new Table();
+ table.setLocale(Locale.FRANCE);
+ table.addContainerProperty(PERCENT_PROPERTY, Double.class, 0);
+ table.addContainerProperty(CURRENCY_PROPERTY, Double.class, 0);
+ table.addContainerProperty(DEFAULT_PROPERTY, Double.class, 0);
+
+ Object itemId = table.addItem();
+ table.getItem(itemId).getItemProperty(PERCENT_PROPERTY)
+ .setValue(3.1415);
+ table.getItem(itemId).getItemProperty(CURRENCY_PROPERTY)
+ .setValue(3.1415);
+ table.getItem(itemId).getItemProperty(DEFAULT_PROPERTY)
+ .setValue(3.1415);
+
+ table.setConverter(PERCENT_PROPERTY, new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getPercentInstance(locale);
+ }
+ });
+
+ table.setConverter(CURRENCY_PROPERTY, new StringToNumberConverter() {
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ return NumberFormat.getCurrencyInstance(locale);
+ }
+ });
+
+ addComponent(table);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Formatting%20data%20in%20Table";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java
new file mode 100644
index 0000000000..af60b0e9e3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java
@@ -0,0 +1,67 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.data.Property;
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.TextField;
+
+public class IntegerTextFieldDataSource extends AbstractTestRoot {
+
+ public class MyBean {
+ private int value;
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int integer) {
+ value = integer;
+ }
+ }
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final MyBean myBean = new MyBean();
+ BeanItem<MyBean> beanItem = new BeanItem<MyBean>(myBean);
+
+ final Property<Integer> integerProperty = (Property<Integer>) beanItem
+ .getItemProperty("value");
+ final TextField textField = new TextField("Text field", integerProperty);
+
+ Button submitButton = new Button("Submit value", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String uiValue = textField.getValue();
+ Integer propertyValue = integerProperty.getValue();
+ int dataModelValue = myBean.getValue();
+
+ Notification.show("UI value (String): " + uiValue
+ + "\nProperty value (Integer): " + propertyValue
+ + "\nData model value (int): " + dataModelValue);
+ }
+ });
+
+ addComponent(new Label("Text field type: " + textField.getType()));
+ addComponent(new Label("Text field type: " + integerProperty.getType()));
+ addComponent(textField);
+ addComponent(submitButton);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20TextField%20for%20Integer%20only%20input%20using%20a%20data%20source";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java
new file mode 100644
index 0000000000..f733b5df40
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java
@@ -0,0 +1,56 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.data.util.converter.StringToIntegerConverter;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.TextField;
+
+public class IntegerTextFieldStandalone extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final TextField textField = new TextField("Text field");
+ textField.setConverter(new StringToIntegerConverter());
+
+ Button submitButton = new Button("Submit value", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ String uiValue = textField.getValue();
+ try {
+ Integer convertedValue = (Integer) textField
+ .getConvertedValue();
+ Notification.show("UI value (String): " + uiValue
+ + "<br />Converted value (Integer): "
+ + convertedValue);
+ } catch (ConversionException e) {
+ e.printStackTrace();
+ Notification.show("Could not convert value: " + uiValue);
+ }
+ }
+ });
+
+ addComponent(new Label("Text field type: " + textField.getType()));
+ addComponent(new Label("Converterd text field type: "
+ + textField.getConverter().getModelType()));
+ addComponent(textField);
+ addComponent(submitButton);
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20TextField%20for%20Integer%20only%20input%20when%20not%20using%20a%20data%20source";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java
new file mode 100644
index 0000000000..89c6ef52c4
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java
@@ -0,0 +1,51 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Link;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.VerticalLayout;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20multi%20tab%20applications
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class MultiTabApplication extends Root {
+
+ private class MainView extends VerticalLayout {
+ public MainView() {
+ addComponent(new Link("Edit person 1", new ExternalResource(
+ "?editPerson=person1")));
+ addComponent(new Link("Edit person 2", new ExternalResource(
+ "?editPerson=person2")));
+ }
+ }
+
+ private class EditPersonView extends VerticalLayout {
+
+ public EditPersonView(String person) {
+ addComponent(new Label("Editor for " + person));
+ }
+
+ }
+
+ @Override
+ public void init(WrappedRequest request) {
+ String person = request.getParameter("editPerson");
+ if (person == null) {
+ setContent(new MainView());
+ } else {
+ setContent(new EditPersonView(person));
+ }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyConverterFactory.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyConverterFactory.java
new file mode 100644
index 0000000000..17c37f2115
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyConverterFactory.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.DefaultConverterFactory;
+
+public class MyConverterFactory extends DefaultConverterFactory {
+ @Override
+ protected <PRESENTATION, MODEL> Converter<PRESENTATION, MODEL> findConverter(
+ Class<PRESENTATION> presentationType, Class<MODEL> modelType) {
+ // Handle String <-> Double
+ if (presentationType == String.class && modelType == Double.class) {
+ return (Converter<PRESENTATION, MODEL>) new MyStringToDoubleConverter();
+ }
+ // Let default factory handle the rest
+ return super.findConverter(presentationType, modelType);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyStringToDoubleConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyStringToDoubleConverter.java
new file mode 100644
index 0000000000..483f841ce2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MyStringToDoubleConverter.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import java.text.NumberFormat;
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.StringToDoubleConverter;
+
+public class MyStringToDoubleConverter extends StringToDoubleConverter {
+
+ @Override
+ protected NumberFormat getFormat(Locale locale) {
+ NumberFormat format = super.getFormat(locale);
+ format.setGroupingUsed(false);
+ format.setMaximumFractionDigits(3);
+ format.setMinimumFractionDigits(3);
+ return format;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java
new file mode 100644
index 0000000000..c2393300f2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java
@@ -0,0 +1,113 @@
+package com.vaadin.tests.minitutorials.v7a1;
+
+import java.util.Locale;
+
+import com.vaadin.data.util.converter.Converter;
+import com.vaadin.data.util.converter.Converter.ConversionException;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.TextField;
+
+public class StringMyTypeConverter extends AbstractTestRoot {
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ Name name = new Name("Rudolph", "Reindeer");
+
+ final TextField textField = new TextField("Name");
+ textField.setConverter(new StringToNameConverter());
+ textField.setConvertedValue(name);
+
+ addComponent(textField);
+ addComponent(new Button("Submit value", new ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ try {
+ Name name = (Name) textField.getConvertedValue();
+ Notification.show("First name: " + name.getFirstName()
+ + "<br />Last name: " + name.getLastName());
+ } catch (ConversionException e) {
+ e.printStackTrace();
+ Notification.show(e.getCause().getMessage());
+ }
+ }
+ }));
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Mini tutorial for https://vaadin.com/wiki/-/wiki/Main/Creating%20your%20own%20converter%20for%20String%20-%20MyType%20conversion";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return null;
+ }
+
+}
+
+class StringToNameConverter implements Converter<String, Name> {
+ @Override
+ public Name convertToModel(String text, Locale locale)
+ throws ConversionException {
+ if (text == null) {
+ return null;
+ }
+ String[] parts = text.split(" ");
+ if (parts.length != 2) {
+ throw new ConversionException("Can not convert text to a name: "
+ + text);
+ }
+ return new Name(parts[0], parts[1]);
+ }
+
+ @Override
+ public String convertToPresentation(Name name, Locale locale)
+ throws ConversionException {
+ if (name == null) {
+ return null;
+ } else {
+ return name.getFirstName() + " " + name.getLastName();
+ }
+ }
+
+ @Override
+ public Class<Name> getModelType() {
+ return Name.class;
+ }
+
+ @Override
+ public Class<String> getPresentationType() {
+ return String.class;
+ }
+}
+
+class Name {
+ private String firstName;
+ private String lastName;
+
+ public Name(String firstName, String lastName) {
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java
new file mode 100644
index 0000000000..eb297ebd36
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java
@@ -0,0 +1,74 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import javax.validation.constraints.Max;
+import javax.validation.constraints.Min;
+import javax.validation.constraints.Size;
+
+import com.vaadin.data.util.BeanItem;
+import com.vaadin.data.validator.BeanValidator;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.TextField;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20Bean%20Validation
+ * %20to%20validate%20input
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class UsingBeanValidation extends Root {
+ class Person {
+
+ @Size(min = 5, max = 50)
+ private String name;
+
+ @Min(0)
+ @Max(100)
+ private int age;
+
+ // + constructor + setters + getters
+
+ public Person(String name, int age) {
+ this.name = name;
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ private void setN() {
+ // TODO Auto-generated method stub
+
+ }
+ }
+
+ @Override
+ protected void init(WrappedRequest request) {
+ Person person = new Person("John", 26);
+ BeanItem<Person> item = new BeanItem<Person>(person);
+
+ TextField firstName = new TextField("First name",
+ item.getItemProperty("name"));
+ firstName.setImmediate(true);
+ addComponent(firstName);
+
+ firstName.addValidator(new BeanValidator(Person.class, "name"));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java
new file mode 100644
index 0000000000..bf497a7b86
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java
@@ -0,0 +1,56 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.Page.FragmentChangedEvent;
+import com.vaadin.terminal.Page.FragmentChangedListener;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20URI%20fragments
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class UsingUriFragments extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ Label label = new Label("Hello, your fragment is "
+ + request.getBrowserDetails().getUriFragment());
+ getContent().addComponent(label);
+
+ // React to fragment changes
+ getPage().addListener(new FragmentChangedListener() {
+ @Override
+ public void fragmentChanged(FragmentChangedEvent source) {
+ handleFragment(source.getFragment());
+ }
+ });
+
+ // Handle the fragment received in the initial request
+ handleFragment(request.getBrowserDetails().getUriFragment());
+
+ addComponent(new Button("Show and set fragment",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ handleFragment(getPage().getFragment());
+ getPage().setFragment("customFragment");
+ }
+ }));
+ }
+
+ private void handleFragment(String uriFragment) {
+ addComponent(new Label("Got new fragment: " + uriFragment));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java
new file mode 100644
index 0000000000..426ef3525e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java
@@ -0,0 +1,52 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a1;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20URI%20or%20
+ * parameters%20or%20screen%20size%20when%20initializing%20an%20application
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class UsingXyzWhenInitializing extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ String name = request.getParameter("name");
+ if (name == null) {
+ name = "Unknown";
+ }
+
+ getContent().addComponent(new Label("Hello " + name));
+
+ String pathInfo = request.getRequestPathInfo();
+ if ("/viewSource".equals(pathInfo)) {
+ getContent().addComponent(new Label("This is the source"));
+ } else {
+ getContent().addComponent(new Label("Welcome to my application"));
+ }
+
+ // WebBrowser browser = request.getBrowserDetails().getWebBrowser();
+ // String resolution = "Your browser window on startup was "
+ // + browser.getClientWidth() + "x" + browser.getClientHeight();
+ // if (browser.getClientWidth() > 1024) {
+ // getContent().addComponent(
+ // new Label("The is the large version of the application. "
+ // + resolution));
+ // } else {
+ // getContent().addComponent(
+ // new Label("This is the small version of the application. "
+ // + resolution));
+ // }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java
new file mode 100644
index 0000000000..78a945901d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateComponent.java
@@ -0,0 +1,26 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.tests.widgetset.client.minitutorials.v7a2.ComponentInStateState;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.Component;
+
+public class ComponentInStateComponent extends AbstractComponent {
+
+ @Override
+ public ComponentInStateState getState() {
+ return (ComponentInStateState) super.getState();
+ }
+
+ public void setOtherComponent(Component component) {
+ getState().setOtherComponent(component);
+ requestRepaint();
+ }
+
+ public Component getOtherComponent() {
+ return (Component) getState().getOtherComponent();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java
new file mode 100644
index 0000000000..61b5f98f99
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateRoot.java
@@ -0,0 +1,27 @@
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20Components%
+ * 20in%20the%20shared%20state
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class ComponentInStateRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ ComponentInStateComponent component = new ComponentInStateComponent();
+ component.setOtherComponent(this);
+ addComponent(component);
+ addComponent(new Label("Server-side type of other component: "
+ + component.getOtherComponent().getClass().getName()));
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java
new file mode 100644
index 0000000000..b4dab09807
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponent.java
@@ -0,0 +1,48 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.tests.widgetset.client.minitutorials.v7a2.MyComponentClientRpc;
+import com.vaadin.tests.widgetset.client.minitutorials.v7a2.MyComponentServerRpc;
+import com.vaadin.tests.widgetset.client.minitutorials.v7a2.MyComponentState;
+import com.vaadin.ui.AbstractComponent;
+
+public class MyComponent extends AbstractComponent {
+ private int clickCount = 0;
+
+ private MyComponentServerRpc rpc = new MyComponentServerRpc() {
+ @Override
+ public void clicked(MouseEventDetails mouseDetails) {
+ clickCount++;
+
+ // nag every 5:th click
+ if (clickCount % 5 == 0) {
+ getRpcProxy(MyComponentClientRpc.class).alert(
+ "Ok, that's enough!");
+ }
+
+ setText("You have clicked " + clickCount + " times");
+ }
+ };
+
+ public MyComponent() {
+ registerRpc(rpc);
+ }
+
+ @Override
+ public MyComponentState getState() {
+ return (MyComponentState) super.getState();
+ }
+
+ public void setText(String text) {
+ getState().setText(text);
+ requestRepaint();
+ }
+
+ public String getText() {
+ return getState().getText();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java
new file mode 100644
index 0000000000..77792436f5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentRoot.java
@@ -0,0 +1,36 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
+ * https://vaadin.com/wiki/-/wiki/Main/Creating%20a%20simple%20component,
+ * https://vaadin.com/wiki/-/wiki/Main/Sending%
+ * 20events%20from%20the%20client%20to%20the%20server%20using%20RPC,
+ * https://vaadin
+ * .com/wiki/-/wiki/Main/Using%20RPC%20to%20send%20events%20to%20the%20client
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class MyComponentRoot extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ MyComponent component = new MyComponent();
+
+ component.setText("My component text");
+
+ addComponent(component);
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java
new file mode 100644
index 0000000000..98ff0386b3
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerConnector.java
@@ -0,0 +1,63 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.google.gwt.user.client.Element;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.SimpleManagedLayout;
+import com.vaadin.terminal.gwt.client.ui.layout.ElementResizeEvent;
+import com.vaadin.terminal.gwt.client.ui.layout.ElementResizeListener;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Widget%20styling%20using%20only%20CSS,
+ * https
+ * ://vaadin.com/wiki/-/wiki/Main/Lightweight%20calculations%20of%20widget%20l
+ * ayout and https://vaadin.com/wiki/-/wiki/Main/Complex%20widget%20layouts
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+public class MyPickerConnector extends AbstractComponentConnector implements
+ SimpleManagedLayout {
+ @Override
+ public MyPickerWidget getWidget() {
+ return (MyPickerWidget) super.getWidget();
+ }
+
+ private final ElementResizeListener listener = new ElementResizeListener() {
+ @Override
+ public void onElementResize(ElementResizeEvent e) {
+ int buttonWidth = getLayoutManager().getOuterWidth(e.getElement());
+ buttonWidth -= getLayoutManager().getMarginRight(e.getElement());
+ getWidget().adjustButtonSpace(buttonWidth);
+ }
+ };
+
+ @Override
+ protected void init() {
+ Element button = getWidget().getWidget(1).getElement();
+ getLayoutManager().addElementResizeListener(button, listener);
+
+ getLayoutManager().registerDependency(this, button);
+ }
+
+ @Override
+ public void onUnregister() {
+ Element button = getWidget().getWidget(1).getElement();
+ getLayoutManager().removeElementResizeListener(button, listener);
+
+ getLayoutManager().unregisterDependency(this, button);
+ }
+
+ @Override
+ public void layout() {
+ Element button = getWidget().getWidget(1).getElement();
+ int buttonWidth = getLayoutManager().getOuterWidth(button);
+ buttonWidth -= getLayoutManager().getMarginRight(button);
+ getWidget().adjustButtonSpace(buttonWidth);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java
new file mode 100644
index 0000000000..7818ac4f99
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyPickerWidget.java
@@ -0,0 +1,52 @@
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.google.gwt.dom.client.Document;
+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.Window;
+import com.google.gwt.user.client.ui.ComplexPanel;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.TextBox;
+
+public class MyPickerWidget extends ComplexPanel {
+
+ public static final String CLASSNAME = "mypicker";
+
+ private final TextBox textBox = new TextBox();
+ private final PushButton button = new PushButton("...");
+
+ public MyPickerWidget() {
+ setElement(Document.get().createDivElement());
+ setStylePrimaryName(CLASSNAME);
+
+ textBox.setStylePrimaryName(CLASSNAME + "-field");
+ button.setStylePrimaryName(CLASSNAME + "-button");
+
+ add(textBox, getElement());
+ add(button, getElement());
+
+ button.addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+ Window.alert("Calendar picker not yet supported!");
+ }
+ });
+ }
+
+ public void setButtonText(String buttonText, boolean adjustSpace) {
+ if (buttonText == null || buttonText.length() == 0) {
+ buttonText = "...";
+ }
+ button.setText(buttonText);
+
+ if (adjustSpace) {
+ adjustButtonSpace(button.getOffsetWidth());
+ }
+ }
+
+ public void adjustButtonSpace(int width) {
+ getElement().getStyle().setPaddingRight(width, Unit.PX);
+ button.getElement().getStyle().setMarginRight(-width, Unit.PX);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java
new file mode 100644
index 0000000000..f9d4cb38e6
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java
@@ -0,0 +1,30 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.terminal.Resource;
+import com.vaadin.terminal.gwt.server.ResourceReference;
+import com.vaadin.tests.widgetset.client.minitutorials.v7a2.ResourceInStateState;
+import com.vaadin.ui.AbstractComponent;
+
+public class ResourceInStateComponent extends AbstractComponent {
+ @Override
+ public ResourceInStateState getState() {
+ return (ResourceInStateState) super.getState();
+ }
+
+ public void setMyIcon(Resource icon) {
+ getState().setMyIcon(new ResourceReference(icon));
+ }
+
+ public Resource getMyIcon() {
+ ResourceReference ref = ((ResourceReference) getState().getMyIcon());
+ if (ref != null) {
+ return ref.getResource();
+ } else {
+ return null;
+ }
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java
new file mode 100644
index 0000000000..135d36828d
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateRoot.java
@@ -0,0 +1,32 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a2;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.ThemeResource;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+
+/**
+ * Mini tutorial code for
+ * https://vaadin.com/wiki/-/wiki/Main/Using%20Resources%20
+ * in%20the%20shared%20state
+ *
+ * @author Vaadin Ltd
+ * @version @VERSION@
+ * @since 7.0.0
+ */
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class ResourceInStateRoot extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ ResourceInStateComponent component = new ResourceInStateComponent();
+ component.setIcon(new ThemeResource("../runo/icons/32/calendar.png"));
+
+ addComponent(component);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java
new file mode 100644
index 0000000000..40bb7b68b8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetContainer.java
@@ -0,0 +1,49 @@
+package com.vaadin.tests.minitutorials.v7a2;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import com.vaadin.ui.AbstractComponentContainer;
+import com.vaadin.ui.Component;
+
+public class WidgetContainer extends AbstractComponentContainer {
+
+ List<Component> children = new ArrayList<Component>();
+
+ @Override
+ public void addComponent(Component c) {
+ children.add(c);
+ super.addComponent(c);
+ requestRepaint();
+ }
+
+ @Override
+ public void removeComponent(Component c) {
+ children.remove(c);
+ super.removeComponent(c);
+ requestRepaint();
+ }
+
+ @Override
+ public void replaceComponent(Component oldComponent, Component newComponent) {
+ int index = children.indexOf(oldComponent);
+ if (index != -1) {
+ children.remove(index);
+ children.add(index, newComponent);
+ fireComponentDetachEvent(oldComponent);
+ fireComponentAttachEvent(newComponent);
+ requestRepaint();
+ }
+ }
+
+ @Override
+ public int getComponentCount() {
+ return children.size();
+ }
+
+ @Override
+ public Iterator<Component> getComponentIterator() {
+ return children.iterator();
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java
new file mode 100644
index 0000000000..fae4265750
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerRoot.java
@@ -0,0 +1,45 @@
+package com.vaadin.tests.minitutorials.v7a2;
+
+import java.util.Random;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Component;
+import com.vaadin.ui.Label;
+import com.vaadin.ui.Root;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class WidgetcontainerRoot extends Root {
+ @Override
+ public void init(WrappedRequest request) {
+ Label label = new Label("Hello Vaadin user");
+ addComponent(label);
+ final WidgetContainer widgetContainer = new WidgetContainer();
+ addComponent(widgetContainer);
+ widgetContainer.addComponent(new Label(
+ "Click the button to add components to the WidgetContainer."));
+ Button button = new Button("Add more components", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ Random randomGenerator = new Random();
+ int random = randomGenerator.nextInt(3);
+ Component component;
+ if (random % 3 == 0) {
+ component = new Label("A new label");
+ } else if (random % 3 == 1) {
+ component = new Button("A button!");
+ } else {
+ component = new CheckBox("A textfield");
+ }
+ widgetContainer.addComponent(component);
+ }
+ });
+ addComponent(button);
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java
new file mode 100644
index 0000000000..bd4cfd5839
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java
@@ -0,0 +1,37 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.terminal.AbstractJavaScriptExtension;
+import com.vaadin.terminal.gwt.server.ClientConnector;
+import com.vaadin.ui.Root;
+
+@JavaScript("analytics_connector.js")
+public class Analytics extends AbstractJavaScriptExtension {
+
+ public Analytics(String account) {
+ pushCommand("_setAccount", account);
+ }
+
+ public void trackPageview(String name) {
+ pushCommand("_trackPageview", name);
+ }
+
+ private void pushCommand(Object... commandAndArguments) {
+ // Cast to Object to use Object[] commandAndArguments as the first
+ // varargs argument instead of as the full varargs argument array.
+ invokeCallback("pushCommand", (Object) commandAndArguments);
+ }
+
+ protected void extend(Root root) {
+ super.extend(root);
+ }
+
+ @Override
+ protected Class<? extends ClientConnector> getSupportedParentType() {
+ return Root.class;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java
new file mode 100644
index 0000000000..6f59aa765e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsRoot.java
@@ -0,0 +1,27 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root;
+
+public class AnalyticsRoot extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ final Analytics analytics = new Analytics("UA-33036133-12");
+ analytics.extend(this);
+
+ addComponent(new Button("Track pageview", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ analytics.trackPageview("/fake/url");
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java
new file mode 100644
index 0000000000..2dc6dea432
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesBean.java
@@ -0,0 +1,27 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+public class ComplexTypesBean {
+ private int integer;
+ private ComplexTypesBean bean;
+
+ public int getInteger() {
+ return integer;
+ }
+
+ public void setInteger(int integer) {
+ this.integer = integer;
+ }
+
+ public ComplexTypesBean getBean() {
+ return bean;
+ }
+
+ public void setBean(ComplexTypesBean bean) {
+ this.bean = bean;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java
new file mode 100644
index 0000000000..9f452c61b0
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesComponent.java
@@ -0,0 +1,53 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.shared.Connector;
+import com.vaadin.ui.AbstractJavaScriptComponent;
+import com.vaadin.ui.Root;
+
+@JavaScript("complex_types_connector.js")
+public class ComplexTypesComponent extends AbstractJavaScriptComponent {
+ public void sendComplexTypes() {
+ List<String> list = new ArrayList<String>();
+ list.add("First string");
+ list.add(null);
+ list.add("Another string");
+
+ Map<String, Integer> stringMap = new HashMap<String, Integer>();
+ stringMap.put("one", 1);
+ stringMap.put("two", 2);
+
+ Map<Integer, String> otherMap = new HashMap<Integer, String>();
+ otherMap.put(3, "3");
+ otherMap.put(4, "4");
+
+ Map<Connector, String> connectorMap = new HashMap<Connector, String>();
+ connectorMap.put(this, "this");
+ connectorMap.put(Root.getCurrent(), "root");
+
+ boolean[] bits = { true, true, false, true };
+
+ List<List<Double>> matrix = Arrays.asList(Arrays.asList(1d, 2d),
+ Arrays.asList(3d, 4d));
+
+ ComplexTypesBean innerBean = new ComplexTypesBean();
+ innerBean.setInteger(-42);
+
+ ComplexTypesBean bean = new ComplexTypesBean();
+ bean.setInteger(42);
+ bean.setBean(innerBean);
+
+ getRpcProxy(ComplexTypesRpc.class).sendComplexTypes(list, stringMap,
+ otherMap, connectorMap, bits, matrix, bean);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java
new file mode 100644
index 0000000000..dc46fe0c29
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRoot.java
@@ -0,0 +1,19 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+
+public class ComplexTypesRoot extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ ComplexTypesComponent complexTypesComponent = new ComplexTypesComponent();
+ complexTypesComponent.sendComplexTypes();
+ addComponent(complexTypesComponent);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java
new file mode 100644
index 0000000000..f763f51118
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesRpc.java
@@ -0,0 +1,18 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import java.util.List;
+import java.util.Map;
+
+import com.vaadin.shared.Connector;
+import com.vaadin.shared.communication.ClientRpc;
+
+public interface ComplexTypesRpc extends ClientRpc {
+ public void sendComplexTypes(List<String> list,
+ Map<String, Integer> stringMap, Map<Integer, String> otherMap,
+ Map<Connector, String> connectorMap, boolean[] bits,
+ List<List<Double>> matrix, ComplexTypesBean bean);
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java
new file mode 100644
index 0000000000..946a67d7fd
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Flot.java
@@ -0,0 +1,62 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import com.vaadin.annotations.JavaScript;
+import com.vaadin.external.json.JSONArray;
+import com.vaadin.external.json.JSONException;
+import com.vaadin.ui.AbstractJavaScriptComponent;
+import com.vaadin.ui.JavaScriptCallback;
+import com.vaadin.ui.Notification;
+
+@JavaScript({
+ "https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js",
+ "jquery.flot.js", "flot_connector.js" })
+public class Flot extends AbstractJavaScriptComponent {
+ public Flot() {
+ registerRpc(new FlotClickRpc() {
+ @Override
+ public void onPlotClick(int seriesIndex, int dataIndex) {
+ Notification.show("Clicked on [" + seriesIndex + ", "
+ + dataIndex + "]");
+ }
+ });
+ registerCallback("onPlotClick", new JavaScriptCallback() {
+ @Override
+ public void call(JSONArray arguments) throws JSONException {
+ int seriesIndex = arguments.getInt(0);
+ int dataIndex = arguments.getInt(1);
+ Notification.show("Clicked on [" + seriesIndex + ", "
+ + dataIndex + "]");
+ }
+ });
+ }
+
+ public void addSeries(double... points) {
+ List<List<Double>> pointList = new ArrayList<List<Double>>();
+ for (int i = 0; i < points.length; i++) {
+ pointList.add(Arrays.asList(Double.valueOf(i),
+ Double.valueOf(points[i])));
+ }
+
+ getState().getSeries().add(pointList);
+
+ requestRepaint();
+ }
+
+ public void highlight(int seriesIndex, int dataIndex) {
+ getRpcProxy(FlotHighlightRpc.class).highlight(seriesIndex, dataIndex);
+ invokeCallback("highlight", seriesIndex, dataIndex);
+ }
+
+ @Override
+ public FlotState getState() {
+ return (FlotState) super.getState();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotClickRpc.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotClickRpc.java
new file mode 100644
index 0000000000..3802fe6e3f
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotClickRpc.java
@@ -0,0 +1,7 @@
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+public interface FlotClickRpc extends ServerRpc {
+ public void onPlotClick(int seriesIndex, int dataIndex);
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java
new file mode 100644
index 0000000000..93730a8640
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotHighlightRpc.java
@@ -0,0 +1,11 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+public interface FlotHighlightRpc extends ClientRpc {
+ public void highlight(int seriesIndex, int dataIndex);
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java
new file mode 100644
index 0000000000..2b5e7337c8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptRoot.java
@@ -0,0 +1,31 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root;
+
+public class FlotJavaScriptRoot extends Root {
+
+ @Override
+ protected void init(WrappedRequest request) {
+ final Flot flot = new Flot();
+ flot.setHeight("300px");
+ flot.setWidth("400px");
+
+ flot.addSeries(1, 2, 4, 8, 16);
+ addComponent(flot);
+
+ addComponent(new Button("Highlight point", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ flot.highlight(0, 3);
+ }
+ }));
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotState.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotState.java
new file mode 100644
index 0000000000..eb9e2f64ce
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotState.java
@@ -0,0 +1,18 @@
+package com.vaadin.tests.minitutorials.v7a3;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import com.vaadin.shared.ui.JavaScriptComponentState;
+
+public class FlotState extends JavaScriptComponentState {
+ public List<List<List<Double>>> series = new ArrayList<List<List<Double>>>();
+
+ public List<List<List<Double>>> getSeries() {
+ return series;
+ }
+
+ public void setSeries(List<List<List<Double>>> series) {
+ this.series = series;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButton.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButton.java
new file mode 100644
index 0000000000..003eab7e9c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButton.java
@@ -0,0 +1,16 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.annotations.StyleSheet;
+import com.vaadin.ui.NativeButton;
+
+@StyleSheet("redbutton.css")
+public class RedButton extends NativeButton {
+ public RedButton(String caption) {
+ super(caption);
+ addStyleName("redButton");
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java
new file mode 100644
index 0000000000..9cffdc9e63
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonRoot.java
@@ -0,0 +1,15 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.minitutorials.v7a3;
+
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.ui.Root;
+
+public class RedButtonRoot extends Root {
+ @Override
+ protected void init(WrappedRequest request) {
+ addComponent(new RedButton("My red button"));
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/analytics_connector.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/analytics_connector.js
new file mode 100644
index 0000000000..4eadff5803
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/analytics_connector.js
@@ -0,0 +1,13 @@
+window._gaq = window._gaq || [];
+
+(function() {
+ var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+
+window.com_vaadin_tests_minitutorials_v7a3_Analytics = function() {
+ this.pushCommand = function(command) {
+ _gaq.push(command);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js
new file mode 100644
index 0000000000..85dfb1369b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/complex_types_connector.js
@@ -0,0 +1,17 @@
+window.com_vaadin_tests_minitutorials_v7a3_ComplexTypesComponent = function() {
+ this.registerRpc({
+ sendComplexTypes: function(list, stringMap, otherMap, connectorMap, bits, matrix, bean) {
+ var connectorId = this.getConnectorId();
+
+ var message = 'list[2] = "' + list[2] + '"<br />';
+ message += 'stringMap.two = ' + stringMap.two + '<br />';
+ message += 'otherMap[1][1] = "' + otherMap[1][1] + '"<br />';
+ message += 'connectorMap[connectorId] = "' + connectorMap[connectorId] +'"<br />';
+ message += 'bits[3] = ' + bits[3] + '<br />';
+ message += 'matrix[0][1] = ' + matrix[0][1] + '<br />';
+ message += 'bean.bean.integer = ' + bean.bean.integer + '<br />';
+
+ this.getElement().innerHTML = message;
+ }
+ });
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/flot_connector.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/flot_connector.js
new file mode 100644
index 0000000000..5e572a4c72
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/flot_connector.js
@@ -0,0 +1,31 @@
+window.com_vaadin_tests_minitutorials_v7a3_Flot = function() {
+ var element = $(this.getElement());
+ var rpcProxy = this.getRpcProxy();
+ var self = this;
+ var flot;
+
+ this.onStateChange = function() {
+ flot = $.plot(element, this.getState().series, {grid: {clickable: true}});
+ }
+
+ element.bind('plotclick', function(event, point, item) {
+ if (item) {
+ rpcProxy.onPlotClick(item.seriesIndex, item.dataIndex);
+ self.onPlotClick(item.seriesIndex, item.dataIndex);
+ }
+ });
+
+ this.registerRpc({
+ highlight: function(seriesIndex, dataIndex) {
+ if (flot) {
+ flot.highlight(seriesIndex, dataIndex);
+ }
+ }
+ });
+
+ this.highlight = function(seriesIndex, dataIndex) {
+ if (flot) {
+ flot.highlight(seriesIndex, dataIndex);
+ }
+ };
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/jquery.flot.js b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/jquery.flot.js
new file mode 100644
index 0000000000..f38561ba10
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/jquery.flot.js
@@ -0,0 +1,2599 @@
+/*! Javascript plotting library for jQuery, v. 0.7.
+ *
+ * Released under the MIT license by IOLA, December 2007.
+ *
+ */
+
+// first an inline dependency, jquery.colorhelpers.js, we inline it here
+// for convenience
+
+/* Plugin for jQuery for working with colors.
+ *
+ * Version 1.1.
+ *
+ * Inspiration from jQuery color animation plugin by John Resig.
+ *
+ * Released under the MIT license by Ole Laursen, October 2009.
+ *
+ * Examples:
+ *
+ * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString()
+ * var c = $.color.extract($("#mydiv"), 'background-color');
+ * console.log(c.r, c.g, c.b, c.a);
+ * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)"
+ *
+ * Note that .scale() and .add() return the same modified object
+ * instead of making a new one.
+ *
+ * V. 1.1: Fix error handling so e.g. parsing an empty string does
+ * produce a color rather than just crashing.
+ */
+(function(B){B.color={};B.color.make=function(F,E,C,D){var G={};G.r=F||0;G.g=E||0;G.b=C||0;G.a=D!=null?D:1;G.add=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]+=I}return G.normalize()};G.scale=function(J,I){for(var H=0;H<J.length;++H){G[J.charAt(H)]*=I}return G.normalize()};G.toString=function(){if(G.a>=1){return"rgb("+[G.r,G.g,G.b].join(",")+")"}else{return"rgba("+[G.r,G.g,G.b,G.a].join(",")+")"}};G.normalize=function(){function H(J,K,I){return K<J?J:(K>I?I:K)}G.r=H(0,parseInt(G.r),255);G.g=H(0,parseInt(G.g),255);G.b=H(0,parseInt(G.b),255);G.a=H(0,G.a,1);return G};G.clone=function(){return B.color.make(G.r,G.b,G.g,G.a)};return G.normalize()};B.color.extract=function(D,C){var E;do{E=D.css(C).toLowerCase();if(E!=""&&E!="transparent"){break}D=D.parent()}while(!B.nodeName(D.get(0),"body"));if(E=="rgba(0, 0, 0, 0)"){E="transparent"}return B.color.parse(E)};B.color.parse=function(F){var E,C=B.color.make;if(E=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10))}if(E=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseInt(E[1],10),parseInt(E[2],10),parseInt(E[3],10),parseFloat(E[4]))}if(E=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55)}if(E=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(F)){return C(parseFloat(E[1])*2.55,parseFloat(E[2])*2.55,parseFloat(E[3])*2.55,parseFloat(E[4]))}if(E=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(F)){return C(parseInt(E[1],16),parseInt(E[2],16),parseInt(E[3],16))}if(E=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(F)){return C(parseInt(E[1]+E[1],16),parseInt(E[2]+E[2],16),parseInt(E[3]+E[3],16))}var D=B.trim(F).toLowerCase();if(D=="transparent"){return C(255,255,255,0)}else{E=A[D]||[0,0,0];return C(E[0],E[1],E[2])}};var A={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery);
+
+// the actual Flot code
+(function($) {
+ function Plot(placeholder, data_, options_, plugins) {
+ // data is on the form:
+ // [ series1, series2 ... ]
+ // where series is either just the data as [ [x1, y1], [x2, y2], ... ]
+ // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... }
+
+ var series = [],
+ options = {
+ // the color theme used for graphs
+ colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"],
+ legend: {
+ show: true,
+ noColumns: 1, // number of colums in legend table
+ labelFormatter: null, // fn: string -> string
+ labelBoxBorderColor: "#ccc", // border color for the little label boxes
+ container: null, // container (as jQuery object) to put legend in, null means default on top of graph
+ position: "ne", // position of default legend container within plot
+ margin: 5, // distance from grid edge to default legend container within plot
+ backgroundColor: null, // null means auto-detect
+ backgroundOpacity: 0.85 // set to 0 to avoid background
+ },
+ xaxis: {
+ show: null, // null = auto-detect, true = always, false = never
+ position: "bottom", // or "top"
+ mode: null, // null or "time"
+ color: null, // base color, labels, ticks
+ tickColor: null, // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)"
+ transform: null, // null or f: number -> number to transform axis
+ inverseTransform: null, // if transform is set, this should be the inverse function
+ min: null, // min. value to show, null means set automatically
+ max: null, // max. value to show, null means set automatically
+ autoscaleMargin: null, // margin in % to add if auto-setting min/max
+ ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks
+ tickFormatter: null, // fn: number -> string
+ labelWidth: null, // size of tick labels in pixels
+ labelHeight: null,
+ reserveSpace: null, // whether to reserve space even if axis isn't shown
+ tickLength: null, // size in pixels of ticks, or "full" for whole line
+ alignTicksWithAxis: null, // axis number or null for no sync
+
+ // mode specific options
+ tickDecimals: null, // no. of decimals, null means auto
+ tickSize: null, // number or [number, "unit"]
+ minTickSize: null, // number or [number, "unit"]
+ monthNames: null, // list of names of months
+ timeformat: null, // format string to use
+ twelveHourClock: false // 12 or 24 time in time mode
+ },
+ yaxis: {
+ autoscaleMargin: 0.02,
+ position: "left" // or "right"
+ },
+ xaxes: [],
+ yaxes: [],
+ series: {
+ points: {
+ show: false,
+ radius: 3,
+ lineWidth: 2, // in pixels
+ fill: true,
+ fillColor: "#ffffff",
+ symbol: "circle" // or callback
+ },
+ lines: {
+ // we don't put in show: false so we can see
+ // whether lines were actively disabled
+ lineWidth: 2, // in pixels
+ fill: false,
+ fillColor: null,
+ steps: false
+ },
+ bars: {
+ show: false,
+ lineWidth: 2, // in pixels
+ barWidth: 1, // in units of the x axis
+ fill: true,
+ fillColor: null,
+ align: "left", // or "center"
+ horizontal: false
+ },
+ shadowSize: 3
+ },
+ grid: {
+ show: true,
+ aboveData: false,
+ color: "#545454", // primary color used for outline and labels
+ backgroundColor: null, // null for transparent, else color
+ borderColor: null, // set if different from the grid color
+ tickColor: null, // color for the ticks, e.g. "rgba(0,0,0,0.15)"
+ labelMargin: 5, // in pixels
+ axisMargin: 8, // in pixels
+ borderWidth: 2, // in pixels
+ minBorderMargin: null, // in pixels, null means taken from points radius
+ markings: null, // array of ranges or fn: axes -> array of ranges
+ markingsColor: "#f4f4f4",
+ markingsLineWidth: 2,
+ // interactive stuff
+ clickable: false,
+ hoverable: false,
+ autoHighlight: true, // highlight in case mouse is near
+ mouseActiveRadius: 10 // how far the mouse can be away to activate an item
+ },
+ hooks: {}
+ },
+ canvas = null, // the canvas for the plot itself
+ overlay = null, // canvas for interactive stuff on top of plot
+ eventHolder = null, // jQuery object that events should be bound to
+ ctx = null, octx = null,
+ xaxes = [], yaxes = [],
+ plotOffset = { left: 0, right: 0, top: 0, bottom: 0},
+ canvasWidth = 0, canvasHeight = 0,
+ plotWidth = 0, plotHeight = 0,
+ hooks = {
+ processOptions: [],
+ processRawData: [],
+ processDatapoints: [],
+ drawSeries: [],
+ draw: [],
+ bindEvents: [],
+ drawOverlay: [],
+ shutdown: []
+ },
+ plot = this;
+
+ // public functions
+ plot.setData = setData;
+ plot.setupGrid = setupGrid;
+ plot.draw = draw;
+ plot.getPlaceholder = function() { return placeholder; };
+ plot.getCanvas = function() { return canvas; };
+ plot.getPlotOffset = function() { return plotOffset; };
+ plot.width = function () { return plotWidth; };
+ plot.height = function () { return plotHeight; };
+ plot.offset = function () {
+ var o = eventHolder.offset();
+ o.left += plotOffset.left;
+ o.top += plotOffset.top;
+ return o;
+ };
+ plot.getData = function () { return series; };
+ plot.getAxes = function () {
+ var res = {}, i;
+ $.each(xaxes.concat(yaxes), function (_, axis) {
+ if (axis)
+ res[axis.direction + (axis.n != 1 ? axis.n : "") + "axis"] = axis;
+ });
+ return res;
+ };
+ plot.getXAxes = function () { return xaxes; };
+ plot.getYAxes = function () { return yaxes; };
+ plot.c2p = canvasToAxisCoords;
+ plot.p2c = axisToCanvasCoords;
+ plot.getOptions = function () { return options; };
+ plot.highlight = highlight;
+ plot.unhighlight = unhighlight;
+ plot.triggerRedrawOverlay = triggerRedrawOverlay;
+ plot.pointOffset = function(point) {
+ return {
+ left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left),
+ top: parseInt(yaxes[axisNumber(point, "y") - 1].p2c(+point.y) + plotOffset.top)
+ };
+ };
+ plot.shutdown = shutdown;
+ plot.resize = function () {
+ getCanvasDimensions();
+ resizeCanvas(canvas);
+ resizeCanvas(overlay);
+ };
+
+ // public attributes
+ plot.hooks = hooks;
+
+ // initialize
+ initPlugins(plot);
+ parseOptions(options_);
+ setupCanvases();
+ setData(data_);
+ setupGrid();
+ draw();
+ bindEvents();
+
+
+ function executeHooks(hook, args) {
+ args = [plot].concat(args);
+ for (var i = 0; i < hook.length; ++i)
+ hook[i].apply(this, args);
+ }
+
+ function initPlugins() {
+ for (var i = 0; i < plugins.length; ++i) {
+ var p = plugins[i];
+ p.init(plot);
+ if (p.options)
+ $.extend(true, options, p.options);
+ }
+ }
+
+ function parseOptions(opts) {
+ var i;
+
+ $.extend(true, options, opts);
+
+ if (options.xaxis.color == null)
+ options.xaxis.color = options.grid.color;
+ if (options.yaxis.color == null)
+ options.yaxis.color = options.grid.color;
+
+ if (options.xaxis.tickColor == null) // backwards-compatibility
+ options.xaxis.tickColor = options.grid.tickColor;
+ if (options.yaxis.tickColor == null) // backwards-compatibility
+ options.yaxis.tickColor = options.grid.tickColor;
+
+ if (options.grid.borderColor == null)
+ options.grid.borderColor = options.grid.color;
+ if (options.grid.tickColor == null)
+ options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString();
+
+ // fill in defaults in axes, copy at least always the
+ // first as the rest of the code assumes it'll be there
+ for (i = 0; i < Math.max(1, options.xaxes.length); ++i)
+ options.xaxes[i] = $.extend(true, {}, options.xaxis, options.xaxes[i]);
+ for (i = 0; i < Math.max(1, options.yaxes.length); ++i)
+ options.yaxes[i] = $.extend(true, {}, options.yaxis, options.yaxes[i]);
+
+ // backwards compatibility, to be removed in future
+ if (options.xaxis.noTicks && options.xaxis.ticks == null)
+ options.xaxis.ticks = options.xaxis.noTicks;
+ if (options.yaxis.noTicks && options.yaxis.ticks == null)
+ options.yaxis.ticks = options.yaxis.noTicks;
+ if (options.x2axis) {
+ options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis);
+ options.xaxes[1].position = "top";
+ }
+ if (options.y2axis) {
+ options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis);
+ options.yaxes[1].position = "right";
+ }
+ if (options.grid.coloredAreas)
+ options.grid.markings = options.grid.coloredAreas;
+ if (options.grid.coloredAreasColor)
+ options.grid.markingsColor = options.grid.coloredAreasColor;
+ if (options.lines)
+ $.extend(true, options.series.lines, options.lines);
+ if (options.points)
+ $.extend(true, options.series.points, options.points);
+ if (options.bars)
+ $.extend(true, options.series.bars, options.bars);
+ if (options.shadowSize != null)
+ options.series.shadowSize = options.shadowSize;
+
+ // save options on axes for future reference
+ for (i = 0; i < options.xaxes.length; ++i)
+ getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i];
+ for (i = 0; i < options.yaxes.length; ++i)
+ getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i];
+
+ // add hooks from options
+ for (var n in hooks)
+ if (options.hooks[n] && options.hooks[n].length)
+ hooks[n] = hooks[n].concat(options.hooks[n]);
+
+ executeHooks(hooks.processOptions, [options]);
+ }
+
+ function setData(d) {
+ series = parseData(d);
+ fillInSeriesOptions();
+ processData();
+ }
+
+ function parseData(d) {
+ var res = [];
+ for (var i = 0; i < d.length; ++i) {
+ var s = $.extend(true, {}, options.series);
+
+ if (d[i].data != null) {
+ s.data = d[i].data; // move the data instead of deep-copy
+ delete d[i].data;
+
+ $.extend(true, s, d[i]);
+
+ d[i].data = s.data;
+ }
+ else
+ s.data = d[i];
+ res.push(s);
+ }
+
+ return res;
+ }
+
+ function axisNumber(obj, coord) {
+ var a = obj[coord + "axis"];
+ if (typeof a == "object") // if we got a real axis, extract number
+ a = a.n;
+ if (typeof a != "number")
+ a = 1; // default to first axis
+ return a;
+ }
+
+ function allAxes() {
+ // return flat array without annoying null entries
+ return $.grep(xaxes.concat(yaxes), function (a) { return a; });
+ }
+
+ function canvasToAxisCoords(pos) {
+ // return an object with x/y corresponding to all used axes
+ var res = {}, i, axis;
+ for (i = 0; i < xaxes.length; ++i) {
+ axis = xaxes[i];
+ if (axis && axis.used)
+ res["x" + axis.n] = axis.c2p(pos.left);
+ }
+
+ for (i = 0; i < yaxes.length; ++i) {
+ axis = yaxes[i];
+ if (axis && axis.used)
+ res["y" + axis.n] = axis.c2p(pos.top);
+ }
+
+ if (res.x1 !== undefined)
+ res.x = res.x1;
+ if (res.y1 !== undefined)
+ res.y = res.y1;
+
+ return res;
+ }
+
+ function axisToCanvasCoords(pos) {
+ // get canvas coords from the first pair of x/y found in pos
+ var res = {}, i, axis, key;
+
+ for (i = 0; i < xaxes.length; ++i) {
+ axis = xaxes[i];
+ if (axis && axis.used) {
+ key = "x" + axis.n;
+ if (pos[key] == null && axis.n == 1)
+ key = "x";
+
+ if (pos[key] != null) {
+ res.left = axis.p2c(pos[key]);
+ break;
+ }
+ }
+ }
+
+ for (i = 0; i < yaxes.length; ++i) {
+ axis = yaxes[i];
+ if (axis && axis.used) {
+ key = "y" + axis.n;
+ if (pos[key] == null && axis.n == 1)
+ key = "y";
+
+ if (pos[key] != null) {
+ res.top = axis.p2c(pos[key]);
+ break;
+ }
+ }
+ }
+
+ return res;
+ }
+
+ function getOrCreateAxis(axes, number) {
+ if (!axes[number - 1])
+ axes[number - 1] = {
+ n: number, // save the number for future reference
+ direction: axes == xaxes ? "x" : "y",
+ options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis)
+ };
+
+ return axes[number - 1];
+ }
+
+ function fillInSeriesOptions() {
+ var i;
+
+ // collect what we already got of colors
+ var neededColors = series.length,
+ usedColors = [],
+ assignedColors = [];
+ for (i = 0; i < series.length; ++i) {
+ var sc = series[i].color;
+ if (sc != null) {
+ --neededColors;
+ if (typeof sc == "number")
+ assignedColors.push(sc);
+ else
+ usedColors.push($.color.parse(series[i].color));
+ }
+ }
+
+ // we might need to generate more colors if higher indices
+ // are assigned
+ for (i = 0; i < assignedColors.length; ++i) {
+ neededColors = Math.max(neededColors, assignedColors[i] + 1);
+ }
+
+ // produce colors as needed
+ var colors = [], variation = 0;
+ i = 0;
+ while (colors.length < neededColors) {
+ var c;
+ if (options.colors.length == i) // check degenerate case
+ c = $.color.make(100, 100, 100);
+ else
+ c = $.color.parse(options.colors[i]);
+
+ // vary color if needed
+ var sign = variation % 2 == 1 ? -1 : 1;
+ c.scale('rgb', 1 + sign * Math.ceil(variation / 2) * 0.2)
+
+ // FIXME: if we're getting to close to something else,
+ // we should probably skip this one
+ colors.push(c);
+
+ ++i;
+ if (i >= options.colors.length) {
+ i = 0;
+ ++variation;
+ }
+ }
+
+ // fill in the options
+ var colori = 0, s;
+ for (i = 0; i < series.length; ++i) {
+ s = series[i];
+
+ // assign colors
+ if (s.color == null) {
+ s.color = colors[colori].toString();
+ ++colori;
+ }
+ else if (typeof s.color == "number")
+ s.color = colors[s.color].toString();
+
+ // turn on lines automatically in case nothing is set
+ if (s.lines.show == null) {
+ var v, show = true;
+ for (v in s)
+ if (s[v] && s[v].show) {
+ show = false;
+ break;
+ }
+ if (show)
+ s.lines.show = true;
+ }
+
+ // setup axes
+ s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, "x"));
+ s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, "y"));
+ }
+ }
+
+ function processData() {
+ var topSentry = Number.POSITIVE_INFINITY,
+ bottomSentry = Number.NEGATIVE_INFINITY,
+ fakeInfinity = Number.MAX_VALUE,
+ i, j, k, m, length,
+ s, points, ps, x, y, axis, val, f, p;
+
+ function updateAxis(axis, min, max) {
+ if (min < axis.datamin && min != -fakeInfinity)
+ axis.datamin = min;
+ if (max > axis.datamax && max != fakeInfinity)
+ axis.datamax = max;
+ }
+
+ $.each(allAxes(), function (_, axis) {
+ // init axis
+ axis.datamin = topSentry;
+ axis.datamax = bottomSentry;
+ axis.used = false;
+ });
+
+ for (i = 0; i < series.length; ++i) {
+ s = series[i];
+ s.datapoints = { points: [] };
+
+ executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]);
+ }
+
+ // first pass: clean and copy data
+ for (i = 0; i < series.length; ++i) {
+ s = series[i];
+
+ var data = s.data, format = s.datapoints.format;
+
+ if (!format) {
+ format = [];
+ // find out how to copy
+ format.push({ x: true, number: true, required: true });
+ format.push({ y: true, number: true, required: true });
+
+ if (s.bars.show || (s.lines.show && s.lines.fill)) {
+ format.push({ y: true, number: true, required: false, defaultValue: 0 });
+ if (s.bars.horizontal) {
+ delete format[format.length - 1].y;
+ format[format.length - 1].x = true;
+ }
+ }
+
+ s.datapoints.format = format;
+ }
+
+ if (s.datapoints.pointsize != null)
+ continue; // already filled in
+
+ s.datapoints.pointsize = format.length;
+
+ ps = s.datapoints.pointsize;
+ points = s.datapoints.points;
+
+ insertSteps = s.lines.show && s.lines.steps;
+ s.xaxis.used = s.yaxis.used = true;
+
+ for (j = k = 0; j < data.length; ++j, k += ps) {
+ p = data[j];
+
+ var nullify = p == null;
+ if (!nullify) {
+ for (m = 0; m < ps; ++m) {
+ val = p[m];
+ f = format[m];
+
+ if (f) {
+ if (f.number && val != null) {
+ val = +val; // convert to number
+ if (isNaN(val))
+ val = null;
+ else if (val == Infinity)
+ val = fakeInfinity;
+ else if (val == -Infinity)
+ val = -fakeInfinity;
+ }
+
+ if (val == null) {
+ if (f.required)
+ nullify = true;
+
+ if (f.defaultValue != null)
+ val = f.defaultValue;
+ }
+ }
+
+ points[k + m] = val;
+ }
+ }
+
+ if (nullify) {
+ for (m = 0; m < ps; ++m) {
+ val = points[k + m];
+ if (val != null) {
+ f = format[m];
+ // extract min/max info
+ if (f.x)
+ updateAxis(s.xaxis, val, val);
+ if (f.y)
+ updateAxis(s.yaxis, val, val);
+ }
+ points[k + m] = null;
+ }
+ }
+ else {
+ // a little bit of line specific stuff that
+ // perhaps shouldn't be here, but lacking
+ // better means...
+ if (insertSteps && k > 0
+ && points[k - ps] != null
+ && points[k - ps] != points[k]
+ && points[k - ps + 1] != points[k + 1]) {
+ // copy the point to make room for a middle point
+ for (m = 0; m < ps; ++m)
+ points[k + ps + m] = points[k + m];
+
+ // middle point has same y
+ points[k + 1] = points[k - ps + 1];
+
+ // we've added a point, better reflect that
+ k += ps;
+ }
+ }
+ }
+ }
+
+ // give the hooks a chance to run
+ for (i = 0; i < series.length; ++i) {
+ s = series[i];
+
+ executeHooks(hooks.processDatapoints, [ s, s.datapoints]);
+ }
+
+ // second pass: find datamax/datamin for auto-scaling
+ for (i = 0; i < series.length; ++i) {
+ s = series[i];
+ points = s.datapoints.points,
+ ps = s.datapoints.pointsize;
+
+ var xmin = topSentry, ymin = topSentry,
+ xmax = bottomSentry, ymax = bottomSentry;
+
+ for (j = 0; j < points.length; j += ps) {
+ if (points[j] == null)
+ continue;
+
+ for (m = 0; m < ps; ++m) {
+ val = points[j + m];
+ f = format[m];
+ if (!f || val == fakeInfinity || val == -fakeInfinity)
+ continue;
+
+ if (f.x) {
+ if (val < xmin)
+ xmin = val;
+ if (val > xmax)
+ xmax = val;
+ }
+ if (f.y) {
+ if (val < ymin)
+ ymin = val;
+ if (val > ymax)
+ ymax = val;
+ }
+ }
+ }
+
+ if (s.bars.show) {
+ // make sure we got room for the bar on the dancing floor
+ var delta = s.bars.align == "left" ? 0 : -s.bars.barWidth/2;
+ if (s.bars.horizontal) {
+ ymin += delta;
+ ymax += delta + s.bars.barWidth;
+ }
+ else {
+ xmin += delta;
+ xmax += delta + s.bars.barWidth;
+ }
+ }
+
+ updateAxis(s.xaxis, xmin, xmax);
+ updateAxis(s.yaxis, ymin, ymax);
+ }
+
+ $.each(allAxes(), function (_, axis) {
+ if (axis.datamin == topSentry)
+ axis.datamin = null;
+ if (axis.datamax == bottomSentry)
+ axis.datamax = null;
+ });
+ }
+
+ function makeCanvas(skipPositioning, cls) {
+ var c = document.createElement('canvas');
+ c.className = cls;
+ c.width = canvasWidth;
+ c.height = canvasHeight;
+
+ if (!skipPositioning)
+ $(c).css({ position: 'absolute', left: 0, top: 0 });
+
+ $(c).appendTo(placeholder);
+
+ if (!c.getContext) // excanvas hack
+ c = window.G_vmlCanvasManager.initElement(c);
+
+ // used for resetting in case we get replotted
+ c.getContext("2d").save();
+
+ return c;
+ }
+
+ function getCanvasDimensions() {
+ canvasWidth = placeholder.width();
+ canvasHeight = placeholder.height();
+
+ if (canvasWidth <= 0 || canvasHeight <= 0)
+ throw "Invalid dimensions for plot, width = " + canvasWidth + ", height = " + canvasHeight;
+ }
+
+ function resizeCanvas(c) {
+ // resizing should reset the state (excanvas seems to be
+ // buggy though)
+ if (c.width != canvasWidth)
+ c.width = canvasWidth;
+
+ if (c.height != canvasHeight)
+ c.height = canvasHeight;
+
+ // so try to get back to the initial state (even if it's
+ // gone now, this should be safe according to the spec)
+ var cctx = c.getContext("2d");
+ cctx.restore();
+
+ // and save again
+ cctx.save();
+ }
+
+ function setupCanvases() {
+ var reused,
+ existingCanvas = placeholder.children("canvas.base"),
+ existingOverlay = placeholder.children("canvas.overlay");
+
+ if (existingCanvas.length == 0 || existingOverlay == 0) {
+ // init everything
+
+ placeholder.html(""); // make sure placeholder is clear
+
+ placeholder.css({ padding: 0 }); // padding messes up the positioning
+
+ if (placeholder.css("position") == 'static')
+ placeholder.css("position", "relative"); // for positioning labels and overlay
+
+ getCanvasDimensions();
+
+ canvas = makeCanvas(true, "base");
+ overlay = makeCanvas(false, "overlay"); // overlay canvas for interactive features
+
+ reused = false;
+ }
+ else {
+ // reuse existing elements
+
+ canvas = existingCanvas.get(0);
+ overlay = existingOverlay.get(0);
+
+ reused = true;
+ }
+
+ ctx = canvas.getContext("2d");
+ octx = overlay.getContext("2d");
+
+ // we include the canvas in the event holder too, because IE 7
+ // sometimes has trouble with the stacking order
+ eventHolder = $([overlay, canvas]);
+
+ if (reused) {
+ // run shutdown in the old plot object
+ placeholder.data("plot").shutdown();
+
+ // reset reused canvases
+ plot.resize();
+
+ // make sure overlay pixels are cleared (canvas is cleared when we redraw)
+ octx.clearRect(0, 0, canvasWidth, canvasHeight);
+
+ // then whack any remaining obvious garbage left
+ eventHolder.unbind();
+ placeholder.children().not([canvas, overlay]).remove();
+ }
+
+ // save in case we get replotted
+ placeholder.data("plot", plot);
+ }
+
+ function bindEvents() {
+ // bind events
+ if (options.grid.hoverable) {
+ eventHolder.mousemove(onMouseMove);
+ eventHolder.mouseleave(onMouseLeave);
+ }
+
+ if (options.grid.clickable)
+ eventHolder.click(onClick);
+
+ executeHooks(hooks.bindEvents, [eventHolder]);
+ }
+
+ function shutdown() {
+ if (redrawTimeout)
+ clearTimeout(redrawTimeout);
+
+ eventHolder.unbind("mousemove", onMouseMove);
+ eventHolder.unbind("mouseleave", onMouseLeave);
+ eventHolder.unbind("click", onClick);
+
+ executeHooks(hooks.shutdown, [eventHolder]);
+ }
+
+ function setTransformationHelpers(axis) {
+ // set helper functions on the axis, assumes plot area
+ // has been computed already
+
+ function identity(x) { return x; }
+
+ var s, m, t = axis.options.transform || identity,
+ it = axis.options.inverseTransform;
+
+ // precompute how much the axis is scaling a point
+ // in canvas space
+ if (axis.direction == "x") {
+ s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min));
+ m = Math.min(t(axis.max), t(axis.min));
+ }
+ else {
+ s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min));
+ s = -s;
+ m = Math.max(t(axis.max), t(axis.min));
+ }
+
+ // data point to canvas coordinate
+ if (t == identity) // slight optimization
+ axis.p2c = function (p) { return (p - m) * s; };
+ else
+ axis.p2c = function (p) { return (t(p) - m) * s; };
+ // canvas coordinate to data point
+ if (!it)
+ axis.c2p = function (c) { return m + c / s; };
+ else
+ axis.c2p = function (c) { return it(m + c / s); };
+ }
+
+ function measureTickLabels(axis) {
+ var opts = axis.options, i, ticks = axis.ticks || [], labels = [],
+ l, w = opts.labelWidth, h = opts.labelHeight, dummyDiv;
+
+ function makeDummyDiv(labels, width) {
+ return $('<div style="position:absolute;top:-10000px;' + width + 'font-size:smaller">' +
+ '<div class="' + axis.direction + 'Axis ' + axis.direction + axis.n + 'Axis">'
+ + labels.join("") + '</div></div>')
+ .appendTo(placeholder);
+ }
+
+ if (axis.direction == "x") {
+ // to avoid measuring the widths of the labels (it's slow), we
+ // construct fixed-size boxes and put the labels inside
+ // them, we don't need the exact figures and the
+ // fixed-size box content is easy to center
+ if (w == null)
+ w = Math.floor(canvasWidth / (ticks.length > 0 ? ticks.length : 1));
+
+ // measure x label heights
+ if (h == null) {
+ labels = [];
+ for (i = 0; i < ticks.length; ++i) {
+ l = ticks[i].label;
+ if (l)
+ labels.push('<div class="tickLabel" style="float:left;width:' + w + 'px">' + l + '</div>');
+ }
+
+ if (labels.length > 0) {
+ // stick them all in the same div and measure
+ // collective height
+ labels.push('<div style="clear:left"></div>');
+ dummyDiv = makeDummyDiv(labels, "width:10000px;");
+ h = dummyDiv.height();
+ dummyDiv.remove();
+ }
+ }
+ }
+ else if (w == null || h == null) {
+ // calculate y label dimensions
+ for (i = 0; i < ticks.length; ++i) {
+ l = ticks[i].label;
+ if (l)
+ labels.push('<div class="tickLabel">' + l + '</div>');
+ }
+
+ if (labels.length > 0) {
+ dummyDiv = makeDummyDiv(labels, "");
+ if (w == null)
+ w = dummyDiv.children().width();
+ if (h == null)
+ h = dummyDiv.find("div.tickLabel").height();
+ dummyDiv.remove();
+ }
+ }
+
+ if (w == null)
+ w = 0;
+ if (h == null)
+ h = 0;
+
+ axis.labelWidth = w;
+ axis.labelHeight = h;
+ }
+
+ function allocateAxisBoxFirstPhase(axis) {
+ // find the bounding box of the axis by looking at label
+ // widths/heights and ticks, make room by diminishing the
+ // plotOffset
+
+ var lw = axis.labelWidth,
+ lh = axis.labelHeight,
+ pos = axis.options.position,
+ tickLength = axis.options.tickLength,
+ axismargin = options.grid.axisMargin,
+ padding = options.grid.labelMargin,
+ all = axis.direction == "x" ? xaxes : yaxes,
+ index;
+
+ // determine axis margin
+ var samePosition = $.grep(all, function (a) {
+ return a && a.options.position == pos && a.reserveSpace;
+ });
+ if ($.inArray(axis, samePosition) == samePosition.length - 1)
+ axismargin = 0; // outermost
+
+ // determine tick length - if we're innermost, we can use "full"
+ if (tickLength == null)
+ tickLength = "full";
+
+ var sameDirection = $.grep(all, function (a) {
+ return a && a.reserveSpace;
+ });
+
+ var innermost = $.inArray(axis, sameDirection) == 0;
+ if (!innermost && tickLength == "full")
+ tickLength = 5;
+
+ if (!isNaN(+tickLength))
+ padding += +tickLength;
+
+ // compute box
+ if (axis.direction == "x") {
+ lh += padding;
+
+ if (pos == "bottom") {
+ plotOffset.bottom += lh + axismargin;
+ axis.box = { top: canvasHeight - plotOffset.bottom, height: lh };
+ }
+ else {
+ axis.box = { top: plotOffset.top + axismargin, height: lh };
+ plotOffset.top += lh + axismargin;
+ }
+ }
+ else {
+ lw += padding;
+
+ if (pos == "left") {
+ axis.box = { left: plotOffset.left + axismargin, width: lw };
+ plotOffset.left += lw + axismargin;
+ }
+ else {
+ plotOffset.right += lw + axismargin;
+ axis.box = { left: canvasWidth - plotOffset.right, width: lw };
+ }
+ }
+
+ // save for future reference
+ axis.position = pos;
+ axis.tickLength = tickLength;
+ axis.box.padding = padding;
+ axis.innermost = innermost;
+ }
+
+ function allocateAxisBoxSecondPhase(axis) {
+ // set remaining bounding box coordinates
+ if (axis.direction == "x") {
+ axis.box.left = plotOffset.left;
+ axis.box.width = plotWidth;
+ }
+ else {
+ axis.box.top = plotOffset.top;
+ axis.box.height = plotHeight;
+ }
+ }
+
+ function setupGrid() {
+ var i, axes = allAxes();
+
+ // first calculate the plot and axis box dimensions
+
+ $.each(axes, function (_, axis) {
+ axis.show = axis.options.show;
+ if (axis.show == null)
+ axis.show = axis.used; // by default an axis is visible if it's got data
+
+ axis.reserveSpace = axis.show || axis.options.reserveSpace;
+
+ setRange(axis);
+ });
+
+ allocatedAxes = $.grep(axes, function (axis) { return axis.reserveSpace; });
+
+ plotOffset.left = plotOffset.right = plotOffset.top = plotOffset.bottom = 0;
+ if (options.grid.show) {
+ $.each(allocatedAxes, function (_, axis) {
+ // make the ticks
+ setupTickGeneration(axis);
+ setTicks(axis);
+ snapRangeToTicks(axis, axis.ticks);
+
+ // find labelWidth/Height for axis
+ measureTickLabels(axis);
+ });
+
+ // with all dimensions in house, we can compute the
+ // axis boxes, start from the outside (reverse order)
+ for (i = allocatedAxes.length - 1; i >= 0; --i)
+ allocateAxisBoxFirstPhase(allocatedAxes[i]);
+
+ // make sure we've got enough space for things that
+ // might stick out
+ var minMargin = options.grid.minBorderMargin;
+ if (minMargin == null) {
+ minMargin = 0;
+ for (i = 0; i < series.length; ++i)
+ minMargin = Math.max(minMargin, series[i].points.radius + series[i].points.lineWidth/2);
+ }
+
+ for (var a in plotOffset) {
+ plotOffset[a] += options.grid.borderWidth;
+ plotOffset[a] = Math.max(minMargin, plotOffset[a]);
+ }
+ }
+
+ plotWidth = canvasWidth - plotOffset.left - plotOffset.right;
+ plotHeight = canvasHeight - plotOffset.bottom - plotOffset.top;
+
+ // now we got the proper plotWidth/Height, we can compute the scaling
+ $.each(axes, function (_, axis) {
+ setTransformationHelpers(axis);
+ });
+
+ if (options.grid.show) {
+ $.each(allocatedAxes, function (_, axis) {
+ allocateAxisBoxSecondPhase(axis);
+ });
+
+ insertAxisLabels();
+ }
+
+ insertLegend();
+ }
+
+ function setRange(axis) {
+ var opts = axis.options,
+ min = +(opts.min != null ? opts.min : axis.datamin),
+ max = +(opts.max != null ? opts.max : axis.datamax),
+ delta = max - min;
+
+ if (delta == 0.0) {
+ // degenerate case
+ var widen = max == 0 ? 1 : 0.01;
+
+ if (opts.min == null)
+ min -= widen;
+ // always widen max if we couldn't widen min to ensure we
+ // don't fall into min == max which doesn't work
+ if (opts.max == null || opts.min != null)
+ max += widen;
+ }
+ else {
+ // consider autoscaling
+ var margin = opts.autoscaleMargin;
+ if (margin != null) {
+ if (opts.min == null) {
+ min -= delta * margin;
+ // make sure we don't go below zero if all values
+ // are positive
+ if (min < 0 && axis.datamin != null && axis.datamin >= 0)
+ min = 0;
+ }
+ if (opts.max == null) {
+ max += delta * margin;
+ if (max > 0 && axis.datamax != null && axis.datamax <= 0)
+ max = 0;
+ }
+ }
+ }
+ axis.min = min;
+ axis.max = max;
+ }
+
+ function setupTickGeneration(axis) {
+ var opts = axis.options;
+
+ // estimate number of ticks
+ var noTicks;
+ if (typeof opts.ticks == "number" && opts.ticks > 0)
+ noTicks = opts.ticks;
+ else
+ // heuristic based on the model a*sqrt(x) fitted to
+ // some data points that seemed reasonable
+ noTicks = 0.3 * Math.sqrt(axis.direction == "x" ? canvasWidth : canvasHeight);
+
+ var delta = (axis.max - axis.min) / noTicks,
+ size, generator, unit, formatter, i, magn, norm;
+
+ if (opts.mode == "time") {
+ // pretty handling of time
+
+ // map of app. size of time units in milliseconds
+ var timeUnitSize = {
+ "second": 1000,
+ "minute": 60 * 1000,
+ "hour": 60 * 60 * 1000,
+ "day": 24 * 60 * 60 * 1000,
+ "month": 30 * 24 * 60 * 60 * 1000,
+ "year": 365.2425 * 24 * 60 * 60 * 1000
+ };
+
+
+ // the allowed tick sizes, after 1 year we use
+ // an integer algorithm
+ var spec = [
+ [1, "second"], [2, "second"], [5, "second"], [10, "second"],
+ [30, "second"],
+ [1, "minute"], [2, "minute"], [5, "minute"], [10, "minute"],
+ [30, "minute"],
+ [1, "hour"], [2, "hour"], [4, "hour"],
+ [8, "hour"], [12, "hour"],
+ [1, "day"], [2, "day"], [3, "day"],
+ [0.25, "month"], [0.5, "month"], [1, "month"],
+ [2, "month"], [3, "month"], [6, "month"],
+ [1, "year"]
+ ];
+
+ var minSize = 0;
+ if (opts.minTickSize != null) {
+ if (typeof opts.tickSize == "number")
+ minSize = opts.tickSize;
+ else
+ minSize = opts.minTickSize[0] * timeUnitSize[opts.minTickSize[1]];
+ }
+
+ for (var i = 0; i < spec.length - 1; ++i)
+ if (delta < (spec[i][0] * timeUnitSize[spec[i][1]]
+ + spec[i + 1][0] * timeUnitSize[spec[i + 1][1]]) / 2
+ && spec[i][0] * timeUnitSize[spec[i][1]] >= minSize)
+ break;
+ size = spec[i][0];
+ unit = spec[i][1];
+
+ // special-case the possibility of several years
+ if (unit == "year") {
+ magn = Math.pow(10, Math.floor(Math.log(delta / timeUnitSize.year) / Math.LN10));
+ norm = (delta / timeUnitSize.year) / magn;
+ if (norm < 1.5)
+ size = 1;
+ else if (norm < 3)
+ size = 2;
+ else if (norm < 7.5)
+ size = 5;
+ else
+ size = 10;
+
+ size *= magn;
+ }
+
+ axis.tickSize = opts.tickSize || [size, unit];
+
+ generator = function(axis) {
+ var ticks = [],
+ tickSize = axis.tickSize[0], unit = axis.tickSize[1],
+ d = new Date(axis.min);
+
+ var step = tickSize * timeUnitSize[unit];
+
+ if (unit == "second")
+ d.setUTCSeconds(floorInBase(d.getUTCSeconds(), tickSize));
+ if (unit == "minute")
+ d.setUTCMinutes(floorInBase(d.getUTCMinutes(), tickSize));
+ if (unit == "hour")
+ d.setUTCHours(floorInBase(d.getUTCHours(), tickSize));
+ if (unit == "month")
+ d.setUTCMonth(floorInBase(d.getUTCMonth(), tickSize));
+ if (unit == "year")
+ d.setUTCFullYear(floorInBase(d.getUTCFullYear(), tickSize));
+
+ // reset smaller components
+ d.setUTCMilliseconds(0);
+ if (step >= timeUnitSize.minute)
+ d.setUTCSeconds(0);
+ if (step >= timeUnitSize.hour)
+ d.setUTCMinutes(0);
+ if (step >= timeUnitSize.day)
+ d.setUTCHours(0);
+ if (step >= timeUnitSize.day * 4)
+ d.setUTCDate(1);
+ if (step >= timeUnitSize.year)
+ d.setUTCMonth(0);
+
+
+ var carry = 0, v = Number.NaN, prev;
+ do {
+ prev = v;
+ v = d.getTime();
+ ticks.push(v);
+ if (unit == "month") {
+ if (tickSize < 1) {
+ // a bit complicated - we'll divide the month
+ // up but we need to take care of fractions
+ // so we don't end up in the middle of a day
+ d.setUTCDate(1);
+ var start = d.getTime();
+ d.setUTCMonth(d.getUTCMonth() + 1);
+ var end = d.getTime();
+ d.setTime(v + carry * timeUnitSize.hour + (end - start) * tickSize);
+ carry = d.getUTCHours();
+ d.setUTCHours(0);
+ }
+ else
+ d.setUTCMonth(d.getUTCMonth() + tickSize);
+ }
+ else if (unit == "year") {
+ d.setUTCFullYear(d.getUTCFullYear() + tickSize);
+ }
+ else
+ d.setTime(v + step);
+ } while (v < axis.max && v != prev);
+
+ return ticks;
+ };
+
+ formatter = function (v, axis) {
+ var d = new Date(v);
+
+ // first check global format
+ if (opts.timeformat != null)
+ return $.plot.formatDate(d, opts.timeformat, opts.monthNames);
+
+ var t = axis.tickSize[0] * timeUnitSize[axis.tickSize[1]];
+ var span = axis.max - axis.min;
+ var suffix = (opts.twelveHourClock) ? " %p" : "";
+
+ if (t < timeUnitSize.minute)
+ fmt = "%h:%M:%S" + suffix;
+ else if (t < timeUnitSize.day) {
+ if (span < 2 * timeUnitSize.day)
+ fmt = "%h:%M" + suffix;
+ else
+ fmt = "%b %d %h:%M" + suffix;
+ }
+ else if (t < timeUnitSize.month)
+ fmt = "%b %d";
+ else if (t < timeUnitSize.year) {
+ if (span < timeUnitSize.year)
+ fmt = "%b";
+ else
+ fmt = "%b %y";
+ }
+ else
+ fmt = "%y";
+
+ return $.plot.formatDate(d, fmt, opts.monthNames);
+ };
+ }
+ else {
+ // pretty rounding of base-10 numbers
+ var maxDec = opts.tickDecimals;
+ var dec = -Math.floor(Math.log(delta) / Math.LN10);
+ if (maxDec != null && dec > maxDec)
+ dec = maxDec;
+
+ magn = Math.pow(10, -dec);
+ norm = delta / magn; // norm is between 1.0 and 10.0
+
+ if (norm < 1.5)
+ size = 1;
+ else if (norm < 3) {
+ size = 2;
+ // special case for 2.5, requires an extra decimal
+ if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) {
+ size = 2.5;
+ ++dec;
+ }
+ }
+ else if (norm < 7.5)
+ size = 5;
+ else
+ size = 10;
+
+ size *= magn;
+
+ if (opts.minTickSize != null && size < opts.minTickSize)
+ size = opts.minTickSize;
+
+ axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec);
+ axis.tickSize = opts.tickSize || size;
+
+ generator = function (axis) {
+ var ticks = [];
+
+ // spew out all possible ticks
+ var start = floorInBase(axis.min, axis.tickSize),
+ i = 0, v = Number.NaN, prev;
+ do {
+ prev = v;
+ v = start + i * axis.tickSize;
+ ticks.push(v);
+ ++i;
+ } while (v < axis.max && v != prev);
+ return ticks;
+ };
+
+ formatter = function (v, axis) {
+ return v.toFixed(axis.tickDecimals);
+ };
+ }
+
+ if (opts.alignTicksWithAxis != null) {
+ var otherAxis = (axis.direction == "x" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1];
+ if (otherAxis && otherAxis.used && otherAxis != axis) {
+ // consider snapping min/max to outermost nice ticks
+ var niceTicks = generator(axis);
+ if (niceTicks.length > 0) {
+ if (opts.min == null)
+ axis.min = Math.min(axis.min, niceTicks[0]);
+ if (opts.max == null && niceTicks.length > 1)
+ axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]);
+ }
+
+ generator = function (axis) {
+ // copy ticks, scaled to this axis
+ var ticks = [], v, i;
+ for (i = 0; i < otherAxis.ticks.length; ++i) {
+ v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min);
+ v = axis.min + v * (axis.max - axis.min);
+ ticks.push(v);
+ }
+ return ticks;
+ };
+
+ // we might need an extra decimal since forced
+ // ticks don't necessarily fit naturally
+ if (axis.mode != "time" && opts.tickDecimals == null) {
+ var extraDec = Math.max(0, -Math.floor(Math.log(delta) / Math.LN10) + 1),
+ ts = generator(axis);
+
+ // only proceed if the tick interval rounded
+ // with an extra decimal doesn't give us a
+ // zero at end
+ if (!(ts.length > 1 && /\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec))))
+ axis.tickDecimals = extraDec;
+ }
+ }
+ }
+
+ axis.tickGenerator = generator;
+ if ($.isFunction(opts.tickFormatter))
+ axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); };
+ else
+ axis.tickFormatter = formatter;
+ }
+
+ function setTicks(axis) {
+ var oticks = axis.options.ticks, ticks = [];
+ if (oticks == null || (typeof oticks == "number" && oticks > 0))
+ ticks = axis.tickGenerator(axis);
+ else if (oticks) {
+ if ($.isFunction(oticks))
+ // generate the ticks
+ ticks = oticks({ min: axis.min, max: axis.max });
+ else
+ ticks = oticks;
+ }
+
+ // clean up/labelify the supplied ticks, copy them over
+ var i, v;
+ axis.ticks = [];
+ for (i = 0; i < ticks.length; ++i) {
+ var label = null;
+ var t = ticks[i];
+ if (typeof t == "object") {
+ v = +t[0];
+ if (t.length > 1)
+ label = t[1];
+ }
+ else
+ v = +t;
+ if (label == null)
+ label = axis.tickFormatter(v, axis);
+ if (!isNaN(v))
+ axis.ticks.push({ v: v, label: label });
+ }
+ }
+
+ function snapRangeToTicks(axis, ticks) {
+ if (axis.options.autoscaleMargin && ticks.length > 0) {
+ // snap to ticks
+ if (axis.options.min == null)
+ axis.min = Math.min(axis.min, ticks[0].v);
+ if (axis.options.max == null && ticks.length > 1)
+ axis.max = Math.max(axis.max, ticks[ticks.length - 1].v);
+ }
+ }
+
+ function draw() {
+ ctx.clearRect(0, 0, canvasWidth, canvasHeight);
+
+ var grid = options.grid;
+
+ // draw background, if any
+ if (grid.show && grid.backgroundColor)
+ drawBackground();
+
+ if (grid.show && !grid.aboveData)
+ drawGrid();
+
+ for (var i = 0; i < series.length; ++i) {
+ executeHooks(hooks.drawSeries, [ctx, series[i]]);
+ drawSeries(series[i]);
+ }
+
+ executeHooks(hooks.draw, [ctx]);
+
+ if (grid.show && grid.aboveData)
+ drawGrid();
+ }
+
+ function extractRange(ranges, coord) {
+ var axis, from, to, key, axes = allAxes();
+
+ for (i = 0; i < axes.length; ++i) {
+ axis = axes[i];
+ if (axis.direction == coord) {
+ key = coord + axis.n + "axis";
+ if (!ranges[key] && axis.n == 1)
+ key = coord + "axis"; // support x1axis as xaxis
+ if (ranges[key]) {
+ from = ranges[key].from;
+ to = ranges[key].to;
+ break;
+ }
+ }
+ }
+
+ // backwards-compat stuff - to be removed in future
+ if (!ranges[key]) {
+ axis = coord == "x" ? xaxes[0] : yaxes[0];
+ from = ranges[coord + "1"];
+ to = ranges[coord + "2"];
+ }
+
+ // auto-reverse as an added bonus
+ if (from != null && to != null && from > to) {
+ var tmp = from;
+ from = to;
+ to = tmp;
+ }
+
+ return { from: from, to: to, axis: axis };
+ }
+
+ function drawBackground() {
+ ctx.save();
+ ctx.translate(plotOffset.left, plotOffset.top);
+
+ ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, "rgba(255, 255, 255, 0)");
+ ctx.fillRect(0, 0, plotWidth, plotHeight);
+ ctx.restore();
+ }
+
+ function drawGrid() {
+ var i;
+
+ ctx.save();
+ ctx.translate(plotOffset.left, plotOffset.top);
+
+ // draw markings
+ var markings = options.grid.markings;
+ if (markings) {
+ if ($.isFunction(markings)) {
+ var axes = plot.getAxes();
+ // xmin etc. is backwards compatibility, to be
+ // removed in the future
+ axes.xmin = axes.xaxis.min;
+ axes.xmax = axes.xaxis.max;
+ axes.ymin = axes.yaxis.min;
+ axes.ymax = axes.yaxis.max;
+
+ markings = markings(axes);
+ }
+
+ for (i = 0; i < markings.length; ++i) {
+ var m = markings[i],
+ xrange = extractRange(m, "x"),
+ yrange = extractRange(m, "y");
+
+ // fill in missing
+ if (xrange.from == null)
+ xrange.from = xrange.axis.min;
+ if (xrange.to == null)
+ xrange.to = xrange.axis.max;
+ if (yrange.from == null)
+ yrange.from = yrange.axis.min;
+ if (yrange.to == null)
+ yrange.to = yrange.axis.max;
+
+ // clip
+ if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max ||
+ yrange.to < yrange.axis.min || yrange.from > yrange.axis.max)
+ continue;
+
+ xrange.from = Math.max(xrange.from, xrange.axis.min);
+ xrange.to = Math.min(xrange.to, xrange.axis.max);
+ yrange.from = Math.max(yrange.from, yrange.axis.min);
+ yrange.to = Math.min(yrange.to, yrange.axis.max);
+
+ if (xrange.from == xrange.to && yrange.from == yrange.to)
+ continue;
+
+ // then draw
+ xrange.from = xrange.axis.p2c(xrange.from);
+ xrange.to = xrange.axis.p2c(xrange.to);
+ yrange.from = yrange.axis.p2c(yrange.from);
+ yrange.to = yrange.axis.p2c(yrange.to);
+
+ if (xrange.from == xrange.to || yrange.from == yrange.to) {
+ // draw line
+ ctx.beginPath();
+ ctx.strokeStyle = m.color || options.grid.markingsColor;
+ ctx.lineWidth = m.lineWidth || options.grid.markingsLineWidth;
+ ctx.moveTo(xrange.from, yrange.from);
+ ctx.lineTo(xrange.to, yrange.to);
+ ctx.stroke();
+ }
+ else {
+ // fill area
+ ctx.fillStyle = m.color || options.grid.markingsColor;
+ ctx.fillRect(xrange.from, yrange.to,
+ xrange.to - xrange.from,
+ yrange.from - yrange.to);
+ }
+ }
+ }
+
+ // draw the ticks
+ var axes = allAxes(), bw = options.grid.borderWidth;
+
+ for (var j = 0; j < axes.length; ++j) {
+ var axis = axes[j], box = axis.box,
+ t = axis.tickLength, x, y, xoff, yoff;
+ if (!axis.show || axis.ticks.length == 0)
+ continue;
+
+ ctx.strokeStyle = axis.options.tickColor || $.color.parse(axis.options.color).scale('a', 0.22).toString();
+ ctx.lineWidth = 1;
+
+ // find the edges
+ if (axis.direction == "x") {
+ x = 0;
+ if (t == "full")
+ y = (axis.position == "top" ? 0 : plotHeight);
+ else
+ y = box.top - plotOffset.top + (axis.position == "top" ? box.height : 0);
+ }
+ else {
+ y = 0;
+ if (t == "full")
+ x = (axis.position == "left" ? 0 : plotWidth);
+ else
+ x = box.left - plotOffset.left + (axis.position == "left" ? box.width : 0);
+ }
+
+ // draw tick bar
+ if (!axis.innermost) {
+ ctx.beginPath();
+ xoff = yoff = 0;
+ if (axis.direction == "x")
+ xoff = plotWidth;
+ else
+ yoff = plotHeight;
+
+ if (ctx.lineWidth == 1) {
+ x = Math.floor(x) + 0.5;
+ y = Math.floor(y) + 0.5;
+ }
+
+ ctx.moveTo(x, y);
+ ctx.lineTo(x + xoff, y + yoff);
+ ctx.stroke();
+ }
+
+ // draw ticks
+ ctx.beginPath();
+ for (i = 0; i < axis.ticks.length; ++i) {
+ var v = axis.ticks[i].v;
+
+ xoff = yoff = 0;
+
+ if (v < axis.min || v > axis.max
+ // skip those lying on the axes if we got a border
+ || (t == "full" && bw > 0
+ && (v == axis.min || v == axis.max)))
+ continue;
+
+ if (axis.direction == "x") {
+ x = axis.p2c(v);
+ yoff = t == "full" ? -plotHeight : t;
+
+ if (axis.position == "top")
+ yoff = -yoff;
+ }
+ else {
+ y = axis.p2c(v);
+ xoff = t == "full" ? -plotWidth : t;
+
+ if (axis.position == "left")
+ xoff = -xoff;
+ }
+
+ if (ctx.lineWidth == 1) {
+ if (axis.direction == "x")
+ x = Math.floor(x) + 0.5;
+ else
+ y = Math.floor(y) + 0.5;
+ }
+
+ ctx.moveTo(x, y);
+ ctx.lineTo(x + xoff, y + yoff);
+ }
+
+ ctx.stroke();
+ }
+
+
+ // draw border
+ if (bw) {
+ ctx.lineWidth = bw;
+ ctx.strokeStyle = options.grid.borderColor;
+ ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw);
+ }
+
+ ctx.restore();
+ }
+
+ function insertAxisLabels() {
+ placeholder.find(".tickLabels").remove();
+
+ var html = ['<div class="tickLabels" style="font-size:smaller">'];
+
+ var axes = allAxes();
+ for (var j = 0; j < axes.length; ++j) {
+ var axis = axes[j], box = axis.box;
+ if (!axis.show)
+ continue;
+ //debug: html.push('<div style="position:absolute;opacity:0.10;background-color:red;left:' + box.left + 'px;top:' + box.top + 'px;width:' + box.width + 'px;height:' + box.height + 'px"></div>')
+ html.push('<div class="' + axis.direction + 'Axis ' + axis.direction + axis.n + 'Axis" style="color:' + axis.options.color + '">');
+ for (var i = 0; i < axis.ticks.length; ++i) {
+ var tick = axis.ticks[i];
+ if (!tick.label || tick.v < axis.min || tick.v > axis.max)
+ continue;
+
+ var pos = {}, align;
+
+ if (axis.direction == "x") {
+ align = "center";
+ pos.left = Math.round(plotOffset.left + axis.p2c(tick.v) - axis.labelWidth/2);
+ if (axis.position == "bottom")
+ pos.top = box.top + box.padding;
+ else
+ pos.bottom = canvasHeight - (box.top + box.height - box.padding);
+ }
+ else {
+ pos.top = Math.round(plotOffset.top + axis.p2c(tick.v) - axis.labelHeight/2);
+ if (axis.position == "left") {
+ pos.right = canvasWidth - (box.left + box.width - box.padding)
+ align = "right";
+ }
+ else {
+ pos.left = box.left + box.padding;
+ align = "left";
+ }
+ }
+
+ pos.width = axis.labelWidth;
+
+ var style = ["position:absolute", "text-align:" + align ];
+ for (var a in pos)
+ style.push(a + ":" + pos[a] + "px")
+
+ html.push('<div class="tickLabel" style="' + style.join(';') + '">' + tick.label + '</div>');
+ }
+ html.push('</div>');
+ }
+
+ html.push('</div>');
+
+ placeholder.append(html.join(""));
+ }
+
+ function drawSeries(series) {
+ if (series.lines.show)
+ drawSeriesLines(series);
+ if (series.bars.show)
+ drawSeriesBars(series);
+ if (series.points.show)
+ drawSeriesPoints(series);
+ }
+
+ function drawSeriesLines(series) {
+ function plotLine(datapoints, xoffset, yoffset, axisx, axisy) {
+ var points = datapoints.points,
+ ps = datapoints.pointsize,
+ prevx = null, prevy = null;
+
+ ctx.beginPath();
+ for (var i = ps; i < points.length; i += ps) {
+ var x1 = points[i - ps], y1 = points[i - ps + 1],
+ x2 = points[i], y2 = points[i + 1];
+
+ if (x1 == null || x2 == null)
+ continue;
+
+ // clip with ymin
+ if (y1 <= y2 && y1 < axisy.min) {
+ if (y2 < axisy.min)
+ continue; // line segment is outside
+ // compute new intersection point
+ x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y1 = axisy.min;
+ }
+ else if (y2 <= y1 && y2 < axisy.min) {
+ if (y1 < axisy.min)
+ continue;
+ x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y2 = axisy.min;
+ }
+
+ // clip with ymax
+ if (y1 >= y2 && y1 > axisy.max) {
+ if (y2 > axisy.max)
+ continue;
+ x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y1 = axisy.max;
+ }
+ else if (y2 >= y1 && y2 > axisy.max) {
+ if (y1 > axisy.max)
+ continue;
+ x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y2 = axisy.max;
+ }
+
+ // clip with xmin
+ if (x1 <= x2 && x1 < axisx.min) {
+ if (x2 < axisx.min)
+ continue;
+ y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x1 = axisx.min;
+ }
+ else if (x2 <= x1 && x2 < axisx.min) {
+ if (x1 < axisx.min)
+ continue;
+ y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x2 = axisx.min;
+ }
+
+ // clip with xmax
+ if (x1 >= x2 && x1 > axisx.max) {
+ if (x2 > axisx.max)
+ continue;
+ y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x1 = axisx.max;
+ }
+ else if (x2 >= x1 && x2 > axisx.max) {
+ if (x1 > axisx.max)
+ continue;
+ y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x2 = axisx.max;
+ }
+
+ if (x1 != prevx || y1 != prevy)
+ ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset);
+
+ prevx = x2;
+ prevy = y2;
+ ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset);
+ }
+ ctx.stroke();
+ }
+
+ function plotLineArea(datapoints, axisx, axisy) {
+ var points = datapoints.points,
+ ps = datapoints.pointsize,
+ bottom = Math.min(Math.max(0, axisy.min), axisy.max),
+ i = 0, top, areaOpen = false,
+ ypos = 1, segmentStart = 0, segmentEnd = 0;
+
+ // we process each segment in two turns, first forward
+ // direction to sketch out top, then once we hit the
+ // end we go backwards to sketch the bottom
+ while (true) {
+ if (ps > 0 && i > points.length + ps)
+ break;
+
+ i += ps; // ps is negative if going backwards
+
+ var x1 = points[i - ps],
+ y1 = points[i - ps + ypos],
+ x2 = points[i], y2 = points[i + ypos];
+
+ if (areaOpen) {
+ if (ps > 0 && x1 != null && x2 == null) {
+ // at turning point
+ segmentEnd = i;
+ ps = -ps;
+ ypos = 2;
+ continue;
+ }
+
+ if (ps < 0 && i == segmentStart + ps) {
+ // done with the reverse sweep
+ ctx.fill();
+ areaOpen = false;
+ ps = -ps;
+ ypos = 1;
+ i = segmentStart = segmentEnd + ps;
+ continue;
+ }
+ }
+
+ if (x1 == null || x2 == null)
+ continue;
+
+ // clip x values
+
+ // clip with xmin
+ if (x1 <= x2 && x1 < axisx.min) {
+ if (x2 < axisx.min)
+ continue;
+ y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x1 = axisx.min;
+ }
+ else if (x2 <= x1 && x2 < axisx.min) {
+ if (x1 < axisx.min)
+ continue;
+ y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x2 = axisx.min;
+ }
+
+ // clip with xmax
+ if (x1 >= x2 && x1 > axisx.max) {
+ if (x2 > axisx.max)
+ continue;
+ y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x1 = axisx.max;
+ }
+ else if (x2 >= x1 && x2 > axisx.max) {
+ if (x1 > axisx.max)
+ continue;
+ y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1;
+ x2 = axisx.max;
+ }
+
+ if (!areaOpen) {
+ // open area
+ ctx.beginPath();
+ ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom));
+ areaOpen = true;
+ }
+
+ // now first check the case where both is outside
+ if (y1 >= axisy.max && y2 >= axisy.max) {
+ ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max));
+ ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max));
+ continue;
+ }
+ else if (y1 <= axisy.min && y2 <= axisy.min) {
+ ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min));
+ ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min));
+ continue;
+ }
+
+ // else it's a bit more complicated, there might
+ // be a flat maxed out rectangle first, then a
+ // triangular cutout or reverse; to find these
+ // keep track of the current x values
+ var x1old = x1, x2old = x2;
+
+ // clip the y values, without shortcutting, we
+ // go through all cases in turn
+
+ // clip with ymin
+ if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) {
+ x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y1 = axisy.min;
+ }
+ else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) {
+ x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y2 = axisy.min;
+ }
+
+ // clip with ymax
+ if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) {
+ x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y1 = axisy.max;
+ }
+ else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) {
+ x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1;
+ y2 = axisy.max;
+ }
+
+ // if the x value was changed we got a rectangle
+ // to fill
+ if (x1 != x1old) {
+ ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1));
+ // it goes to (x1, y1), but we fill that below
+ }
+
+ // fill triangular section, this sometimes result
+ // in redundant points if (x1, y1) hasn't changed
+ // from previous line to, but we just ignore that
+ ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1));
+ ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
+
+ // fill the other rectangle if it's there
+ if (x2 != x2old) {
+ ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2));
+ ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2));
+ }
+ }
+ }
+
+ ctx.save();
+ ctx.translate(plotOffset.left, plotOffset.top);
+ ctx.lineJoin = "round";
+
+ var lw = series.lines.lineWidth,
+ sw = series.shadowSize;
+ // FIXME: consider another form of shadow when filling is turned on
+ if (lw > 0 && sw > 0) {
+ // draw shadow as a thick and thin line with transparency
+ ctx.lineWidth = sw;
+ ctx.strokeStyle = "rgba(0,0,0,0.1)";
+ // position shadow at angle from the mid of line
+ var angle = Math.PI/18;
+ plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis);
+ ctx.lineWidth = sw/2;
+ plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis);
+ }
+
+ ctx.lineWidth = lw;
+ ctx.strokeStyle = series.color;
+ var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight);
+ if (fillStyle) {
+ ctx.fillStyle = fillStyle;
+ plotLineArea(series.datapoints, series.xaxis, series.yaxis);
+ }
+
+ if (lw > 0)
+ plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis);
+ ctx.restore();
+ }
+
+ function drawSeriesPoints(series) {
+ function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) {
+ var points = datapoints.points, ps = datapoints.pointsize;
+
+ for (var i = 0; i < points.length; i += ps) {
+ var x = points[i], y = points[i + 1];
+ if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)
+ continue;
+
+ ctx.beginPath();
+ x = axisx.p2c(x);
+ y = axisy.p2c(y) + offset;
+ if (symbol == "circle")
+ ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false);
+ else
+ symbol(ctx, x, y, radius, shadow);
+ ctx.closePath();
+
+ if (fillStyle) {
+ ctx.fillStyle = fillStyle;
+ ctx.fill();
+ }
+ ctx.stroke();
+ }
+ }
+
+ ctx.save();
+ ctx.translate(plotOffset.left, plotOffset.top);
+
+ var lw = series.points.lineWidth,
+ sw = series.shadowSize,
+ radius = series.points.radius,
+ symbol = series.points.symbol;
+ if (lw > 0 && sw > 0) {
+ // draw shadow in two steps
+ var w = sw / 2;
+ ctx.lineWidth = w;
+ ctx.strokeStyle = "rgba(0,0,0,0.1)";
+ plotPoints(series.datapoints, radius, null, w + w/2, true,
+ series.xaxis, series.yaxis, symbol);
+
+ ctx.strokeStyle = "rgba(0,0,0,0.2)";
+ plotPoints(series.datapoints, radius, null, w/2, true,
+ series.xaxis, series.yaxis, symbol);
+ }
+
+ ctx.lineWidth = lw;
+ ctx.strokeStyle = series.color;
+ plotPoints(series.datapoints, radius,
+ getFillStyle(series.points, series.color), 0, false,
+ series.xaxis, series.yaxis, symbol);
+ ctx.restore();
+ }
+
+ function drawBar(x, y, b, barLeft, barRight, offset, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) {
+ var left, right, bottom, top,
+ drawLeft, drawRight, drawTop, drawBottom,
+ tmp;
+
+ // in horizontal mode, we start the bar from the left
+ // instead of from the bottom so it appears to be
+ // horizontal rather than vertical
+ if (horizontal) {
+ drawBottom = drawRight = drawTop = true;
+ drawLeft = false;
+ left = b;
+ right = x;
+ top = y + barLeft;
+ bottom = y + barRight;
+
+ // account for negative bars
+ if (right < left) {
+ tmp = right;
+ right = left;
+ left = tmp;
+ drawLeft = true;
+ drawRight = false;
+ }
+ }
+ else {
+ drawLeft = drawRight = drawTop = true;
+ drawBottom = false;
+ left = x + barLeft;
+ right = x + barRight;
+ bottom = b;
+ top = y;
+
+ // account for negative bars
+ if (top < bottom) {
+ tmp = top;
+ top = bottom;
+ bottom = tmp;
+ drawBottom = true;
+ drawTop = false;
+ }
+ }
+
+ // clip
+ if (right < axisx.min || left > axisx.max ||
+ top < axisy.min || bottom > axisy.max)
+ return;
+
+ if (left < axisx.min) {
+ left = axisx.min;
+ drawLeft = false;
+ }
+
+ if (right > axisx.max) {
+ right = axisx.max;
+ drawRight = false;
+ }
+
+ if (bottom < axisy.min) {
+ bottom = axisy.min;
+ drawBottom = false;
+ }
+
+ if (top > axisy.max) {
+ top = axisy.max;
+ drawTop = false;
+ }
+
+ left = axisx.p2c(left);
+ bottom = axisy.p2c(bottom);
+ right = axisx.p2c(right);
+ top = axisy.p2c(top);
+
+ // fill the bar
+ if (fillStyleCallback) {
+ c.beginPath();
+ c.moveTo(left, bottom);
+ c.lineTo(left, top);
+ c.lineTo(right, top);
+ c.lineTo(right, bottom);
+ c.fillStyle = fillStyleCallback(bottom, top);
+ c.fill();
+ }
+
+ // draw outline
+ if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) {
+ c.beginPath();
+
+ // FIXME: inline moveTo is buggy with excanvas
+ c.moveTo(left, bottom + offset);
+ if (drawLeft)
+ c.lineTo(left, top + offset);
+ else
+ c.moveTo(left, top + offset);
+ if (drawTop)
+ c.lineTo(right, top + offset);
+ else
+ c.moveTo(right, top + offset);
+ if (drawRight)
+ c.lineTo(right, bottom + offset);
+ else
+ c.moveTo(right, bottom + offset);
+ if (drawBottom)
+ c.lineTo(left, bottom + offset);
+ else
+ c.moveTo(left, bottom + offset);
+ c.stroke();
+ }
+ }
+
+ function drawSeriesBars(series) {
+ function plotBars(datapoints, barLeft, barRight, offset, fillStyleCallback, axisx, axisy) {
+ var points = datapoints.points, ps = datapoints.pointsize;
+
+ for (var i = 0; i < points.length; i += ps) {
+ if (points[i] == null)
+ continue;
+ drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, offset, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth);
+ }
+ }
+
+ ctx.save();
+ ctx.translate(plotOffset.left, plotOffset.top);
+
+ // FIXME: figure out a way to add shadows (for instance along the right edge)
+ ctx.lineWidth = series.bars.lineWidth;
+ ctx.strokeStyle = series.color;
+ var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2;
+ var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null;
+ plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, 0, fillStyleCallback, series.xaxis, series.yaxis);
+ ctx.restore();
+ }
+
+ function getFillStyle(filloptions, seriesColor, bottom, top) {
+ var fill = filloptions.fill;
+ if (!fill)
+ return null;
+
+ if (filloptions.fillColor)
+ return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor);
+
+ var c = $.color.parse(seriesColor);
+ c.a = typeof fill == "number" ? fill : 0.4;
+ c.normalize();
+ return c.toString();
+ }
+
+ function insertLegend() {
+ placeholder.find(".legend").remove();
+
+ if (!options.legend.show)
+ return;
+
+ var fragments = [], rowStarted = false,
+ lf = options.legend.labelFormatter, s, label;
+ for (var i = 0; i < series.length; ++i) {
+ s = series[i];
+ label = s.label;
+ if (!label)
+ continue;
+
+ if (i % options.legend.noColumns == 0) {
+ if (rowStarted)
+ fragments.push('</tr>');
+ fragments.push('<tr>');
+ rowStarted = true;
+ }
+
+ if (lf)
+ label = lf(label, s);
+
+ fragments.push(
+ '<td class="legendColorBox"><div style="border:1px solid ' + options.legend.labelBoxBorderColor + ';padding:1px"><div style="width:4px;height:0;border:5px solid ' + s.color + ';overflow:hidden"></div></div></td>' +
+ '<td class="legendLabel">' + label + '</td>');
+ }
+ if (rowStarted)
+ fragments.push('</tr>');
+
+ if (fragments.length == 0)
+ return;
+
+ var table = '<table style="font-size:smaller;color:' + options.grid.color + '">' + fragments.join("") + '</table>';
+ if (options.legend.container != null)
+ $(options.legend.container).html(table);
+ else {
+ var pos = "",
+ p = options.legend.position,
+ m = options.legend.margin;
+ if (m[0] == null)
+ m = [m, m];
+ if (p.charAt(0) == "n")
+ pos += 'top:' + (m[1] + plotOffset.top) + 'px;';
+ else if (p.charAt(0) == "s")
+ pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;';
+ if (p.charAt(1) == "e")
+ pos += 'right:' + (m[0] + plotOffset.right) + 'px;';
+ else if (p.charAt(1) == "w")
+ pos += 'left:' + (m[0] + plotOffset.left) + 'px;';
+ var legend = $('<div class="legend">' + table.replace('style="', 'style="position:absolute;' + pos +';') + '</div>').appendTo(placeholder);
+ if (options.legend.backgroundOpacity != 0.0) {
+ // put in the transparent background
+ // separately to avoid blended labels and
+ // label boxes
+ var c = options.legend.backgroundColor;
+ if (c == null) {
+ c = options.grid.backgroundColor;
+ if (c && typeof c == "string")
+ c = $.color.parse(c);
+ else
+ c = $.color.extract(legend, 'background-color');
+ c.a = 1;
+ c = c.toString();
+ }
+ var div = legend.children();
+ $('<div style="position:absolute;width:' + div.width() + 'px;height:' + div.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').prependTo(legend).css('opacity', options.legend.backgroundOpacity);
+ }
+ }
+ }
+
+
+ // interactive features
+
+ var highlights = [],
+ redrawTimeout = null;
+
+ // returns the data item the mouse is over, or null if none is found
+ function findNearbyItem(mouseX, mouseY, seriesFilter) {
+ var maxDistance = options.grid.mouseActiveRadius,
+ smallestDistance = maxDistance * maxDistance + 1,
+ item = null, foundPoint = false, i, j;
+
+ for (i = series.length - 1; i >= 0; --i) {
+ if (!seriesFilter(series[i]))
+ continue;
+
+ var s = series[i],
+ axisx = s.xaxis,
+ axisy = s.yaxis,
+ points = s.datapoints.points,
+ ps = s.datapoints.pointsize,
+ mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster
+ my = axisy.c2p(mouseY),
+ maxx = maxDistance / axisx.scale,
+ maxy = maxDistance / axisy.scale;
+
+ // with inverse transforms, we can't use the maxx/maxy
+ // optimization, sadly
+ if (axisx.options.inverseTransform)
+ maxx = Number.MAX_VALUE;
+ if (axisy.options.inverseTransform)
+ maxy = Number.MAX_VALUE;
+
+ if (s.lines.show || s.points.show) {
+ for (j = 0; j < points.length; j += ps) {
+ var x = points[j], y = points[j + 1];
+ if (x == null)
+ continue;
+
+ // For points and lines, the cursor must be within a
+ // certain distance to the data point
+ if (x - mx > maxx || x - mx < -maxx ||
+ y - my > maxy || y - my < -maxy)
+ continue;
+
+ // We have to calculate distances in pixels, not in
+ // data units, because the scales of the axes may be different
+ var dx = Math.abs(axisx.p2c(x) - mouseX),
+ dy = Math.abs(axisy.p2c(y) - mouseY),
+ dist = dx * dx + dy * dy; // we save the sqrt
+
+ // use <= to ensure last point takes precedence
+ // (last generally means on top of)
+ if (dist < smallestDistance) {
+ smallestDistance = dist;
+ item = [i, j / ps];
+ }
+ }
+ }
+
+ if (s.bars.show && !item) { // no other point can be nearby
+ var barLeft = s.bars.align == "left" ? 0 : -s.bars.barWidth/2,
+ barRight = barLeft + s.bars.barWidth;
+
+ for (j = 0; j < points.length; j += ps) {
+ var x = points[j], y = points[j + 1], b = points[j + 2];
+ if (x == null)
+ continue;
+
+ // for a bar graph, the cursor must be inside the bar
+ if (series[i].bars.horizontal ?
+ (mx <= Math.max(b, x) && mx >= Math.min(b, x) &&
+ my >= y + barLeft && my <= y + barRight) :
+ (mx >= x + barLeft && mx <= x + barRight &&
+ my >= Math.min(b, y) && my <= Math.max(b, y)))
+ item = [i, j / ps];
+ }
+ }
+ }
+
+ if (item) {
+ i = item[0];
+ j = item[1];
+ ps = series[i].datapoints.pointsize;
+
+ return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps),
+ dataIndex: j,
+ series: series[i],
+ seriesIndex: i };
+ }
+
+ return null;
+ }
+
+ function onMouseMove(e) {
+ if (options.grid.hoverable)
+ triggerClickHoverEvent("plothover", e,
+ function (s) { return s["hoverable"] != false; });
+ }
+
+ function onMouseLeave(e) {
+ if (options.grid.hoverable)
+ triggerClickHoverEvent("plothover", e,
+ function (s) { return false; });
+ }
+
+ function onClick(e) {
+ triggerClickHoverEvent("plotclick", e,
+ function (s) { return s["clickable"] != false; });
+ }
+
+ // trigger click or hover event (they send the same parameters
+ // so we share their code)
+ function triggerClickHoverEvent(eventname, event, seriesFilter) {
+ var offset = eventHolder.offset(),
+ canvasX = event.pageX - offset.left - plotOffset.left,
+ canvasY = event.pageY - offset.top - plotOffset.top,
+ pos = canvasToAxisCoords({ left: canvasX, top: canvasY });
+
+ pos.pageX = event.pageX;
+ pos.pageY = event.pageY;
+
+ var item = findNearbyItem(canvasX, canvasY, seriesFilter);
+
+ if (item) {
+ // fill in mouse pos for any listeners out there
+ item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left);
+ item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top);
+ }
+
+ if (options.grid.autoHighlight) {
+ // clear auto-highlights
+ for (var i = 0; i < highlights.length; ++i) {
+ var h = highlights[i];
+ if (h.auto == eventname &&
+ !(item && h.series == item.series &&
+ h.point[0] == item.datapoint[0] &&
+ h.point[1] == item.datapoint[1]))
+ unhighlight(h.series, h.point);
+ }
+
+ if (item)
+ highlight(item.series, item.datapoint, eventname);
+ }
+
+ placeholder.trigger(eventname, [ pos, item ]);
+ }
+
+ function triggerRedrawOverlay() {
+ if (!redrawTimeout)
+ redrawTimeout = setTimeout(drawOverlay, 30);
+ }
+
+ function drawOverlay() {
+ redrawTimeout = null;
+
+ // draw highlights
+ octx.save();
+ octx.clearRect(0, 0, canvasWidth, canvasHeight);
+ octx.translate(plotOffset.left, plotOffset.top);
+
+ var i, hi;
+ for (i = 0; i < highlights.length; ++i) {
+ hi = highlights[i];
+
+ if (hi.series.bars.show)
+ drawBarHighlight(hi.series, hi.point);
+ else
+ drawPointHighlight(hi.series, hi.point);
+ }
+ octx.restore();
+
+ executeHooks(hooks.drawOverlay, [octx]);
+ }
+
+ function highlight(s, point, auto) {
+ if (typeof s == "number")
+ s = series[s];
+
+ if (typeof point == "number") {
+ var ps = s.datapoints.pointsize;
+ point = s.datapoints.points.slice(ps * point, ps * (point + 1));
+ }
+
+ var i = indexOfHighlight(s, point);
+ if (i == -1) {
+ highlights.push({ series: s, point: point, auto: auto });
+
+ triggerRedrawOverlay();
+ }
+ else if (!auto)
+ highlights[i].auto = false;
+ }
+
+ function unhighlight(s, point) {
+ if (s == null && point == null) {
+ highlights = [];
+ triggerRedrawOverlay();
+ }
+
+ if (typeof s == "number")
+ s = series[s];
+
+ if (typeof point == "number")
+ point = s.data[point];
+
+ var i = indexOfHighlight(s, point);
+ if (i != -1) {
+ highlights.splice(i, 1);
+
+ triggerRedrawOverlay();
+ }
+ }
+
+ function indexOfHighlight(s, p) {
+ for (var i = 0; i < highlights.length; ++i) {
+ var h = highlights[i];
+ if (h.series == s && h.point[0] == p[0]
+ && h.point[1] == p[1])
+ return i;
+ }
+ return -1;
+ }
+
+ function drawPointHighlight(series, point) {
+ var x = point[0], y = point[1],
+ axisx = series.xaxis, axisy = series.yaxis;
+
+ if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max)
+ return;
+
+ var pointRadius = series.points.radius + series.points.lineWidth / 2;
+ octx.lineWidth = pointRadius;
+ octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString();
+ var radius = 1.5 * pointRadius,
+ x = axisx.p2c(x),
+ y = axisy.p2c(y);
+
+ octx.beginPath();
+ if (series.points.symbol == "circle")
+ octx.arc(x, y, radius, 0, 2 * Math.PI, false);
+ else
+ series.points.symbol(octx, x, y, radius, false);
+ octx.closePath();
+ octx.stroke();
+ }
+
+ function drawBarHighlight(series, point) {
+ octx.lineWidth = series.bars.lineWidth;
+ octx.strokeStyle = $.color.parse(series.color).scale('a', 0.5).toString();
+ var fillStyle = $.color.parse(series.color).scale('a', 0.5).toString();
+ var barLeft = series.bars.align == "left" ? 0 : -series.bars.barWidth/2;
+ drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth,
+ 0, function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth);
+ }
+
+ function getColorOrGradient(spec, bottom, top, defaultColor) {
+ if (typeof spec == "string")
+ return spec;
+ else {
+ // assume this is a gradient spec; IE currently only
+ // supports a simple vertical gradient properly, so that's
+ // what we support too
+ var gradient = ctx.createLinearGradient(0, top, 0, bottom);
+
+ for (var i = 0, l = spec.colors.length; i < l; ++i) {
+ var c = spec.colors[i];
+ if (typeof c != "string") {
+ var co = $.color.parse(defaultColor);
+ if (c.brightness != null)
+ co = co.scale('rgb', c.brightness)
+ if (c.opacity != null)
+ co.a *= c.opacity;
+ c = co.toString();
+ }
+ gradient.addColorStop(i / (l - 1), c);
+ }
+
+ return gradient;
+ }
+ }
+ }
+
+ $.plot = function(placeholder, data, options) {
+ //var t0 = new Date();
+ var plot = new Plot($(placeholder), data, options, $.plot.plugins);
+ //(window.console ? console.log : alert)("time used (msecs): " + ((new Date()).getTime() - t0.getTime()));
+ return plot;
+ };
+
+ $.plot.version = "0.7";
+
+ $.plot.plugins = [];
+
+ // returns a string with the date d formatted according to fmt
+ $.plot.formatDate = function(d, fmt, monthNames) {
+ var leftPad = function(n) {
+ n = "" + n;
+ return n.length == 1 ? "0" + n : n;
+ };
+
+ var r = [];
+ var escape = false, padNext = false;
+ var hours = d.getUTCHours();
+ var isAM = hours < 12;
+ if (monthNames == null)
+ monthNames = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
+
+ if (fmt.search(/%p|%P/) != -1) {
+ if (hours > 12) {
+ hours = hours - 12;
+ } else if (hours == 0) {
+ hours = 12;
+ }
+ }
+ for (var i = 0; i < fmt.length; ++i) {
+ var c = fmt.charAt(i);
+
+ if (escape) {
+ switch (c) {
+ case 'h': c = "" + hours; break;
+ case 'H': c = leftPad(hours); break;
+ case 'M': c = leftPad(d.getUTCMinutes()); break;
+ case 'S': c = leftPad(d.getUTCSeconds()); break;
+ case 'd': c = "" + d.getUTCDate(); break;
+ case 'm': c = "" + (d.getUTCMonth() + 1); break;
+ case 'y': c = "" + d.getUTCFullYear(); break;
+ case 'b': c = "" + monthNames[d.getUTCMonth()]; break;
+ case 'p': c = (isAM) ? ("" + "am") : ("" + "pm"); break;
+ case 'P': c = (isAM) ? ("" + "AM") : ("" + "PM"); break;
+ case '0': c = ""; padNext = true; break;
+ }
+ if (c && padNext) {
+ c = leftPad(c);
+ padNext = false;
+ }
+ r.push(c);
+ if (!padNext)
+ escape = false;
+ }
+ else {
+ if (c == "%")
+ escape = true;
+ else
+ r.push(c);
+ }
+ }
+ return r.join("");
+ };
+
+ // round to nearby lower multiple of base
+ function floorInBase(n, base) {
+ return base * Math.floor(n / base);
+ }
+
+})(jQuery);
diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/redbutton.css b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/redbutton.css
new file mode 100644
index 0000000000..a70cf5e575
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/redbutton.css
@@ -0,0 +1,3 @@
+.redButton {
+ background-color: red;
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html
new file mode 100644
index 0000000000..da050b3aaa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.html
@@ -0,0 +1,66 @@
+<?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>CloseSubWindow</title>
+</head>
+<body>
+<table cellpadding="1" cellspacing="1" border="1">
+<thead>
+<tr><td rowspan="1" colspan="3">CloseSubWindow</td></tr>
+</thead><tbody>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>57,3</td>
+</tr>
+<tr>
+ <td>assertTextNotPresent</td>
+ <td>404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[1]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>72,9</td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/12341234/</td>
+ <td></td>
+</tr>
+<tr>
+ <td>open</td>
+ <td>/run/com.vaadin.tests.requesthandlers.AppResource404</td>
+ <td></td>
+</tr>
+<tr>
+ <td>click</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[2]/VButton[0]/domChild[0]/domChild[0]</td>
+ <td></td>
+</tr>
+<tr>
+ <td>mouseClickAndWait</td>
+ <td>vaadin=runcomvaadintestsrequesthandlersAppResource404::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[0]/VLink[0]/domChild[0]/domChild[0]</td>
+ <td>47,9</td>
+</tr>
+<tr>
+ <td>assertTextPresent</td>
+ <td>RequestURI=/run/com.vaadin.tests.requesthandlers.AppResource404/APP/1//com/vaadin/tests/integration/se.gif</td>
+ <td></td>
+</tr>
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java
new file mode 100644
index 0000000000..2f5c1177fa
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java
@@ -0,0 +1,42 @@
+package com.vaadin.tests.requesthandlers;
+
+import com.vaadin.terminal.ExternalResource;
+import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.integration.FlagSeResource;
+import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Link;
+
+public class AppResource404 extends TestBase {
+
+ @Override
+ protected void setup() {
+ // Add one existing resource
+ final FlagSeResource resource = new FlagSeResource(this);
+ resource.setCacheTime(0);
+ addResource(resource);
+
+ addComponent(new Link("Existing resource", resource));
+ addComponent(new Link("Non-existing resource", new ExternalResource(
+ getURL().toString() + "APP/12341234/")));
+
+ addComponent(new Button("Remove existing resrouce",
+ new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ removeResource(resource);
+ }
+ }));
+ }
+
+ @Override
+ protected String getDescription() {
+ return "Accessing the URL of a resource that has been removed or the URL following the resource URL pattern but not currently mapped to a resource should give a 404 error message";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(6702);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java b/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java
index 3d7379aafe..cb8963c3d4 100644
--- a/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java
+++ b/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java
@@ -22,6 +22,7 @@ public class DownloadLargeFileResource extends TestBase {
+ String.format("%.1f", fileSize / 1024.0 / 1024.0)
+ "MB file", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
download();
}
diff --git a/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java b/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java
index d3bbeef99a..b6dbcfca97 100644
--- a/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java
+++ b/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java
@@ -22,6 +22,7 @@ public class NonExistingFileResource extends TestBase {
Button b = new Button("Download " + filename);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
FileResource res = new FileResource(new File(getContext()
.getBaseDirectory() + "/" + filename),
diff --git a/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java b/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java
index 69fd0b2b81..8ab6ce153d 100644
--- a/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java
+++ b/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java
@@ -17,6 +17,7 @@ public class ResourceDownload extends TestBase {
public void setup() {
Button b = new Button("Download (_new)", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
download("_new");
}
@@ -24,6 +25,7 @@ public class ResourceDownload extends TestBase {
addComponent(b);
b = new Button("Download (_blank)", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
download("_blank");
}
@@ -31,6 +33,7 @@ public class ResourceDownload extends TestBase {
addComponent(b);
b = new Button("Download ()", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
download("");
}
@@ -38,6 +41,7 @@ public class ResourceDownload extends TestBase {
addComponent(b);
b = new Button("Download (_top)", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
download("_top");
}
@@ -45,6 +49,7 @@ public class ResourceDownload extends TestBase {
addComponent(b);
b = new Button("Test", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ResourceDownload.this.getMainWindow().showNotification(
"Still working");
@@ -59,6 +64,7 @@ public class ResourceDownload extends TestBase {
String filename = "filename";
StreamResource streamResource = new StreamResource(new StreamSource() {
+ @Override
public InputStream getStream() {
try {
return new FileInputStream("FIXME C:/temp/file.xls");
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html
new file mode 100644
index 0000000000..3d52356cab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.html
@@ -0,0 +1,107 @@
+<?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.serialization.SerializerTest?restartApplication</td>
+ <td></td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[16]</td>
+ <td>1. sendBoolean: false, false, [false, false, true, false, true, true]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[15]</td>
+ <td>2. sendByte: 5, -12, [3, 1, 2]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[14]</td>
+ <td>3. sendChar: Å, ∫, [a, b, c, d]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[13]</td>
+ <td>4. sendInt: 2, 5, [2147483647, 0]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[12]</td>
+ <td>5. sendLong: -57841235865, 577431841358, [57, 0]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[11]</td>
+ <td>6. sendFloat: 1.0000001, 3.14159, [-12.0, 0.0, 57.0]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[10]</td>
+ <td>7. sendDouble: 0.423310825130748, 5.859874482048838, [2.0, 1.7976931348623157E308, 4.9E-324]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[9]</td>
+ <td>8. sendString: Taegghiiiinnrsssstt‡</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[8]</td>
+ <td>9. sendConnector: com.vaadin.tests.widgetset.server.SerializerTestExtension</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[7]</td>
+ <td>10. sendBean: ComplexTestBean [innerBean1=SimpleTestBean(1), innerBean2=SimpleTestBean(3), innerBeanCollection=[SimpleTestBean(6), SimpleTestBean(0)], privimite=6], SimpleTestBean(0), [SimpleTestBean(7)]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[6]</td>
+ <td>11. sendNull: null, Not null</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[5]</td>
+ <td>12. sendNestedArray: [[7, 5]], [[SimpleTestBean(2)], [SimpleTestBean(4)]]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[4]</td>
+ <td>13. sendList: [-234, 5, 8], class com.vaadin.tests.widgetset.server.SerializerTestExtension, class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(-568), SimpleTestBean(234)]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[3]</td>
+ <td>14. sendArrayList: [[2], [2]], [[2, 1], [2, 3]], [[SimpleTestBean(7)]]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[2]</td>
+ <td>15. sendSet: [-12, -7, -4], class com.vaadin.tests.serialization.SerializerTest, [SimpleTestBean(2), SimpleTestBean(3)]</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[1]</td>
+ <td>16. sendMap: {a=null}, [com.vaadin.tests.widgetset.server.SerializerTestExtension=false], [2=com.vaadin.tests.widgetset.server.SerializerTestExtension], {SimpleTestBean(4)=SimpleTestBean(-4), SimpleTestBean(-5)=SimpleTestBean(5)}</td>
+</tr>
+<tr>
+ <td>assertText</td>
+ <td>vaadin=runcomvaadintestsserializationSerializerTest::/VVerticalLayout[0]/VVerticalLayout[0]/VVerticalLayout[0]/VLabel[0]</td>
+ <td>17. sendWrappedGenerics: {[SimpleTestBean(1)]={1=[SimpleTestBean(42)]}}</td>
+</tr>
+
+</tbody></table>
+</body>
+</html>
diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
new file mode 100644
index 0000000000..7c8aed1992
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java
@@ -0,0 +1,292 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.serialization;
+
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import com.vaadin.annotations.Widgetset;
+import com.vaadin.shared.Connector;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.tests.components.AbstractTestRoot;
+import com.vaadin.tests.util.Log;
+import com.vaadin.tests.widgetset.client.ComplexTestBean;
+import com.vaadin.tests.widgetset.client.SerializerTestRpc;
+import com.vaadin.tests.widgetset.client.SimpleTestBean;
+import com.vaadin.tests.widgetset.server.SerializerTestExtension;
+
+@Widgetset("com.vaadin.tests.widgetset.TestingWidgetSet")
+public class SerializerTest extends AbstractTestRoot {
+
+ private Log log = new Log(40);
+
+ @Override
+ protected void setup(WrappedRequest request) {
+ final SerializerTestExtension testExtension = new SerializerTestExtension();
+ addExtension(testExtension);
+ addComponent(log);
+
+ SerializerTestRpc rpc = testExtension
+ .getRpcProxy(SerializerTestRpc.class);
+ rpc.sendBoolean(true, Boolean.FALSE, new boolean[] { true, true, false,
+ true, false, false });
+ rpc.sendByte((byte) 5, Byte.valueOf((byte) -12), new byte[] { 3, 1, 2 });
+ rpc.sendChar('\u222b', Character.valueOf('Ã¥'), "aBcD".toCharArray());
+ rpc.sendInt(Integer.MAX_VALUE, Integer.valueOf(0), new int[] { 5, 7 });
+ rpc.sendLong(577431841358l, Long.valueOf(0), new long[] {
+ -57841235865l, 57 });
+ rpc.sendFloat(3.14159f, Float.valueOf(Math.nextUp(1)), new float[] {
+ 57, 0, -12 });
+ rpc.sendDouble(Math.PI, Double.valueOf(-Math.E), new double[] {
+ Double.MAX_VALUE, Double.MIN_VALUE });
+ rpc.sendString("This is a tesing string ‡");
+ rpc.sendConnector(this);
+ rpc.sendBean(
+ new ComplexTestBean(new SimpleTestBean(0),
+ new SimpleTestBean(1), Arrays.asList(
+ new SimpleTestBean(3), new SimpleTestBean(4)),
+ 5), new SimpleTestBean(6),
+ new SimpleTestBean[] { new SimpleTestBean(7) });
+ rpc.sendNull("Not null", null);
+ rpc.sendNestedArray(new int[][] { { 5 }, { 7 } },
+ new SimpleTestBean[][] { { new SimpleTestBean(4),
+ new SimpleTestBean(2) } });
+ rpc.sendList(Arrays.asList(5, 8, -234), Arrays.<Connector> asList(this,
+ testExtension), Arrays.asList(new SimpleTestBean(234),
+ new SimpleTestBean(-568)));
+ rpc.sendArrayList(
+ Arrays.asList(new int[] { 1, 2 }, new int[] { 3, 4 }),
+ Arrays.asList(new Integer[] { 5, 6 }, new Integer[] { 7, 8 }),
+ Collections
+ .singletonList(new SimpleTestBean[] { new SimpleTestBean(
+ 7) }));
+ // Disabled because of #8861
+ // rpc.sendListArray(
+ // new List[] { Arrays.asList(1, 2), Arrays.asList(3, 4) },
+ // new List[] { Collections.singletonList(new SimpleTestBean(-1)) });
+ rpc.sendSet(new HashSet<Integer>(Arrays.asList(4, 7, 12)), Collections
+ .singleton((Connector) this), new HashSet<SimpleTestBean>(
+ Arrays.asList(new SimpleTestBean(1), new SimpleTestBean(2))));
+
+ rpc.sendMap(new HashMap<String, SimpleTestBean>() {
+ {
+ put("1", new SimpleTestBean(1));
+ put("2", new SimpleTestBean(2));
+ }
+ }, new HashMap<Connector, Boolean>() {
+ {
+ put(testExtension, true);
+ put(getRoot(), false);
+ }
+ }, new HashMap<Integer, Connector>() {
+ {
+ put(5, testExtension);
+ put(10, getRoot());
+ }
+ }, new HashMap<SimpleTestBean, SimpleTestBean>() {
+ {
+ put(new SimpleTestBean(5), new SimpleTestBean(-5));
+ put(new SimpleTestBean(-4), new SimpleTestBean(4));
+ }
+ });
+ rpc.sendWrappedGenerics(new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>() {
+ {
+ put(Collections.singleton(new SimpleTestBean(42)),
+ new HashMap<Integer, List<SimpleTestBean>>() {
+ {
+ put(1, Arrays.asList(new SimpleTestBean(1),
+ new SimpleTestBean(3)));
+ }
+ });
+ }
+ });
+
+ testExtension.registerRpc(new SerializerTestRpc() {
+ @Override
+ public void sendBoolean(boolean value, Boolean boxedValue,
+ boolean[] array) {
+ log.log("sendBoolean: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendByte(byte value, Byte boxedValue, byte[] array) {
+ log.log("sendByte: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendChar(char value, Character boxedValue, char[] array) {
+ log.log("sendChar: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendInt(int value, Integer boxedValue, int[] array) {
+ log.log("sendInt: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendLong(long value, Long boxedValue, long[] array) {
+ log.log("sendLong: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendFloat(float value, Float boxedValue, float[] array) {
+ log.log("sendFloat: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendDouble(double value, Double boxedValue,
+ double[] array) {
+ log.log("sendDouble: " + value + ", " + boxedValue + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendString(String value) {
+ log.log("sendString: " + value);
+ }
+
+ @Override
+ public void sendConnector(Connector connector) {
+ log.log("sendConnector: " + connector.getClass().getName());
+ }
+
+ @Override
+ public void sendBean(ComplexTestBean complexBean,
+ SimpleTestBean simpleBean, SimpleTestBean[] array) {
+ log.log("sendBean: " + complexBean + ", " + simpleBean + ", "
+ + Arrays.toString(array));
+ }
+
+ @Override
+ public void sendNull(String value1, String value2) {
+ log.log("sendNull: " + value1 + ", " + value2);
+ }
+
+ @Override
+ public void sendNestedArray(int[][] nestedIntArray,
+ SimpleTestBean[][] nestedBeanArray) {
+ log.log("sendNestedArray: "
+ + Arrays.deepToString(nestedIntArray) + ", "
+ + Arrays.deepToString(nestedBeanArray));
+ }
+
+ @Override
+ public void sendList(List<Integer> intList,
+ List<Connector> connectorList, List<SimpleTestBean> beanList) {
+ log.log("sendList: " + intList + ", "
+ + connectorCollectionToString(connectorList) + ", "
+ + beanList);
+ }
+
+ private String connectorCollectionToString(
+ Collection<Connector> collection) {
+ StringBuilder sb = new StringBuilder();
+
+ for (Connector connector : collection) {
+ if (sb.length() != 0) {
+ sb.append(", ");
+ }
+ sb.append(connector.getClass());
+ }
+
+ String string = sb.toString();
+ return string;
+ }
+
+ @Override
+ public void sendArrayList(List<int[]> primitiveArrayList,
+ List<Integer[]> objectArrayList,
+ List<SimpleTestBean[]> beanArrayList) {
+ log.log("sendArrayList: "
+ + Arrays.deepToString(primitiveArrayList.toArray())
+ + ", " + Arrays.deepToString(objectArrayList.toArray())
+ + ", " + Arrays.deepToString(beanArrayList.toArray()));
+ }
+
+ @Override
+ public void sendListArray(List<Integer>[] objectListArray,
+ List<SimpleTestBean>[] beanListArray) {
+ log.log("sendArrayList: " + Arrays.toString(objectListArray)
+ + ", " + Arrays.toString(beanListArray));
+ }
+
+ @Override
+ public void sendSet(Set<Integer> intSet,
+ Set<Connector> connectorSet, Set<SimpleTestBean> beanSet) {
+ log.log("sendSet: " + intSet + ", "
+ + connectorCollectionToString(connectorSet) + ", "
+ + beanSet);
+ }
+
+ @Override
+ public void sendMap(Map<String, SimpleTestBean> stringMap,
+ Map<Connector, Boolean> connectorMap,
+ Map<Integer, Connector> intMap,
+ Map<SimpleTestBean, SimpleTestBean> beanMap) {
+ StringBuilder sb = new StringBuilder();
+ for (Entry<Connector, Boolean> entry : connectorMap.entrySet()) {
+ if (sb.length() == 0) {
+ sb.append('[');
+ } else {
+ sb.append(", ");
+ }
+ sb.append(entry.getKey().getClass().getName());
+ sb.append('=');
+ sb.append(entry.getValue());
+ }
+ sb.append(']');
+ String connectorMapString = sb.toString();
+
+ sb = new StringBuilder();
+ for (Entry<Integer, Connector> entry : intMap.entrySet()) {
+ if (sb.length() == 0) {
+ sb.append('[');
+ } else {
+ sb.append(", ");
+ }
+ sb.append(entry.getKey());
+ sb.append('=');
+ sb.append(entry.getValue().getClass().getName());
+ }
+ sb.append(']');
+ String intMapString = sb.toString();
+
+ log.log("sendMap: " + stringMap + ", " + connectorMapString
+ + ", " + intMapString + ", " + beanMap);
+ }
+
+ @Override
+ public void sendWrappedGenerics(
+ Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics) {
+ log.log("sendWrappedGenerics: " + generics.toString());
+ }
+
+ });
+ }
+
+ @Override
+ protected String getTestDescription() {
+ return "Test for lots of different cases of encoding and decoding variuos data types";
+ }
+
+ @Override
+ protected Integer getTicketNumber() {
+ return Integer.valueOf(8655);
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
index 9425cd9bd2..a2d482dfbf 100644
--- a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
+++ b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java
@@ -1,5 +1,7 @@
package com.vaadin.tests.themes;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
@@ -8,12 +10,13 @@ import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.NativeButton;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
-public class ButtonsTest extends com.vaadin.Application {
+public class ButtonsTest extends com.vaadin.Application.LegacyApplication {
- final Window main = new Window("Button states & themes");
+ final Root.LegacyWindow main = new LegacyWindow("Button states & themes");
CheckBox styleToggle;
CheckBox iconToggle;
@@ -29,8 +32,11 @@ public class ButtonsTest extends com.vaadin.Application {
setMainWindow(main);
setTheme("reindeer");
- themeToggle = new CheckBox("Runo theme", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ themeToggle = new CheckBox("Runo theme");
+ themeToggle.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
if (getTheme() == "reindeer") {
setTheme("runo");
} else {
@@ -41,8 +47,11 @@ public class ButtonsTest extends com.vaadin.Application {
themeToggle.setStyleName("small");
themeToggle.setImmediate(true);
- styleToggle = new CheckBox("Black style", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ styleToggle = new CheckBox("Black style");
+ styleToggle.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
if (!main.getContent().getStyleName().contains("black")) {
main.getContent().setStyleName("black");
} else {
@@ -53,8 +62,11 @@ public class ButtonsTest extends com.vaadin.Application {
styleToggle.setImmediate(true);
styleToggle.setStyleName("small");
- iconToggle = new CheckBox("64x icons", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ iconToggle = new CheckBox("64x icons");
+ iconToggle.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
largeIcons = !largeIcons;
recreateAll();
}
@@ -62,13 +74,15 @@ public class ButtonsTest extends com.vaadin.Application {
iconToggle.setImmediate(true);
iconToggle.setStyleName("small");
- nativeToggle = new CheckBox("Native buttons",
- new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- nativeButtons = !nativeButtons;
- recreateAll();
- }
- });
+ nativeToggle = new CheckBox("Native buttons");
+ nativeToggle.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ nativeButtons = !nativeButtons;
+ recreateAll();
+ }
+ });
nativeToggle.setImmediate(true);
nativeToggle.setStyleName("small");
@@ -110,6 +124,7 @@ public class ButtonsTest extends com.vaadin.Application {
main.addComponent(b);
Button c = new Button("toggle enabled", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
b.setEnabled(!b.isEnabled());
}
@@ -155,4 +170,4 @@ public class ButtonsTest extends com.vaadin.Application {
return hl;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
index 0596fd4d49..299c939043 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1225.java
@@ -1,26 +1,27 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
/**
* With IE7 extra scrollbars appear in content area all though content fits
* properly. Scrollbars will disappear if "shaking" content a bit, like
* selecting tests in area.
*/
-public class Ticket1225 extends Application {
+public class Ticket1225 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(
+ final LegacyWindow mainWin = new LegacyWindow(
"Test app to break layout fuction in IE7");
setMainWindow(mainWin);
@@ -45,7 +46,7 @@ public class Ticket1225 extends Application {
Label red = new Label(
"<div style='background:red;width:100%;height:100%;'>??</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
// red.setCaption("cap");
// red.setSizeFull();
@@ -58,7 +59,7 @@ public class Ticket1225 extends Application {
ts.getTab(red).setCaption("REd tab");
Label l = new Label("<div style='background:blue;'>sdf</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
el.addComponent(l);
el.setComponentAlignment(l, Alignment.MIDDLE_RIGHT);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
index fd859459c0..b1841b69ba 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1230.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class Ticket1230 extends Application {
+public class Ticket1230 extends Application.LegacyApplication {
private static final Object PROPERTY_ID = new Object();
private static final Object NULL_ITEM_ID = new Object();
@@ -18,7 +18,7 @@ public class Ticket1230 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
GridLayout layout = new GridLayout(5, 5);
@@ -32,6 +32,7 @@ public class Ticket1230 extends Application {
layout.addComponent(selectWithoutNullItem);
Button b = new Button("Select NULL_PROPERTY", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithoutNullItem.select(NULL_ITEM_ID);
printState();
@@ -41,6 +42,7 @@ public class Ticket1230 extends Application {
layout.addComponent(b);
b = new Button("Select 1", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithoutNullItem.select("1");
printState();
@@ -50,6 +52,7 @@ public class Ticket1230 extends Application {
layout.addComponent(b);
b = new Button("Select 2", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithoutNullItem.select("2");
printState();
@@ -60,6 +63,7 @@ public class Ticket1230 extends Application {
b = new Button("Select null", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithoutNullItem.select(null);
printState();
@@ -79,6 +83,7 @@ public class Ticket1230 extends Application {
selectWithNullItem.setCaption("Select with null item id");
Button b = new Button("Select NULL_PROPERTY", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithNullItem.select(NULL_ITEM_ID);
printState();
@@ -89,6 +94,7 @@ public class Ticket1230 extends Application {
b = new Button("Select 1", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithNullItem.select("1");
printState();
@@ -98,6 +104,7 @@ public class Ticket1230 extends Application {
layout.addComponent(b);
b = new Button("Select 2", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithNullItem.select("2");
printState();
@@ -107,6 +114,7 @@ public class Ticket1230 extends Application {
b = new Button("Select null", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
selectWithNullItem.select(null);
printState();
@@ -118,6 +126,7 @@ public class Ticket1230 extends Application {
w.addComponent(new Button("print select values",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
printState();
}
@@ -127,7 +136,6 @@ public class Ticket1230 extends Application {
@SuppressWarnings("deprecation")
private Select createSelect() {
Select select = new Select();
- select.setMultiSelect(false);
select.addContainerProperty(PROPERTY_ID, String.class, "");
select.setItemCaptionPropertyId(PROPERTY_ID);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
index efd28d7f41..8761db1cc3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket124.java
@@ -1,22 +1,24 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket124 extends Application {
+public class Ticket124 extends Application.LegacyApplication {
private TextField tf;
private GridLayout gl;
@Override
public void init() {
- Window w = new Window("#124: Insert & remove row for GridLayout");
+ LegacyWindow w = new LegacyWindow(
+ "#124: Insert & remove row for GridLayout");
setMainWindow(w);
setTheme("tests-tickets");
// gl = new GridLayout(4, 4);
@@ -25,6 +27,7 @@ public class Ticket124 extends Application {
tf = new TextField("Row nr");
Button insert = new Button("Insert row", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
insertRow();
@@ -32,6 +35,7 @@ public class Ticket124 extends Application {
});
Button delete = new Button("Delete row", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
deleteRow();
@@ -45,7 +49,7 @@ public class Ticket124 extends Application {
gl.addComponent(new Label("0,0-1,0"), 0, 0, 1, 0);
gl.addComponent(new Label("2,0-3,0"), 2, 0, 3, 0);
Label l = new Label("Large cell 0,1-2,2<br/>yadayada<br/>lorem ipsum");
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
gl.addComponent(l, 0, 1, 2, 2);
gl.addComponent(new Label("3-1"), 3, 1);
gl.addComponent(new Label("3,2-3,3"), 3, 2, 3, 3);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
index 2e8675de7b..a5aa8cd2ac 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1245.java
@@ -5,20 +5,20 @@ import com.vaadin.data.Property;
import com.vaadin.ui.AbstractSelect;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket1245 extends com.vaadin.Application {
+public class Ticket1245 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new TreeExample());
@@ -80,7 +80,9 @@ class TreeExample extends CustomComponent {
// get the created item
final Item item = tree.getItem(id);
// set our "caption" property
- final Property p = item.getItemProperty(CAPTION_PROPERTY);
+ @SuppressWarnings("unchecked")
+ final Property<String> p = (Property<String>) item
+ .getItemProperty(CAPTION_PROPERTY);
p.setValue(caption);
if (parent != null) {
tree.setChildrenAllowed(parent, true);
@@ -90,4 +92,4 @@ class TreeExample extends CustomComponent {
return id;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java
deleted file mode 100644
index d8fdefbd38..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1362Login.java
+++ /dev/null
@@ -1,275 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.io.ByteArrayInputStream;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.ApplicationResource;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.ParameterHandler;
-import com.vaadin.terminal.URIHandler;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.CustomComponent;
-import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-
-/**
- * Proof of concept how to create a decent login screen that works with browsers
- * PW managers. (Browsers don't autofill generated login forms)
- *
- * TODO generalize js to work inside iframes (if a Vaadin application is inside
- * iframe)
- *
- * TODO extract login form to a external template.
- *
- * TODO theme
- *
- * TODO refine docs, make LoginBox a standard Vaadin component
- *
- * TODO article
- *
- */
-public class Ticket1362Login extends Application {
-
- public class LoginBox extends CustomComponent {
-
- Embedded iframe = new Embedded();
-
- ApplicationResource loginPage = new ApplicationResource() {
-
- private byte[] loginHTML = (""
- + "<html>"
- + "<head><script type='text/javascript'>"
- + "var setTarget = function() {document.getElementById('loginf').action = top.location;};"
- + "</script></head>"
- + "<body onload='setTarget();'>"
- + "Iframe generated by LoginBox. PW managers can autofill form. Form handled by LoginBox "
- + "that will fire LoginEvents. Will post into another iframe, from where the script "
- + "will find Vaadin client that will be force synced. <form id='loginf' target='logintarget'>"
- + "Username : <input type='text' name='username'>"
- + "Password : <input type='password' name='password'>"
- + "<input type='submit' value='login'>" + "</form>"
- + "<iframe name='logintarget'></iframe>" + "</body>"
- + "</html>").getBytes();
-
- public Application getApplication() {
- return LoginBox.this.getApplication();
- }
-
- public int getBufferSize() {
- return loginHTML.length;
- }
-
- public long getCacheTime() {
- return 0;
- }
-
- public String getFilename() {
- return "login.html";
- }
-
- public DownloadStream getStream() {
- return new DownloadStream(new ByteArrayInputStream(loginHTML),
- getMIMEType(), getFilename());
- }
-
- public String getMIMEType() {
- return "text/html";
- }
- };
-
- private ParameterHandler paramHandler = new ParameterHandler() {
-
- public void handleParameters(Map<String, String[]> parameters) {
- if (parameters.containsKey("username")) {
- getWindow().addURIHandler(uriHandler);
-
- HashMap<String, String> params = new HashMap<String, String>();
- // expecting single params
- for (Iterator<String> it = parameters.keySet().iterator(); it
- .hasNext();) {
- String key = it.next();
- String value = (parameters.get(key))[0];
- params.put(key, value);
- }
- LoginEvent event = new LoginEvent(params);
- for (Iterator<LoginListener> iterator = listeners
- .iterator(); iterator.hasNext();) {
- LoginListener listener = iterator.next();
- listener.onLogin(event);
- }
- }
- }
- };
-
- private URIHandler uriHandler = new URIHandler() {
- public DownloadStream handleURI(URL context, String relativeUri) {
- if (window != null) {
- window.removeURIHandler(this);
- }
- return new DownloadStream(
- new ByteArrayInputStream(
- "<html><body>Login form handeled.<script type='text/javascript'>top.vaadin.forceSync();</script></body></html>"
- .getBytes()), "text/html",
- "loginSuccesfull.html");
- }
- };
-
- private LinkedList<LoginListener> listeners = new LinkedList<LoginListener>();
-
- private Window window;
-
- LoginBox() {
- iframe.setType(Embedded.TYPE_BROWSER);
- iframe.setSizeFull();
- setCompositionRoot(iframe);
- }
-
- @Override
- public void attach() {
- super.attach();
- getApplication().addResource(loginPage);
- getWindow().addParameterHandler(paramHandler);
- iframe.setSource(loginPage);
- }
-
- @Override
- public void detach() {
- getApplication().removeResource(loginPage);
- getWindow().removeParameterHandler(paramHandler);
- // store window temporary to properly remove uri handler once
- // response is handled. (May happen if login handler removes login
- // box
- window = getWindow();
- super.detach();
- }
-
- /**
- * This event is sent when login form is submitted.
- */
- public class LoginEvent {
-
- private Map<String, String> params;
-
- private LoginEvent(Map<String, String> params) {
- this.params = params;
- }
-
- /**
- * Returns form value by field name.
- *
- * @param name
- * @return value in given field
- */
- public String getLoginParameter(String name) {
- if (params.containsKey(name)) {
- return params.get(name);
- } else {
- return null;
- }
- }
- }
-
- /**
- * Adds LoginListener to handle login logic
- *
- * @param listener
- */
- public void addLoginListener(LoginListener listener) {
- listeners.add(listener);
- }
-
- /**
- * Removes LoginListener
- *
- * @param listener
- */
- public void removeLoginListener(LoginListener listener) {
- listeners.remove(listener);
- }
-
- }
-
- /**
- * Login listener is a class capable to listen LoginEvents sent from
- * LoginBox
- */
- public interface LoginListener {
- /**
- * This method is fired on each login form post.
- *
- * @param event
- */
- public void onLogin(LoginBox.LoginEvent event);
- }
-
- final static String GUEST = "guest";
-
- LoginBox loginBox = new LoginBox();
-
- Label currentUser = new Label(GUEST);
-
- private Panel mainPanel;
-
- private VerticalLayout el;
-
- @Override
- public void init() {
-
- final Window mainWin = new Window(
- "Test app with password manager savvy login functionality");
-
- el = new VerticalLayout();
-
- currentUser.setCaption("Currennt user");
- el.addComponent(currentUser);
-
- el.addComponent(loginBox);
- el.setExpandRatio(loginBox, 1);
-
- mainWin.setContent(el);
-
- setMainWindow(mainWin);
-
- mainPanel = new Panel("Test app");
- mainPanel.setSizeFull();
- mainPanel.addComponent(new Label("User is logged in"));
- mainPanel.addComponent(new Button("Logout", new Button.ClickListener() {
-
- public void buttonClick(ClickEvent event) {
- Ticket1362Login.this.close();
- }
- }));
-
- loginBox.addLoginListener(new LoginListener() {
- public void onLogin(LoginBox.LoginEvent event) {
- String pw = event.getLoginParameter("password");
- String username = event.getLoginParameter("username");
- if (pw.equals("1234")) {
- setUser(username);
- currentUser.setValue(username);
- currentUser.getWindow().showNotification(
- "Logged in user: " + username);
- getMainWindow().getContent().replaceComponent(loginBox,
- mainPanel);
- el.setExpandRatio(mainPanel, 1);
- } else {
- getMainWindow().showNotification(
- "Wrong password. Hint, try '1234' ",
- Notification.TYPE_WARNING_MESSAGE);
- }
- }
- });
-
- }
-
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
index 9916ca634d..7e9f5dab2c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1365.java
@@ -4,10 +4,11 @@ import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.event.ShortcutAction;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1365 extends com.vaadin.Application implements Handler {
+public class Ticket1365 extends com.vaadin.Application.LegacyApplication
+ implements Handler {
TextField f = new TextField();
@@ -15,8 +16,8 @@ public class Ticket1365 extends com.vaadin.Application implements Handler {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(f);
@@ -32,10 +33,12 @@ public class Ticket1365 extends com.vaadin.Application implements Handler {
new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S,
new int[] { ShortcutAction.ModifierKey.CTRL }), };
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
status.setValue("Pressed " + action.getCaption()
+ " to fire shortcut. Texfield value: " + f.getValue());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
index 9df316fdcb..92d3598382 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1368.java
@@ -3,19 +3,19 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket1368 extends Application {
+public class Ticket1368 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1368");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
setMainWindow(mainWin);
t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5);
@@ -26,6 +26,7 @@ public class Ticket1368 extends Application {
addColumn.setImmediate(true);
addColumn.setNewItemsAllowed(true);
addColumn.setNewItemHandler(new ComboBox.NewItemHandler() {
+ @Override
public void addNewItem(String newItemCaption) {
t.addContainerProperty(newItemCaption, String.class, "-");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
index 282df33d89..3ba7ae2bfa 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1397.java
@@ -10,18 +10,18 @@ import com.vaadin.ui.InlineDateField;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
import com.vaadin.ui.PopupView;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1397 extends Application {
+public class Ticket1397 extends Application.LegacyApplication {
- Window main;
+ LegacyWindow main;
@Override
public void init() {
setTheme("runo");
- main = new Window("PopupView test");
+ main = new LegacyWindow("PopupView test");
setMainWindow(main);
Panel panel = new Panel("PopupTest");
@@ -30,10 +30,12 @@ public class Ticket1397 extends Application {
"fooTextField");
PopupView.Content content = new PopupView.Content() {
+ @Override
public String getMinimizedValueAsHTML() {
- return prop.toString();
+ return String.valueOf(prop.getValue());
}
+ @Override
public Component getPopupComponent() {
return new TextField("Edit foo", prop);
}
@@ -56,6 +58,7 @@ public class Ticket1397 extends Application {
public myButton() {
super("Reverse the property");
this.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
StringBuffer getContents = prop2.getValue();
getContents.reverse();
@@ -68,10 +71,12 @@ public class Ticket1397 extends Application {
final Panel panel2 = new Panel("Editor with a button");
panel2.addComponent(new myButton());
PopupView.Content content2 = new PopupView.Content() {
+ @Override
public String getMinimizedValueAsHTML() {
- return prop2.toString();
+ return String.valueOf(prop2.getValue());
}
+ @Override
public Component getPopupComponent() {
return panel2;
}
@@ -89,10 +94,12 @@ public class Ticket1397 extends Application {
panel3.addComponent(tf2);
PopupView.Content content3 = new PopupView.Content() {
+ @Override
public String getMinimizedValueAsHTML() {
- return op.toString();
+ return String.valueOf(op.getValue());
}
+ @Override
public Component getPopupComponent() {
return panel3;
}
@@ -113,10 +120,12 @@ public class Ticket1397 extends Application {
final InlineDateField df = new InlineDateField("", new Date());
PopupView pp = new PopupView(new PopupView.Content() {
+ @Override
public String getMinimizedValueAsHTML() {
- return df.toString();
+ return String.valueOf(df.getValue());
}
+ @Override
public Component getPopupComponent() {
return df;
}
@@ -130,10 +139,13 @@ public class Ticket1397 extends Application {
+ lineNum
+ " and see how the overview-version changes.");
+ @Override
public String getMinimizedValueAsHTML() {
- return "" + tf.toString().length() + " characters of info";
+ return "" + String.valueOf(tf.getValue()).length()
+ + " characters of info";
}
+ @Override
public Component getPopupComponent() {
return tf;
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
index b961c0d6b1..438f7e2d5f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1435.java
@@ -11,18 +11,19 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1435 extends Application {
+public class Ticket1435 extends Application.LegacyApplication {
private static final boolean useWorkaround = true;
@Override
public void init() {
- final Window mainWin = new Window("ButtonPanel containing a table test");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
setMainWindow(mainWin);
((AbstractOrderedLayout) mainWin.getContent()).setSpacing(true);
@@ -54,7 +55,7 @@ public class Ticket1435 extends Application {
// Last known height before the panel was collapsed
private float lastHeight = -1;
- private int lastHeightUnit = -1;
+ private Unit lastHeightUnit = null;
public ButtonPanel(String labelString) {
setCompositionRoot(root);
@@ -117,6 +118,7 @@ public class Ticket1435 extends Application {
collapse.setStyleName("collapse");
collapse.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
if (useWorkaround) {
container.setVisible(false);
@@ -143,6 +145,7 @@ public class Ticket1435 extends Application {
if (useWorkaround) {
expand.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
container.setVisible(true);
root.setHeight(lastHeight, lastHeightUnit);
@@ -162,7 +165,7 @@ public class Ticket1435 extends Application {
root.setExpandRatio(container, 1);
}
- public void setHeight(int height, int unit) {
+ public void setHeight(int height, Unit unit) {
root.setHeight(height, unit);
lastHeight = height;
lastHeightUnit = unit;
@@ -182,7 +185,7 @@ public class Ticket1435 extends Application {
root.setWidth(width);
}
- public void setWidth(int width, int unit) {
+ public void setWidth(int width, Unit unit) {
root.setWidth(width, unit);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
index 003b50240b..a597a5b242 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1444.java
@@ -1,16 +1,17 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1444 extends Application {
+public class Ticket1444 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(
+ final LegacyWindow mainWin = new LegacyWindow(
"Test app to break layout fuction in IE7");
setMainWindow(mainWin);
@@ -20,7 +21,7 @@ public class Ticket1444 extends Application {
Label red = new Label(
"<div style='background:red;width:100%;height:100%;'>??</div>",
- Label.CONTENT_XHTML);
+ ContentMode.XHTML);
red.setSizeFull();
ol.addComponent(red);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
index ff716aefc1..4b7d4201e0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1465ModalNotification.java
@@ -4,14 +4,17 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket1465ModalNotification extends Application {
+public class Ticket1465ModalNotification extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("ButtonPanel containing a table test");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "ButtonPanel containing a table test");
setMainWindow(mainWin);
final Window modal = new Window("Modal window");
@@ -20,10 +23,11 @@ public class Ticket1465ModalNotification extends Application {
Button b = new Button("click to show notification",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Notification.show(
"Try clicking the button in main window!",
- Window.Notification.TYPE_ERROR_MESSAGE);
+ Notification.TYPE_ERROR_MESSAGE);
}
});
@@ -32,10 +36,11 @@ public class Ticket1465ModalNotification extends Application {
b = new Button("click to warning notification",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Notification.show(
"Try clicking the button in main window!",
- Window.Notification.TYPE_WARNING_MESSAGE);
+ Notification.TYPE_WARNING_MESSAGE);
}
});
modal.addComponent(b);
@@ -43,16 +48,18 @@ public class Ticket1465ModalNotification extends Application {
b = new Button("click to Humanized notification",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- modal.showNotification(
+ Notification.show(
"Try clicking the button in main window!",
- Window.Notification.TYPE_HUMANIZED_MESSAGE);
+ Notification.TYPE_HUMANIZED_MESSAGE);
}
});
modal.addComponent(b);
b = new Button("click to test modality!", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mainWin.addComponent(new Label("clicked"));
@@ -65,6 +72,7 @@ public class Ticket1465ModalNotification extends Application {
b = new Button("click to test modality!", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mainWin.addComponent(new Label("clicked"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_Panel.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_Panel.java
index 0c06a24df5..9835e046dc 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_Panel.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_Panel.java
@@ -26,6 +26,7 @@ public class Ticket1506_Panel extends Panel {
private Component initButton(final ObjectProperty<?> property) {
Button button = new Button("Clear select");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
property.setValue(null);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
index a0f3070988..d6b53db7c7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer.java
@@ -38,6 +38,7 @@ public class Ticket1506_TestContainer implements Container {
items.put(ITEM_2_ID, item2);
}
+ @Override
public Item getItem(Object itemId) {
if (items.isEmpty()) {
loadItems();
@@ -45,6 +46,7 @@ public class Ticket1506_TestContainer implements Container {
return items.get(itemId);
}
+ @Override
public Collection<String> getContainerPropertyIds() {
if (items.isEmpty()) {
loadItems();
@@ -55,6 +57,7 @@ public class Ticket1506_TestContainer implements Container {
return a;
}
+ @Override
public Collection<String> getItemIds() {
if (items.isEmpty()) {
loadItems();
@@ -65,7 +68,8 @@ public class Ticket1506_TestContainer implements Container {
return a;
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ @Override
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
@@ -76,6 +80,7 @@ public class Ticket1506_TestContainer implements Container {
return null;
}
+ @Override
public Class<String> getType(Object propertyId) {
if (items.isEmpty()) {
loadItems();
@@ -83,6 +88,7 @@ public class Ticket1506_TestContainer implements Container {
return String.class;
}
+ @Override
public int size() {
if (items.isEmpty()) {
loadItems();
@@ -90,6 +96,7 @@ public class Ticket1506_TestContainer implements Container {
return items.size();
}
+ @Override
public boolean containsId(Object itemId) {
if (items.isEmpty()) {
loadItems();
@@ -97,29 +104,35 @@ public class Ticket1506_TestContainer implements Container {
return items.containsKey(itemId);
}
+ @Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeAllItems() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
index 4b296d2eda..7ac34dcd2e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java
@@ -33,6 +33,7 @@ public class Ticket1506_TestContainer2 implements Container {
}
}
+ @Override
public Item getItem(Object itemId) {
if (items.isEmpty()) {
loadItems();
@@ -40,6 +41,7 @@ public class Ticket1506_TestContainer2 implements Container {
return items.get(itemId);
}
+ @Override
public Collection<String> getContainerPropertyIds() {
if (items.isEmpty()) {
loadItems();
@@ -50,6 +52,7 @@ public class Ticket1506_TestContainer2 implements Container {
return a;
}
+ @Override
public Collection<String> getItemIds() {
if (items.isEmpty()) {
loadItems();
@@ -57,7 +60,8 @@ public class Ticket1506_TestContainer2 implements Container {
return items.keySet();
}
- public Property getContainerProperty(Object itemId, Object propertyId) {
+ @Override
+ public Property<?> getContainerProperty(Object itemId, Object propertyId) {
if (items.isEmpty()) {
loadItems();
}
@@ -68,6 +72,7 @@ public class Ticket1506_TestContainer2 implements Container {
return null;
}
+ @Override
public Class<String> getType(Object propertyId) {
if (items.isEmpty()) {
loadItems();
@@ -75,6 +80,7 @@ public class Ticket1506_TestContainer2 implements Container {
return String.class;
}
+ @Override
public int size() {
if (items.isEmpty()) {
loadItems();
@@ -82,6 +88,7 @@ public class Ticket1506_TestContainer2 implements Container {
return items.size();
}
+ @Override
public boolean containsId(Object itemId) {
if (items.isEmpty()) {
loadItems();
@@ -89,29 +96,35 @@ public class Ticket1506_TestContainer2 implements Container {
return items.containsKey(itemId);
}
+ @Override
public Item addItem(Object itemId) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public Object addItem() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeItem(Object itemId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean addContainerProperty(Object propertyId, Class<?> type,
Object defaultValue) throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeContainerProperty(Object propertyId)
throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
+ @Override
public boolean removeAllItems() throws UnsupportedOperationException {
throw new UnsupportedOperationException("Not implemented");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
index ff6d340372..1c4156d7ff 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1519.java
@@ -2,18 +2,18 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket1519 extends Application {
+public class Ticket1519 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1519");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1519");
setMainWindow(mainWin);
- mainWin.setTheme("tests-tickets");
+ setTheme("tests-tickets");
TabSheet ts = new TabSheet();
ts.addTab(new CustomLayout("Ticket1519_News"), "News", null);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
index 425a3d5ee2..b9fd2debd5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1572.java
@@ -6,9 +6,9 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1572 extends com.vaadin.Application {
+public class Ticket1572 extends com.vaadin.Application.LegacyApplication {
private Label state;
private GridLayout gl;
@@ -17,8 +17,8 @@ public class Ticket1572 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Panel p = new Panel("Test wrapper for gridlayout margin/spacing");
@@ -35,6 +35,7 @@ public class Ticket1572 extends com.vaadin.Application {
Button b = new Button("next margin state");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
nextMarginState();
}
@@ -48,6 +49,7 @@ public class Ticket1572 extends com.vaadin.Application {
Button b2 = new Button("next spacing state");
b2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
nextSpacingState();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
index e87ad848ce..6831d4c52d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1581.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1581 extends com.vaadin.Application {
+public class Ticket1581 extends com.vaadin.Application.LegacyApplication {
private Label time;
private ProgressIndicator poller;
@@ -17,8 +17,8 @@ public class Ticket1581 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new Label("Test the second issue in ticket #1581"));
@@ -52,6 +52,7 @@ public class Ticket1581 extends com.vaadin.Application {
final Button stop = new Button("Stop updating", new ClickListener() {
boolean active = true;
+ @Override
public void buttonClick(ClickEvent event) {
if (active) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
index 7074be65e4..95cc918b6e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java
@@ -6,7 +6,6 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.net.URL;
import java.util.Date;
import javax.imageio.ImageIO;
@@ -14,20 +13,22 @@ import javax.imageio.ImageIO;
import com.vaadin.Application;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.URIHandler;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1589 extends Application {
+public class Ticket1589 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
MyDynamicResource res = new MyDynamicResource();
- w.addURIHandler(res);
+ addRequestHandler(res);
w.addComponent(new Link(
"Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)",
@@ -39,7 +40,7 @@ public class Ticket1589 extends Application {
}
}
-class MyDynamicResource implements URIHandler {
+class MyDynamicResource implements RequestHandler {
String textToDisplay = (new Date()).toString();
/**
@@ -49,11 +50,15 @@ class MyDynamicResource implements URIHandler {
* Returns null if the URI does not match. Otherwise returns a download
* stream that contains the response from the server.
*/
- public DownloadStream handleURI(URL context, String relativeUri) {
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
// Catch the given URI that identifies the resource, otherwise let other
// URI handlers or the Application to handle the response.
if (!relativeUri.startsWith("myresource")) {
- return null;
+ return false;
}
// Create an image and draw some background on it.
@@ -86,9 +91,10 @@ class MyDynamicResource implements URIHandler {
downloadStream.setParameter("Content-Disposition",
"attachment; filename=\"downloadedPNG.png\"");
}
- return downloadStream;
+ downloadStream.writeTo(response);
+ return true;
} catch (IOException e) {
- return null;
+ return false;
}
}
} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
index 20f1d4d985..5cb03e77af 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java
@@ -8,11 +8,11 @@ import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.MenuBar;
import com.vaadin.ui.MenuBar.Command;
import com.vaadin.ui.MenuBar.MenuItem;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1598 extends Application {
+public class Ticket1598 extends Application.LegacyApplication {
- Window main = new Window("MenuBar test");
+ LegacyWindow main = new LegacyWindow("MenuBar test");
final MenuBar menuBar = new MenuBar();
@@ -32,6 +32,7 @@ public class Ticket1598 extends Application {
for (int i = 0; i < 5; i++) {
first.addItem(new String("Submenu item" + i), null, new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
main.showNotification("Action " + selected.getText());
}
@@ -44,6 +45,7 @@ public class Ticket1598 extends Application {
firstSubItem1.addItem(new String("Subsubmenu item" + i), null,
new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
main.showNotification("Action "
+ selected.getText());
@@ -56,6 +58,7 @@ public class Ticket1598 extends Application {
firstSubItem2.addItem(new String("Subsubmenu item" + i), null,
new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
main.showNotification("Action "
+ selected.getText());
@@ -69,6 +72,7 @@ public class Ticket1598 extends Application {
second.addItem(new String("Second submenu item" + i), null,
new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
main.showNotification("Action "
+ selected.getText());
@@ -82,6 +86,7 @@ public class Ticket1598 extends Application {
for (int i = 2; i <= 3; i++) {
(menuBar.getItems().get(i)).setCommand(new Command() {
+ @Override
public void menuSelected(MenuItem selectedItem) {
main.showNotification("Action " + selectedItem.getText());
}
@@ -92,6 +97,7 @@ public class Ticket1598 extends Application {
fourth.setText("Add new item");
fourth.setCommand(new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
menuBar.addItem("Newborn", null, null);
}
@@ -108,6 +114,7 @@ public class Ticket1598 extends Application {
// A command for removing the selected menuitem
Command removeCommand = new Command() {
+ @Override
public void menuSelected(MenuItem selected) {
MenuItem parent = selected.getParent();
if (parent != null) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
index b2998c687d..b8bf8deb20 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket161.java
@@ -5,19 +5,19 @@ import com.vaadin.data.Container;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket161 extends Application {
+public class Ticket161 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app to #1368");
+ final LegacyWindow mainWin = new LegacyWindow("Test app to #1368");
setMainWindow(mainWin);
t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 100);
@@ -27,6 +27,7 @@ public class Ticket161 extends Application {
Button b = new Button("Truncate to 20 rows");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Container containerDataSource = t.getContainerDataSource();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
index e156752450..43feab5ab7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1632.java
@@ -4,19 +4,19 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*/
-public class Ticket1632 extends Application {
+public class Ticket1632 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- final Window mainWin = new Window("Test app");
+ final LegacyWindow mainWin = new LegacyWindow("Test app");
setMainWindow(mainWin);
t = new Table();
@@ -45,6 +45,7 @@ public class Ticket1632 extends Application {
b.addListener(new Button.ClickListener() {
boolean visible = false;
+ @Override
public void buttonClick(ClickEvent event) {
visible = !visible;
if (visible) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
index 8bba5a103e..3c64a49316 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java
@@ -4,18 +4,19 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1659 extends Application {
+public class Ticket1659 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window();
+ final LegacyWindow mainWin = new LegacyWindow();
setMainWindow(mainWin);
mainWin.addComponent(new Button(
"Change URI using Application.getURL()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mainWin.open(new ExternalResource(getURL() + "#"
+ System.currentTimeMillis()));
@@ -24,6 +25,7 @@ public class Ticket1659 extends Application {
mainWin.addComponent(new Button("Change URI uring Window.getURL()",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mainWin.open(new ExternalResource(mainWin.getURL()
+ "#" + System.currentTimeMillis()));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
index 79bd22a96d..64d53e33f6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.terminal.SystemError;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1663 extends com.vaadin.Application {
+public class Ticket1663 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("#1663");
+ LegacyWindow main = new LegacyWindow("#1663");
setMainWindow(main);
TextField tf = new TextField("First name");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
index 7af141b972..277096598e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1673.java
@@ -2,17 +2,23 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1673 extends com.vaadin.Application {
+public class Ticket1673 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("#1673");
+ final LegacyWindow main = new LegacyWindow("#1673");
setMainWindow(main);
- main.addComponent(new Button("close", this, "close"));
+ main.addComponent(new Button("close", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ close();
+ }
+ }));
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
index 176f2efdd2..01792aeb89 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java
@@ -21,11 +21,11 @@ import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1710 extends com.vaadin.Application {
+public class Ticket1710 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
@@ -33,7 +33,7 @@ public class Ticket1710 extends com.vaadin.Application {
setTheme("tests-tickets");
VerticalLayout lo = new VerticalLayout();
- setMainWindow(new Window("#1710", lo));
+ setMainWindow(new LegacyWindow("#1710", lo));
lo.setMargin(true);
lo.setSpacing(true);
lo.setWidth("100%");
@@ -99,7 +99,6 @@ public class Ticket1710 extends com.vaadin.Application {
cb.setImmediate(true);
hidingControls.addComponent(cb);
elhp.setVisible(false);
- elhp.setScrollable(true);
elh.setWidth("2000px");
elh.setHeight("100px");
addFields(elh);
@@ -139,9 +138,6 @@ public class Ticket1710 extends com.vaadin.Application {
private Form getFormPanelExample() {
Form f = new Form();
f.setCaption("Test form");
- Button fb1 = new Button("Test button");
- fb1.setComponentError(new SystemError("Test error"));
- f.addField("fb1", fb1);
CheckBox fb2 = new CheckBox("Test button", true);
fb2.setComponentError(new SystemError("Test error"));
f.addField("fb2", fb2);
@@ -254,7 +250,6 @@ public class Ticket1710 extends com.vaadin.Application {
Panel controlWrapper = new Panel();
controlWrapper.addComponent(controls);
controlWrapper.setWidth("100%");
- controlWrapper.setScrollable(true);
controlWrapper.setStyleName("controls");
internalLayout.addComponent(controlWrapper);
Panel testPanel = new Panel(testPanelLayout);
@@ -284,6 +279,7 @@ public class Ticket1710 extends com.vaadin.Application {
}
Property.ValueChangeListener marginSpacingListener = new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateMarginsAndSpacing();
}
@@ -348,6 +344,7 @@ public class Ticket1710 extends com.vaadin.Application {
Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");
Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
updateAlignments(((Integer) hAlign.getValue()).intValue(),
((Integer) vAlign.getValue()).intValue());
@@ -377,6 +374,7 @@ public class Ticket1710 extends com.vaadin.Application {
Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right");
lAlign.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
testPanelLayout.setComponentAlignment(testedLayout,
((Integer) lAlign.getValue()).intValue(),
@@ -395,15 +393,13 @@ public class Ticket1710 extends com.vaadin.Application {
}
private void updateMarginsAndSpacing() {
- testedLayout.setMargin(
- ((Boolean) marginTop.getValue()).booleanValue(),
- ((Boolean) marginRight.getValue()).booleanValue(),
- ((Boolean) marginBottom.getValue()).booleanValue(),
- ((Boolean) marginLeft.getValue()).booleanValue());
+ testedLayout.setMargin(marginTop.getValue().booleanValue(),
+ marginRight.getValue().booleanValue(), marginBottom
+ .getValue().booleanValue(), marginLeft.getValue()
+ .booleanValue());
if (testedLayout instanceof Layout.SpacingHandler) {
- ((Layout.SpacingHandler) testedLayout)
- .setSpacing(((Boolean) spacing.getValue())
- .booleanValue());
+ ((Layout.SpacingHandler) testedLayout).setSpacing(spacing
+ .getValue().booleanValue());
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
index f45fe88889..ccd649c542 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java
@@ -7,10 +7,10 @@ import com.vaadin.terminal.Resource;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1737 extends Application {
+public class Ticket1737 extends Application.LegacyApplication {
Resource slowRes = new ClassResource(Ticket1737.class, "m-bullet-blue.gif",
this) {
@@ -28,8 +28,8 @@ public class Ticket1737 extends Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
VerticalLayout el = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
index 92fbddeeb3..bf57118a8c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1767.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1767 extends com.vaadin.Application {
+public class Ticket1767 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
ComboBox cb = new ComboBox(" '<' item is not seen in populist?");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
index 7cf3483277..2cbb648227 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1772.java
@@ -3,16 +3,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1772 extends com.vaadin.Application {
+public class Ticket1772 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Button b = new Button("Add content");
@@ -24,6 +24,7 @@ public class Ticket1772 extends com.vaadin.Application {
b.addListener(new Button.ClickListener() {
int counter = 0;
+ @Override
public void buttonClick(ClickEvent event) {
gridLayout
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
index de841288e8..63af96b1a2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1775.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1775 extends com.vaadin.Application {
+public class Ticket1775 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("#1775");
+ final LegacyWindow main = new LegacyWindow("#1775");
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
String layoutName = "Ticket1775";
final CustomLayout layout = new CustomLayout(layoutName);
@@ -27,6 +27,7 @@ public class Ticket1775 extends com.vaadin.Application {
button2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Label mainComponent = new Label("Main");
Label header = new Label("Header");
@@ -34,6 +35,7 @@ public class Ticket1775 extends com.vaadin.Application {
layout.addComponent(mainComponent, "body");
layout.addComponent(header, "loginUser");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
layout.addComponent(anotherComponent, "body");
layout.removeComponent("loginUser");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
index e22fbe90ee..0a89675fc0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java
@@ -5,22 +5,24 @@ import java.util.LinkedList;
import com.vaadin.data.Validator;
import com.vaadin.data.util.MethodProperty;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.SystemError;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class Ticket1804 extends com.vaadin.Application {
+public class Ticket1804 extends com.vaadin.Application.LegacyApplication {
LinkedList<Select> listOfAllFields = new LinkedList<Select>();
@Override
public void init() {
- final Window main = new Window("#1804");
+ final LegacyWindow main = new LegacyWindow("#1804");
setMainWindow(main);
com.vaadin.ui.Select s;
@@ -89,11 +91,12 @@ public class Ticket1804 extends com.vaadin.Application {
main.addComponent(checkValidity);
checkValidity.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
if (af.isValid()) {
@@ -105,9 +108,8 @@ public class Ticket1804 extends com.vaadin.Application {
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.setScrollable(true);
w.setHeight("80%");
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
@@ -127,7 +129,7 @@ public class Ticket1804 extends com.vaadin.Application {
}
/** Throws an exception when the string is empty or null. */
- class EmptyStringValidator implements Validator {
+ static class EmptyStringValidator implements Validator {
String msg;
@@ -135,12 +137,9 @@ public class Ticket1804 extends com.vaadin.Application {
this.msg = msg;
}
- public boolean isValid(Object value) {
- return !(value == null || value.toString().length() == 0);
- }
-
+ @Override
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || value.toString().length() == 0) {
throw new InvalidValueException(msg);
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
index d2407aae39..a40f5b25b9 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1805.java
@@ -7,15 +7,15 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1805 extends com.vaadin.Application {
+public class Ticket1805 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
((Layout) main.getContent()).setMargin(false);
@@ -30,6 +30,7 @@ public class Ticket1805 extends com.vaadin.Application {
final TextField size = new TextField("Grid width in css unit");
size.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
String width = size.getValue().toString();
if (width == null || width.equals("")) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
index c403a8242c..2c979f4600 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1806.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.data.util.ObjectProperty;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1806 extends com.vaadin.Application {
+public class Ticket1806 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
final ObjectProperty<String> prop = new ObjectProperty<String>("");
@@ -25,18 +25,21 @@ public class Ticket1806 extends com.vaadin.Application {
"This button does nothing (but flushes queued variable changes)"));
main.addComponent(new Button("Commit the field to property",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
tf1.commit();
}
}));
main.addComponent(new Button("Show property value",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
main.showNotification("'" + prop.getValue() + "'");
}
}));
main.addComponent(new Button("Show field value",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
main.showNotification("'" + tf1.getValue() + "'");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
index 6cbf37541c..695be19300 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1811.java
@@ -5,20 +5,22 @@ import java.util.LinkedList;
import com.vaadin.data.Validator;
import com.vaadin.data.validator.StringLengthValidator;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Window;
-public class Ticket1811 extends com.vaadin.Application {
+public class Ticket1811 extends com.vaadin.Application.LegacyApplication {
LinkedList<TextField> listOfAllFields = new LinkedList<TextField>();
@Override
public void init() {
- final Window main = new Window("#1811");
+ final LegacyWindow main = new LegacyWindow("#1811");
setMainWindow(main);
Validator strLenValidator = new StringLengthValidator(
@@ -54,6 +56,7 @@ public class Ticket1811 extends com.vaadin.Application {
main.addComponent(checkValidity);
checkValidity.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
StringBuffer msg = new StringBuffer();
for (Iterator<TextField> i = listOfAllFields.iterator(); i
@@ -69,7 +72,7 @@ public class Ticket1811 extends com.vaadin.Application {
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
index 97357d8d2c..42474d748d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1819.java
@@ -3,21 +3,23 @@ package com.vaadin.tests.tickets;
import java.util.Iterator;
import java.util.LinkedList;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.AbstractField;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.Window;
-public class Ticket1819 extends com.vaadin.Application {
+public class Ticket1819 extends com.vaadin.Application.LegacyApplication {
LinkedList<Select> listOfAllFields = new LinkedList<Select>();
@Override
public void init() {
- final Window main = new Window("#1819");
+ final LegacyWindow main = new LegacyWindow("#1819");
setMainWindow(main);
com.vaadin.ui.Select s;
@@ -45,17 +47,18 @@ public class Ticket1819 extends com.vaadin.Application {
main.addComponent(checkValidity);
checkValidity.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
StringBuffer msg = new StringBuffer();
for (Iterator<Select> i = listOfAllFields.iterator(); i
.hasNext();) {
- AbstractField af = i.next();
+ AbstractField<?> af = i.next();
msg.append("<h1>" + af.getCaption() + "</h1>\n");
msg.append("Value=" + af.getValue() + "<br/>\n");
}
Window w = new Window("Status of the fields");
w.setModal(true);
- w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML));
+ w.addComponent(new Label(msg.toString(), ContentMode.XHTML));
main.addWindow(w);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
index 824447b6a9..de91b04c1c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java
@@ -6,9 +6,10 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1834PanelScrolling extends com.vaadin.Application {
+public class Ticket1834PanelScrolling extends
+ com.vaadin.Application.LegacyApplication {
private static final int ROWS = 50;
@@ -18,8 +19,8 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
HorizontalLayout currentState = new HorizontalLayout();
@@ -28,6 +29,7 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
Button b = new Button("update");
currentState.addComponent(b);
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
state.setValue("ScrollTop: " + p.getScrollTop()
+ " ScrollLeft: " + p.getScrollLeft());
@@ -37,6 +39,7 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
b = new Button("ScrollBy 50px");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.setScrollLeft(p.getScrollLeft() + 50);
p.setScrollTop(p.getScrollTop() + 50);
@@ -51,6 +54,7 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
b.addListener(new ClickListener() {
int i = 0;
+ @Override
public void buttonClick(ClickEvent event) {
p.addComponent(new Label("new Row" + ++i));
}
@@ -60,6 +64,7 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
b = new Button("Repaint Panel");
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.requestRepaint();
}
@@ -68,7 +73,6 @@ public class Ticket1834PanelScrolling extends com.vaadin.Application {
main.addComponent(b);
p = new Panel("TestPanel");
- p.setScrollable(true);
for (int i = 0; i < ROWS; i++) {
p.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
index f82467b519..4b546de0f6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1857.java
@@ -7,11 +7,12 @@ import com.vaadin.event.Action;
import com.vaadin.event.Action.Handler;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1857 extends Application implements Handler {
+public class Ticket1857 extends Application.LegacyApplication implements
+ Handler {
@Override
public void init() {
@@ -19,7 +20,7 @@ public class Ticket1857 extends Application implements Handler {
setTheme("tests-tickets");
VerticalLayout el = new VerticalLayout();
- Window main = new Window("Testcase for #1857", el);
+ LegacyWindow main = new LegacyWindow("Testcase for #1857", el);
setMainWindow(main);
el.setMargin(true);
el.setSpacing(true);
@@ -40,8 +41,9 @@ public class Ticket1857 extends Application implements Handler {
footer.addComponent(actionHandlerEnabler);
actionHandlerEnabler.setImmediate(true);
actionHandlerEnabler.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- if (((Boolean) actionHandlerEnabler.getValue()).booleanValue()) {
+ if (actionHandlerEnabler.getValue().booleanValue()) {
t.addActionHandler(Ticket1857.this);
} else {
t.removeActionHandler(Ticket1857.this);
@@ -53,9 +55,11 @@ public class Ticket1857 extends Application implements Handler {
footer.addComponent(cellStylesEnabler);
cellStylesEnabler.setImmediate(true);
cellStylesEnabler.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- if (((Boolean) cellStylesEnabler.getValue()).booleanValue()) {
+ if (cellStylesEnabler.getValue().booleanValue()) {
t.setCellStyleGenerator(new Table.CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
Object cell = t.getContainerProperty(itemId,
propertyId).getValue();
@@ -98,10 +102,12 @@ public class Ticket1857 extends Application implements Handler {
private final Action removeAction = new Action("Remove");
+ @Override
public Action[] getActions(Object target, Object sender) {
return new Action[] { removeAction };
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
getMainWindow().showNotification("Removing row number:" + target);
((Table) sender).removeItem(target);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
index fe32dbc775..1af0ed2041 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1868.java
@@ -1,14 +1,14 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1868 extends com.vaadin.Application {
+public class Ticket1868 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window("#1868"));
+ setMainWindow(new LegacyWindow("#1868"));
Panel p = new Panel(
"This is a really long caption for the panel, too long in fact!");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
index 9c2fdb762d..d51c0990ae 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1869.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1869 extends com.vaadin.Application {
+public class Ticket1869 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
GridLayout lo = new GridLayout(2, 1);
- setMainWindow(new Window("#1869", lo));
+ setMainWindow(new LegacyWindow("#1869", lo));
lo.setMargin(true);
lo.setSpacing(true);
@@ -32,7 +32,6 @@ public class Ticket1869 extends com.vaadin.Application {
lo.addComponent(elp);
elp.setWidth("300px");
elp.setHeight("300px");
- elp.setScrollable(true);
HorizontalLayout elh = new HorizontalLayout();
Panel elph = new Panel(
@@ -49,7 +48,6 @@ public class Ticket1869 extends com.vaadin.Application {
lo.addComponent(elph);
elph.setWidth("300px");
elph.setHeight("300px");
- elph.setScrollable(true);
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
index 0cacb603fc..0a8992c17f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java
@@ -23,11 +23,11 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1878 extends Application {
+public class Ticket1878 extends Application.LegacyApplication {
private Layout orderedLayout;
private Layout gridLayout;
@@ -39,7 +39,7 @@ public class Ticket1878 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
@@ -52,6 +52,7 @@ public class Ticket1878 extends Application {
switchToGridButton = new Button("Switch to GridLayout",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
changeLayout(switchToGridButton, gridLayout);
}
@@ -60,6 +61,7 @@ public class Ticket1878 extends Application {
switchToOrderedButton = new Button("Switch to OrderedLayout",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
changeLayout(switchToOrderedButton, orderedLayout);
}
@@ -69,6 +71,7 @@ public class Ticket1878 extends Application {
switchToFormsButton = new Button("Switch to Form", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
changeLayout(switchToFormsButton, formLayout);
}
@@ -184,7 +187,7 @@ public class Ticket1878 extends Application {
form.setItemDataSource(item);
for (Iterator<?> i = item.getItemPropertyIds().iterator(); i.hasNext();) {
Object property = i.next();
- Field f = form.getField(property);
+ Field<?> f = form.getField(property);
f.setRequired(r.nextBoolean());
if (r.nextBoolean()) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
index 2047b4698c..9fe8ccd801 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1900.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1900 extends Application {
+public class Ticket1900 extends Application.LegacyApplication {
TextField f[] = new TextField[5];
- Window main = new Window("#1900 test");
+ LegacyWindow main = new LegacyWindow("#1900 test");
@Override
public void init() {
@@ -24,6 +24,7 @@ public class Ticket1900 extends Application {
f[i].setRequired(true);
main.addComponent(f[i]);
f[i].addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
main.showNotification("Validity test", "Testcase " + j
+ " is " + (f[j].isValid() ? "valid" : "invalid"));
@@ -53,19 +54,16 @@ public class Ticket1900 extends Application {
}
- class ContainsValidator implements Validator {
+ static class ContainsValidator implements Validator {
private final String c;
public ContainsValidator(String c) {
this.c = c;
}
- public boolean isValid(Object value) {
- return value != null && value.toString().contains(c);
- }
-
+ @Override
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || !value.toString().contains(c)) {
throw new InvalidValueException("Value does not contain " + c);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
index 1d79158333..2837d71e67 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1904.java
@@ -5,14 +5,14 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1904 extends Application {
+public class Ticket1904 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window("#1904"));
+ setMainWindow(new LegacyWindow("#1904"));
setTheme("tests-tickets");
addOL("defaults", null, false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
index d340bf144a..790d3aa931 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java
@@ -4,10 +4,10 @@ import com.vaadin.Application;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket1916 extends Application {
+public class Ticket1916 extends Application.LegacyApplication {
@Override
public void init() {
@@ -21,7 +21,7 @@ public class Ticket1916 extends Application {
test.addComponent(tf);
test.setComponentAlignment(tf, Alignment.MIDDLE_CENTER);
- Window w = new Window("Test #1916", test);
+ LegacyWindow w = new LegacyWindow("Test #1916", test);
setMainWindow(w);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
index 70bc0e1211..75a2aafb96 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1919.java
@@ -1,23 +1,24 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1919 extends com.vaadin.Application {
+public class Ticket1919 extends com.vaadin.Application.LegacyApplication {
private GridLayout lo;
private boolean on = true;
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
lo = new GridLayout(2, 2);
lo.setSizeFull();
@@ -46,8 +47,13 @@ public class Ticket1919 extends com.vaadin.Application {
Panel p = new Panel();
p.setSizeFull();
- Button b = new Button("toggle Values", this, "toggleStyleName");
+ Button b = new Button("toggle Values", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ toggleStyleName();
+ }
+ });
p.addComponent(b);
return p;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
index 71c45c34ce..416bb80875 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java
@@ -1,15 +1,20 @@
package com.vaadin.tests.tickets;
+import java.io.IOException;
import java.util.Map;
import com.vaadin.Application;
-import com.vaadin.terminal.ParameterHandler;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1921 extends Application implements ParameterHandler {
+public class Ticket1921 extends Application.LegacyApplication implements
+ RequestHandler {
int state = -1;
int round = 1;
@@ -20,11 +25,16 @@ public class Ticket1921 extends Application implements ParameterHandler {
public void init() {
outer = new VerticalLayout();
- setMainWindow(new Window("#1921", outer));
+ setMainWindow(new LegacyWindow("#1921", outer));
setTheme("tests-tickets");
inner = new VerticalLayout();
outer.addComponent(inner);
- button = new Button("foo", this, "newState");
+ button = new Button("foo", new Button.ClickListener() {
+ @Override
+ public void buttonClick(ClickEvent event) {
+ newState();
+ }
+ });
inner.addComponent(button);
outer.setStyleName("red");
@@ -32,7 +42,7 @@ public class Ticket1921 extends Application implements ParameterHandler {
newState();
- getMainWindow().addParameterHandler(this);
+ addRequestHandler(this);
}
public void newState() {
@@ -83,14 +93,18 @@ public class Ticket1921 extends Application implements ParameterHandler {
}
}
- public void handleParameters(Map<String, String[]> parameters) {
+ @Override
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ Map<String, String[]> parameters = request.getParameterMap();
String[] s = parameters.get("state");
if (s == null || s.length != 1) {
- return;
+ return false;
}
String v[] = s[0].split("\\.");
if (v == null || v.length != 2) {
- return;
+ return false;
}
try {
int rr = Integer.parseInt(v[0]);
@@ -98,12 +112,13 @@ public class Ticket1921 extends Application implements ParameterHandler {
if (rr < round || (rr == round && rs < state)) {
getMainWindow().showNotification(
"Already past requested " + s[0]);
- return;
+ return false;
}
while (round < rr || state < rs) {
newState();
}
} catch (NumberFormatException ignored) {
}
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
index 9ea952a2b5..17a7dacf26 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1923.java
@@ -2,10 +2,10 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1923 extends com.vaadin.Application {
+public class Ticket1923 extends com.vaadin.Application.LegacyApplication {
private static final int ROWS = 50;
@@ -13,13 +13,12 @@ public class Ticket1923 extends com.vaadin.Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
p = new Panel("TestPanel 250x300");
// p.getLayout().setWidth("100%");
- p.setScrollable(true);
// p.setContent(new GridLayout(1, 100));
for (int i = 0; i < ROWS; i++) {
p.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java
deleted file mode 100644
index 11621c7fa9..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Button.ClickListener;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
-
-public class Ticket1924ThemeChanging extends com.vaadin.Application {
-
- private Label l = new Label("Background should be red with test theme");
-
- @SuppressWarnings("unused")
- private Panel p;
-
- @Override
- public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
- setMainWindow(main);
-
- l.setStyleName("red");
- main.addComponent(l);
-
- Button b = new Button("Toggle tests-tickets theme");
- b.addListener(new ClickListener() {
- boolean flag = false;
-
- public void buttonClick(ClickEvent event) {
- if (flag == !flag) {
- main.setTheme("tests-tickets");
- } else {
- main.setTheme(null);
- }
- }
- });
-
- main.addComponent(b);
-
- b = new Button("Modify caption (should not reload page)");
- b.addListener(new ClickListener() {
- public void buttonClick(ClickEvent event) {
- main.setCaption(main.getCaption() + ".");
- }
- });
-
- main.addComponent(b);
-
- }
-} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
index bb15f2c80e..91ea8c0c44 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1925.java
@@ -1,13 +1,13 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1925 extends Application {
+public class Ticket1925 extends Application.LegacyApplication {
@Override
public void init() {
- Window mainWindow = new Window("Test åäö");
+ LegacyWindow mainWindow = new LegacyWindow("Test åäö");
setMainWindow(mainWindow);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
index 2970335d83..48d8ff458c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1939.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1939 extends Application {
+public class Ticket1939 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
@@ -26,6 +26,7 @@ public class Ticket1939 extends Application {
w.addComponent(new Button("show me the bug",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
l.setWidth(null);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
index a3264ecba4..10eebe4cba 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1940.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1940 extends Application {
+public class Ticket1940 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window(getClass().getName());
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
index 43e7f10220..a832401cd0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1953.java
@@ -4,9 +4,9 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1953 extends Application {
+public class Ticket1953 extends Application.LegacyApplication {
public static final String cellStyle = "test-cell";
public static final String colHeadStyle = "test-col-head";
public static final String headingStyle = "test-heading";
@@ -16,11 +16,11 @@ public class Ticket1953 extends Application {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
GridLayout gl = new GridLayout(5, 5);
gl.setStyleName("borders");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
index 2245be0057..d461ffe4e3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966.java
@@ -9,14 +9,14 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966 extends Application {
+public class Ticket1966 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-tickets");
w.setContent(new GridLayout(2, 2));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
index 2d287ecdd4..85b802d46c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_2.java
@@ -9,14 +9,14 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966_2 extends Application {
+public class Ticket1966_2 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
w.setContent(new GridLayout(2, 2));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
index e6953d4193..cfc9825b58 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java
@@ -6,15 +6,15 @@ import com.vaadin.terminal.UserError;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1966_3 extends Application {
+public class Ticket1966_3 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
index ffe099b067..2a29113829 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java
@@ -5,17 +5,17 @@ import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1969 extends com.vaadin.Application {
+public class Ticket1969 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.getContent().setSizeFull();
@@ -46,6 +46,7 @@ public class Ticket1969 extends com.vaadin.Application {
b = new Button(
"change introduction caption (should add * to tab name)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
testContent.setCaption(testContent.getCaption() + "*");
}
@@ -54,6 +55,7 @@ public class Ticket1969 extends com.vaadin.Application {
b = new Button("change tab caption (should add * to tab name)",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
actions.setCaption(actions.getCaption() + "*");
}
@@ -64,6 +66,7 @@ public class Ticket1969 extends com.vaadin.Application {
final UserError e = new UserError("Test error");
b = new Button("Toggle error", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (testContent.getComponentError() == null) {
testContent.setComponentError(e);
@@ -75,6 +78,7 @@ public class Ticket1969 extends com.vaadin.Application {
actions.addComponent(b);
b = new Button("Change table caption", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
t.setCaption(t.getCaption() + "*");
}
@@ -82,6 +86,7 @@ public class Ticket1969 extends com.vaadin.Application {
actions.addComponent(b);
b = new Button("Toggle Table error", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (t.getComponentError() == null) {
t.setComponentError(e);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
index 1442c9ea5b..f9f098a05a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1970.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import java.util.Iterator;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.CloseEvent;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1970 extends Application {
+public class Ticket1970 extends Application.LegacyApplication {
@Override
public void init() {
@@ -17,10 +17,10 @@ public class Ticket1970 extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
@@ -29,8 +29,8 @@ public class Ticket1970 extends Application {
return w;
}
- private Window createExtraWindow(String name) {
- final Window w = new Window("Extra window: " + name);
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
w.setName(name);
addWindow(w);
w.addComponent(new Label(
@@ -38,41 +38,38 @@ public class Ticket1970 extends Application {
w.addComponent(new Button("Show open windows",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
String openWindows = "";
- for (Iterator<Window> i = getWindows().iterator(); i
+ for (Iterator<LegacyWindow> i = getWindows().iterator(); i
.hasNext();) {
- Window t = i.next();
+ LegacyWindow t = i.next();
openWindows += (openWindows.length() > 0 ? "," : "")
+ t.getName();
}
w.showNotification(openWindows);
}
}));
- w.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- removeWindow(w);
- }
- });
return w;
}
- private Window createWindow() {
- final Window w = new Window();
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
w.addComponent(new Button("Show the name of the application",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
w.showNotification("Name of this window = "
+ w.getName());
}
}));
w.addComponent(new Label("<a href='" + getURL().toExternalForm() + "'>"
- + getURL().toExternalForm() + "</a>", Label.CONTENT_XHTML));
+ + getURL().toExternalForm() + "</a>", ContentMode.XHTML));
w.addComponent(new Label(
"<h2>How to reproduce</h2>Open the above link in another browser"
+ " window and then press the Show-button on this window.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return w;
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
index 62b001bbda..fd77343259 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1972.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1972 extends Application {
+public class Ticket1972 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
setTheme("tests-ticket");
GridLayout layout = new GridLayout(3, 3);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
index 9629c4507b..24d11e6569 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973.java
@@ -4,13 +4,13 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1973 extends com.vaadin.Application {
+public class Ticket1973 extends com.vaadin.Application.LegacyApplication {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
@@ -30,6 +30,7 @@ public class Ticket1973 extends com.vaadin.Application {
Button refreshTable = new Button("Change table container");
refreshTable.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent e) {
table.setContainerDataSource(container2);
table.setContainerDataSource(container1);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
index 5cffdbd5db..68307f7f99 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1973_2.java
@@ -5,12 +5,12 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket1973_2 extends Application {
- Window main = new Window();
+public class Ticket1973_2 extends Application.LegacyApplication {
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
@@ -31,6 +31,7 @@ public class Ticket1973_2 extends Application {
Button refreshTable = new Button("Change table container");
refreshTable.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent e) {
table.setContainerDataSource(container2);
table.setContainerDataSource(container1);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
index 4f4376721a..e959098765 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1975.java
@@ -11,16 +11,16 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1975 extends Application {
+public class Ticket1975 extends Application.LegacyApplication {
private CustomLayout cl1;
private CustomLayout cl2;
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
setTheme("tests-tickets");
GridLayout layout = new GridLayout(1, 10);
@@ -38,6 +38,7 @@ public class Ticket1975 extends Application {
layout.addComponent(new Button("Disable/Enable",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
boolean e = cl1.isEnabled();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
index 53e5630353..fe0b636c56 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1982.java
@@ -10,15 +10,15 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket1982 extends Application {
+public class Ticket1982 extends Application.LegacyApplication {
private List<TitleBar> components = new ArrayList<TitleBar>();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
GridLayout gl = new GridLayout(2, 2);
@@ -62,6 +62,7 @@ public class Ticket1982 extends Application {
min.setVisible(false);
max.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
min.setVisible(true);
max.setVisible(false);
@@ -71,6 +72,7 @@ public class Ticket1982 extends Application {
}
});
min.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
min.setVisible(false);
max.setVisible(true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
index fbab5c5244..4deb5020ab 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java
@@ -1,25 +1,26 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.terminal.Sizeable;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Test class for ticket 1983
*/
-public class Ticket1983 extends Application {
+public class Ticket1983 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Test for ticket 1983");
+ LegacyWindow main = new LegacyWindow("Test for ticket 1983");
main.setContent(new TestLayout());
setMainWindow(main);
}
@@ -33,7 +34,6 @@ public class Ticket1983 extends Application {
public TestLayout() {
setSplitPosition(200, Sizeable.UNITS_PIXELS);
- setMargin(false);
setLocked(true);
final HorizontalSplitPanel leftSide = initLeftSide();
@@ -83,6 +83,7 @@ public class Ticket1983 extends Application {
Button button = new Button("Change col value to short");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
// Change the column value to a short one --> Should remove
// the scrollbar
@@ -114,11 +115,12 @@ public class Ticket1983 extends Application {
ol.addComponent(button);
leftSide.setFirstComponent(ol);
- button = new CheckBox("Two col");
- button.addListener(new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
- Button b = event.getButton();
- if (((Boolean) b.getValue()).booleanValue()) {
+ CheckBox checkBox = new CheckBox("Two col");
+ checkBox.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
+ if ((Boolean) event.getProperty().getValue()) {
table.setVisibleColumns(new Object[] { propId, propId2 });
} else {
table.setVisibleColumns(new Object[] { propId });
@@ -127,7 +129,7 @@ public class Ticket1983 extends Application {
}
});
- ol.addComponent(button);
+ ol.addComponent(checkBox);
return leftSide;
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
index 44d4632427..88ebad933f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1986.java
@@ -8,15 +8,15 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.ListSelect;
import com.vaadin.ui.NativeSelect;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.TwinColSelect;
-import com.vaadin.ui.Window;
-public class Ticket1986 extends Application {
+public class Ticket1986 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
int index = 1;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
index d2aca84848..72866a3ee8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1991.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket1991 extends com.vaadin.Application {
+public class Ticket1991 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Table t = new Table("Test table");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
index 8b66c7f012..2aaacef448 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1995.java
@@ -7,17 +7,17 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.filter.SimpleStringFilter;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket1995 extends Application {
+public class Ticket1995 extends Application.LegacyApplication {
private static final Object PROPERTY_1 = "Test";
private Table table;
@Override
public void init() {
- final Window mainWin = new Window(getClass().getName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass().getName());
setMainWindow(mainWin);
table = new Table();
@@ -40,6 +40,7 @@ public class Ticket1995 extends Application {
mainWin.addComponent(new Button("Add item",
new com.vaadin.ui.Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
addItem();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
index 55fee95de3..061fc0cf16 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket20.java
@@ -4,43 +4,29 @@ import com.vaadin.Application;
import com.vaadin.data.Validator;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.data.validator.CompositeValidator;
+import com.vaadin.data.validator.CompositeValidator.CombinationMode;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket20 extends Application {
+public class Ticket20 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for #20");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #20");
setMainWindow(mainWin);
final TextField tx = new TextField("Integer");
mainWin.addComponent(tx);
tx.setImmediate(true);
CompositeValidator v = new CompositeValidator();
+ v.addValidator(new IntegerValidator("{0} is not a number"));
v.addValidator(new Validator() {
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException(value + " is not a number");
- }
- }
- });
- v.addValidator(new Validator() {
-
- public boolean isValid(Object value) {
+ private boolean isValid(Object value) {
try {
int i = Integer.parseInt("" + value);
if (i < 0) {
@@ -52,6 +38,7 @@ public class Ticket20 extends Application {
}
}
+ @Override
public void validate(Object value) throws InvalidValueException {
if (!isValid(value)) {
throw new InvalidValueException(value
@@ -59,17 +46,13 @@ public class Ticket20 extends Application {
}
}
});
- CompositeValidator v2 = new CompositeValidator(
- CompositeValidator.MODE_OR, null);
+ CompositeValidator v2 = new CompositeValidator(CombinationMode.OR, null);
v2.addValidator(v);
v2.addValidator(new Validator() {
- public boolean isValid(Object value) {
- return "".equals("" + value);
- }
-
+ @Override
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (!"".equals("" + value)) {
throw new InvalidValueException("Value is not empty string");
}
}
@@ -88,6 +71,7 @@ public class Ticket20 extends Application {
mainWin.addComponent(new Button("Validate integer",
new Button.ClickListener() {
+ @Override
public void buttonClick(
com.vaadin.ui.Button.ClickEvent event) {
mainWin.showNotification("The field is "
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
index 4796451dc0..8c7a7ba659 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2001.java
@@ -5,14 +5,14 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2001 extends Application {
+public class Ticket2001 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window(getClass().getName());
+ final LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
final VerticalLayout l = new VerticalLayout();
@@ -22,8 +22,9 @@ public class Ticket2001 extends Application {
final CheckBox b = new CheckBox("fixed width: 30px", false);
b.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- if (b.booleanValue()) {
+ if ((Boolean) b.getValue()) {
l.setWidth("30px");
} else {
l.setWidth(null);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
index 2776fbc3b4..2c4a948cea 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2002.java
@@ -3,10 +3,10 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2002 extends Application {
+public class Ticket2002 extends Application.LegacyApplication {
private Long long1 = new Long(1L);
private Long long2 = new Long(2L);
@@ -28,7 +28,7 @@ public class Ticket2002 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
index 84dafb41f3..e0b8635f32 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java
@@ -4,22 +4,23 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2007 extends Application {
+public class Ticket2007 extends Application.LegacyApplication {
int childs = 0;
@Override
public void init() {
- final Window main = new Window("Main window for #2007");
+ final LegacyWindow main = new LegacyWindow("Main window for #2007");
setMainWindow(main);
main.addComponent(new Button("Open another (non-main) window",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
- Window c = new Window("Non-main browser window "
- + (++childs));
+ LegacyWindow c = new LegacyWindow(
+ "Non-main browser window " + (++childs));
addWindow(c);
main.open(new ExternalResource(c.getURL()), "_new");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
index b1138acc08..68cf5ef6d4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2009.java
@@ -8,20 +8,21 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.Tree;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2009 extends com.vaadin.Application {
+public class Ticket2009 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
HorizontalLayout ol = new HorizontalLayout();
@@ -39,6 +40,7 @@ public class Ticket2009 extends com.vaadin.Application {
final VerticalLayout events = new VerticalLayout();
t.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
events.addComponent(new Label(new Label("Click:"
+ (event.isDoubleClick() ? "double" : "single")
@@ -61,6 +63,7 @@ public class Ticket2009 extends com.vaadin.Application {
.getTestTable(5, 100);
table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID);
table.addListener(new ItemClickEvent.ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
events2.addComponent(new Label("Click:"
+ (event.isDoubleClick() ? "double" : "single")
@@ -114,6 +117,7 @@ public class Ticket2009 extends com.vaadin.Application {
getMainWindow().addWindow(this);
done.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().removeWindow(PropertyEditor.this);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
index 0cfa642ff4..e8113b0cea 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2011.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
-import com.vaadin.ui.Window;
-public class Ticket2011 extends Application {
+public class Ticket2011 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-ticket");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
index e4cf36b084..8d9a5e67d4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2014.java
@@ -9,9 +9,9 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2014 extends Application {
+public class Ticket2014 extends Application.LegacyApplication {
private HorizontalLayout innerLayout1;
private Button b1;
@@ -19,7 +19,7 @@ public class Ticket2014 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getName());
+ LegacyWindow w = new LegacyWindow(getClass().getName());
setMainWindow(w);
// setTheme("tests-ticket");
GridLayout layout = new GridLayout(10, 10);
@@ -33,6 +33,7 @@ public class Ticket2014 extends Application {
layout.addComponent(new Button("Change class name",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
b1.setStyleName(UUID.randomUUID().toString());
}
@@ -51,6 +52,7 @@ public class Ticket2014 extends Application {
b1 = new Button("Button inside orderedLayout", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
System.out.println("Clicked " + event.getButton().getCaption());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
index 9f37ddfef3..c36bb5c25e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2021.java
@@ -10,11 +10,11 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2021 extends Application {
+public class Ticket2021 extends Application.LegacyApplication {
private TextArea tf1, tf2, tf3;
@@ -26,7 +26,7 @@ public class Ticket2021 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
w.setContent(new GridLayout(2, 2));
setMainWindow(w);
@@ -111,6 +111,7 @@ public class Ticket2021 extends Application {
Button b = new Button("Enable/disable caption and watch button move",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
System.out.println("Enable/disable caption");
for (AbstractComponent l : new AbstractComponent[] {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
index 501f11e0b4..bc97f906b1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2022.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2022 extends Application {
+public class Ticket2022 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
CustomLayout l;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
index ac80ef602b..427a55391b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2023.java
@@ -4,16 +4,16 @@ import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2023 extends com.vaadin.Application implements
- Button.ClickListener {
+public class Ticket2023 extends com.vaadin.Application.LegacyApplication
+ implements Button.ClickListener {
AbstractComponent c = new Button();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
String[] sizes = { "20", "100", "1", "0", "-1", "", "z" };
@@ -31,6 +31,7 @@ public class Ticket2023 extends com.vaadin.Application implements
gl.addComponent(new Button("null", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
c.setWidth(null);
c.setHeight(null);
@@ -43,6 +44,7 @@ public class Ticket2023 extends com.vaadin.Application implements
}
+ @Override
public void buttonClick(ClickEvent event) {
c.setWidth(event.getButton().getCaption());
c.setHeight(event.getButton().getCaption());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
index 41c7fd96f1..e7cabbca95 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2024.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2024 extends Application {
+public class Ticket2024 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
index aa23572e0a..6d608ad529 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2026.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2026 extends Application {
+public class Ticket2026 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout layout = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
index f13b57d110..8acf4f1d16 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java
@@ -11,12 +11,12 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2029 extends Application {
+public class Ticket2029 extends Application.LegacyApplication {
int COMPONENTS;
int DIM1, DIM2;
@@ -28,7 +28,7 @@ public class Ticket2029 extends Application {
DIM1 = 504;
DIM2 = 100;
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
Panel p = createPanel();
@@ -81,6 +81,7 @@ public class Ticket2029 extends Application {
tf.setImmediate(true);
tf.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
Component c = ((Component) event.getProperty());
c.setCaption("askfdj");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
index 782cbd06c2..c979898299 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2037.java
@@ -4,14 +4,14 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2037 extends com.vaadin.Application {
+public class Ticket2037 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(new Label(
@@ -25,6 +25,7 @@ public class Ticket2037 extends com.vaadin.Application {
main.addComponent(lo);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
repopupate(lo);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
index 85a5a4b701..fa4cd76f47 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2038.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class Ticket2038 extends Application {
+public class Ticket2038 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Testing for #2038");
+ final LegacyWindow w = new LegacyWindow("Testing for #2038");
setMainWindow(w);
final TextField tf = new TextField(
@@ -21,6 +21,7 @@ public class Ticket2038 extends Application {
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ "valid, with error: " + tf.getErrorMessage(),
@@ -35,8 +36,9 @@ public class Ticket2038 extends Application {
w.addComponent(b);
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ tf.setRequiredError((Boolean) b.getValue() ? "Field must not be empty"
: null);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
index 35210ebaa4..ac8928d110 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2040.java
@@ -3,17 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2040 extends com.vaadin.Application {
+public class Ticket2040 extends com.vaadin.Application.LegacyApplication {
TextField f = new TextField();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
index 1714a93f82..d79f4a1bd6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2042.java
@@ -6,14 +6,14 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2042 extends Application {
+public class Ticket2042 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(1, 2);
@@ -26,6 +26,7 @@ public class Ticket2042 extends Application {
layout.addComponent(new Label("abc"));
layout.addComponent(new Button("B", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Notification n = new Notification("Test");
getMainWindow().showNotification(n);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
index ce42699094..7238462397 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2043 extends Application {
+public class Ticket2043 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
index 92a08eced9..0b5a537b4d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java
@@ -10,10 +10,10 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2048 extends Application {
+public class Ticket2048 extends Application.LegacyApplication {
private Embedded embedded;
private Panel p;
@@ -21,7 +21,7 @@ public class Ticket2048 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
// splitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL);
@@ -71,6 +71,7 @@ public class Ticket2048 extends Application {
"Replace image with new embedded component (flashes)",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Embedded newEmbedded = new Embedded(null,
new ThemeResource("icons/64/folder-add.png"));
@@ -85,6 +86,7 @@ public class Ticket2048 extends Application {
b = new Button("Change image source (is fine)", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
String img = "folder-add";
if (((ThemeResource) embedded.getSource()).getResourceId()
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
index 29aeef21b1..bd098443f2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2051.java
@@ -7,18 +7,18 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.DateField;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2051 extends Application {
+public class Ticket2051 extends Application.LegacyApplication {
private static final Object P1 = new Object();
private static final Object P2 = new Object();
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
index f784b40aed..fd64d6e35a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java
@@ -7,18 +7,17 @@ import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.CloseEvent;
-public class Ticket2053 extends Application {
+public class Ticket2053 extends Application.LegacyApplication {
int childs = 0;
@Override
public void init() {
- final Window main = new Window("#2053");
+ final LegacyWindow main = new LegacyWindow("#2053");
setMainWindow(main);
Button nothing = new Button("Do nothing");
main.addComponent(nothing);
@@ -26,29 +25,28 @@ public class Ticket2053 extends Application {
+ "draw changes not originating from this window. Such changes include changes "
+ "made by other browser-windows.");
Button add = new Button("Add a window", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
final String name = "Child " + (++childs);
- Window c = new Window(name);
- c.addListener(new Window.CloseListener() {
- public void windowClose(CloseEvent e) {
- main.addComponent(new Label(name + " closed"));
- }
- });
+ LegacyWindow c = new LegacyWindow(name);
+
addWindow(c);
main.open(new ExternalResource(c.getURL()), "_new");
main.addComponent(new Label(name + " opened"));
final TextField tf = new TextField("Non immediate textfield");
c.addComponent(tf);
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
main.addComponent(new Label(name + " send text:"
- + tf.toString()));
+ + tf.getValue()));
}
});
for (int i = 0; i < 3; i++) {
final String caption = "Slow button " + i;
c.addComponent(new Button(caption,
new Button.ClickListener() {
+ @Override
public synchronized void buttonClick(
ClickEvent event) {
try {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
index 061c71a509..1d7d8bb006 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2060.java
@@ -6,9 +6,9 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2060 extends Application {
+public class Ticket2060 extends Application.LegacyApplication {
private Button button1;
private Button button2;
@@ -16,7 +16,7 @@ public class Ticket2060 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
@@ -31,6 +31,7 @@ public class Ticket2060 extends Application {
button2 = new Button("Button without width");
button3 = new Button("Click to repaint buttons", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
button1.requestRepaint();
button2.requestRepaint();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
index c9cc3ce328..1f633d7337 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061.java
@@ -8,18 +8,18 @@ import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2061 extends Application {
+public class Ticket2061 extends Application.LegacyApplication {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
@Override
public void init() {
- mainWindow = new Window("Ticket 2061");
+ mainWindow = new LegacyWindow("Ticket 2061");
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
@@ -95,6 +95,7 @@ public class Ticket2061 extends Application {
return columns;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
index 5dc6dde768..e3cd09926e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java
@@ -12,6 +12,7 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
@@ -19,17 +20,16 @@ import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2061b extends Application implements
+public class Ticket2061b extends Application.LegacyApplication implements
SelectedTabChangeListener {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Panel p;
@Override
public void init() {
- mainWindow = new Window("Ticket 2061b");
+ mainWindow = new LegacyWindow("Ticket 2061b");
mainWindow.setSizeFull();
AbstractOrderedLayout mainLayout = (AbstractOrderedLayout) mainWindow
.getContent();
@@ -148,6 +148,7 @@ public class Ticket2061b extends Application implements
return columns;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
}
@@ -192,6 +193,7 @@ public class Ticket2061b extends Application implements
}
}
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
p.setScrollTop(10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
index 4cca979268..082b956fe0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061c.java
@@ -10,22 +10,22 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.TabSheet.SelectedTabChangeEvent;
import com.vaadin.ui.TabSheet.SelectedTabChangeListener;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2061c extends Application implements
+public class Ticket2061c extends Application.LegacyApplication implements
SelectedTabChangeListener {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private Panel p;
@Override
public void init() {
- mainWindow = new Window("Vaadin");
+ mainWindow = new LegacyWindow("Vaadin");
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
setMainWindow(mainWindow);
@@ -111,6 +111,7 @@ public class Ticket2061c extends Application implements
return columns;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
}
@@ -140,6 +141,7 @@ public class Ticket2061c extends Application implements
}
}
+ @Override
public void selectedTabChange(SelectedTabChangeEvent event) {
p.setScrollTop(10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
index 5b6bbe71de..5d91240c6a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2062.java
@@ -2,17 +2,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2062 extends Application {
+public class Ticket2062 extends Application.LegacyApplication {
private static final Object P1 = new Object();
@Override
public void init() {
- setMainWindow(new Window("Ticket2062"));
+ setMainWindow(new LegacyWindow("Ticket2062"));
getMainWindow().setSizeFull();
HorizontalSplitPanel p = new HorizontalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
index 25ecfabbec..ea77b6f2e6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2083.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2083 extends Application {
+public class Ticket2083 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
index 5bc69e0a64..2042cf7cad 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java
@@ -3,18 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
-import com.vaadin.terminal.Sizeable;
import com.vaadin.terminal.UserError;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2090 extends Application {
+public class Ticket2090 extends Application.LegacyApplication {
Label label = new Label();
Button target = new Button();
- Window w = new Window("#2090");
+ LegacyWindow w = new LegacyWindow("#2090");
@Override
public void init() {
@@ -28,9 +27,10 @@ public class Ticket2090 extends Application {
w.addComponent(label);
w.addComponent(target);
height.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
try {
- target.setHeight(height.toString());
+ target.setHeight(height.getValue());
height.setComponentError(null);
updateLabel();
} catch (Exception e) {
@@ -39,9 +39,10 @@ public class Ticket2090 extends Application {
}
});
width.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
try {
- target.setWidth(width.toString());
+ target.setWidth(width.getValue());
width.setComponentError(null);
updateLabel();
} catch (Exception e) {
@@ -54,9 +55,8 @@ public class Ticket2090 extends Application {
private void updateLabel() {
label.setValue("width: " + target.getWidth()
- + Sizeable.UNIT_SYMBOLS[target.getWidthUnits()] + ", height: "
- + target.getHeight()
- + Sizeable.UNIT_SYMBOLS[target.getHeightUnits()]);
+ + target.getWidthUnits().getSymbol() + ", height: "
+ + target.getHeight() + target.getHeightUnits().getSymbol());
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
index 42486748d2..a27ae7ac4d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Embedded;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2095 extends Application {
+public class Ticket2095 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// uncomment to workaround iorderedlayout bug in current trunk
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
index 4d02862e4b..5dc741eff6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2098.java
@@ -2,23 +2,23 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2098 extends Application {
+public class Ticket2098 extends Application.LegacyApplication {
private static final String info = "First tab hidden, second should initially be selected";
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
w.addComponent(new Label(info));
createUI(w);
}
- private void createUI(Window w) {
+ private void createUI(LegacyWindow w) {
TabSheet ts = new TabSheet();
Label l1 = new Label("111");
Label l2 = new Label("222");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
index d0021ae75f..0f0c00b05c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2099.java
@@ -6,11 +6,12 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2099 extends Application {
+public class Ticket2099 extends Application.LegacyApplication {
private Label l1, l2, l3;
private VerticalLayout ol1, ol2, ol3;
@@ -18,7 +19,7 @@ public class Ticket2099 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout layout = new GridLayout(10, 10);
@@ -29,6 +30,7 @@ public class Ticket2099 extends Application {
private void createUI(GridLayout layout) {
Button b = new Button("Show popup", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().addWindow(popup);
// popup.setVisible(true);
@@ -36,11 +38,12 @@ public class Ticket2099 extends Application {
});
popup = createPopup();
- addWindow(popup);
+ getMainWindow().addWindow(popup);
layout.addComponent(b);
layout.addComponent(new Button("Hide label '222'", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
l2.setVisible(!l2.isVisible());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
index 7d3412bfd8..67c3c9f331 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2101.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2101 extends Application {
+public class Ticket2101 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
Button b = new Button(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
index d65f4c1aec..1fb89eebc4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2103.java
@@ -5,16 +5,16 @@ import com.vaadin.data.Item;
import com.vaadin.data.util.HierarchicalContainer;
import com.vaadin.ui.Accordion;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2103 extends Application {
- private Window mainWindow;
+public class Ticket2103 extends Application.LegacyApplication {
+ private LegacyWindow mainWindow;
@Override
public void init() {
- mainWindow = new Window(getClass().getSimpleName());
+ mainWindow = new LegacyWindow(getClass().getSimpleName());
mainWindow.setContent(new VerticalLayout());
mainWindow.setSizeFull();
mainWindow.getContent().setSizeFull();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
index 8b95fa35a2..b8a6724a41 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java
@@ -1,31 +1,32 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.data.Property.ValueChangeListener;
import com.vaadin.data.util.MethodProperty;
import com.vaadin.event.ItemClickEvent;
import com.vaadin.event.ItemClickEvent.ItemClickListener;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
-import com.vaadin.ui.Button;
-import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Tree;
-import com.vaadin.ui.Window;
-public class Ticket2104 extends Application {
+public class Ticket2104 extends Application.LegacyApplication {
private static final Label info = new Label(
"Click event should _always_ come trough. Switching features on/off should immediatly affect the tree (verify w/ debug window)",
- Label.CONTENT_RAW);
+ ContentMode.RAW);
Tree tree = new Tree();
Table table = new Table();
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(info);
@@ -48,8 +49,11 @@ public class Ticket2104 extends Application {
"multiSelect"));
cb.setImmediate(true);
ol.addComponent(cb);
- cb = new CheckBox("icon", new Button.ClickListener() {
- public void buttonClick(ClickEvent event) {
+ cb = new CheckBox("icon");
+ cb.addListener(new ValueChangeListener() {
+
+ @Override
+ public void valueChange(ValueChangeEvent event) {
if (tree.getItemIconPropertyId() == null) {
tree.setItemIconPropertyId("icon");
} else {
@@ -79,6 +83,7 @@ public class Ticket2104 extends Application {
"http://www.itmill.com/res/images/itmill_logo.gif"));
tree.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
getMainWindow().addComponent(
new Label(event.toString() + " // " + event.getItemId()
@@ -114,6 +119,7 @@ public class Ticket2104 extends Application {
table.addItem("Item " + i);
}
table.addListener(new ItemClickListener() {
+ @Override
public void itemClick(ItemClickEvent event) {
getMainWindow().addComponent(
new Label(event.toString() + " // " + event.getItemId()
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
index 92908aa66d..6edc625b39 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2106.java
@@ -6,9 +6,9 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2106 extends Application {
+public class Ticket2106 extends Application.LegacyApplication {
private static CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages();
static {
@@ -24,9 +24,10 @@ public class Ticket2106 extends Application {
@Override
public void init() {
- setMainWindow(new Window("#2106"));
+ setMainWindow(new LegacyWindow("#2106"));
getMainWindow().addComponent(
new Button("Do nothing", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
getMainWindow().addComponent(
new Label("Last time did nothing: "
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
index 199b278343..09ba9fac0b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2107.java
@@ -5,15 +5,15 @@ import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Notification;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-import com.vaadin.ui.Window.Notification;
-public class Ticket2107 extends Application {
+public class Ticket2107 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Testing for #2107");
+ final LegacyWindow w = new LegacyWindow("Testing for #2107");
setMainWindow(w);
final TextField tf = new TextField(
@@ -23,6 +23,7 @@ public class Ticket2107 extends Application {
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
w.showNotification("TextField is " + (tf.isValid() ? "" : "in")
+ "valid, with error: " + tf.getErrorMessage(),
@@ -31,12 +32,9 @@ public class Ticket2107 extends Application {
});
tf.addValidator(new Validator() {
- public boolean isValid(Object value) {
- return value != null && value.toString().length() > 3;
- }
-
+ @Override
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || value.toString().length() <= 3) {
throw new InvalidValueException(
"Text length must exceed 3 characters");
}
@@ -50,8 +48,9 @@ public class Ticket2107 extends Application {
w.addComponent(b);
b.setImmediate(true);
b.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
- tf.setRequiredError(b.booleanValue() ? "Field must not be empty"
+ tf.setRequiredError(b.getValue() ? "Field must not be empty"
: null);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
index 974b3c4572..8bbfe0cd07 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java
@@ -1,14 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2117 extends Application {
+public class Ticket2117 extends Application.LegacyApplication {
@Override
public void init() {
@@ -16,10 +17,10 @@ public class Ticket2117 extends Application {
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
@@ -29,8 +30,8 @@ public class Ticket2117 extends Application {
return w;
}
- private Window createExtraWindow(String name) {
- final Window w = new Window("Extra window: " + name);
+ private LegacyWindow createExtraWindow(String name) {
+ final LegacyWindow w = new LegacyWindow("Extra window: " + name);
w.setName(name);
addWindow(w);
w.addComponent(new Label(
@@ -38,6 +39,7 @@ public class Ticket2117 extends Application {
w.addComponent(new Label("It has also been redirected to " + w.getURL()
+ " to support reloading"));
w.addComponent(new Button("button", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
w.showNotification("Button clicked");
w.addComponent(new Label("clicked"));
@@ -46,15 +48,15 @@ public class Ticket2117 extends Application {
return w;
}
- private Window createWindow() {
- final Window w = new Window();
+ private LegacyWindow createWindow() {
+ final LegacyWindow w = new LegacyWindow();
w.addComponent(new Label(
"Click this link: <a target=\"_blank\" href='"
+ getURL().toExternalForm()
+ "'>"
+ getURL().toExternalForm()
+ "</a> which opens new windows to this uri. They should end up having a separate Window and URL.",
- Label.CONTENT_XHTML));
+ ContentMode.XHTML));
return w;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
index c1e0d64dde..b563ec90ef 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java
@@ -3,35 +3,36 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.ExternalResource;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
/**
* Test case for Ticket 2119.
*/
-public class Ticket2119 extends Application {
+public class Ticket2119 extends Application.LegacyApplication {
private ObjectProperty<String> globalValue;
@Override
public void init() {
globalValue = new ObjectProperty<String>(null, String.class);
- Window main = createWindow();
+ LegacyWindow main = createWindow();
setMainWindow(main);
}
@Override
- public Window getWindow(String name) {
+ public LegacyWindow getWindow(String name) {
if (!isRunning()) {
return null;
}
// If we already have the requested window, use it
- Window w = super.getWindow(name);
+ LegacyWindow w = super.getWindow(name);
if (w == null) {
// If no window found, create it
w = createWindow();
@@ -41,8 +42,8 @@ public class Ticket2119 extends Application {
return w;
}
- private Window createWindow() {
- Window main = new Window("Test for ticket XXX");
+ private LegacyWindow createWindow() {
+ LegacyWindow main = new LegacyWindow("Test for ticket XXX");
main.setContent(testLayout());
return main;
}
@@ -56,7 +57,7 @@ public class Ticket2119 extends Application {
+ " - Go to the second Window\n"
+ " - Click the arrow in the Select\n"
+ " --> The opened list correctly shows the new value but the old one is shown in the \"input\" part");
- label.setContentMode(Label.CONTENT_PREFORMATTED);
+ label.setContentMode(ContentMode.PREFORMATTED);
layout.addComponent(label);
final Select select = new Select("Test Select");
@@ -73,13 +74,17 @@ public class Ticket2119 extends Application {
layout.addComponent(select);
globalValue.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(Property.ValueChangeEvent event) {
- valueProperty.setValue(event.getProperty().getValue());
+ Object value = event.getProperty().getValue();
+ valueProperty.setValue((null != value) ? value.toString()
+ : null);
}
});
final Button changeValueButton = new Button("Change Value to 2");
changeValueButton.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
globalValue.setValue("2");
}
@@ -89,4 +94,4 @@ public class Ticket2119 extends Application {
return layout;
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
index b296a4ff46..b12a865e80 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2125.java
@@ -5,12 +5,12 @@ import com.vaadin.data.util.MethodProperty;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
-import com.vaadin.ui.Window;
-public class Ticket2125 extends Application {
+public class Ticket2125 extends Application.LegacyApplication {
@Override
public void init() {
@@ -18,7 +18,7 @@ public class Ticket2125 extends Application {
}
- class MainWindow extends Window {
+ class MainWindow extends LegacyWindow {
MainWindow(String caption) {
super(caption);
@@ -34,12 +34,14 @@ public class Ticket2125 extends Application {
table.addContainerProperty("String", String.class, "a string");
table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE);
table.addGeneratedColumn("Generated", new ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
return new Label("Item " + itemId);
}
});
table.setCellStyleGenerator(new CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if (new Integer(4).equals(itemId)) {
if (propertyId == null) {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
index 4de873a7fc..c9e070bef4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2126.java
@@ -5,8 +5,8 @@ import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
*
@@ -14,9 +14,9 @@ import com.vaadin.ui.Window;
* client.
*
*/
-public class Ticket2126 extends com.vaadin.Application {
+public class Ticket2126 extends com.vaadin.Application.LegacyApplication {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
Table table = new Table();
@Override
@@ -46,6 +46,7 @@ public class Ticket2126 extends com.vaadin.Application {
refreshTable.addListener(new Button.ClickListener() {
boolean full = true;
+ @Override
public void buttonClick(Button.ClickEvent e) {
if (full) {
table.setContainerDataSource(container2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
index 5a48156367..c2fbe1b4f7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2151.java
@@ -2,19 +2,21 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.ObjectProperty;
+import com.vaadin.ui.AbstractComponent;
+import com.vaadin.ui.AbstractField;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2151 extends Application {
+public class Ticket2151 extends Application.LegacyApplication {
private Label status;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -38,30 +40,21 @@ public class Ticket2151 extends Application {
layout.addComponent(new Label("b"));
layout.addComponent(new Label("c"));
- check(Button.class);
- check(CheckBox.class);
- checkDataBinding(Button.class);
+ checkButton(Button.class);
+ checkCheckBox(CheckBox.class);
checkDataBinding(CheckBox.class);
}
- private void check(Class<? extends Button> class1) {
+ private void checkButton(Class<? extends Button> class1) {
boolean ok = false;
- Button b;
+ AbstractComponent b;
try {
b = class1.newInstance();
b.setCaption("Button of type " + class1.getSimpleName());
- try {
- // This should throw an exception
- b.setValue("ON");
- } catch (IllegalArgumentException e) {
- ok = true;
- } catch (Exception e) {
- e.printStackTrace();
- }
+ ok = true;
} catch (Exception e1) {
e1.printStackTrace();
- return;
}
if (ok) {
@@ -74,15 +67,30 @@ public class Ticket2151 extends Application {
}
- private void checkDataBinding(Class<? extends Button> class1) {
+ private void checkCheckBox(Class<? extends CheckBox> class1) {
+ boolean ok = false;
+ CheckBox b;
+ try {
+ b = class1.newInstance();
+ } catch (Exception e1) {
+ e1.printStackTrace();
+ return;
+ }
+
+ b.setCaption("Button of type " + class1.getSimpleName());
+ status.setValue(status.getValue() + " "
+ + class1.getClass().getSimpleName() + ": OK");
+
+ }
+
+ private void checkDataBinding(Class<? extends AbstractField> class1) {
boolean ok = false;
- Button b;
+ AbstractField b;
try {
b = class1.newInstance();
b.setCaption("Button of type " + class1.getSimpleName());
try {
- b.setWriteThrough(true);
- b.setReadThrough(true);
+ b.setBuffered(false);
ObjectProperty<String> prop = new ObjectProperty<String>(
"ABC 123");
/*
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
index 3d90907e50..23c5b0bcd5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2157.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2157 extends Application {
+public class Ticket2157 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
index a3461dd8b6..6de42003b4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2178.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2178 extends Application {
+public class Ticket2178 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
index 165e770307..31e1a9a0d6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2179.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.Validator;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2179 extends Application {
+public class Ticket2179 extends Application.LegacyApplication {
TextField f = new TextField("Test fiel ( must contain 1 & 2 )");
- Window main = new Window("Dual validator test");
+ LegacyWindow main = new LegacyWindow("Dual validator test");
@Override
public void init() {
@@ -25,6 +25,7 @@ public class Ticket2179 extends Application {
f.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
main.showNotification("Test field is "
+ (f.isValid() ? "valid" : "invalid"));
@@ -33,19 +34,16 @@ public class Ticket2179 extends Application {
}
- class ContainsValidator implements Validator {
+ static class ContainsValidator implements Validator {
private final String c;
public ContainsValidator(String c) {
this.c = c;
}
- public boolean isValid(Object value) {
- return value != null && value.toString().contains(c);
- }
-
+ @Override
public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value == null || !value.toString().contains(c)) {
throw new InvalidValueException("Value does not contain " + c);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
index 9f5e2a2de1..7b993cdf24 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2180.java
@@ -3,17 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2180 extends Application {
+public class Ticket2180 extends Application.LegacyApplication {
- private Window mainWindow;
+ private LegacyWindow mainWindow;
private TabSheet tabSheet;
@Override
public void init() {
- mainWindow = new Window("Tabsheet should cause scrollbars");
+ mainWindow = new LegacyWindow("Tabsheet should cause scrollbars");
setMainWindow(mainWindow);
// mainWindow.getLayout().setSizeFull();
tabSheet = new TabSheet();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
index ea3d996b98..44893eb531 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java
@@ -12,17 +12,18 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.OptionGroup;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2181 extends Application implements Button.ClickListener {
+public class Ticket2181 extends Application.LegacyApplication implements
+ Button.ClickListener {
// private static final Object PROPERTY_VALUE = new Object();
// private static final Object PROPERTY_CAPTION = new Object();
private static final String caption = "This is a caption which is very long and nice and perhaps sometimes should be clipped";
- Window main = new Window("#2181 test");
+ LegacyWindow main = new LegacyWindow("#2181 test");
TextField tf1 = new TextField(caption, "Test field - undefined width");
TextField tf2 = new TextField(caption, "Test field - 150px wide");
Button setButton = new Button("Set", this);
@@ -69,6 +70,7 @@ public class Ticket2181 extends Application implements Button.ClickListener {
return options;
}
+ @Override
public void buttonClick(ClickEvent event) {
if (event.getButton() == setButton) {
set();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
index bc9ff8c27d..b7817d2ed7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2186.java
@@ -4,15 +4,15 @@ import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2186 extends Application {
+public class Ticket2186 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Quick test");
+ LegacyWindow main = new LegacyWindow("Quick test");
setMainWindow(main);
HorizontalLayout base = new HorizontalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
index 6a047cb626..4caba62df2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2204.java
@@ -26,12 +26,12 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2204 extends Application {
+public class Ticket2204 extends Application.LegacyApplication {
private final List<RichTextArea> textAreas = new ArrayList<RichTextArea>();
private TabSheet ts;
@@ -52,7 +52,7 @@ public class Ticket2204 extends Application {
classes.add(HorizontalSplitPanel.class);
classes.add(Form.class);
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -71,6 +71,7 @@ public class Ticket2204 extends Application {
Button b = new Button("Show area", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
showHide();
}
@@ -80,6 +81,7 @@ public class Ticket2204 extends Application {
b = new Button("Show tab", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
showTab();
}
@@ -128,7 +130,8 @@ public class Ticket2204 extends Application {
Form f = (Form) cc;
f.setFormFieldFactory(new FormFieldFactory() {
- public Field createField(Item item, Object propertyId,
+ @Override
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
formTextArea = new RichTextArea();
formTextArea.setVisible(false);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
index ff3d9e6ca1..3f0f35bb84 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2208.java
@@ -4,18 +4,18 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.CellStyleGenerator;
import com.vaadin.ui.Table.ColumnGenerator;
-import com.vaadin.ui.Window;
-public class Ticket2208 extends Application {
+public class Ticket2208 extends Application.LegacyApplication {
private Table t;
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
t = new Table("A table");
@@ -25,6 +25,7 @@ public class Ticket2208 extends Application {
t.setHeight("150px");
t.addGeneratedColumn("col 3 (green)", new ColumnGenerator() {
+ @Override
public Component generateCell(Table source, Object itemId,
Object columnId) {
Item item = source.getItem(itemId);
@@ -38,6 +39,7 @@ public class Ticket2208 extends Application {
t.addContainerProperty("col 4", String.class, "");
t.setCellStyleGenerator(new CellStyleGenerator() {
+ @Override
public String getStyle(Object itemId, Object propertyId) {
if ("col 1 (red)".equals(propertyId)) {
return "red";
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
index c6b30fa52f..a387781ae3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209.java
@@ -7,9 +7,9 @@ import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2209 extends Application {
+public class Ticket2209 extends Application.LegacyApplication {
private GridLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209 extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
gl = new GridLayout(1, 2);
gl.setStyleName("borders");
@@ -31,6 +31,7 @@ public class Ticket2209 extends Application {
Button b = new Button("Add label text", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
labelLong.setValue(labelLong.getValue() + "-12345");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
index c7305bd0fb..226df8b5e7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2209OL extends Application {
+public class Ticket2209OL extends Application.LegacyApplication {
private VerticalLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209OL extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
getMainWindow().getContent().setWidth("250px");
gl = new VerticalLayout();
gl.setStyleName("borders");
@@ -38,6 +38,7 @@ public class Ticket2209OL extends Application {
Button b = new Button("Add label text", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
labelLong.setValue(labelLong.getValue() + "-12345");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
index d7385562cd..921f3b190b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2209OL2.java
@@ -6,10 +6,10 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.ComboBox;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2209OL2 extends Application {
+public class Ticket2209OL2 extends Application.LegacyApplication {
private VerticalLayout gl;
private ComboBox combo;
@@ -17,7 +17,7 @@ public class Ticket2209OL2 extends Application {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
getMainWindow().getContent().setWidth("250px");
gl = new VerticalLayout();
gl.setSizeUndefined();
@@ -44,6 +44,7 @@ public class Ticket2209OL2 extends Application {
Button b = new Button("Add label text", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
labelLong.setValue(labelLong.getValue() + "-12345");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
index 62ed69e433..5b98fe3af3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2215.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2215 extends Application {
+public class Ticket2215 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
VerticalLayout ol = new VerticalLayout();
Panel p = new Panel("Test");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
index e6489da432..886aa376c3 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2221.java
@@ -9,15 +9,15 @@ import com.vaadin.ui.Component;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2221 extends Application {
+public class Ticket2221 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -46,6 +46,7 @@ public class Ticket2221 extends Application {
Button b = new Button("Switch textfield/panel",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Component visible = tf;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
index 86dccede69..51ac463a6e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2222.java
@@ -5,14 +5,14 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2222 extends Application {
+public class Ticket2222 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
index c93b26bec2..e436bab283 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java
@@ -5,15 +5,16 @@ import com.vaadin.data.Item;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2227OrderedlayoutInTable extends Application {
+public class Ticket2227OrderedlayoutInTable extends
+ Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
Table t = new Table();
t.setWidth("500px");
t.setHeight("200px");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
index ba12dd7abc..ab0cc82628 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2231.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2231 extends Application {
+public class Ticket2231 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
index ab4e83f0ba..ae8a4b0f51 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2232.java
@@ -6,14 +6,14 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.SpacingHandler;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2232 extends Application {
+public class Ticket2232 extends Application.LegacyApplication {
@Override
public void init() {
- setMainWindow(new Window());
+ setMainWindow(new LegacyWindow());
setTheme("tests-tickets");
getMainWindow()
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
index 5c6167fbfe..24a6d2ea77 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2234.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.data.Item;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2234 extends Application {
+public class Ticket2234 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
index 72a77e502e..10978cad30 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2235.java
@@ -2,14 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
-import com.vaadin.ui.Window;
-public class Ticket2235 extends Application {
+public class Ticket2235 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
index 6d70d89af8..c777d0772f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2240.java
@@ -1,12 +1,13 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2240 extends Application {
+public class Ticket2240 extends Application.LegacyApplication {
public static final String txt = "<p>There are two main types of windows: application-level windows, and "
+ "\"sub windows\".</p><p>A sub window is rendered as a \"inline\" popup window"
@@ -25,7 +26,7 @@ public class Ticket2240 extends Application {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -36,7 +37,7 @@ public class Ticket2240 extends Application {
layout.setStyleName("borders");
// layout.setSizeFull();
final Label l = new Label(txt);
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
// l.setWidth("100%");
TextField tf = new TextField("This is a textField");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
index fa25ff55f1..4b44ed1a87 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2242.java
@@ -10,10 +10,11 @@ import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2242 extends Application implements ValueChangeListener {
+public class Ticket2242 extends Application.LegacyApplication implements
+ ValueChangeListener {
private Object tableValue = null;
private Table t;
@@ -22,7 +23,7 @@ public class Ticket2242 extends Application implements ValueChangeListener {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
@@ -32,6 +33,7 @@ public class Ticket2242 extends Application implements ValueChangeListener {
Button b = new Button("Change container datasource",
new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
for (int i = 0; i < 5; i++) {
t.setContainerDataSource(createContainer());
@@ -70,6 +72,7 @@ public class Ticket2242 extends Application implements ValueChangeListener {
return ic;
}
+ @Override
public void valueChange(ValueChangeEvent event) {
System.out.println("Value change from " + tableValue + " to "
+ t.getValue());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
index e9ae3ac720..a360760039 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2244.java
@@ -8,15 +8,15 @@ import com.vaadin.ui.Form;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2244 extends Application {
+public class Ticket2244 extends Application.LegacyApplication {
Form form;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout gl = new GridLayout(3, 3);
@@ -33,6 +33,7 @@ public class Ticket2244 extends Application {
w.addComponent(new Button("new item", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setItemDataSource(new BeanItem<MyBean>(new MyBean()));
@@ -42,6 +43,7 @@ public class Ticket2244 extends Application {
w.addComponent(new Button("new bigger item",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setItemDataSource(new BeanItem<MyBean>(
new MyBiggerBean()));
@@ -52,6 +54,7 @@ public class Ticket2244 extends Application {
w.addComponent(new Button("new grid layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setLayout(new GridLayout());
@@ -61,6 +64,7 @@ public class Ticket2244 extends Application {
w.addComponent(new Button("new form layout",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.setLayout(new FormLayout());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
index bac85c95cd..1586a1966b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2245.java
@@ -2,13 +2,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalSplitPanel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2245 extends Application {
+public class Ticket2245 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("The Main Window");
+ LegacyWindow main = new LegacyWindow("The Main Window");
main.getContent().setSizeFull();
setMainWindow(main);
HorizontalSplitPanel sp = new HorizontalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
index 020ea5c7c6..b5d6772e7f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2267.java
@@ -6,21 +6,22 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2267 extends Application {
+public class Ticket2267 extends Application.LegacyApplication {
Label l = new Label("0");
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
GridLayout gl = new GridLayout(4, 2);
Button button = new Button("1", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
Button b = event.getButton();
l.setValue(l.getValue() + b.getCaption());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
index 50a99edb7a..fb281f22b2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2271.java
@@ -4,14 +4,14 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Button;
import com.vaadin.ui.ComboBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2271 extends Application {
+public class Ticket2271 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java
deleted file mode 100644
index e3b446f242..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2279.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.gwt.client.ui.AlignmentInfo;
-import com.vaadin.ui.AbstractOrderedLayout;
-import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Layout;
-import com.vaadin.ui.Layout.AlignmentHandler;
-import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-
-// This tests the deprecated setComponentAlignment(Component,String) API
-@SuppressWarnings("deprecation")
-public class Ticket2279 extends Application {
-
- private Label label;
-
- private static Map<String, Integer> expected = new HashMap<String, Integer>();
-
- private static Set<String> longHorizontalAlignments = new HashSet<String>();
- private static Set<String> shortHorizontalAlignments = new HashSet<String>();
- private static Set<String> longVerticalAlignments = new HashSet<String>();
- private static Set<String> shortVerticalAlignments = new HashSet<String>();
-
- static {
- expected.put("r", AlignmentInfo.Bits.ALIGNMENT_RIGHT);
- expected.put("l", AlignmentInfo.Bits.ALIGNMENT_LEFT);
- expected.put("c", AlignmentInfo.Bits.ALIGNMENT_HORIZONTAL_CENTER);
- expected.put("t", AlignmentInfo.Bits.ALIGNMENT_TOP);
- expected.put("b", AlignmentInfo.Bits.ALIGNMENT_BOTTOM);
- expected.put("m", AlignmentInfo.Bits.ALIGNMENT_VERTICAL_CENTER);
-
- expected.put("right", AlignmentInfo.Bits.ALIGNMENT_RIGHT);
- expected.put("left", AlignmentInfo.Bits.ALIGNMENT_LEFT);
- expected.put("center", AlignmentInfo.Bits.ALIGNMENT_HORIZONTAL_CENTER);
- expected.put("top", AlignmentInfo.Bits.ALIGNMENT_TOP);
- expected.put("bottom", AlignmentInfo.Bits.ALIGNMENT_BOTTOM);
- expected.put("middle", AlignmentInfo.Bits.ALIGNMENT_VERTICAL_CENTER);
-
- shortHorizontalAlignments.add("r");
- shortHorizontalAlignments.add("l");
- shortHorizontalAlignments.add("c");
- shortVerticalAlignments.add("t");
- shortVerticalAlignments.add("b");
- shortVerticalAlignments.add("m");
-
- longHorizontalAlignments.add("right");
- longHorizontalAlignments.add("left");
- longHorizontalAlignments.add("center");
- longVerticalAlignments.add("top");
- longVerticalAlignments.add("bottom");
- longVerticalAlignments.add("middle");
-
- }
-
- @Override
- public void init() {
- Window w = new Window(getClass().getSimpleName());
- setMainWindow(w);
- setTheme("tests-tickets");
- AbstractOrderedLayout layout = (AbstractOrderedLayout) w.getContent();
-
- createUI(layout);
- }
-
- private void createUI(Layout layout) {
- VerticalLayout vl = new VerticalLayout();
- vl.setWidth("500px");
- vl.setHeight("500px");
- vl.setStyleName("borders");
- label = new Label("<b>Error messages follows:</b><br/>",
- Label.CONTENT_XHTML);
- vl.addComponent(label);
- layout.addComponent(vl);
-
- testAlignments(vl);
-
- GridLayout gl = new GridLayout(1, 1);
- gl.setWidth("500px");
- gl.setHeight("500px");
- gl.setStyleName("borders");
- label = new Label("<b>Error messages follows:</b><br/>",
- Label.CONTENT_XHTML);
- gl.addComponent(label);
- layout.addComponent(gl);
-
- testAlignments(gl);
-
- }
-
- private void testAlignments(AlignmentHandler layout) {
- HashSet<String> horizontals = new HashSet<String>();
- horizontals.addAll(shortHorizontalAlignments);
- horizontals.addAll(longHorizontalAlignments);
-
- for (String horiz : horizontals) {
- // Test "l","r","left","right" etc
- int expectedHoriz = expected.get(horiz);
- checkAlignment(layout, horiz, AlignmentHandler.ALIGNMENT_TOP
- | expectedHoriz);
-
- for (String vert : shortVerticalAlignments) {
- int expectedVert = expected.get(vert);
-
- // Test "lt","rt" etc
- if (horiz.length() == 1) {
- checkAlignment(layout, horiz + vert, expectedHoriz
- | expectedVert);
- checkAlignment(layout, vert + horiz, expectedHoriz
- | expectedVert);
- } else {
- boolean ok = false;
- try {
- checkAlignment(layout, horiz + vert, expectedHoriz
- | expectedVert);
- } catch (IllegalArgumentException e) {
- // OK, "centert","rightb" etc are not valid
- ok = true;
- }
- if (!ok) {
- error("IllegalArgumentException was not thrown for "
- + horiz + vert);
- }
- ok = false;
- try {
- checkAlignment(layout, vert + horiz, expectedHoriz
- | expectedVert);
- } catch (IllegalArgumentException e) {
- // OK, "centert","rightb" etc are not valid
- ok = true;
- }
- if (!ok) {
- error("IllegalArgumentException was not thrown for "
- + horiz + vert);
- }
-
- }
-
- // Test "l t","r t" etc
- checkAlignment(layout, horiz + " " + vert, expectedHoriz
- | expectedVert);
- checkAlignment(layout, vert + " " + horiz, expectedHoriz
- | expectedVert);
- }
-
- for (String vert : longVerticalAlignments) {
- int expectedVert = expected.get(vert);
-
- // Test "right t","right b" etc
- checkAlignment(layout, horiz + " " + vert, expectedHoriz
- | expectedVert);
- checkAlignment(layout, vert + " " + horiz, expectedHoriz
- | expectedVert);
-
- // Three alignments should throw an exception
- boolean ok = false;
- try {
- checkAlignment(layout, horiz + " " + vert + " " + horiz,
- expectedHoriz | expectedVert);
- } catch (IllegalArgumentException e) {
- // OK, "centert","rightb" etc are not valid
- ok = true;
- }
- if (!ok) {
- error("IllegalArgumentException was not thrown for "
- + horiz + " " + vert + " " + horiz);
- }
- }
- }
-
- checkAlignment(layout, "left right", AlignmentHandler.ALIGNMENT_TOP
- | AlignmentHandler.ALIGNMENT_RIGHT);
- }
-
- private void checkAlignment(AlignmentHandler layout,
- String alignmentString, int expected) {
- layout.setComponentAlignment(label, AlignmentInfo.Bits.ALIGNMENT_TOP,
- AlignmentInfo.Bits.ALIGNMENT_LEFT);
- if (layout instanceof AbstractOrderedLayout) {
- ((AbstractOrderedLayout) layout).setComponentAlignment(label,
- alignmentString);
- } else {
- ((GridLayout) layout).setComponentAlignment(label, alignmentString);
- }
-
- int actual = layout.getComponentAlignment(label).getBitMask();
- if (actual != expected) {
- String error = "Error " + alignmentString
- + " did not produce expected results";
- error(error);
- } else {
- String str = layout.getClass().getSimpleName() + "/"
- + alignmentString + ": OK";
- System.out.println(str);
- }
-
- }
-
- private void error(String error) {
- label.setValue(label.getValue() + error + "<br/>");
- System.out.println(error);
- }
-}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
index c63faf2cef..c72b4e15ff 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2282.java
@@ -5,16 +5,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2282 extends Application {
+public class Ticket2282 extends Application.LegacyApplication {
private FormLayout layout1;
private FormLayout layout2;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
w.getContent().setSizeUndefined();
@@ -38,6 +38,7 @@ public class Ticket2282 extends Application {
Button b = new Button("Swap", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (layout1.getWidth() < 0.0) {
layout1.setWidth("500px");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
index 89b90eaa01..8375ca648f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2283.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2283 extends Application {
+public class Ticket2283 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
GridLayout gl = new GridLayout(2, 2);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
index 0942877947..716c8af0db 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2287.java
@@ -2,28 +2,29 @@ package com.vaadin.tests.tickets;
import java.net.URL;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class Ticket2287 extends Ticket2292 {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
URL url = getURL();
main.addComponent(new Label(
"Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)."));
Label l = new Label();
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setValue("This is a label with as slow image. <img src=\"" + url
+ "/icon.png\" />");
main.addComponent(l);
l = new Label();
- l.setContentMode(Label.CONTENT_XHTML);
+ l.setContentMode(ContentMode.XHTML);
l.setValue("This is a label with as slow image. <img src=\"" + url
+ "/icon.png\" />");
main.addComponent(l);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
index 19574b50fb..0ad023450c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2289.java
@@ -7,11 +7,11 @@ import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.CustomComponent;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2289 extends Application {
+public class Ticket2289 extends Application.LegacyApplication {
TabSheet ts = null;
Accordion acc = null;
@@ -19,12 +19,13 @@ public class Ticket2289 extends Application {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
VerticalLayout ol = new VerticalLayout();
w.setContent(ol);
Button b = new Button("close current tab");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeCurrentTab();
@@ -34,6 +35,7 @@ public class Ticket2289 extends Application {
b = new Button("close first tab");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
closeFirstTab();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
index 8ddc6519f7..35e9b8f2c5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java
@@ -6,24 +6,28 @@ import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.net.URL;
import javax.imageio.ImageIO;
+import com.vaadin.Application;
import com.vaadin.terminal.DownloadStream;
import com.vaadin.terminal.ExternalResource;
+import com.vaadin.terminal.RequestHandler;
+import com.vaadin.terminal.WrappedRequest;
+import com.vaadin.terminal.WrappedResponse;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Label;
import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2292 extends com.vaadin.Application {
+public class Ticket2292 extends com.vaadin.Application.LegacyApplication
+ implements RequestHandler {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
ExternalResource icon = new ExternalResource("./icon.png");
@@ -40,12 +44,17 @@ public class Ticket2292 extends com.vaadin.Application {
Link l = new Link("l", icon);
main.addComponent(l);
+ addRequestHandler(this);
}
@Override
- public DownloadStream handleURI(URL context, String relativeUri) {
+ public boolean handleRequest(Application application,
+ WrappedRequest request, WrappedResponse response)
+ throws IOException {
+ String relativeUri = request.getRequestPathInfo();
+
if (!relativeUri.contains("icon.png")) {
- return null;
+ return false;
}
// be slow to show bug
@@ -78,9 +87,10 @@ public class Ticket2292 extends com.vaadin.Application {
// Return a stream from the buffer.
ByteArrayInputStream istream = new ByteArrayInputStream(
imagebuffer.toByteArray());
- return new DownloadStream(istream, null, null);
+ new DownloadStream(istream, null, null).writeTo(response);
+ return true;
} catch (IOException e) {
- return null;
+ return false;
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
index 37c29ca5e0..30392a245d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2294.java
@@ -4,13 +4,13 @@ import com.vaadin.Application;
import com.vaadin.ui.AbstractOrderedLayout;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2294 extends Application {
+public class Ticket2294 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((AbstractOrderedLayout) w.getContent());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
index 1503811341..31ff4a8353 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2296.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2296 extends Application {
+public class Ticket2296 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
CustomLayout cl = new CustomLayout("Ticket2296");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
index 8b425af136..1d1f0f1d74 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2297.java
@@ -6,14 +6,14 @@ import java.net.URL;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
public class Ticket2297 extends Ticket2292 {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
URL url = getURL();
main.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
index 3b8864bccc..bc11a7ea49 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2303.java
@@ -6,14 +6,14 @@ import java.io.IOException;
import com.vaadin.Application;
import com.vaadin.ui.CustomLayout;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2303 extends Application {
+public class Ticket2303 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window("main window");
+ LegacyWindow w = new LegacyWindow("main window");
String customlayout = "<div location=\"test\"></div>";
CustomLayout cl = null;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
index 1b356c73fb..b767b3661f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2304.java
@@ -1,17 +1,18 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2304 extends Application {
+public class Ticket2304 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
Panel p = new Panel();
@@ -21,7 +22,7 @@ public class Ticket2304 extends Application {
Label l = new Label(
"a\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\na\n");
- l.setContentMode(Label.CONTENT_PREFORMATTED);
+ l.setContentMode(ContentMode.PREFORMATTED);
p.addComponent(l);
main.addComponent(new Label(
"This text should be right below the panel, w/o spacing"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
index 6363fddcaf..1cad5bde4f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2310.java
@@ -5,15 +5,15 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.themes.Reindeer;
-public class Ticket2310 extends Application {
+public class Ticket2310 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window(getClass().getName().substring(
- getClass().getName().lastIndexOf(".") + 1));
+ final LegacyWindow main = new LegacyWindow(getClass().getName()
+ .substring(getClass().getName().lastIndexOf(".") + 1));
setMainWindow(main);
main.addComponent(new Label("Instructions: change label when panel is "
@@ -34,6 +34,7 @@ public class Ticket2310 extends Application {
b.addListener(new Button.ClickListener() {
int i = 0;
+ @Override
public void buttonClick(ClickEvent event) {
l.setValue("foobar " + i++);
@@ -43,6 +44,7 @@ public class Ticket2310 extends Application {
Button b2 = new Button("toggle panel visibility");
b2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
p.setVisible(!p.isVisible());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
index b8a2ba8db8..ec6d3be801 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2319.java
@@ -6,15 +6,15 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
-public class Ticket2319 extends Application {
+public class Ticket2319 extends Application.LegacyApplication {
@Override
public void init() {
- Window mainw = new Window();
+ LegacyWindow mainw = new LegacyWindow();
setMainWindow(mainw);
mainw.addComponent(new Label(
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
index 503878ecad..123c154e61 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2323.java
@@ -2,13 +2,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.RichTextArea;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket2323 extends Application {
+public class Ticket2323 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
Window subWindow = new Window("");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
index 1245254fa0..c253eb70e6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2325.java
@@ -1,15 +1,16 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2325 extends Application {
+public class Ticket2325 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Testing....");
+ LegacyWindow main = new LegacyWindow("Testing....");
setMainWindow(main);
final VerticalLayout lo = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
index 57dbeb4033..f583a4af4b 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2329.java
@@ -3,18 +3,18 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.Table.ColumnGenerator;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2329 extends Application {
+public class Ticket2329 extends Application.LegacyApplication {
private Table table;
private VerticalLayout mainLo;
@Override
public void init() {
- Window mainw = new Window();
+ LegacyWindow mainw = new LegacyWindow();
setMainWindow(mainw);
mainLo = (VerticalLayout) mainw.getContent();
table = new Table();
@@ -34,6 +34,7 @@ public class Ticket2329 extends Application {
}
class TestColumnGenerator implements ColumnGenerator {
+ @Override
public Component generateCell(Table source, Object rowId,
Object columnId) {
return new Button("1");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
index 9277a01f96..f0cae1a59f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2337.java
@@ -5,18 +5,19 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.GridLayout;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2337 extends Application {
+public class Ticket2337 extends Application.LegacyApplication {
GridLayout gl = new GridLayout(3, 1);
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Button b = new Button("add", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2,
gl.getCursorY());
@@ -28,6 +29,7 @@ public class Ticket2337 extends Application {
b = new Button("empty", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
gl.removeAllComponents();
;
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
index 6476807ada..81dc3af40f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2339.java
@@ -6,14 +6,15 @@ import java.io.IOException;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.CustomLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2339 extends Application {
+public class Ticket2339 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(getClass().getSimpleName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
setMainWindow(mainWin);
try {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
index d7fbccfa4e..a35c27962f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2341.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.data.Item;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2341 extends com.vaadin.Application {
+public class Ticket2341 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
constructTables((Layout) main.getContent());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
index 26ef216940..d7b1eacd2c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2344.java
@@ -4,16 +4,16 @@ import java.util.Random;
import com.vaadin.Application;
import com.vaadin.ui.Button;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
import com.vaadin.ui.themes.BaseTheme;
-public class Ticket2344 extends Application {
+public class Ticket2344 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("Quick test");
+ LegacyWindow main = new LegacyWindow("Quick test");
setMainWindow(main);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
index 76e59146db..5528dfebd6 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2347.java
@@ -5,16 +5,16 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CustomLayout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2347 extends Application {
+public class Ticket2347 extends Application.LegacyApplication {
private Button b1;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
setTheme("tests-tickets");
createUI((VerticalLayout) w.getContent());
@@ -25,6 +25,7 @@ public class Ticket2347 extends Application {
b1 = new Button("200px button");
b1.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (b1.getWidth() == 200.0) {
b1.setWidth("300px");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
index 7f7290dd80..8039609339 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2364.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Select;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2364 extends Application {
+public class Ticket2364 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window("The Main Window!!!");
+ LegacyWindow main = new LegacyWindow("The Main Window!!!");
setMainWindow(main);
Form form = new Form();
VerticalLayout formLayout = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
index 0c8a095ec9..252406cc2d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2365.java
@@ -4,15 +4,16 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2365 extends Application {
+public class Ticket2365 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window(getClass().getSimpleName());
+ final LegacyWindow mainWin = new LegacyWindow(getClass()
+ .getSimpleName());
setMainWindow(mainWin);
VerticalLayout lo = new VerticalLayout();
@@ -24,6 +25,7 @@ public class Ticket2365 extends Application {
Button b = new Button("Toggle parent level size");
lo.addComponent(b);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (p.getWidth() > 0) {
p.setSizeUndefined();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
index dee0417eff..054cc5f0cc 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2398.java
@@ -3,15 +3,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.util.IndexedContainer;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2398 extends Application {
+public class Ticket2398 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window();
+ final LegacyWindow mainWin = new LegacyWindow();
setMainWindow(mainWin);
Table t = new Table();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
index 478d8b7786..0da70301d1 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2404.java
@@ -3,9 +3,9 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2404 extends Application {
+public class Ticket2404 extends Application.LegacyApplication {
@Override
public void init() {
@@ -22,7 +22,7 @@ public class Ticket2404 extends Application {
b.setSizeFull();
}
- setMainWindow(new Window("GridLayout test", gl));
+ setMainWindow(new LegacyWindow("GridLayout test", gl));
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
index 9ab0d851ad..16a552e37a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java
@@ -9,11 +9,11 @@ import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.HorizontalSplitPanel;
import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2405 extends Application {
+public class Ticket2405 extends Application.LegacyApplication {
private Label label;
private HorizontalSplitPanel split;
@@ -21,10 +21,9 @@ public class Ticket2405 extends Application {
@Override
public void init() {
- final Window root = new Window("VaadinTunes");
+ final LegacyWindow root = new LegacyWindow("VaadinTunes");
root.setWidth("90%");
root.setHeight("90%");
- root.center();
// We'll attach the window to the browser view already here, so we won't
// forget it later.
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
index b7c9f902d2..0036bdc7b2 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2406.java
@@ -4,16 +4,17 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.Window;
-public class Ticket2406 extends Application {
+public class Ticket2406 extends Application.LegacyApplication {
private Window w;
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// setTheme("tests-tickets");
createUI((VerticalLayout) w.getContent());
@@ -32,6 +33,7 @@ public class Ticket2406 extends Application {
b.setSizeFull();
b.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
w.setHeight("200px");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
index f5ac1dc37f..51ab08188e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2407.java
@@ -1,15 +1,15 @@
package com.vaadin.tests.tickets;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket2407 extends com.vaadin.Application {
+public class Ticket2407 extends com.vaadin.Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("Ticket2407");
+ final LegacyWindow main = new LegacyWindow("Ticket2407");
setMainWindow(main);
Form form = new Form(new VerticalLayout());
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
index 01bd4f0651..6801bfa88d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2411.java
@@ -3,13 +3,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.GridLayout;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2411 extends Application {
+public class Ticket2411 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
// VerticalLayout l = new VerticalLayout();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
index 5c1d0c2a51..509f4cf437 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2415.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket2415 extends Application {
+public class Ticket2415 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("");
+ final LegacyWindow main = new LegacyWindow("");
setMainWindow(main);
final TextField tf = new TextField("Try to change me");
@@ -19,6 +19,7 @@ public class Ticket2415 extends Application {
tf.setImmediate(true);
tf.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
main.showNotification("New value = " + tf);
}
@@ -30,6 +31,7 @@ public class Ticket2415 extends Application {
tf2.setImmediate(true);
tf2.addListener(new Property.ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
main.showNotification("New value = " + tf2);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
index e40d73877c..adca729c9e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2420.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.ProgressIndicator;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2420 extends Application {
+public class Ticket2420 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window("Hello window");
+ final LegacyWindow main = new LegacyWindow("Hello window");
setMainWindow(main);
- main.setTheme("tests-tickets");
+ setTheme("tests-tickets");
ProgressIndicator pi = new ProgressIndicator();
pi.setCaption("Visible");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
index 75810137ad..8c9be295a0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2425.java
@@ -3,14 +3,14 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TabSheet;
-import com.vaadin.ui.Window;
-public class Ticket2425 extends Application {
+public class Ticket2425 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window(getClass().getSimpleName());
+ LegacyWindow w = new LegacyWindow(getClass().getSimpleName());
setMainWindow(w);
w.addComponent(new Label("No scrollbars should be visible anywhere"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
index 90e2ce438d..40862e3ccd 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2426.java
@@ -1,27 +1,27 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2426 extends Application {
+public class Ticket2426 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
final String content = "<select/>";
w.addComponent(new Label("CONTENT_DEFAULT: " + content,
- Label.CONTENT_DEFAULT));
+ ContentMode.TEXT));
w.addComponent(new Label("CONTENT_PREFORMATTED: " + content,
- Label.CONTENT_PREFORMATTED));
- w.addComponent(new Label("CONTENT_RAW: " + content, Label.CONTENT_RAW));
- w.addComponent(new Label("CONTENT_TEXT: " + content, Label.CONTENT_TEXT));
- w.addComponent(new Label("CONTENT_XML: " + content, Label.CONTENT_XML));
- w.addComponent(new Label("CONTENT_XHTML: " + content,
- Label.CONTENT_XHTML));
+ ContentMode.PREFORMATTED));
+ w.addComponent(new Label("CONTENT_RAW: " + content, ContentMode.RAW));
+ w.addComponent(new Label("CONTENT_TEXT: " + content, ContentMode.TEXT));
+ w.addComponent(new Label("CONTENT_XML: " + content, ContentMode.XML));
+ w.addComponent(new Label("CONTENT_XHTML: " + content, ContentMode.XHTML));
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
index e1eb2531f2..f6e6c1e7b5 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2431.java
@@ -7,14 +7,14 @@ import com.vaadin.event.ShortcutAction;
import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutAction.ModifierKey;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2431 extends Application {
+public class Ticket2431 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
Label help = new Label(
"Use CTRL X to fire action, CTRL C to remove it (fails before fix)");
@@ -30,10 +30,12 @@ public class Ticket2431 extends Application {
Action[] actions = new Action[] { a1, a2 };
+ @Override
public Action[] getActions(Object target, Object sender) {
return actions;
}
+ @Override
public void handleAction(Action action, Object sender, Object target) {
if (action == a1) {
getMainWindow().addComponent(new Label("CTRL X hit"));
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
index 326f27d58a..2716038873 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2432.java
@@ -8,14 +8,14 @@ import com.vaadin.ui.Label;
import com.vaadin.ui.Layout;
import com.vaadin.ui.Layout.AlignmentHandler;
import com.vaadin.ui.Layout.SpacingHandler;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2432 extends Application {
+public class Ticket2432 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
w.getContent().setSizeFull();
((SpacingHandler) w.getContent()).setSpacing(true);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
index 5d4a884895..79e383393f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2434.java
@@ -2,15 +2,15 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
-public class Ticket2434 extends Application {
+public class Ticket2434 extends Application.LegacyApplication {
@Override
public void init() {
- Window w = new Window();
+ LegacyWindow w = new LegacyWindow();
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
index 0d8c5ad2dd..f48cf7a79a 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2436.java
@@ -4,27 +4,30 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Component;
import com.vaadin.ui.PopupView;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket2436 extends Application {
+public class Ticket2436 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window();
+ final LegacyWindow main = new LegacyWindow();
setMainWindow(main);
final Button remover = new Button("Remove PopupView");
final PopupView pv = new PopupView(new PopupView.Content() {
+ @Override
public String getMinimizedValueAsHTML() {
return "PopupView";
}
+ @Override
public Component getPopupComponent() {
return remover;
}
});
remover.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(Button.ClickEvent event) {
main.removeComponent(pv);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java
deleted file mode 100644
index cd1e8e682e..0000000000
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2440.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package com.vaadin.tests.tickets;
-
-import java.net.URL;
-
-import com.vaadin.Application;
-import com.vaadin.terminal.DownloadStream;
-import com.vaadin.terminal.ExternalResource;
-import com.vaadin.terminal.URIHandler;
-import com.vaadin.ui.Label;
-import com.vaadin.ui.Link;
-import com.vaadin.ui.Window;
-
-public class Ticket2440 extends Application {
-
- @Override
- public void init() {
- final Window main = new MainWindow();
- setMainWindow(main);
- main.addComponent(new Label(
- "Clicking the link should open a new window that should receive the URI 'msg/hello' and add that a a Label to it's ui. Currently the Label ends up in this (main) window (try reloading). Console intentionally spams during the window finding/uri handling - looks, uhm, interesting."));
- }
-
- @Override
- public Window getWindow(String name) {
- System.err.println("Looking for " + name);
- if ("msg".equals(name)) {
- System.err
- .println(" rest uri, returning new MainWindow with message from uri");
- MainWindow restWindow = new MainWindow();
- addWindow(restWindow);
- return restWindow;
- }
- // If we already have the requested window, use it
- Window w = super.getWindow(name);
- if (w == null) {
- // If no window found, create it
- System.err.println(" new win");
- w = new MainWindow();
- w.setName(name);
- addWindow(w);
- return w;
- } else {
- System.err.println(" found win");
- return w;
- }
-
- }
-
- private class MainWindow extends Window {
- public MainWindow() {
- super("Main window");
-
- addComponent(new Link("new mainwin", new ExternalResource(
- Ticket2440.this.getURL() + "msg/hello"), "_blank", -1, -1,
- Window.BORDER_DEFAULT));
-
- addURIHandler(new URIHandler() {
- public DownloadStream handleURI(URL context, String relativeUri) {
- System.err
- .println((getMainWindow() == getWindow() ? "mainwin: "
- : "subwin: ")
- + context + ", " + relativeUri);
- addComponent(new Label(relativeUri));
- return null;
- }
- });
- }
-
- @Override
- public DownloadStream handleURI(URL context, String relativeUri) {
- System.err.println("MainWindow.handleURI();");
- return super.handleURI(context, relativeUri);
- }
-
- }
-
-}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
index 5fc06c27bf..97d096405e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2526.java
@@ -3,16 +3,18 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Window;
-public class Ticket2526 extends Application {
+public class Ticket2526 extends Application.LegacyApplication {
@Override
public void init() {
- final Window main = new Window();
+ final LegacyWindow main = new LegacyWindow();
setMainWindow(main);
Button b = new Button("Add windows");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
main.addWindow(new Window());
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
index d656b0205c..1003ea1c66 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2742.java
@@ -6,13 +6,13 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.NativeSelect;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
/**
* @author Risto Yrjänä / Vaadin Ltd.
*
*/
-public class Ticket2742 extends Application {
+public class Ticket2742 extends Application.LegacyApplication {
/*
* (non-Javadoc)
@@ -21,7 +21,7 @@ public class Ticket2742 extends Application {
*/
@Override
public void init() {
- Window mainWindow = new Window();
+ LegacyWindow mainWindow = new LegacyWindow();
setMainWindow(mainWindow);
String shortString = "Short";
@@ -39,4 +39,4 @@ public class Ticket2742 extends Application {
mainWindow.addComponent(hl);
}
-} \ No newline at end of file
+}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
index 9e28908c22..ab808501f7 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2901.java
@@ -2,21 +2,22 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.VerticalLayout;
import com.vaadin.ui.VerticalSplitPanel;
-import com.vaadin.ui.Window;
/**
* With IE7 extra scrollbars appear in content area all though content fits
* properly. Scrollbars will disappear if "shaking" content a bit, like
* selecting tests in area.
*/
-public class Ticket2901 extends Application {
+public class Ticket2901 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app to break layout in IE6");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app to break layout in IE6");
setMainWindow(mainWin);
VerticalSplitPanel sp = new VerticalSplitPanel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
index c37a9362d6..ee60c0ce7e 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2998.java
@@ -20,7 +20,9 @@ import com.vaadin.ui.Field;
import com.vaadin.ui.FormLayout;
import com.vaadin.ui.Layout;
import com.vaadin.ui.ListSelect;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
@@ -35,7 +37,7 @@ import com.vaadin.ui.themes.Reindeer;
*
* Other browsers are much faster.
*/
-public class Ticket2998 extends Application {
+public class Ticket2998 extends Application.LegacyApplication {
private Table table;
private VerticalLayout mainLayout;
@@ -129,7 +131,7 @@ public class Ticket2998 extends Application {
close();
} else {
date.setValue(run.getDate());
- kilomiters.setValue(run.getKilometers());
+ kilomiters.setValue(String.valueOf(run.getKilometers()));
title.setValue(run.getTitle());
if (getParent() == null) {
workoutLog.getMainWindow().addWindow(this);
@@ -145,7 +147,7 @@ public class Ticket2998 extends Application {
}
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
/*
@@ -162,7 +164,7 @@ public class Ticket2998 extends Application {
return getSecondaryTypesList(itemId);
}
- final Field f = super.createField(container, itemId, propertyId,
+ final Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
if (f != null) {
if (f instanceof TextField) {
@@ -172,24 +174,19 @@ public class Ticket2998 extends Application {
if (propertyId.equals("kilometers")) {
f.setWidth("4em");
f.addValidator(new Validator() {
- public boolean isValid(Object value) {
+ @Override
+ public void validate(Object value)
+ throws InvalidValueException {
+ // FIXME this does not follow the standard pattern
+ // for validators and has side effects!
try {
@SuppressWarnings("unused")
float f = Float.parseFloat((String) value);
- return true;
} catch (Exception e) {
- f.getWindow().showNotification(
- "Bad number value");
+ Notification.show("Bad number value");
f.setValue(0);
- return false;
}
}
-
- public void validate(Object value)
- throws InvalidValueException {
- // TODO Auto-generated method stub
-
- }
});
}
if (propertyId.equals("date")) {
@@ -202,7 +199,7 @@ public class Ticket2998 extends Application {
private Map<Object, ListSelect> workoutIdToList = new HashMap<Object, ListSelect>();
- private Field getSecondaryTypesList(Object itemId) {
+ private Field<?> getSecondaryTypesList(Object itemId) {
ListSelect list = workoutIdToList.get(itemId);
if (list == null) {
list = new ListSelect();
@@ -221,7 +218,7 @@ public class Ticket2998 extends Application {
private Map<Object, ComboBox> workoutIdToCombobox = new HashMap<Object, ComboBox>();
- private Field getTrainingTypeComboboxFor(Object itemId) {
+ private Field<?> getTrainingTypeComboboxFor(Object itemId) {
ComboBox cb = workoutIdToCombobox.get(itemId);
if (cb == null) {
final ComboBox cb2 = new ComboBox();
@@ -250,7 +247,7 @@ public class Ticket2998 extends Application {
*/
private void buildView() {
- final Window w = new Window("Workout Log");
+ final LegacyWindow w = new LegacyWindow("Workout Log");
// set theme and some layout stuff
setMainWindow(w);
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
index f4dc1d59e4..b6e01d912f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket3146.java
@@ -6,18 +6,18 @@ import java.util.HashSet;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket3146 extends Application {
+public class Ticket3146 extends Application.LegacyApplication {
Table table;
TextField result;
@Override
public void init() {
- Window mainWindow = new Window("Test");
+ LegacyWindow mainWindow = new LegacyWindow("Test");
table = new Table();
table.addContainerProperty("Items", String.class, null);
@@ -36,6 +36,7 @@ public class Ticket3146 extends Application {
Button clearButton = new Button("Clear selection",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
clearSelection();
}
@@ -43,6 +44,7 @@ public class Ticket3146 extends Application {
mainWindow.addComponent(clearButton);
Button clearButton2 = new Button("Clear selection 2",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
clearSelection2();
}
@@ -50,6 +52,7 @@ public class Ticket3146 extends Application {
mainWindow.addComponent(clearButton2);
Button clearButton3 = new Button("Clear selection 3",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
clearSelection3();
}
@@ -57,6 +60,7 @@ public class Ticket3146 extends Application {
mainWindow.addComponent(clearButton3);
Button printButton = new Button("Print selection",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
printSelection();
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
index 7d3baf78fa..e3b90c94b0 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java
@@ -4,51 +4,45 @@ import java.util.HashMap;
import java.util.Map;
import com.vaadin.Application;
+import com.vaadin.terminal.Page;
+import com.vaadin.terminal.Page.FragmentChangedEvent;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.UriFragmentUtility;
-import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket34 extends Application {
+public class Ticket34 extends Application.LegacyApplication {
private Map<String, Component> views = new HashMap<String, Component>();
private VerticalLayout mainLayout;
private Component currentView;
- private UriFragmentUtility reader;
@Override
public void init() {
buildViews(new String[] { "main", "view2", "view3" });
- reader = new UriFragmentUtility();
- reader.addListener(new UriFragmentUtility.FragmentChangedListener() {
+ mainLayout = new VerticalLayout();
+ mainLayout.setSizeFull();
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for URI fragment management/reading", mainLayout);
+ setMainWindow(mainWin);
+
+ mainWin.getPage().addListener(new Page.FragmentChangedListener() {
+ @Override
public void fragmentChanged(FragmentChangedEvent event) {
getMainWindow().showNotification(
- "Fragment now: "
- + event.getUriFragmentUtility().getFragment());
+ "Fragment now: " + event.getFragment());
// try to change to view mapped by fragment string
- setView(event.getUriFragmentUtility().getFragment());
+ setView(event.getFragment());
}
});
- mainLayout = new VerticalLayout();
- mainLayout.setSizeFull();
- final Window mainWin = new Window(
- "Test app for URI fragment management/reading", mainLayout);
- setMainWindow(mainWin);
-
- // UriFragmentReader is 0px size by default, so it will not render
- // anything on screen
- mainLayout.addComponent(reader);
-
setView("main");
}
@@ -97,10 +91,11 @@ public class Ticket34 extends Application {
p.addComponent(b);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
String viewName = tf.getValue().toString();
// fragmentChangedListener will change the view if possible
- reader.setFragment(viewName);
+ event.getButton().getRoot().getPage().setFragment(viewName);
}
});
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
index 2f5bade03a..35f244e07f 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5053.java
@@ -2,16 +2,16 @@ package com.vaadin.tests.tickets;
import com.vaadin.Application;
import com.vaadin.ui.ComboBox;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
/**
* #5053: Last ComboBox item may not be shown if null selection enabled
*/
-public class Ticket5053 extends Application {
+public class Ticket5053 extends Application.LegacyApplication {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
ComboBox combobox = new ComboBox("My ComboBox");
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
index c5049f67c0..5902382d01 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5157.java
@@ -5,8 +5,8 @@ import com.vaadin.event.ShortcutAction.KeyCode;
import com.vaadin.event.ShortcutListener;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
/**
* Key codes were converted to lower case on the server (overlapping special key
@@ -14,11 +14,12 @@ import com.vaadin.ui.Window;
* Therefore, registering e.g. F8 as a key code resulted in "w" being used as
* the trigger and F8 being ignored.
*/
-public class Ticket5157 extends Application {
+public class Ticket5157 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window("Forumtests Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
setMainWindow(mainWindow);
Panel p = new Panel();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
index cd2b3a70e6..b7caa08b82 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket5952.java
@@ -1,30 +1,30 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket5952 extends Application {
+public class Ticket5952 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWindow = new Window("Forumtests Application");
+ final LegacyWindow mainWindow = new LegacyWindow(
+ "Forumtests Application");
setMainWindow(mainWindow);
-
- String mathml =
- "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>"+
- "<mrow>"+
- " <msup>"+
- " <mi>x</mi>"+
- " <mn>2</mn>"+
- " </msup>"+
- " <msup>"+
- " <mi>c</mi>"+
- " <mn>2</mn>"+
- " </msup>"+
- " </mrow>"+
- "</math>";
- Label mathLabel = new Label(mathml, Label.CONTENT_XML);
+
+ String mathml = "<math mode='display' xmlns='http://www.w3.org/1998/Math/MathML'>"
+ + "<mrow>"
+ + " <msup>"
+ + " <mi>x</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " <msup>"
+ + " <mi>c</mi>"
+ + " <mn>2</mn>"
+ + " </msup>"
+ + " </mrow>" + "</math>";
+ Label mathLabel = new Label(mathml, ContentMode.XML);
mainWindow.addComponent(mathLabel);
}
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
index ad3b01ae78..fef7061516 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket6002.java
@@ -3,18 +3,17 @@ package com.vaadin.tests.tickets;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.data.util.ObjectProperty;
-import com.vaadin.tests.components.AbstractTestCase;
+import com.vaadin.tests.components.TestBase;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
-public class Ticket6002 extends AbstractTestCase {
+public class Ticket6002 extends TestBase {
@Override
- public void init() {
- Window main = new Window("The Main Window");
- setMainWindow(main);
+ public void setup() {
+ LegacyWindow main = getMainWindow();
final VerticalLayout mainLayout = new VerticalLayout();
main.setContent(mainLayout);
@@ -32,6 +31,8 @@ public class Ticket6002 extends AbstractTestCase {
final TextField tf1 = new TextField(
"Changing this field modifies only the textfield", property1);
tf1.addListener(new Property.ValueChangeListener() {
+
+ @Override
public void valueChange(ValueChangeEvent event) {
// This value change event is called twice if the new
// input value is an integer. The second time is during
@@ -56,6 +57,8 @@ public class Ticket6002 extends AbstractTestCase {
"Changing this field modifies the layout - do it twice",
property2);
tf2.addListener(new Property.ValueChangeListener() {
+
+ @Override
public void valueChange(ValueChangeEvent event) {
// This value change event is called twice if the new
// input value is an integer. The second time is during
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
index f2a1ae1664..ca55b8648c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket677.java
@@ -5,6 +5,7 @@ import com.vaadin.data.Container;
import com.vaadin.data.Item;
import com.vaadin.data.Property;
import com.vaadin.data.util.BeanItem;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Component;
@@ -16,11 +17,11 @@ import com.vaadin.ui.GridLayout;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.Table;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket677 extends Application {
+public class Ticket677 extends Application.LegacyApplication {
private static final Label info = new Label(
"<li> keep debug window open to see variable changes"
@@ -30,7 +31,7 @@ public class Ticket677 extends Application {
+ "<li> focusing should fail (try tabbing as well) [worked previousy]"
+ "<li> no variable changes should be sent from disabled fields [changed sent previously]"
+ "<li> try further toggling and tabbing around",
- Label.CONTENT_RAW);
+ ContentMode.RAW);
Panel root = new Panel("Enabled");
Panel one = new Panel("Enabled");
@@ -40,7 +41,7 @@ public class Ticket677 extends Application {
@Override
public void init() {
- Window main = new Window();
+ LegacyWindow main = new LegacyWindow();
setMainWindow(main);
main.addComponent(info);
@@ -50,28 +51,33 @@ public class Ticket677 extends Application {
l.addComponent(new Button("Toggle root panel",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toggle(root);
}
}));
l.addComponent(new Button("Toggle panel one",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toggle(one);
}
}));
l.addComponent(new Button("Toggle panel two",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toggle(two);
}
}));
l.addComponent(new Button("Toggle form", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toggle(form);
}
}));
l.addComponent(new Button("Toggle table", new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
toggle(table);
}
@@ -111,9 +117,9 @@ public class Ticket677 extends Application {
form.setFormFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Item item, Object propertyId,
+ public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
- Field f = super.createField(item, propertyId, uiContext);
+ Field<?> f = super.createField(item, propertyId, uiContext);
f.setEnabled(!"disabled".equals(propertyId));
return f;
}
@@ -127,19 +133,19 @@ public class Ticket677 extends Application {
table.addContainerProperty("Text", String.class, null);
for (int i = 0; i < 150; i++) {
Item item = table.addItem("Item" + i);
- Property p = item.getItemProperty("Text");
+ Property<?> p = item.getItemProperty("Text");
p.setValue(i % 5 == 0 ? "enabled" : "disabled");
}
table.setTableFieldFactory(new DefaultFieldFactory() {
@Override
- public Field createField(Container container, Object itemId,
+ public Field<?> createField(Container container, Object itemId,
Object propertyId, Component uiContext) {
- Field f = super.createField(container, itemId, propertyId,
+ Field<?> f = super.createField(container, itemId, propertyId,
uiContext);
Item item = container.getItem(itemId);
- Property p = item.getItemProperty(propertyId);
+ Property<?> p = item.getItemProperty(propertyId);
if ("disabled".equals(p.getValue())) {
f.setEnabled(false);
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
index f122031b6e..c62cee038c 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket695.java
@@ -7,19 +7,20 @@ import java.io.ObjectOutputStream;
import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
@SuppressWarnings("serial")
-public class Ticket695 extends Application {
+public class Ticket695 extends Application.LegacyApplication {
@Override
public void init() {
- final Window w = new Window("Serialization test #695");
+ final LegacyWindow w = new LegacyWindow("Serialization test #695");
setMainWindow(w);
Button b = new Button("Serialize ApplicationContext");
w.addComponent(b);
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
try {
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
index c530b7ca99..d871c8adc4 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java
@@ -4,28 +4,30 @@ import com.vaadin.Application;
import com.vaadin.data.Validator;
import com.vaadin.data.util.BeanItem;
import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.terminal.ThemeResource;
import com.vaadin.ui.AbstractComponent;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
+import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.CheckBox;
import com.vaadin.ui.Form;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root.LegacyWindow;
-public class Ticket736 extends Application {
+public class Ticket736 extends Application.LegacyApplication {
Address address = new Address();
@Override
public void init() {
- final Window mainWin = new Window("Test app for #736");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #736");
setMainWindow(mainWin);
- mainWin.setTheme("runo");
+ setTheme("runo");
// Create form for editing address
final Form f = new Form();
@@ -37,10 +39,22 @@ public class Ticket736 extends Application {
mainWin.addComponent(f);
// Select to use buffered mode for editing to enable commit and discard
- f.setWriteThrough(false);
- f.setReadThrough(false);
- Button commit = new Button("Commit", f, "commit");
- Button discard = new Button("Discard", f, "discard");
+ f.setBuffered(true);
+ Button commit = new Button("Commit", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ f.commit();
+ }
+ });
+ Button discard = new Button("Discard", new ClickListener() {
+
+ @Override
+ public void buttonClick(ClickEvent event) {
+ f.discard();
+ }
+
+ });
HorizontalLayout ol = new HorizontalLayout();
ol.setHeight("3em");
ol.addComponent(commit);
@@ -49,8 +63,9 @@ public class Ticket736 extends Application {
f.setFooter(ol);
// Add some validators for the form
- f.getField("zip").addValidator(new IsInteger());
- f.getField("zip").setDescription("Jepjep");
+ f.getField("zip").addValidator(
+ new IntegerValidator("'{0}' is not a number"));
+ ((AbstractComponent) f.getField("zip")).setDescription("Jepjep");
((AbstractComponent) f.getField("zip")).setIcon(new ThemeResource(
"../runo/icons/16/folder.png"));
f.getField("state").addValidator(new IsValidState());
@@ -77,6 +92,7 @@ public class Ticket736 extends Application {
mainWin.addComponent(new Button("Show state of the address object",
new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
mainWin.showNotification(address.toString());
}
@@ -84,7 +100,7 @@ public class Ticket736 extends Application {
}
/** Address pojo. */
- public class Address {
+ public static class Address {
String name = "";
String street = "";
String zip = "";
@@ -148,44 +164,19 @@ public class Ticket736 extends Application {
}
- /** Simple validator for checking if the validated value is an integer */
- class IsInteger implements Validator {
-
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException("'" + value
- + "' is not a number");
- }
- }
- }
-
/** Simple state validator */
- class IsValidState implements Validator {
+ static class IsValidState implements Validator {
- public boolean isValid(Object value) {
+ @Override
+ public void validate(Object value) throws InvalidValueException {
// Empty and null are accepted values
if (value == null || "".equals("" + value)) {
- return true;
+ return;
}
// Otherwise state must be two capital letter combo
- if (value.toString().length() != 2) {
- return false;
- }
- return value.toString().equals(("" + value).toUpperCase());
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
+ if (value.toString().length() != 2
+ || !value.toString().equals(("" + value).toUpperCase())) {
throw new InvalidValueException(
"State must be either two capital letter abreviation or left empty");
}
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java
index 86b5db953b..2f094f0bf8 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java
@@ -4,33 +4,35 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
-import com.vaadin.Application;
import com.vaadin.data.Container.Filter;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItemContainer;
+import com.vaadin.terminal.WrappedRequest;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.HorizontalLayout;
+import com.vaadin.ui.Root;
import com.vaadin.ui.Table;
-import com.vaadin.ui.Window;
/**
* Test for #8291 and #7666: NegativeArraySizeException when Table scrolled to
* the end and its size reduced.
*/
-public class Ticket8291 extends Application {
+public class Ticket8291 extends Root {
@Override
- public void init() {
- setMainWindow(new Window("", new TestView()));
+ public void init(WrappedRequest request) {
+ setContent(new TestView());
}
private static class DecimateFilter implements Filter {
+ @Override
public boolean passesFilter(Object itemId, Item item)
throws UnsupportedOperationException {
return ((((TestObject) itemId).property3 % 10) == 0);
}
+ @Override
public boolean appliesToProperty(Object propertyId) {
return true;
}
@@ -61,6 +63,7 @@ public class Ticket8291 extends Application {
addComponent(table);
Button button = new Button("Click");
button.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
reduceData = !reduceData;
table.refreshRowCache();
@@ -69,6 +72,7 @@ public class Ticket8291 extends Application {
addComponent(button);
Button button2 = new Button("Filter");
button2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
if (filter != null) {
container.removeAllContainerFilters();
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
index 23f3134308..413d823d2d 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket846.java
@@ -1,41 +1,25 @@
package com.vaadin.tests.tickets;
import com.vaadin.Application;
-import com.vaadin.data.Validator;
import com.vaadin.data.util.MethodProperty;
+import com.vaadin.data.validator.IntegerValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.CheckBox;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket846 extends Application {
+public class Ticket846 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for #846");
+ final LegacyWindow mainWin = new LegacyWindow("Test app for #846");
setMainWindow(mainWin);
final TextField tx = new TextField("Integer");
mainWin.addComponent(tx);
tx.setImmediate(true);
- tx.addValidator(new Validator() {
-
- public boolean isValid(Object value) {
- try {
- Integer.parseInt("" + value);
- return true;
- } catch (NumberFormatException e) {
- return false;
- }
- }
-
- public void validate(Object value) throws InvalidValueException {
- if (!isValid(value)) {
- throw new InvalidValueException(value + " is not a number");
- }
- }
- });
+ tx.addValidator(new IntegerValidator("{0} is not a number"));
final String[] visibleProps = { "required", "invalidAllowed",
"readOnly", "readThrough", "invalidCommitted",
@@ -51,6 +35,7 @@ public class Ticket846 extends Application {
mainWin.addComponent(new Button("Validate integer",
new Button.ClickListener() {
+ @Override
public void buttonClick(
com.vaadin.ui.Button.ClickEvent event) {
mainWin.showNotification("The field is "
diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
index a9333b5e0f..f72ff8beec 100644
--- a/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
+++ b/tests/testbench/com/vaadin/tests/tickets/Ticket932.java
@@ -4,16 +4,17 @@ import com.vaadin.Application;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Label;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextArea;
import com.vaadin.ui.TextField;
-import com.vaadin.ui.Window;
-public class Ticket932 extends Application {
+public class Ticket932 extends Application.LegacyApplication {
@Override
public void init() {
- final Window mainWin = new Window("Test app for max length feature");
+ final LegacyWindow mainWin = new LegacyWindow(
+ "Test app for max length feature");
setMainWindow(mainWin);
final TextField tx = new TextField(
@@ -26,6 +27,7 @@ public class Ticket932 extends Application {
Button b = new Button("Check value");
b.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
l.setValue("Length: " + tx.getValue().toString().length()
+ " Content: " + tx.getValue());
@@ -45,6 +47,7 @@ public class Ticket932 extends Application {
Button b2 = new Button("Check value");
b2.addListener(new Button.ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
l.setValue("Length: " + tx2.getValue().toString().length()
+ " Content: " + tx2.getValue());
diff --git a/tests/testbench/com/vaadin/tests/util/Address.java b/tests/testbench/com/vaadin/tests/util/Address.java
new file mode 100644
index 0000000000..5ef0669e1b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Address.java
@@ -0,0 +1,66 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+
+@SuppressWarnings("serial")
+public class Address implements Serializable {
+
+ private String streetAddress = "";
+ private Integer postalCode = null;
+ private String city = "";
+
+ public Address() {
+ }
+
+ public Address(String streetAddress, int postalCode, String city) {
+ setStreetAddress(streetAddress);
+ setPostalCode(postalCode);
+ setCity(city);
+ }
+
+ /**
+ * @return the streetAddress
+ */
+ public String getStreetAddress() {
+ return streetAddress;
+ }
+
+ /**
+ * @param streetAddress
+ * the streetAddress to set
+ */
+ public void setStreetAddress(String streetAddress) {
+ this.streetAddress = streetAddress;
+ }
+
+ /**
+ * @return the postalCode
+ */
+ public Integer getPostalCode() {
+ return postalCode;
+ }
+
+ /**
+ * @param postalCode
+ * the postalCode to set
+ */
+ public void setPostalCode(Integer postalCode) {
+ this.postalCode = postalCode;
+ }
+
+ /**
+ * @return the city
+ */
+ public String getCity() {
+ return city;
+ }
+
+ /**
+ * @param city
+ * the city to set
+ */
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java b/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java
new file mode 100644
index 0000000000..ddb58999ee
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/AlwaysFailValidator.java
@@ -0,0 +1,23 @@
+package com.vaadin.tests.util;
+
+import com.vaadin.data.validator.AbstractValidator;
+
+public class AlwaysFailValidator extends AbstractValidator<Object> {
+ public AlwaysFailValidator() {
+ super("Validation error");
+ }
+
+ public AlwaysFailValidator(String message) {
+ super(message);
+ }
+
+ @Override
+ protected boolean isValidValue(Object value) {
+ return false;
+ }
+
+ @Override
+ public Class getType() {
+ return Object.class;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/util/Log.java b/tests/testbench/com/vaadin/tests/util/Log.java
index 4eef48a789..9111ff3968 100644
--- a/tests/testbench/com/vaadin/tests/util/Log.java
+++ b/tests/testbench/com/vaadin/tests/util/Log.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.util;
import java.util.ArrayList;
import java.util.List;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
@@ -49,7 +50,7 @@ public class Log extends VerticalLayout {
}
private Label createEventLabel() {
- Label l = new Label("&nbsp;", Label.CONTENT_XHTML);
+ Label l = new Label("&nbsp;", ContentMode.XHTML);
l.setWidth(null);
return l;
}
diff --git a/tests/testbench/com/vaadin/tests/util/Millionaire.java b/tests/testbench/com/vaadin/tests/util/Millionaire.java
new file mode 100644
index 0000000000..44d4def416
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Millionaire.java
@@ -0,0 +1,22 @@
+package com.vaadin.tests.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class Millionaire extends Person {
+ private List<Address> secondaryResidences = new ArrayList<Address>();
+
+ public Millionaire() {
+ }
+
+ public Millionaire(String firstName, String lastName, String email,
+ String phoneNumber, String streetAddress, int postalCode,
+ String city) {
+ super(firstName, lastName, email, phoneNumber, streetAddress,
+ postalCode, city);
+ }
+
+ public List<Address> getSecondaryResidences() {
+ return secondaryResidences;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/util/Person.java b/tests/testbench/com/vaadin/tests/util/Person.java
index c3e7a69d56..72f6b7d20d 100644
--- a/tests/testbench/com/vaadin/tests/util/Person.java
+++ b/tests/testbench/com/vaadin/tests/util/Person.java
@@ -8,12 +8,10 @@ public class Person implements Serializable {
private String lastName = "";
private String email = "";
private String phoneNumber = "";
- private String streetAddress = "";
- private Integer postalCode = null;
- private String city = "";
+ private Address address = new Address();
public Person() {
-
+ address = new Address();
}
public Person(String firstName, String lastName, String email,
@@ -23,9 +21,7 @@ public class Person implements Serializable {
setLastName(lastName);
setEmail(email);
setPhoneNumber(phoneNumber);
- setStreetAddress(streetAddress);
- setPostalCode(postalCode);
- setCity(city);
+ address = new Address(streetAddress, postalCode, city);
}
/**
@@ -89,48 +85,12 @@ public class Person implements Serializable {
}
/**
- * @return the streetAddress
- */
- public String getStreetAddress() {
- return streetAddress;
- }
-
- /**
- * @param streetAddress
- * the streetAddress to set
- */
- public void setStreetAddress(String streetAddress) {
- this.streetAddress = streetAddress;
- }
-
- /**
- * @return the postalCode
- */
- public Integer getPostalCode() {
- return postalCode;
- }
-
- /**
- * @param postalCode
- * the postalCode to set
- */
- public void setPostalCode(Integer postalCode) {
- this.postalCode = postalCode;
- }
-
- /**
- * @return the city
- */
- public String getCity() {
- return city;
- }
-
- /**
- * @param city
- * the city to set
+ * Returns the address where the person lives.
+ *
+ * @return address (not null)
*/
- public void setCity(String city) {
- this.city = city;
+ public Address getAddress() {
+ return address;
}
} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/util/PersonContainer.java b/tests/testbench/com/vaadin/tests/util/PersonContainer.java
index 8195b4d5f0..a3cf28b083 100644
--- a/tests/testbench/com/vaadin/tests/util/PersonContainer.java
+++ b/tests/testbench/com/vaadin/tests/util/PersonContainer.java
@@ -13,8 +13,8 @@ public class PersonContainer extends BeanItemContainer<Person> implements
* Natural property order for Person bean. Used in tables and forms.
*/
public static final Object[] NATURAL_COL_ORDER = new Object[] {
- "firstName", "lastName", "email", "phoneNumber", "streetAddress",
- "postalCode", "city" };
+ "firstName", "lastName", "email", "phoneNumber",
+ "address.streetAddress", "address.postalCode", "address.city" };
/**
* "Human readable" captions for properties in same order as in
@@ -27,6 +27,9 @@ public class PersonContainer extends BeanItemContainer<Person> implements
public PersonContainer() throws InstantiationException,
IllegalAccessException {
super(Person.class);
+ addNestedContainerProperty("address.streetAddress");
+ addNestedContainerProperty("address.postalCode");
+ addNestedContainerProperty("address.city");
}
public static PersonContainer createWithTestData() {
@@ -67,7 +70,7 @@ public class PersonContainer extends BeanItemContainer<Person> implements
Person p = new Person();
p.setFirstName(fnames[r.nextInt(fnames.length)]);
p.setLastName(lnames[r.nextInt(lnames.length)]);
- p.setCity(cities[r.nextInt(cities.length)]);
+ p.getAddress().setCity(cities[r.nextInt(cities.length)]);
p.setEmail(p.getFirstName().toLowerCase() + "."
+ p.getLastName().toLowerCase() + "@vaadin.com");
p.setPhoneNumber("+358 02 555 " + r.nextInt(10) + r.nextInt(10)
@@ -76,8 +79,9 @@ public class PersonContainer extends BeanItemContainer<Person> implements
if (n < 10000) {
n += 10000;
}
- p.setPostalCode(n);
- p.setStreetAddress(streets[r.nextInt(streets.length)]);
+ p.getAddress().setPostalCode(n);
+ p.getAddress().setStreetAddress(
+ streets[r.nextInt(streets.length)]);
c.addItem(p);
}
} catch (InstantiationException e) {
diff --git a/tests/testbench/com/vaadin/tests/util/Role.java b/tests/testbench/com/vaadin/tests/util/Role.java
new file mode 100644
index 0000000000..83f63db4ab
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/Role.java
@@ -0,0 +1,37 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+import java.util.HashSet;
+import java.util.Set;
+
+public class Role implements Serializable {
+ private String name = "";
+ private Set<User> users = new HashSet<User>();
+
+ public Role() {
+ }
+
+ public Role(String name) {
+ setName(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * In this direction, the users for a role can be queried and the returned
+ * collection modified, but the whole collection of users cannot be set
+ * directly.
+ *
+ * @return set of users having the role (not null)
+ */
+ public Set<User> getUsers() {
+ return users;
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
index f97c3c0740..c22eac9a6e 100644
--- a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
+++ b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java
@@ -7,9 +7,11 @@ package com.vaadin.tests.util;
import java.io.File;
import com.vaadin.Application;
+import com.vaadin.shared.ui.label.ContentMode;
import com.vaadin.terminal.SystemError;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
+import com.vaadin.ui.Root;
/**
* Provides sample directory based on application directory. If this fails then
@@ -27,7 +29,7 @@ public class SampleDirectory {
* @param application
* @return file pointing to sample directory
*/
- public static File getDirectory(Application application) {
+ public static File getDirectory(Application application, Root root) {
String errorMessage = "Access to application "
+ "context base directory failed, "
+ "possible security constraint with Application "
@@ -63,11 +65,11 @@ public class SampleDirectory {
errorPanel.setStyleName("strong");
errorPanel.setComponentError(new SystemError(
"Cannot provide sample directory"));
- errorPanel.addComponent(new Label(errorMessage, Label.CONTENT_XHTML));
+ errorPanel.addComponent(new Label(errorMessage, ContentMode.XHTML));
// Remove all components from applications main window
- application.getMainWindow().getContent().removeAllComponents();
+ root.getContent().removeAllComponents();
// Add error panel
- application.getMainWindow().getContent().addComponent(errorPanel);
+ root.getContent().addComponent(errorPanel);
return null;
}
}
diff --git a/tests/testbench/com/vaadin/tests/util/TestClickListener.java b/tests/testbench/com/vaadin/tests/util/TestClickListener.java
index 95b9cf2d40..b9f6d66b3e 100644
--- a/tests/testbench/com/vaadin/tests/util/TestClickListener.java
+++ b/tests/testbench/com/vaadin/tests/util/TestClickListener.java
@@ -29,6 +29,7 @@ public class TestClickListener implements Button.ClickListener {
System.out.println("Created listener " + name + ", id=" + count);
}
+ @Override
public void buttonClick(ClickEvent event) {
System.out
.println("ClickEvent from listener " + name + ", id=" + count);
diff --git a/tests/testbench/com/vaadin/tests/util/TestUtils.java b/tests/testbench/com/vaadin/tests/util/TestUtils.java
index aed69055c7..a9e1518c54 100644
--- a/tests/testbench/com/vaadin/tests/util/TestUtils.java
+++ b/tests/testbench/com/vaadin/tests/util/TestUtils.java
@@ -2,7 +2,7 @@ package com.vaadin.tests.util;
import com.vaadin.data.Item;
import com.vaadin.data.util.IndexedContainer;
-import com.vaadin.ui.Window;
+import com.vaadin.ui.Root;
public class TestUtils {
@@ -102,7 +102,7 @@ public class TestUtils {
*
* @param cssString
*/
- public static void injectCSS(Window w, String cssString) {
+ public static void injectCSS(Root w, String cssString) {
String script = "if ('\\v'=='v') /* ie only */ {\n"
+ " document.createStyleSheet().cssText = '"
+ cssString
@@ -112,7 +112,7 @@ public class TestUtils {
+ "document.body.style.WebkitAppearance=='string') /* webkit only */ ? 'innerText' "
+ ": 'innerHTML'] = '" + cssString + "';}";
- w.executeJavaScript(script);
+ w.getPage().getJavaScript().execute(script);
}
public static IndexedContainer getISO3166Container() {
diff --git a/tests/testbench/com/vaadin/tests/util/User.java b/tests/testbench/com/vaadin/tests/util/User.java
new file mode 100644
index 0000000000..003f485017
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/util/User.java
@@ -0,0 +1,54 @@
+package com.vaadin.tests.util;
+
+import java.io.Serializable;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
+
+public class User implements Serializable {
+ private String name = "";
+ private Set<Role> roles = new HashSet<Role>();
+
+ public User() {
+ }
+
+ public User(String name) {
+ setName(name);
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Returns an unmodifiable set of roles. To modify the roles a user has,
+ * replace the whole set using {@link #setRoles(Set)}.
+ *
+ * @return set of roles (unmodifiable, not null)
+ */
+ public Set<Role> getRoles() {
+ return Collections.unmodifiableSet(roles);
+ }
+
+ /**
+ * Replaces the set of roles with another collection. User references in
+ * roles are automatically updated when setting the roles of a user.
+ *
+ * @param roles
+ * non-null set of roles
+ */
+ public void setRoles(Set<Role> roles) {
+ for (Role role : this.roles) {
+ role.getUsers().remove(this);
+ }
+ this.roles = roles;
+ for (Role role : this.roles) {
+ role.getUsers().add(this);
+ }
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
index af48f92f5c..d6627a7d94 100644
--- a/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
+++ b/tests/testbench/com/vaadin/tests/validation/EmptyFieldErrorIndicators.java
@@ -3,8 +3,8 @@ package com.vaadin.tests.validation;
import java.util.Date;
import com.vaadin.data.Validator.InvalidValueException;
-import com.vaadin.data.validator.AbstractValidator;
import com.vaadin.tests.components.TestBase;
+import com.vaadin.tests.util.AlwaysFailValidator;
import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
@@ -45,7 +45,6 @@ public class EmptyFieldErrorIndicators extends TestBase {
panel.setSizeFull();
panel.setStyleName(Reindeer.PANEL_LIGHT);
panel.addComponent(hl);
- panel.setScrollable(true);
addComponent(panel);
}
@@ -59,6 +58,7 @@ public class EmptyFieldErrorIndicators extends TestBase {
Button validate = new Button("Validate fields");
validate.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
form.validate();
@@ -77,16 +77,12 @@ public class EmptyFieldErrorIndicators extends TestBase {
// hand-crafted form, not using form field factory
final Form form = new Form() {
@Override
- public void addField(Object propertyId, Field field) {
+ public void addField(Object propertyId, Field<?> field) {
super.addField(propertyId, field);
field.setRequired(required);
field.setRequiredError("Missing required value!");
if (failValidator && !(field instanceof Button)) {
- field.addValidator(new AbstractValidator("Validation error") {
- public boolean isValid(Object value) {
- return false;
- }
- });
+ field.addValidator(new AlwaysFailValidator());
}
}
};
@@ -98,8 +94,10 @@ public class EmptyFieldErrorIndicators extends TestBase {
// same as basic DateField
// form.addField("Popup Date", new PopupDateField("Date"));
Button setDateButton = new Button("Set date");
- form.addField("Set Date", setDateButton);
+ form.getLayout().addComponent(setDateButton);
+ // form.addField("Set Date", setDateButton);
setDateButton.addListener(new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
form.getField("Date").setValue(new Date(0));
}
diff --git a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
index 81c737cd17..7b03bc7ec2 100644
--- a/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
+++ b/tests/testbench/com/vaadin/tests/validation/RequiredErrorMessage.java
@@ -2,9 +2,9 @@ package com.vaadin.tests.validation;
import com.vaadin.tests.components.AbstractTestCase;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Root.LegacyWindow;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window;
public class RequiredErrorMessage extends AbstractTestCase {
@@ -21,7 +21,7 @@ public class RequiredErrorMessage extends AbstractTestCase {
@Override
public void init() {
- final Window main = new Window(getClass().getName());
+ final LegacyWindow main = new LegacyWindow(getClass().getName());
setMainWindow(main);
final Form form = new Form(new VerticalLayout());
diff --git a/tests/testbench/com/vaadin/tests/validation/TestValidators.java b/tests/testbench/com/vaadin/tests/validation/TestValidators.java
index 5264d47c9d..746a460da8 100644
--- a/tests/testbench/com/vaadin/tests/validation/TestValidators.java
+++ b/tests/testbench/com/vaadin/tests/validation/TestValidators.java
@@ -3,6 +3,7 @@ package com.vaadin.tests.validation;
import com.vaadin.data.Validator;
import com.vaadin.data.validator.AbstractStringValidator;
import com.vaadin.data.validator.CompositeValidator;
+import com.vaadin.data.validator.CompositeValidator.CombinationMode;
import com.vaadin.data.validator.DoubleValidator;
import com.vaadin.data.validator.EmailValidator;
import com.vaadin.data.validator.IntegerValidator;
@@ -13,9 +14,9 @@ import com.vaadin.ui.Button;
import com.vaadin.ui.Button.ClickEvent;
import com.vaadin.ui.Button.ClickListener;
import com.vaadin.ui.Form;
+import com.vaadin.ui.Notification;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
public class TestValidators extends TestBase {
@@ -96,8 +97,7 @@ public class TestValidators extends TestBase {
// TODO CompositeValidator
tf = new TextField(
"A field, must be a floating point number with 4-5 chars");
- CompositeValidator cv = new CompositeValidator(
- CompositeValidator.MODE_AND,
+ CompositeValidator cv = new CompositeValidator(CombinationMode.AND,
"The field must contain a floating point number with 4-5 characters");
cv.addValidator(new StringLengthValidator(
"String length of '{0}' should be 4-5 characters", 4, 5, false));
@@ -109,7 +109,7 @@ public class TestValidators extends TestBase {
tf = new TextField(
"A field, must be a floating point number or 4-5 chars");
- cv = new CompositeValidator(CompositeValidator.MODE_OR,
+ cv = new CompositeValidator(CombinationMode.OR,
"The field must contain a floating point or with 4-5 characters");
cv.addValidator(new StringLengthValidator(
"String length of '{0}' should be 4-5 characters", 4, 5, false));
@@ -127,7 +127,7 @@ public class TestValidators extends TestBase {
Validator postalCodeValidator = new AbstractStringValidator(
"Postal code must be a number 10000-99999.") {
@Override
- protected boolean isValidString(String value) {
+ protected boolean isValidValue(String value) {
return value.matches("[1-9][0-9]{4}");
}
};
@@ -137,6 +137,7 @@ public class TestValidators extends TestBase {
Button b = new Button("Commit", new ClickListener() {
+ @Override
public void buttonClick(ClickEvent event) {
try {
form.commit();
diff --git a/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html b/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html
index 433ad04ada..62d972e89f 100644
--- a/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html
+++ b/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.html
@@ -58,7 +58,7 @@
</tr>
<tr>
<td>mouseClick</td>
- <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/domChild[0]/domChild[1]</td>
+ <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]</td>
<td>34,186</td>
</tr>
<tr>
@@ -88,11 +88,21 @@
<td>0,0</td>
</tr>
<tr>
+ <td>waitForVisible</td>
+ <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
<td>screenCapture</td>
<td></td>
<td>error-must-be-int-and-5-to-10-chars</td>
</tr>
<tr>
+ <td>showTooltip</td>
+ <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]</td>
+ <td>0,0</td>
+</tr>
+<tr>
<td>mouseClick</td>
<td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::/VVerticalLayout[0]/ChildComponentContainer[1]/VVerticalLayout[0]/ChildComponentContainer[3]/VCheckBox[0]/domChild[0]</td>
<td>12,7</td>
@@ -123,11 +133,15 @@
<td>0,0</td>
</tr>
<tr>
+ <td>waitForVisible</td>
+ <td>vaadin=runcomvaadintestsvalidationValidationOfRequiredEmptyFields::Root/VTooltip[0]/FlowPanel[0]/VErrorMessage[0]/HTML[0]/domChild[0]/domChild[1]</td>
+ <td></td>
+</tr>
+<tr>
<td>screenCapture</td>
<td></td>
<td>empty-invalid-not-required</td>
</tr>
-
</tbody></table>
</body>
</html>
diff --git a/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java b/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
index 51c4f5ecc8..dd1732023b 100644
--- a/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
+++ b/tests/testbench/com/vaadin/tests/validation/ValidationOfRequiredEmptyFields.java
@@ -27,6 +27,7 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
requiredInput = new CheckBox("Field required");
requiredInput.setImmediate(true);
requiredInput.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
tf.setRequired((Boolean) requiredInput.getValue());
}
@@ -35,6 +36,7 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
requiredErrorInput = new TextField("Required error message");
requiredErrorInput.setImmediate(true);
requiredErrorInput.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
tf.setRequiredError((String) requiredErrorInput.getValue());
}
@@ -44,6 +46,7 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
integerValidatorInput.setImmediate(true);
integerValidatorInput.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if ((Boolean) integerValidatorInput.getValue()) {
tf.addValidator(integerValidator);
@@ -57,6 +60,7 @@ public class ValidationOfRequiredEmptyFields extends TestBase {
stringLengthValidatorInput.setImmediate(true);
stringLengthValidatorInput.addListener(new ValueChangeListener() {
+ @Override
public void valueChange(ValueChangeEvent event) {
if ((Boolean) stringLengthValidatorInput.getValue()) {
tf.addValidator(stringLengthValidator);
diff --git a/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml b/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml
new file mode 100644
index 0000000000..bd91d05b02
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/TestingWidgetSet.gwt.xml
@@ -0,0 +1,6 @@
+<module>
+ <!-- WS Compiler: manually edited -->
+
+ <!-- Inherit the DefaultWidgetSet -->
+ <inherits name="com.vaadin.terminal.gwt.DefaultWidgetSet" />
+</module>
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java
new file mode 100644
index 0000000000..db3e097a6e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/BasicExtensionTestConnector.java
@@ -0,0 +1,27 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import com.google.gwt.dom.client.DivElement;
+import com.google.gwt.dom.client.Document;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ServerConnector;
+import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector;
+import com.vaadin.tests.extensions.BasicExtension;
+
+@Connect(BasicExtension.class)
+public class BasicExtensionTestConnector extends AbstractExtensionConnector {
+ @Override
+ protected void extend(ServerConnector target) {
+ String message = Util.getSimpleName(this) + " extending "
+ + Util.getSimpleName(target);
+
+ DivElement element = Document.get().createDivElement();
+ element.setInnerText(message);
+
+ Document.get().getBody().insertFirst(element);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/ComplexTestBean.java b/tests/testbench/com/vaadin/tests/widgetset/client/ComplexTestBean.java
new file mode 100644
index 0000000000..47f8bedab1
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/ComplexTestBean.java
@@ -0,0 +1,70 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import java.util.List;
+
+import com.vaadin.shared.communication.SharedState;
+
+@SuppressWarnings("javadoc")
+public class ComplexTestBean extends SharedState {
+ private SimpleTestBean innerBean1;
+ private SimpleTestBean innerBean2;
+ private List<SimpleTestBean> innerBeanCollection;
+ private int privimite;
+
+ public ComplexTestBean() {
+ // Default
+ }
+
+ public ComplexTestBean(SimpleTestBean innerBean1,
+ SimpleTestBean innerBean2,
+ List<SimpleTestBean> innerBeanCollection, int privimite) {
+ this.innerBean1 = innerBean1;
+ this.innerBean2 = innerBean2;
+ this.innerBeanCollection = innerBeanCollection;
+ this.privimite = privimite;
+ }
+
+ public SimpleTestBean getInnerBean1() {
+ return innerBean1;
+ }
+
+ public void setInnerBean1(SimpleTestBean innerBean) {
+ innerBean1 = innerBean;
+ }
+
+ public SimpleTestBean getInnerBean2() {
+ return innerBean2;
+ }
+
+ public void setInnerBean2(SimpleTestBean innerBean2) {
+ this.innerBean2 = innerBean2;
+ }
+
+ public List<SimpleTestBean> getInnerBeanCollection() {
+ return innerBeanCollection;
+ }
+
+ public void setInnerBeanCollection(List<SimpleTestBean> innerBeanCollection) {
+ this.innerBeanCollection = innerBeanCollection;
+ }
+
+ public int getPrivimite() {
+ return privimite;
+ }
+
+ public void setPrivimite(int privimite) {
+ this.privimite = privimite;
+ }
+
+ @Override
+ public String toString() {
+ return "ComplexTestBean [innerBean1=" + innerBean1 + ", innerBean2="
+ + innerBean2 + ", innerBeanCollection=" + innerBeanCollection
+ + ", privimite=" + privimite + "]";
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java
new file mode 100644
index 0000000000..11d01c552e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/MissingFromDefaultWidgetsetConnector.java
@@ -0,0 +1,26 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client;
+
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.terminal.gwt.client.ui.label.VLabel;
+import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent;
+
+@Connect(MissingFromDefaultWidgetsetComponent.class)
+public class MissingFromDefaultWidgetsetConnector extends
+ AbstractComponentConnector {
+ @Override
+ public VLabel getWidget() {
+ return (VLabel) super.getWidget();
+ }
+
+ @Override
+ protected void init() {
+ getWidget()
+ .setText(
+ "This component is available in TestingWidgetset, but not in DefaultWidgetset");
+ super.init();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
new file mode 100644
index 0000000000..32e87ce6a4
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestConnector.java
@@ -0,0 +1,245 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import com.vaadin.shared.Connector;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.communication.RpcProxy;
+import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
+import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector;
+import com.vaadin.tests.widgetset.server.SerializerTestExtension;
+
+@Connect(SerializerTestExtension.class)
+public class SerializerTestConnector extends AbstractExtensionConnector {
+
+ private SerializerTestRpc rpc = RpcProxy.create(SerializerTestRpc.class,
+ this);
+
+ public SerializerTestConnector() {
+ registerRpc(SerializerTestRpc.class, new SerializerTestRpc() {
+ @Override
+ public void sendWrappedGenerics(
+ Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics) {
+ Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> updated = new HashMap<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>>();
+
+ SimpleTestBean firstValue = generics.values().iterator().next()
+ .get(Integer.valueOf(1)).get(0);
+ Set<SimpleTestBean> key = new HashSet<SimpleTestBean>(Arrays
+ .asList(firstValue));
+
+ Map<Integer, List<SimpleTestBean>> value = new HashMap<Integer, List<SimpleTestBean>>();
+ Set<SimpleTestBean> firstKeyValue = generics.keySet()
+ .iterator().next();
+ value.put(Integer.valueOf(1), new ArrayList<SimpleTestBean>(
+ firstKeyValue));
+
+ updated.put(key, value);
+
+ rpc.sendWrappedGenerics(updated);
+ }
+
+ @Override
+ public void sendString(String value) {
+ char[] chars = value.toCharArray();
+ Arrays.sort(chars);
+ rpc.sendString(new String(chars));
+ }
+
+ @Override
+ public void sendSet(Set<Integer> intSet,
+ Set<Connector> connectorSet, Set<SimpleTestBean> beanSet) {
+
+ beanSet.iterator().next().setValue(intSet.size());
+ Set<Integer> updatedIntSet = new HashSet<Integer>();
+
+ for (Integer integer : intSet) {
+ updatedIntSet.add(Integer.valueOf(-integer.intValue()));
+ }
+ rpc.sendSet(updatedIntSet,
+ Collections.singleton(getRootConnector()), beanSet);
+ }
+
+ @Override
+ public void sendNestedArray(int[][] nestedIntArray,
+ SimpleTestBean[][] nestedBeanArray) {
+ rpc.sendNestedArray(new int[][] { { nestedIntArray[1][0],
+ nestedIntArray[0][0] } }, new SimpleTestBean[][] {
+ { nestedBeanArray[0][1] }, { nestedBeanArray[0][0] } });
+ }
+
+ @Override
+ public void sendMap(Map<String, SimpleTestBean> stringMap,
+ Map<Connector, Boolean> connectorMap,
+ Map<Integer, Connector> intMap,
+ Map<SimpleTestBean, SimpleTestBean> beanMap) {
+ Map<SimpleTestBean, SimpleTestBean> updatedBeanMap = new HashMap<SimpleTestBean, SimpleTestBean>();
+ for (Entry<SimpleTestBean, SimpleTestBean> entry : beanMap
+ .entrySet()) {
+ updatedBeanMap.put(entry.getValue(), entry.getKey());
+ }
+
+ rpc.sendMap(Collections.singletonMap("a", stringMap.get("b")),
+ Collections.singletonMap(getThisConnector(),
+ connectorMap.get(getRootConnector())),
+ Collections.singletonMap(
+ Integer.valueOf(stringMap.size()),
+ getThisConnector()), updatedBeanMap);
+ }
+
+ @Override
+ public void sendLong(long value, Long boxedValue, long[] array) {
+ rpc.sendLong(array[0], Long.valueOf(value), new long[] {
+ array[1], boxedValue.longValue() });
+ }
+
+ @Override
+ public void sendList(List<Integer> intList,
+ List<Connector> connectorList, List<SimpleTestBean> beanList) {
+ Collections.sort(intList);
+ Collections.reverse(beanList);
+ rpc.sendList(intList,
+ Arrays.asList(getThisConnector(), getRootConnector()),
+ beanList);
+ }
+
+ @Override
+ public void sendInt(int value, Integer boxedValue, int[] array) {
+ rpc.sendInt(array.length, Integer.valueOf(array[0]), new int[] {
+ value, boxedValue.intValue() });
+ }
+
+ @Override
+ public void sendFloat(float value, Float boxedValue, float[] array) {
+ Arrays.sort(array);
+ rpc.sendFloat(boxedValue.floatValue(), Float.valueOf(value),
+ array);
+ }
+
+ @Override
+ public void sendDouble(double value, Double boxedValue,
+ double[] array) {
+ rpc.sendDouble(value + boxedValue.doubleValue(),
+ Double.valueOf(value - boxedValue.doubleValue()),
+ new double[] { array.length, array[0], array[1] });
+ }
+
+ @Override
+ public void sendConnector(Connector connector) {
+ rpc.sendConnector(getThisConnector());
+ }
+
+ @Override
+ public void sendChar(char value, Character boxedValue, char[] array) {
+ rpc.sendChar(Character.toUpperCase(boxedValue.charValue()),
+ Character.valueOf(value), new String(array)
+ .toLowerCase().toCharArray());
+ }
+
+ @Override
+ public void sendByte(byte value, Byte boxedValue, byte[] array) {
+ // There will most certainly be a bug that is not discovered
+ // because this particular method doesn't do anything with it's
+ // values...
+ rpc.sendByte(value, boxedValue, array);
+ }
+
+ @Override
+ public void sendBoolean(boolean value, Boolean boxedValue,
+ boolean[] array) {
+ boolean[] inverseArray = new boolean[array.length];
+ for (int i = 0; i < array.length; i++) {
+ inverseArray[i] = !array[i];
+ }
+ rpc.sendBoolean(boxedValue == Boolean.TRUE,
+ Boolean.valueOf(!value), inverseArray);
+ }
+
+ @Override
+ public void sendBean(ComplexTestBean complexBean,
+ SimpleTestBean simpleBean, SimpleTestBean[] array) {
+ SimpleTestBean updatedSimpleBean = new SimpleTestBean();
+ updatedSimpleBean.setValue(complexBean.getInnerBean1()
+ .getValue());
+
+ ComplexTestBean updatedComplexBean = new ComplexTestBean();
+ updatedComplexBean.setInnerBean1(complexBean.getInnerBean2());
+ updatedComplexBean.setInnerBean2(complexBean
+ .getInnerBeanCollection().get(0));
+ updatedComplexBean.setInnerBeanCollection(Arrays.asList(
+ simpleBean, updatedSimpleBean));
+ updatedComplexBean.setPrivimite(complexBean.getPrivimite() + 1);
+
+ ArrayList<SimpleTestBean> arrayList = new ArrayList<SimpleTestBean>(
+ Arrays.asList(array));
+ Collections.reverse(arrayList);
+
+ rpc.sendBean(updatedComplexBean, updatedSimpleBean,
+ arrayList.toArray(new SimpleTestBean[array.length]));
+ }
+
+ @Override
+ public void sendArrayList(List<int[]> primitiveArrayList,
+ List<Integer[]> objectArrayList,
+ List<SimpleTestBean[]> beanArrayList) {
+ Collections.reverse(beanArrayList);
+ List<Integer[]> updatedObjectArrayList = new ArrayList<Integer[]>();
+ for (int[] array : primitiveArrayList) {
+ updatedObjectArrayList.add(new Integer[] {
+ Integer.valueOf(array.length),
+ Integer.valueOf(array[0]) });
+ }
+
+ rpc.sendArrayList(Arrays.asList(
+ new int[] { primitiveArrayList.size() },
+ new int[] { objectArrayList.get(0).length }),
+ updatedObjectArrayList, beanArrayList);
+ }
+
+ @Override
+ public void sendNull(String value1, String value2) {
+ rpc.sendNull(value2, value1);
+ }
+
+ @Override
+ public void sendListArray(List<Integer>[] objectListArray,
+ List<SimpleTestBean>[] beanListArray) {
+ rpc.sendListArray(new List[] { objectListArray[1],
+ objectListArray[0] }, new List[] { Collections
+ .singletonList(beanListArray[0].get(0)) });
+ }
+ });
+ }
+
+ private Connector getRootConnector() {
+ return getConnection().getRootConnector();
+ }
+
+ private Connector getThisConnector() {
+ // Cast to Connector for use in e.g. Collections.singleton() to get a
+ // Set<Connector>
+ return this;
+ }
+
+ @Override
+ public ComplexTestBean getState() {
+ return (ComplexTestBean) super.getState();
+ }
+
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ // TODO do something clever
+ }
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
new file mode 100644
index 0000000000..eedbda0fb8
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/SerializerTestRpc.java
@@ -0,0 +1,64 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import com.vaadin.shared.Connector;
+import com.vaadin.shared.communication.ClientRpc;
+import com.vaadin.shared.communication.ServerRpc;
+
+@SuppressWarnings("javadoc")
+public interface SerializerTestRpc extends ServerRpc, ClientRpc {
+ public void sendBoolean(boolean value, Boolean boxedValue, boolean[] array);
+
+ public void sendByte(byte value, Byte boxedValue, byte[] array);
+
+ public void sendChar(char value, Character boxedValue, char[] array);
+
+ public void sendInt(int value, Integer boxedValue, int[] array);
+
+ public void sendLong(long value, Long boxedValue, long[] array);
+
+ public void sendFloat(float value, Float boxedValue, float[] array);
+
+ public void sendDouble(double value, Double boxedValue, double[] array);
+
+ public void sendString(String value);
+
+ public void sendConnector(Connector connector);
+
+ public void sendBean(ComplexTestBean complexBean,
+ SimpleTestBean simpleBean, SimpleTestBean[] array);
+
+ public void sendNull(String value1, String value2);
+
+ public void sendNestedArray(int[][] nestedIntArray,
+ SimpleTestBean[][] nestedBeanArray);
+
+ public void sendList(List<Integer> intList, List<Connector> connectorList,
+ List<SimpleTestBean> beanList);
+
+ public void sendArrayList(List<int[]> primitiveArrayList,
+ List<Integer[]> objectArrayList,
+ List<SimpleTestBean[]> beanArrayList);
+
+ public void sendListArray(List<Integer>[] objectListArray,
+ List<SimpleTestBean>[] beanListArray);
+
+ public void sendSet(Set<Integer> intSet, Set<Connector> connectorSet,
+ Set<SimpleTestBean> beanSet);
+
+ public void sendMap(Map<String, SimpleTestBean> stringMap,
+ Map<Connector, Boolean> connectorMap,
+ Map<Integer, Connector> intMap,
+ Map<SimpleTestBean, SimpleTestBean> beanMap);
+
+ public void sendWrappedGenerics(
+ Map<Set<SimpleTestBean>, Map<Integer, List<SimpleTestBean>>> generics);
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/SimpleTestBean.java b/tests/testbench/com/vaadin/tests/widgetset/client/SimpleTestBean.java
new file mode 100644
index 0000000000..43ad51e758
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/SimpleTestBean.java
@@ -0,0 +1,38 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client;
+
+import java.io.Serializable;
+
+public class SimpleTestBean implements Serializable {
+ private int value;
+
+ public SimpleTestBean() {
+ this(0);
+ }
+
+ public SimpleTestBean(int value) {
+ this.value = value;
+ }
+
+ public int getValue() {
+ return value;
+ }
+
+ public void setValue(int value) {
+ this.value = value;
+ }
+
+ @Override
+ public String toString() {
+ return "SimpleTestBean(" + value + ")";
+ }
+
+ @Override
+ public int hashCode() {
+ // Implement hash code to get consistent HashSet.toString
+ return value;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java
new file mode 100644
index 0000000000..a5b89e9c1e
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/GreetAgainRpc.java
@@ -0,0 +1,12 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client.helloworldfeature;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+public interface GreetAgainRpc extends ClientRpc {
+
+ public void greetAgain();
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java
new file mode 100644
index 0000000000..3848ad169a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldExtensionConnector.java
@@ -0,0 +1,49 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client.helloworldfeature;
+
+import com.google.gwt.user.client.Window;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ServerConnector;
+import com.vaadin.terminal.gwt.client.Util;
+import com.vaadin.terminal.gwt.client.VConsole;
+import com.vaadin.terminal.gwt.client.communication.RpcProxy;
+import com.vaadin.terminal.gwt.client.extensions.AbstractExtensionConnector;
+import com.vaadin.tests.extensions.HelloWorldExtension;
+
+@Connect(HelloWorldExtension.class)
+public class HelloWorldExtensionConnector extends AbstractExtensionConnector {
+ HelloWorldRpc rpc = RpcProxy.create(HelloWorldRpc.class, this);
+
+ @Override
+ public HelloWorldState getState() {
+ return (HelloWorldState) super.getState();
+ }
+
+ @Override
+ protected void init() {
+ registerRpc(GreetAgainRpc.class, new GreetAgainRpc() {
+ @Override
+ public void greetAgain() {
+ greet();
+ }
+ });
+ }
+
+ @Override
+ public void setParent(ServerConnector parent) {
+ super.setParent(parent);
+ greet();
+ }
+
+ private void greet() {
+ String msg = getState().getGreeting() + " from "
+ + Util.getConnectorString(this) + " attached to "
+ + Util.getConnectorString(getParent());
+ VConsole.log(msg);
+
+ String response = Window.prompt(msg, "");
+ rpc.onMessageSent(response);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java
new file mode 100644
index 0000000000..980d76043a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldRpc.java
@@ -0,0 +1,10 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client.helloworldfeature;
+
+import com.vaadin.shared.communication.ServerRpc;
+
+public interface HelloWorldRpc extends ServerRpc {
+ public void onMessageSent(String message);
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java
new file mode 100644
index 0000000000..913c8bdd1c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/helloworldfeature/HelloWorldState.java
@@ -0,0 +1,18 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.client.helloworldfeature;
+
+import com.vaadin.shared.communication.SharedState;
+
+public class HelloWorldState extends SharedState {
+ private String greeting = "Hello world";
+
+ public String getGreeting() {
+ return greeting;
+ }
+
+ public void setGreeting(String greeting) {
+ this.greeting = greeting;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java
new file mode 100644
index 0000000000..838eff1e5c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateState.java
@@ -0,0 +1,20 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.Connector;
+
+public class ComponentInStateState extends ComponentState {
+ private Connector otherComponent;
+
+ public Connector getOtherComponent() {
+ return otherComponent;
+ }
+
+ public void setOtherComponent(Connector otherComponent) {
+ this.otherComponent = otherComponent;
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java
new file mode 100644
index 0000000000..952e4b83c5
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ComponentInStateStateConnector.java
@@ -0,0 +1,38 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.google.gwt.user.client.ui.Label;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.tests.minitutorials.v7a2.ComponentInStateComponent;
+
+@Connect(ComponentInStateComponent.class)
+public class ComponentInStateStateConnector extends AbstractComponentConnector {
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
+
+ getWidget().setText(
+ "Client-side type of other component: "
+ + getOtherComponent().getClass().getName());
+ }
+
+ public ComponentConnector getOtherComponent() {
+ return (ComponentConnector) getState().getOtherComponent();
+ }
+
+ @Override
+ public ComponentInStateState getState() {
+ return (ComponentInStateState) super.getState();
+ }
+
+ @Override
+ public Label getWidget() {
+ return (Label) super.getWidget();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java
new file mode 100644
index 0000000000..f85d67da4b
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentClientRpc.java
@@ -0,0 +1,9 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.vaadin.shared.communication.ClientRpc;
+
+public interface MyComponentClientRpc extends ClientRpc {
+
+ public void alert(String message);
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java
new file mode 100644
index 0000000000..3a6aab617a
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentConnector.java
@@ -0,0 +1,58 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.Window;
+import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.MouseEventDetailsBuilder;
+import com.vaadin.terminal.gwt.client.communication.RpcProxy;
+import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.tests.minitutorials.v7a2.MyComponent;
+
+@Connect(MyComponent.class)
+public class MyComponentConnector extends AbstractComponentConnector {
+
+ MyComponentServerRpc rpc = RpcProxy
+ .create(MyComponentServerRpc.class, this);
+
+ public MyComponentConnector() {
+ getWidget().addClickHandler(new ClickHandler() {
+ @Override
+ public void onClick(ClickEvent event) {
+
+ final MouseEventDetails mouseDetails = MouseEventDetailsBuilder
+ .buildMouseEventDetails(event.getNativeEvent(),
+ getWidget().getElement());
+
+ rpc.clicked(mouseDetails);
+ }
+ });
+ registerRpc(MyComponentClientRpc.class, new MyComponentClientRpc() {
+ @Override
+ public void alert(String message) {
+ Window.alert(message);
+ }
+ });
+ }
+
+ @Override
+ public MyComponentState getState() {
+ return (MyComponentState) super.getState();
+ }
+
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
+
+ final String text = getState().getText();
+ getWidget().setText(text);
+ }
+
+ @Override
+ public MyComponentWidget getWidget() {
+ return (MyComponentWidget) super.getWidget();
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java
new file mode 100644
index 0000000000..5571ffb701
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentServerRpc.java
@@ -0,0 +1,10 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.vaadin.shared.MouseEventDetails;
+import com.vaadin.shared.communication.ServerRpc;
+
+public interface MyComponentServerRpc extends ServerRpc {
+
+ public void clicked(MouseEventDetails mouseDetails);
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java
new file mode 100644
index 0000000000..8b68331f30
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentState.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.vaadin.shared.ComponentState;
+
+public class MyComponentState extends ComponentState {
+
+ private String text;
+
+ public String getText() {
+ return text;
+ }
+
+ public void setText(String text) {
+ this.text = text;
+ }
+
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java
new file mode 100644
index 0000000000..ab03d51806
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/MyComponentWidget.java
@@ -0,0 +1,16 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class MyComponentWidget extends Label {
+ public static final String CLASSNAME = "mycomponent";
+
+ public MyComponentWidget() {
+ setText("This is MyComponent");
+ setStyleName(CLASSNAME);
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java
new file mode 100644
index 0000000000..bad782e462
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateConnector.java
@@ -0,0 +1,38 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.google.gwt.user.client.ui.Image;
+import com.vaadin.shared.communication.URLReference;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.communication.StateChangeEvent;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentConnector;
+import com.vaadin.tests.minitutorials.v7a2.ResourceInStateComponent;
+
+@Connect(ResourceInStateComponent.class)
+public class ResourceInStateConnector extends AbstractComponentConnector {
+ @Override
+ public void onStateChanged(StateChangeEvent stateChangeEvent) {
+ super.onStateChanged(stateChangeEvent);
+
+ URLReference icon = getState().getMyIcon();
+ if (icon != null) {
+ getWidget().setUrl(icon.getURL());
+ } else {
+ getWidget().setUrl("");
+ }
+
+ }
+
+ @Override
+ public ResourceInStateState getState() {
+ return (ResourceInStateState) super.getState();
+ }
+
+ @Override
+ public Image getWidget() {
+ return (Image) super.getWidget();
+ }
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateState.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateState.java
new file mode 100644
index 0000000000..69b415625c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/ResourceInStateState.java
@@ -0,0 +1,17 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.vaadin.shared.ComponentState;
+import com.vaadin.shared.communication.URLReference;
+
+public class ResourceInStateState extends ComponentState {
+
+ private URLReference myIcon;
+
+ public URLReference getMyIcon() {
+ return myIcon;
+ }
+
+ public void setMyIcon(URLReference icon) {
+ myIcon = icon;
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java
new file mode 100644
index 0000000000..6ec0a6da7c
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/VWidgetContainer.java
@@ -0,0 +1,12 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import com.google.gwt.user.client.ui.VerticalPanel;
+
+public class VWidgetContainer extends VerticalPanel {
+
+ public static final String CLASSNAME = "v-widgetcontainer";
+
+ public VWidgetContainer() {
+ setStyleName(CLASSNAME);
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java
new file mode 100644
index 0000000000..7905de89f2
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/client/minitutorials/v7a2/WidgetContainerConnector.java
@@ -0,0 +1,36 @@
+package com.vaadin.tests.widgetset.client.minitutorials.v7a2;
+
+import java.util.List;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.Widget;
+import com.vaadin.shared.ui.Connect;
+import com.vaadin.terminal.gwt.client.ComponentConnector;
+import com.vaadin.terminal.gwt.client.ConnectorHierarchyChangeEvent;
+import com.vaadin.terminal.gwt.client.ui.AbstractComponentContainerConnector;
+import com.vaadin.tests.minitutorials.v7a2.WidgetContainer;
+
+@Connect(WidgetContainer.class)
+public class WidgetContainerConnector extends
+ AbstractComponentContainerConnector {
+
+ @Override
+ public void onConnectorHierarchyChange(ConnectorHierarchyChangeEvent event) {
+ List<ComponentConnector> children = getChildComponents();
+ VWidgetContainer widget = (VWidgetContainer) getWidget();
+ widget.clear();
+ for (ComponentConnector connector : children) {
+ widget.add(connector.getWidget());
+ }
+ super.onConnectorHierarchyChange(event);
+ }
+
+ @Override
+ protected Widget createWidget() {
+ return GWT.create(VWidgetContainer.class);
+ }
+
+ @Override
+ public void updateCaption(ComponentConnector connector) {
+ }
+} \ No newline at end of file
diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java b/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java
new file mode 100644
index 0000000000..44f91538b6
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/server/MissingFromDefaultWidgetsetComponent.java
@@ -0,0 +1,10 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+package com.vaadin.tests.widgetset.server;
+
+import com.vaadin.ui.AbstractComponent;
+
+public class MissingFromDefaultWidgetsetComponent extends AbstractComponent {
+
+}
diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java b/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java
new file mode 100644
index 0000000000..99c05e8f76
--- /dev/null
+++ b/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java
@@ -0,0 +1,22 @@
+/*
+@VaadinApache2LicenseForJavaFiles@
+ */
+
+package com.vaadin.tests.widgetset.server;
+
+import com.vaadin.terminal.AbstractExtension;
+import com.vaadin.tests.widgetset.client.ComplexTestBean;
+import com.vaadin.tests.widgetset.client.SerializerTestRpc;
+
+public class SerializerTestExtension extends AbstractExtension {
+
+ @Override
+ public ComplexTestBean getState() {
+ return (ComplexTestBean) super.getState();
+ }
+
+ public void registerRpc(SerializerTestRpc rpc) {
+ super.registerRpc(rpc);
+ }
+
+}