From 6a3c715dae922edd723c9423b4308d5d7948b74e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Tue, 27 Oct 2009 07:57:12 +0000 Subject: Split demo and tests files to own source folders, for #3298 svn changeset:9390/svn branch:6.2 --- src/com/vaadin/tests/BasicRandomTest.java | 350 ---- src/com/vaadin/tests/CustomLayoutDemo.java | 140 -- src/com/vaadin/tests/FocusingComponents.java | 65 - src/com/vaadin/tests/LayoutDemo.java | 149 -- src/com/vaadin/tests/ListenerOrder.java | 163 -- src/com/vaadin/tests/ModalWindow.java | 84 - src/com/vaadin/tests/NativeWindowing.java | 130 -- .../vaadin/tests/OrderedLayoutSwapComponents.java | 109 -- src/com/vaadin/tests/Parameters.java | 126 -- .../PerformanceTestBasicComponentRendering.java | 107 -- .../PerformanceTestLabelsAndOrderedLayouts.java | 78 - .../tests/PerformanceTestSubTreeCaching.java | 85 - src/com/vaadin/tests/QueryContainerDemo.java | 193 -- src/com/vaadin/tests/RandomLayoutStress.java | 189 -- src/com/vaadin/tests/ScrollbarStressTest.java | 238 --- src/com/vaadin/tests/StressComponentsInTable.java | 75 - src/com/vaadin/tests/TableChangingDatasource.java | 53 - src/com/vaadin/tests/TableSelectTest.java | 123 -- src/com/vaadin/tests/TestBench.java | 332 ---- src/com/vaadin/tests/TestCaptionWrapper.java | 206 --- .../vaadin/tests/TestComponentAddAndRecursion.java | 128 -- src/com/vaadin/tests/TestComponentsAndLayouts.java | 505 ------ src/com/vaadin/tests/TestContainerChanges.java | 212 --- src/com/vaadin/tests/TestDateField.java | 74 - src/com/vaadin/tests/TestForAlignments.java | 66 - ...ApplicationLayoutThatUsesWholeBrosersSpace.java | 64 - .../tests/TestForBasicApplicationLayout.java | 100 -- .../tests/TestForChildComponentRendering.java | 95 - .../vaadin/tests/TestForContainerFilterable.java | 94 - src/com/vaadin/tests/TestForExpandLayout.java | 55 - src/com/vaadin/tests/TestForExpandLayout2.java | 64 - src/com/vaadin/tests/TestForExpandLayout3.java | 79 - .../TestForGridLayoutChildComponentRendering.java | 103 -- .../vaadin/tests/TestForMultipleStyleNames.java | 97 - src/com/vaadin/tests/TestForNativeWindowing.java | 130 -- .../tests/TestForPreconfiguredComponents.java | 186 -- src/com/vaadin/tests/TestForRichTextEditor.java | 66 - src/com/vaadin/tests/TestForStyledUpload.java | 288 --- src/com/vaadin/tests/TestForTabSheet.java | 58 - ...tForTablesInitialColumnWidthLogicRendering.java | 162 -- src/com/vaadin/tests/TestForTrees.java | 166 -- src/com/vaadin/tests/TestForUpload.java | 375 ---- src/com/vaadin/tests/TestForWindowOpen.java | 59 - src/com/vaadin/tests/TestForWindowing.java | 99 - src/com/vaadin/tests/TestIFrames.java | 39 - .../tests/TestSelectAndDatefieldInDeepLayouts.java | 98 - src/com/vaadin/tests/TestSerialization.java | 113 -- src/com/vaadin/tests/TestSetVisibleAndCaching.java | 82 - src/com/vaadin/tests/TestSizeableIncomponents.java | 320 ---- src/com/vaadin/tests/TestSplitPanel.java | 29 - src/com/vaadin/tests/TreeFilesystem.java | 106 -- src/com/vaadin/tests/TreeFilesystemContainer.java | 103 -- src/com/vaadin/tests/UpgradingSample.java | 171 -- .../tests/UsingCustomNewItemHandlerInSelect.java | 65 - src/com/vaadin/tests/UsingObjectsInSelect.java | 115 -- src/com/vaadin/tests/appengine/GAESyncTest.java | 152 -- src/com/vaadin/tests/appengine/img1.png | Bin 7433 -> 0 bytes .../tests/applicationservlet/NoMainWindow.java | 22 - .../TestStaticFilesLocation.java | 155 -- src/com/vaadin/tests/book/BookTestApplication.java | 1893 -------------------- src/com/vaadin/tests/book/ChatApplication.java | 83 - .../vaadin/tests/book/DefaultButtonExample.java | 94 - src/com/vaadin/tests/book/EmbeddedButton.java | 39 - src/com/vaadin/tests/book/FormExample.java | 229 --- src/com/vaadin/tests/book/FormExample2.java | 124 -- src/com/vaadin/tests/book/MyDynamicResource.java | 77 - src/com/vaadin/tests/book/MyUploader.java | 81 - src/com/vaadin/tests/book/SSNField.java | 98 - src/com/vaadin/tests/book/SelectExample.java | 119 -- src/com/vaadin/tests/book/TabSheetExample.java | 70 - src/com/vaadin/tests/book/TableCellStyle.java | 62 - src/com/vaadin/tests/book/TableEditable.java | 57 - src/com/vaadin/tests/book/TableEditableBean.java | 242 --- src/com/vaadin/tests/book/TableExample.java | 78 - src/com/vaadin/tests/book/TableExample1.java | 48 - src/com/vaadin/tests/book/TableExample2.java | 73 - src/com/vaadin/tests/book/TableExample3.java | 83 - src/com/vaadin/tests/book/TableHuge.java | 197 -- src/com/vaadin/tests/book/TheButton.java | 27 - src/com/vaadin/tests/book/TheButtons.java | 33 - src/com/vaadin/tests/book/TheButtons2.java | 33 - src/com/vaadin/tests/book/TheButtons3.java | 43 - src/com/vaadin/tests/book/WindowOpener.java | 80 - .../vaadin/tests/book/WindowTestApplication.java | 131 -- src/com/vaadin/tests/book/images/Earth_small.png | Bin 287 -> 0 bytes src/com/vaadin/tests/book/images/Earth_symbol.png | Bin 414 -> 0 bytes .../vaadin/tests/book/images/Jupiter_symbol.png | Bin 381 -> 0 bytes src/com/vaadin/tests/book/images/Mars_symbol.png | Bin 509 -> 0 bytes src/com/vaadin/tests/book/images/Mercury_small.png | Bin 278 -> 0 bytes .../vaadin/tests/book/images/Mercury_symbol.png | Bin 469 -> 0 bytes .../vaadin/tests/book/images/Neptune_symbol.png | Bin 490 -> 0 bytes src/com/vaadin/tests/book/images/Saturn_symbol.png | Bin 394 -> 0 bytes src/com/vaadin/tests/book/images/Uranus_symbol.png | Bin 443 -> 0 bytes src/com/vaadin/tests/book/images/Venus_small.png | Bin 292 -> 0 bytes src/com/vaadin/tests/book/images/Venus_symbol.png | Bin 422 -> 0 bytes src/com/vaadin/tests/book/smiley.jpg | Bin 1411 -> 0 bytes .../vaadin/tests/components/AbstractTestCase.java | 11 - .../CustomComponentwithUndefinedSize.java | 83 - .../components/HierarchicalContainerSorting.java | 109 -- .../vaadin/tests/components/MultipleDebugIds.java | 35 - src/com/vaadin/tests/components/TestBase.java | 45 - .../absolutelayout/AbsoluteLayoutClipping.html | 27 - .../absolutelayout/AbsoluteLayoutClipping.java | 42 - .../AbstractFieldCommitWithInvalidValues.html | 72 - .../AbstractFieldCommitWithInvalidValues.java | 69 - .../accordion/AccordionInactiveTabSize.java | 40 - .../tests/components/accordion/RemoveTabs.html | 122 -- .../tests/components/accordion/RemoveTabs.java | 130 -- .../BeanItemContainerGenerator.java | 98 - .../BeanItemContainerNullValues.java | 47 - .../TestBeanItemContainerUsage.html | 32 - .../TestBeanItemContainerUsage.java | 75 - .../components/button/ButtonErrorMessage.java | 31 - .../components/button/ButtonUndefinedWidth.html | 82 - .../components/button/ButtonUndefinedWidth.java | 40 - .../tests/components/button/DisabledButtons.html | 32 - .../tests/components/button/DisabledButtons.java | 60 - .../tests/components/button/IE7ButtonWithIcon.html | 32 - .../tests/components/button/IE7ButtonWithIcon.java | 27 - .../button/TooltipForDisabledButton.java | 48 - .../tests/components/caption/LargeCaptionIcon.html | 47 - .../tests/components/caption/LargeCaptionIcon.java | 31 - .../checkbox/CheckboxCaptionWrapping.html | 32 - .../checkbox/CheckboxCaptionWrapping.java | 39 - .../tests/components/checkbox/CheckboxIcon.java | 29 - .../components/combobox/ComboBoxInPopupView.java | 42 - .../components/combobox/ComboBoxItemIcon.html | 57 - .../components/combobox/ComboBoxItemIcon.java | 37 - .../components/combobox/ComboBoxLargeIcons.java | 44 - .../components/combobox/ComboBoxNavigation.html | 397 ---- .../components/combobox/ComboBoxNavigation.java | 30 - .../components/combobox/ComboBoxValueInput.html | 292 --- .../components/combobox/ComboBoxValueInput.java | 64 - .../components/combobox/ComboBoxValueUpdate.java | 47 - .../components/combobox/ComboxBoxErrorMessage.java | 26 - src/com/vaadin/tests/components/combobox/fi.gif | Bin 371 -> 0 bytes src/com/vaadin/tests/components/combobox/se.gif | Bin 367 -> 0 bytes .../components/datefield/DateFieldReadOnly.html | 77 - .../components/datefield/DateFieldReadOnly.java | 53 - .../components/datefield/DisabledDateFieldWidth | 52 - .../datefield/DisabledDateFieldWidth.java | 42 - .../components/datefield/TestDatefieldYear.html | 132 -- .../components/datefield/TestDatefieldYear.java | 28 - .../tests/components/embedded/EmbeddedFlash.java | 34 - .../components/embedded/EmbeddedImageRefresh.java | 149 -- .../tests/components/embedded/EmbeddedTooltip.java | 28 - .../form/FormCommitWithInvalidValues.html | 112 -- .../form/FormCommitWithInvalidValues.java | 71 - .../components/form/FormNotGettingSmaller.java | 51 - .../components/form/FormRenderingFlicker.java | 65 - .../label/HundredPercentWideLabelResize.html | 62 - .../label/HundredPercentWideLabelResize.java | 42 - .../tests/components/label/LabelWrapping.html | 62 - .../tests/components/label/LabelWrapping.java | 46 - src/com/vaadin/tests/components/link/LinkIcon.java | 30 - .../tests/components/link/LinkTargetSize.java | 30 - .../tests/components/loginform/LoginFormTest.java | 63 - .../OptionGroupMultipleValueChange.java | 42 - .../orderedlayout/ReplaceComponentNPE.html | 47 - .../orderedlayout/ReplaceComponentNPE.java | 40 - .../panel/PanelShouldRemoveActionHandler.java | 119 -- .../popupview/PopupViewLabelResized.java | 37 - .../components/popupview/PopupViewNullValues.java | 103 -- .../components/popupview/PopupViewOffScreen.html | 47 - .../components/popupview/PopupViewOffScreen.java | 80 - .../components/popupview/PopupViewWithRTE.java | 50 - .../components/richtextarea/RichTextAreaSize.html | 32 - .../components/richtextarea/RichTextAreaSize.java | 44 - .../components/select/NullSelectionItemId.java | 57 - .../splitpanel/SplitPanelExtraScrollbars.html | 42 - .../splitpanel/SplitPanelExtraScrollbars.java | 67 - .../splitpanel/SplitPanelSplitterWidth.java | 64 - .../splitpanel/SplitPanelWidthOnResize.java | 44 - .../components/table/ClippedComponentsInTable.html | 32 - .../components/table/ClippedComponentsInTable.java | 40 - .../table/ColumnCollapsingAndColumnExpansion.html | 158 -- .../table/ColumnCollapsingAndColumnExpansion.java | 106 -- .../tests/components/table/ColumnExpandRatio.html | 32 - .../tests/components/table/ColumnExpandRatio.java | 70 - .../table/ColumnExpandWithFixedColumns.html | 32 - .../table/ColumnExpandWithFixedColumns.java | 45 - .../table/ColumnGeneratorAddingOrder.java | 52 - .../tests/components/table/ColumnWidths.java | 69 - .../components/table/ContainerSizeChange.html | 82 - .../components/table/ContainerSizeChange.java | 91 - .../table/LabelEmbeddedClickThroughForTable.html | 52 - .../table/LabelEmbeddedClickThroughForTable.java | 69 - .../tests/components/table/MissingScrollbar.html | 57 - .../tests/components/table/MissingScrollbar.java | 89 - .../components/table/ModifyContainerProperty.java | 57 - .../table/NotselectablePaintSelections.java | 55 - .../components/table/PropertyValueChange.html | 87 - .../components/table/PropertyValueChange.java | 158 -- .../tests/components/table/RowAdditionTest.java | 59 - .../tests/components/table/TableItemIcon.java | 38 - .../components/table/TableLastRowMissing.html | 32 - .../components/table/TableLastRowMissing.java | 35 - .../components/table/TablePageLengthUpdate.html | 127 -- .../components/table/TablePageLengthUpdate.java | 76 - .../tests/components/table/TableRowHeight.html | 32 - .../tests/components/table/TableRowHeight.java | 112 -- .../tests/components/table/TableRowHeight2.html | 57 - .../tests/components/table/TableRowHeight2.java | 64 - .../tests/components/table/TableRowHeight3.html | 27 - .../tests/components/table/TableRowHeight3.java | 61 - .../table/TableVisibleColumnsUpdate.html | 77 - .../table/TableVisibleColumnsUpdate.java | 57 - .../components/table/TestCurrentPageFirstItem.java | 60 - .../components/table/TextFieldRelativeWidth.html | 57 - .../components/table/TextFieldRelativeWidth.java | 129 -- src/com/vaadin/tests/components/table/fi.gif | Bin 371 -> 0 bytes src/com/vaadin/tests/components/table/se.gif | Bin 367 -> 0 bytes .../components/tabsheet/AddAndRemoveTabs.html | 117 -- .../components/tabsheet/AddAndRemoveTabs.java | 60 - .../components/tabsheet/PreventTabChange.html | 77 - .../components/tabsheet/PreventTabChange.java | 67 - .../tests/components/tabsheet/RemoveTabs.java | 129 -- .../components/tabsheet/RemoveTabsTabsheet.html | 112 -- .../components/tabsheet/TabSheetCaptions.html | 77 - .../components/tabsheet/TabSheetCaptions.java | 63 - .../components/tabsheet/TabSheetDisabling.html | 162 -- .../components/tabsheet/TabSheetDisabling.java | 62 - .../tests/components/tabsheet/TabSheetIcons.html | 27 - .../tests/components/tabsheet/TabSheetIcons.java | 54 - .../tabsheet/TabSheetWithoutTabCaption.html | 32 - .../tabsheet/TabSheetWithoutTabCaption.java | 28 - .../tests/components/tabsheet/TabsheetNPE.java | 59 - .../components/tabsheet/TabsheetScrolling.html | 182 -- .../components/tabsheet/TabsheetScrolling.java | 74 - .../tests/components/tabsheet/TabsheetTooltip.html | 82 - .../tests/components/tabsheet/TabsheetTooltip.java | 37 - .../tabsheet/VerticalScrollbarPosition.html | 77 - .../tabsheet/VerticalScrollbarPosition.java | 40 - .../EnterShortcutMaySendInputPromptAsValue.java | 57 - .../tests/components/textfield/IE6Cursor.java | 27 - .../tests/components/textfield/TextFields.html | 122 -- .../tests/components/textfield/TextFields.java | 198 -- .../components/tree/TreeNodeCaptionWrapping.html | 42 - .../components/tree/TreeNodeCaptionWrapping.java | 44 - .../window/CenteredWindowWithUndefinedSize.html | 32 - .../window/CenteredWindowWithUndefinedSize.java | 33 - .../components/window/EmbeddedInSubWindow.html | 32 - .../components/window/EmbeddedInSubWindow.java | 45 - .../tests/components/window/FullSizedWindow.java | 31 - .../tests/components/window/SubWindowOrder.java | 28 - .../components/window/SubwindowInvalidLayout.java | 35 - .../window/TestTooSmallSubwindowSize.html | 32 - .../window/TestTooSmallSubwindowSize.java | 44 - .../components/window/UndefinedWidthSubWindow.html | 87 - .../components/window/UndefinedWidthSubWindow.java | 70 - .../components/window/WindowResizeListener.java | 99 - .../window/WindowShouldRemoveActionHandler.html | 107 -- .../window/WindowShouldRemoveActionHandler.java | 116 -- .../tests/components/window/WindowStyleNames.java | 54 - .../containers/BeanItemContainerFilteringTest.java | 172 -- .../tests/containers/BeanItemContainerTest.java | 75 - .../containers/IndexedContainerFilteringTest.java | 139 -- src/com/vaadin/tests/featurebrowser/Feature.java | 199 -- .../tests/featurebrowser/FeatureBrowser.java | 353 ---- .../tests/featurebrowser/FeatureBuffering.java | 91 - .../vaadin/tests/featurebrowser/FeatureButton.java | 72 - .../tests/featurebrowser/FeatureContainers.java | 94 - .../tests/featurebrowser/FeatureCustomLayout.java | 82 - .../tests/featurebrowser/FeatureDateField.java | 105 -- .../tests/featurebrowser/FeatureEmbedded.java | 95 - .../vaadin/tests/featurebrowser/FeatureForm.java | 182 -- .../tests/featurebrowser/FeatureGridLayout.java | 79 - .../vaadin/tests/featurebrowser/FeatureItems.java | 87 - .../vaadin/tests/featurebrowser/FeatureLabel.java | 77 - .../vaadin/tests/featurebrowser/FeatureLink.java | 68 - .../tests/featurebrowser/FeatureOrderedLayout.java | 81 - .../vaadin/tests/featurebrowser/FeaturePanel.java | 73 - .../tests/featurebrowser/FeatureParameters.java | 167 -- .../tests/featurebrowser/FeatureProperties.java | 92 - .../vaadin/tests/featurebrowser/FeatureSelect.java | 90 - .../tests/featurebrowser/FeatureTabSheet.java | 75 - .../vaadin/tests/featurebrowser/FeatureTable.java | 195 -- .../tests/featurebrowser/FeatureTextField.java | 73 - .../vaadin/tests/featurebrowser/FeatureTree.java | 174 -- .../vaadin/tests/featurebrowser/FeatureUpload.java | 150 -- .../vaadin/tests/featurebrowser/FeatureUtil.java | 37 - .../tests/featurebrowser/FeatureValidators.java | 87 - .../vaadin/tests/featurebrowser/FeatureWindow.java | 146 -- .../tests/featurebrowser/FeaturesApplication.java | 34 - .../vaadin/tests/featurebrowser/IntroBasic.java | 79 - .../tests/featurebrowser/IntroComponents.java | 83 - .../tests/featurebrowser/IntroDataHandling.java | 78 - .../tests/featurebrowser/IntroDataModel.java | 80 - .../tests/featurebrowser/IntroItemContainers.java | 79 - .../vaadin/tests/featurebrowser/IntroLayouts.java | 81 - .../vaadin/tests/featurebrowser/IntroTerminal.java | 55 - .../vaadin/tests/featurebrowser/IntroWelcome.java | 173 -- .../vaadin/tests/featurebrowser/PropertyPanel.java | 512 ------ src/com/vaadin/tests/featurebrowser/components.png | Bin 184749 -> 0 bytes src/com/vaadin/tests/featurebrowser/icon_demo.png | Bin 2428 -> 0 bytes src/com/vaadin/tests/featurebrowser/icon_intro.png | Bin 2465 -> 0 bytes src/com/vaadin/tests/featurebrowser/itmill.gif | Bin 6110 -> 0 bytes .../vaadin/tests/featurebrowser/m-bullet-blue.gif | Bin 8417 -> 0 bytes src/com/vaadin/tests/featurebrowser/m.gif | Bin 1036 -> 0 bytes .../vaadin/tests/featurebrowser/vaadin_spin.swf | Bin 2991 -> 0 bytes .../tests/layouts/AbsoluteLayoutAddRemove.java | 50 - .../vaadin/tests/layouts/DeepComponentTrees.java | 114 -- .../layouts/FormLayoutWithInvisibleComponent.java | 49 - .../layouts/GridLayoutExpandRatioModification.java | 82 - .../tests/layouts/GridLayoutInsidePanel.java | 51 - .../tests/layouts/GridLayoutInsidePanel2.java | 28 - .../tests/layouts/HiddenHorizontalLayout.java | 57 - .../vaadin/tests/layouts/OrderedLayoutBasics.java | 1221 ------------- .../layouts/OrderedLayoutCSSCompatibility.java | 32 - .../vaadin/tests/layouts/TestAbsoluteLayout.java | 312 ---- .../tests/layouts/TestLayoutPerformance.java | 133 -- .../VerticalLayoutExpandRatioModification.java | 76 - .../VerticalLayoutWithRelativeSizeComponents.java | 38 - src/com/vaadin/tests/m.gif | Bin 1036 -> 0 bytes .../vaadin/tests/resources/ResourceDownload.java | 89 - src/com/vaadin/tests/robustness/Robustness.java | 86 - .../vaadin/tests/robustness/RobustnessSimple.java | 49 - src/com/vaadin/tests/themes/ButtonsTest.java | 158 -- src/com/vaadin/tests/tickets/Ticket1225.java | 68 - src/com/vaadin/tests/tickets/Ticket1230.java | 129 -- src/com/vaadin/tests/tickets/Ticket124.java | 90 - src/com/vaadin/tests/tickets/Ticket1245.java | 93 - src/com/vaadin/tests/tickets/Ticket1362Login.java | 276 --- src/com/vaadin/tests/tickets/Ticket1365.java | 46 - src/com/vaadin/tests/tickets/Ticket1368.java | 36 - src/com/vaadin/tests/tickets/Ticket1397.java | 148 -- src/com/vaadin/tests/tickets/Ticket1435.java | 231 --- src/com/vaadin/tests/tickets/Ticket1444.java | 30 - .../tests/tickets/Ticket1465ModalNotification.java | 77 - src/com/vaadin/tests/tickets/Ticket1506.java | 15 - src/com/vaadin/tests/tickets/Ticket1506_Panel.java | 47 - .../tests/tickets/Ticket1506_TestContainer.java | 126 -- .../tests/tickets/Ticket1506_TestContainer2.java | 118 -- src/com/vaadin/tests/tickets/Ticket1519.java | 25 - src/com/vaadin/tests/tickets/Ticket1572.java | 118 -- src/com/vaadin/tests/tickets/Ticket1581.java | 71 - src/com/vaadin/tests/tickets/Ticket1589.java | 96 - src/com/vaadin/tests/tickets/Ticket1598.java | 126 -- src/com/vaadin/tests/tickets/Ticket161.java | 47 - src/com/vaadin/tests/tickets/Ticket1632.java | 66 - src/com/vaadin/tests/tickets/Ticket1659.java | 34 - src/com/vaadin/tests/tickets/Ticket1663.java | 23 - src/com/vaadin/tests/tickets/Ticket1673.java | 28 - src/com/vaadin/tests/tickets/Ticket1710.java | 436 ----- src/com/vaadin/tests/tickets/Ticket1737.java | 52 - src/com/vaadin/tests/tickets/Ticket1767.java | 30 - src/com/vaadin/tests/tickets/Ticket1772.java | 37 - src/com/vaadin/tests/tickets/Ticket1775.java | 48 - src/com/vaadin/tests/tickets/Ticket1804.java | 152 -- src/com/vaadin/tests/tickets/Ticket1805.java | 56 - src/com/vaadin/tests/tickets/Ticket1806.java | 46 - src/com/vaadin/tests/tickets/Ticket1811.java | 78 - src/com/vaadin/tests/tickets/Ticket1819.java | 64 - .../tests/tickets/Ticket1834PanelScrolling.java | 91 - src/com/vaadin/tests/tickets/Ticket1857.java | 109 -- src/com/vaadin/tests/tickets/Ticket1868.java | 20 - src/com/vaadin/tests/tickets/Ticket1869.java | 58 - src/com/vaadin/tests/tickets/Ticket1878.java | 391 ---- src/com/vaadin/tests/tickets/Ticket1900.java | 80 - src/com/vaadin/tests/tickets/Ticket1902.java | 80 - src/com/vaadin/tests/tickets/Ticket1904.java | 42 - src/com/vaadin/tests/tickets/Ticket1916.java | 30 - src/com/vaadin/tests/tickets/Ticket1919.java | 53 - src/com/vaadin/tests/tickets/Ticket1921.java | 130 -- src/com/vaadin/tests/tickets/Ticket1923.java | 82 - .../tests/tickets/Ticket1924ThemeChanging.java | 51 - src/com/vaadin/tests/tickets/Ticket1925.java | 15 - src/com/vaadin/tests/tickets/Ticket1934.java | 32 - src/com/vaadin/tests/tickets/Ticket1939.java | 36 - src/com/vaadin/tests/tickets/Ticket1940.java | 25 - src/com/vaadin/tests/tickets/Ticket1953.java | 114 -- src/com/vaadin/tests/tickets/Ticket1966.java | 128 -- src/com/vaadin/tests/tickets/Ticket1966_2.java | 186 -- src/com/vaadin/tests/tickets/Ticket1966_3.java | 66 - src/com/vaadin/tests/tickets/Ticket1969.java | 105 -- src/com/vaadin/tests/tickets/Ticket1970.java | 79 - src/com/vaadin/tests/tickets/Ticket1972.java | 30 - src/com/vaadin/tests/tickets/Ticket1973.java | 51 - src/com/vaadin/tests/tickets/Ticket1973_2.java | 54 - src/com/vaadin/tests/tickets/Ticket1975.java | 62 - src/com/vaadin/tests/tickets/Ticket1982.java | 84 - src/com/vaadin/tests/tickets/Ticket1983.java | 138 -- src/com/vaadin/tests/tickets/Ticket1986.java | 79 - src/com/vaadin/tests/tickets/Ticket1991.java | 28 - src/com/vaadin/tests/tickets/Ticket1995.java | 64 - src/com/vaadin/tests/tickets/Ticket20.java | 98 - src/com/vaadin/tests/tickets/Ticket2001.java | 33 - src/com/vaadin/tests/tickets/Ticket2002.java | 51 - src/com/vaadin/tests/tickets/Ticket2007.java | 28 - src/com/vaadin/tests/tickets/Ticket2009.java | 126 -- src/com/vaadin/tests/tickets/Ticket2011.java | 26 - src/com/vaadin/tests/tickets/Ticket2014.java | 63 - src/com/vaadin/tests/tickets/Ticket2021.java | 143 -- src/com/vaadin/tests/tickets/Ticket2022.java | 32 - src/com/vaadin/tests/tickets/Ticket2023.java | 51 - src/com/vaadin/tests/tickets/Ticket2024.java | 37 - src/com/vaadin/tests/tickets/Ticket2026.java | 35 - src/com/vaadin/tests/tickets/Ticket2029.java | 140 -- src/com/vaadin/tests/tickets/Ticket2032.java | 58 - src/com/vaadin/tests/tickets/Ticket2033.java | 147 -- src/com/vaadin/tests/tickets/Ticket2037.java | 49 - src/com/vaadin/tests/tickets/Ticket2038.java | 46 - src/com/vaadin/tests/tickets/Ticket2040.java | 85 - src/com/vaadin/tests/tickets/Ticket2042.java | 38 - src/com/vaadin/tests/tickets/Ticket2043.java | 28 - src/com/vaadin/tests/tickets/Ticket2048.java | 107 -- src/com/vaadin/tests/tickets/Ticket2051.java | 44 - src/com/vaadin/tests/tickets/Ticket2053.java | 75 - src/com/vaadin/tests/tickets/Ticket2060.java | 51 - src/com/vaadin/tests/tickets/Ticket2061.java | 128 -- src/com/vaadin/tests/tickets/Ticket2061b.java | 198 -- src/com/vaadin/tests/tickets/Ticket2061c.java | 149 -- src/com/vaadin/tests/tickets/Ticket2062.java | 41 - src/com/vaadin/tests/tickets/Ticket2083.java | 28 - src/com/vaadin/tests/tickets/Ticket2090.java | 62 - src/com/vaadin/tests/tickets/Ticket2095.java | 31 - src/com/vaadin/tests/tickets/Ticket2098.java | 37 - src/com/vaadin/tests/tickets/Ticket2099.java | 77 - src/com/vaadin/tests/tickets/Ticket2101.java | 21 - src/com/vaadin/tests/tickets/Ticket2103.java | 100 -- src/com/vaadin/tests/tickets/Ticket2104.java | 121 -- src/com/vaadin/tests/tickets/Ticket2106.java | 38 - src/com/vaadin/tests/tickets/Ticket2107.java | 62 - src/com/vaadin/tests/tickets/Ticket2117.java | 61 - src/com/vaadin/tests/tickets/Ticket2119.java | 92 - src/com/vaadin/tests/tickets/Ticket2125.java | 62 - src/com/vaadin/tests/tickets/Ticket2126.java | 62 - src/com/vaadin/tests/tickets/Ticket2151.java | 109 -- src/com/vaadin/tests/tickets/Ticket2157.java | 108 -- src/com/vaadin/tests/tickets/Ticket2178.java | 108 -- src/com/vaadin/tests/tickets/Ticket2179.java | 56 - src/com/vaadin/tests/tickets/Ticket2180.java | 41 - src/com/vaadin/tests/tickets/Ticket2181.java | 104 -- src/com/vaadin/tests/tickets/Ticket2186.java | 54 - src/com/vaadin/tests/tickets/Ticket2204.java | 188 -- src/com/vaadin/tests/tickets/Ticket2208.java | 68 - src/com/vaadin/tests/tickets/Ticket2209.java | 42 - src/com/vaadin/tests/tickets/Ticket2209OL.java | 49 - src/com/vaadin/tests/tickets/Ticket2209OL2.java | 55 - src/com/vaadin/tests/tickets/Ticket2215.java | 28 - src/com/vaadin/tests/tickets/Ticket2221.java | 90 - src/com/vaadin/tests/tickets/Ticket2222.java | 64 - .../tickets/Ticket2227OrderedlayoutInTable.java | 44 - src/com/vaadin/tests/tickets/Ticket2231.java | 42 - src/com/vaadin/tests/tickets/Ticket2232.java | 74 - src/com/vaadin/tests/tickets/Ticket2234.java | 43 - src/com/vaadin/tests/tickets/Ticket2235.java | 28 - src/com/vaadin/tests/tickets/Ticket2240.java | 48 - src/com/vaadin/tests/tickets/Ticket2242.java | 116 -- src/com/vaadin/tests/tickets/Ticket2244.java | 127 -- src/com/vaadin/tests/tickets/Ticket2245.java | 17 - src/com/vaadin/tests/tickets/Ticket2267.java | 41 - src/com/vaadin/tests/tickets/Ticket2271.java | 35 - src/com/vaadin/tests/tickets/Ticket2279.java | 207 --- src/com/vaadin/tests/tickets/Ticket2282.java | 55 - src/com/vaadin/tests/tickets/Ticket2283.java | 30 - src/com/vaadin/tests/tickets/Ticket2287.java | 33 - src/com/vaadin/tests/tickets/Ticket2289.java | 100 -- src/com/vaadin/tests/tickets/Ticket2292.java | 88 - src/com/vaadin/tests/tickets/Ticket2294.java | 62 - src/com/vaadin/tests/tickets/Ticket2296.java | 33 - src/com/vaadin/tests/tickets/Ticket2297.java | 42 - src/com/vaadin/tests/tickets/Ticket2303.java | 43 - src/com/vaadin/tests/tickets/Ticket2304.java | 29 - src/com/vaadin/tests/tickets/Ticket2310.java | 57 - src/com/vaadin/tests/tickets/Ticket2319.java | 66 - src/com/vaadin/tests/tickets/Ticket2323.java | 22 - src/com/vaadin/tests/tickets/Ticket2325.java | 29 - src/com/vaadin/tests/tickets/Ticket2329.java | 42 - src/com/vaadin/tests/tickets/Ticket2337.java | 44 - src/com/vaadin/tests/tickets/Ticket2339.java | 38 - src/com/vaadin/tests/tickets/Ticket2341.java | 47 - src/com/vaadin/tests/tickets/Ticket2344.java | 56 - src/com/vaadin/tests/tickets/Ticket2347.java | 49 - src/com/vaadin/tests/tickets/Ticket2364.java | 37 - src/com/vaadin/tests/tickets/Ticket2365.java | 58 - src/com/vaadin/tests/tickets/Ticket2398.java | 40 - src/com/vaadin/tests/tickets/Ticket2404.java | 28 - src/com/vaadin/tests/tickets/Ticket2405.java | 78 - src/com/vaadin/tests/tickets/Ticket2406.java | 48 - src/com/vaadin/tests/tickets/Ticket2407.java | 21 - src/com/vaadin/tests/tickets/Ticket2411.java | 29 - src/com/vaadin/tests/tickets/Ticket2415.java | 40 - src/com/vaadin/tests/tickets/Ticket2420.java | 54 - src/com/vaadin/tests/tickets/Ticket2425.java | 24 - src/com/vaadin/tests/tickets/Ticket2426.java | 30 - src/com/vaadin/tests/tickets/Ticket2431.java | 52 - src/com/vaadin/tests/tickets/Ticket2432.java | 51 - src/com/vaadin/tests/tickets/Ticket2434.java | 30 - src/com/vaadin/tests/tickets/Ticket2436.java | 35 - src/com/vaadin/tests/tickets/Ticket2440.java | 78 - src/com/vaadin/tests/tickets/Ticket2526.java | 22 - src/com/vaadin/tests/tickets/Ticket2742.java | 42 - src/com/vaadin/tests/tickets/Ticket2901.java | 33 - src/com/vaadin/tests/tickets/Ticket2998.java | 337 ---- src/com/vaadin/tests/tickets/Ticket3146.java | 96 - src/com/vaadin/tests/tickets/Ticket34.java | 111 -- src/com/vaadin/tests/tickets/Ticket677.java | 211 --- src/com/vaadin/tests/tickets/Ticket695.java | 42 - src/com/vaadin/tests/tickets/Ticket736.java | 194 -- src/com/vaadin/tests/tickets/Ticket846.java | 65 - src/com/vaadin/tests/tickets/Ticket932.java | 77 - src/com/vaadin/tests/util/LogPrintWriter.java | 34 - src/com/vaadin/tests/util/LoremIpsum.java | 13 - src/com/vaadin/tests/util/RandomComponents.java | 274 --- src/com/vaadin/tests/util/TestClickListener.java | 37 - src/com/vaadin/tests/vaadin_spin.swf | Bin 2991 -> 0 bytes .../tests/validation/RequiredErrorMessage.java | 52 - .../validation/RequiredIndicatorForReadOnly.java | 33 - .../vaadin/tests/validation/TestValidators.java | 163 -- 510 files changed, 43743 deletions(-) delete mode 100644 src/com/vaadin/tests/BasicRandomTest.java delete mode 100644 src/com/vaadin/tests/CustomLayoutDemo.java delete mode 100644 src/com/vaadin/tests/FocusingComponents.java delete mode 100644 src/com/vaadin/tests/LayoutDemo.java delete mode 100644 src/com/vaadin/tests/ListenerOrder.java delete mode 100644 src/com/vaadin/tests/ModalWindow.java delete mode 100644 src/com/vaadin/tests/NativeWindowing.java delete mode 100644 src/com/vaadin/tests/OrderedLayoutSwapComponents.java delete mode 100644 src/com/vaadin/tests/Parameters.java delete mode 100644 src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java delete mode 100644 src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java delete mode 100644 src/com/vaadin/tests/PerformanceTestSubTreeCaching.java delete mode 100644 src/com/vaadin/tests/QueryContainerDemo.java delete mode 100644 src/com/vaadin/tests/RandomLayoutStress.java delete mode 100644 src/com/vaadin/tests/ScrollbarStressTest.java delete mode 100644 src/com/vaadin/tests/StressComponentsInTable.java delete mode 100644 src/com/vaadin/tests/TableChangingDatasource.java delete mode 100644 src/com/vaadin/tests/TableSelectTest.java delete mode 100644 src/com/vaadin/tests/TestBench.java delete mode 100644 src/com/vaadin/tests/TestCaptionWrapper.java delete mode 100644 src/com/vaadin/tests/TestComponentAddAndRecursion.java delete mode 100644 src/com/vaadin/tests/TestComponentsAndLayouts.java delete mode 100644 src/com/vaadin/tests/TestContainerChanges.java delete mode 100644 src/com/vaadin/tests/TestDateField.java delete mode 100644 src/com/vaadin/tests/TestForAlignments.java delete mode 100644 src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java delete mode 100644 src/com/vaadin/tests/TestForBasicApplicationLayout.java delete mode 100644 src/com/vaadin/tests/TestForChildComponentRendering.java delete mode 100644 src/com/vaadin/tests/TestForContainerFilterable.java delete mode 100644 src/com/vaadin/tests/TestForExpandLayout.java delete mode 100644 src/com/vaadin/tests/TestForExpandLayout2.java delete mode 100644 src/com/vaadin/tests/TestForExpandLayout3.java delete mode 100644 src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java delete mode 100644 src/com/vaadin/tests/TestForMultipleStyleNames.java delete mode 100644 src/com/vaadin/tests/TestForNativeWindowing.java delete mode 100644 src/com/vaadin/tests/TestForPreconfiguredComponents.java delete mode 100644 src/com/vaadin/tests/TestForRichTextEditor.java delete mode 100644 src/com/vaadin/tests/TestForStyledUpload.java delete mode 100644 src/com/vaadin/tests/TestForTabSheet.java delete mode 100644 src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java delete mode 100644 src/com/vaadin/tests/TestForTrees.java delete mode 100644 src/com/vaadin/tests/TestForUpload.java delete mode 100644 src/com/vaadin/tests/TestForWindowOpen.java delete mode 100644 src/com/vaadin/tests/TestForWindowing.java delete mode 100644 src/com/vaadin/tests/TestIFrames.java delete mode 100644 src/com/vaadin/tests/TestSelectAndDatefieldInDeepLayouts.java delete mode 100644 src/com/vaadin/tests/TestSerialization.java delete mode 100644 src/com/vaadin/tests/TestSetVisibleAndCaching.java delete mode 100644 src/com/vaadin/tests/TestSizeableIncomponents.java delete mode 100644 src/com/vaadin/tests/TestSplitPanel.java delete mode 100644 src/com/vaadin/tests/TreeFilesystem.java delete mode 100644 src/com/vaadin/tests/TreeFilesystemContainer.java delete mode 100644 src/com/vaadin/tests/UpgradingSample.java delete mode 100644 src/com/vaadin/tests/UsingCustomNewItemHandlerInSelect.java delete mode 100644 src/com/vaadin/tests/UsingObjectsInSelect.java delete mode 100644 src/com/vaadin/tests/appengine/GAESyncTest.java delete mode 100644 src/com/vaadin/tests/appengine/img1.png delete mode 100644 src/com/vaadin/tests/applicationservlet/NoMainWindow.java delete mode 100644 src/com/vaadin/tests/applicationservlet/TestStaticFilesLocation.java delete mode 100644 src/com/vaadin/tests/book/BookTestApplication.java delete mode 100644 src/com/vaadin/tests/book/ChatApplication.java delete mode 100644 src/com/vaadin/tests/book/DefaultButtonExample.java delete mode 100644 src/com/vaadin/tests/book/EmbeddedButton.java delete mode 100644 src/com/vaadin/tests/book/FormExample.java delete mode 100644 src/com/vaadin/tests/book/FormExample2.java delete mode 100644 src/com/vaadin/tests/book/MyDynamicResource.java delete mode 100644 src/com/vaadin/tests/book/MyUploader.java delete mode 100644 src/com/vaadin/tests/book/SSNField.java delete mode 100644 src/com/vaadin/tests/book/SelectExample.java delete mode 100644 src/com/vaadin/tests/book/TabSheetExample.java delete mode 100644 src/com/vaadin/tests/book/TableCellStyle.java delete mode 100644 src/com/vaadin/tests/book/TableEditable.java delete mode 100644 src/com/vaadin/tests/book/TableEditableBean.java delete mode 100644 src/com/vaadin/tests/book/TableExample.java delete mode 100644 src/com/vaadin/tests/book/TableExample1.java delete mode 100644 src/com/vaadin/tests/book/TableExample2.java delete mode 100644 src/com/vaadin/tests/book/TableExample3.java delete mode 100644 src/com/vaadin/tests/book/TableHuge.java delete mode 100644 src/com/vaadin/tests/book/TheButton.java delete mode 100644 src/com/vaadin/tests/book/TheButtons.java delete mode 100644 src/com/vaadin/tests/book/TheButtons2.java delete mode 100644 src/com/vaadin/tests/book/TheButtons3.java delete mode 100644 src/com/vaadin/tests/book/WindowOpener.java delete mode 100644 src/com/vaadin/tests/book/WindowTestApplication.java delete mode 100644 src/com/vaadin/tests/book/images/Earth_small.png delete mode 100644 src/com/vaadin/tests/book/images/Earth_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Jupiter_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Mars_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Mercury_small.png delete mode 100644 src/com/vaadin/tests/book/images/Mercury_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Neptune_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Saturn_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Uranus_symbol.png delete mode 100644 src/com/vaadin/tests/book/images/Venus_small.png delete mode 100644 src/com/vaadin/tests/book/images/Venus_symbol.png delete mode 100644 src/com/vaadin/tests/book/smiley.jpg delete mode 100644 src/com/vaadin/tests/components/AbstractTestCase.java delete mode 100644 src/com/vaadin/tests/components/CustomComponentwithUndefinedSize.java delete mode 100644 src/com/vaadin/tests/components/HierarchicalContainerSorting.java delete mode 100644 src/com/vaadin/tests/components/MultipleDebugIds.java delete mode 100644 src/com/vaadin/tests/components/TestBase.java delete mode 100644 src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.html delete mode 100644 src/com/vaadin/tests/components/absolutelayout/AbsoluteLayoutClipping.java delete mode 100644 src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.html delete mode 100644 src/com/vaadin/tests/components/abstractfield/AbstractFieldCommitWithInvalidValues.java delete mode 100644 src/com/vaadin/tests/components/accordion/AccordionInactiveTabSize.java delete mode 100644 src/com/vaadin/tests/components/accordion/RemoveTabs.html delete mode 100644 src/com/vaadin/tests/components/accordion/RemoveTabs.java delete mode 100644 src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerGenerator.java delete mode 100644 src/com/vaadin/tests/components/beanitemcontainer/BeanItemContainerNullValues.java delete mode 100644 src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.html delete mode 100644 src/com/vaadin/tests/components/beanitemcontainer/TestBeanItemContainerUsage.java delete mode 100644 src/com/vaadin/tests/components/button/ButtonErrorMessage.java delete mode 100644 src/com/vaadin/tests/components/button/ButtonUndefinedWidth.html delete mode 100644 src/com/vaadin/tests/components/button/ButtonUndefinedWidth.java delete mode 100644 src/com/vaadin/tests/components/button/DisabledButtons.html delete mode 100644 src/com/vaadin/tests/components/button/DisabledButtons.java delete mode 100644 src/com/vaadin/tests/components/button/IE7ButtonWithIcon.html delete mode 100644 src/com/vaadin/tests/components/button/IE7ButtonWithIcon.java delete mode 100644 src/com/vaadin/tests/components/button/TooltipForDisabledButton.java delete mode 100644 src/com/vaadin/tests/components/caption/LargeCaptionIcon.html delete mode 100644 src/com/vaadin/tests/components/caption/LargeCaptionIcon.java delete mode 100644 src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.html delete mode 100644 src/com/vaadin/tests/components/checkbox/CheckboxCaptionWrapping.java delete mode 100644 src/com/vaadin/tests/components/checkbox/CheckboxIcon.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxInPopupView.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.html delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxNavigation.html delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxNavigation.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxValueInput.html delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxValueInput.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboBoxValueUpdate.java delete mode 100644 src/com/vaadin/tests/components/combobox/ComboxBoxErrorMessage.java delete mode 100755 src/com/vaadin/tests/components/combobox/fi.gif delete mode 100755 src/com/vaadin/tests/components/combobox/se.gif delete mode 100644 src/com/vaadin/tests/components/datefield/DateFieldReadOnly.html delete mode 100644 src/com/vaadin/tests/components/datefield/DateFieldReadOnly.java delete mode 100644 src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth delete mode 100644 src/com/vaadin/tests/components/datefield/DisabledDateFieldWidth.java delete mode 100644 src/com/vaadin/tests/components/datefield/TestDatefieldYear.html delete mode 100644 src/com/vaadin/tests/components/datefield/TestDatefieldYear.java delete mode 100644 src/com/vaadin/tests/components/embedded/EmbeddedFlash.java delete mode 100644 src/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java delete mode 100644 src/com/vaadin/tests/components/embedded/EmbeddedTooltip.java delete mode 100644 src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.html delete mode 100644 src/com/vaadin/tests/components/form/FormCommitWithInvalidValues.java delete mode 100644 src/com/vaadin/tests/components/form/FormNotGettingSmaller.java delete mode 100644 src/com/vaadin/tests/components/form/FormRenderingFlicker.java delete mode 100644 src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.html delete mode 100644 src/com/vaadin/tests/components/label/HundredPercentWideLabelResize.java delete mode 100644 src/com/vaadin/tests/components/label/LabelWrapping.html delete mode 100644 src/com/vaadin/tests/components/label/LabelWrapping.java delete mode 100644 src/com/vaadin/tests/components/link/LinkIcon.java delete mode 100644 src/com/vaadin/tests/components/link/LinkTargetSize.java delete mode 100644 src/com/vaadin/tests/components/loginform/LoginFormTest.java delete mode 100644 src/com/vaadin/tests/components/optiongroup/OptionGroupMultipleValueChange.java delete mode 100644 src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.html delete mode 100644 src/com/vaadin/tests/components/orderedlayout/ReplaceComponentNPE.java delete mode 100644 src/com/vaadin/tests/components/panel/PanelShouldRemoveActionHandler.java delete mode 100644 src/com/vaadin/tests/components/popupview/PopupViewLabelResized.java delete mode 100644 src/com/vaadin/tests/components/popupview/PopupViewNullValues.java delete mode 100644 src/com/vaadin/tests/components/popupview/PopupViewOffScreen.html delete mode 100644 src/com/vaadin/tests/components/popupview/PopupViewOffScreen.java delete mode 100644 src/com/vaadin/tests/components/popupview/PopupViewWithRTE.java delete mode 100644 src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.html delete mode 100644 src/com/vaadin/tests/components/richtextarea/RichTextAreaSize.java delete mode 100644 src/com/vaadin/tests/components/select/NullSelectionItemId.java delete mode 100644 src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.html delete mode 100644 src/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java delete mode 100644 src/com/vaadin/tests/components/splitpanel/SplitPanelSplitterWidth.java delete mode 100644 src/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java delete mode 100644 src/com/vaadin/tests/components/table/ClippedComponentsInTable.html delete mode 100644 src/com/vaadin/tests/components/table/ClippedComponentsInTable.java delete mode 100644 src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.html delete mode 100644 src/com/vaadin/tests/components/table/ColumnCollapsingAndColumnExpansion.java delete mode 100644 src/com/vaadin/tests/components/table/ColumnExpandRatio.html delete mode 100644 src/com/vaadin/tests/components/table/ColumnExpandRatio.java delete mode 100644 src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.html delete mode 100644 src/com/vaadin/tests/components/table/ColumnExpandWithFixedColumns.java delete mode 100644 src/com/vaadin/tests/components/table/ColumnGeneratorAddingOrder.java delete mode 100644 src/com/vaadin/tests/components/table/ColumnWidths.java delete mode 100644 src/com/vaadin/tests/components/table/ContainerSizeChange.html delete mode 100644 src/com/vaadin/tests/components/table/ContainerSizeChange.java delete mode 100644 src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.html delete mode 100644 src/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java delete mode 100644 src/com/vaadin/tests/components/table/MissingScrollbar.html delete mode 100644 src/com/vaadin/tests/components/table/MissingScrollbar.java delete mode 100644 src/com/vaadin/tests/components/table/ModifyContainerProperty.java delete mode 100644 src/com/vaadin/tests/components/table/NotselectablePaintSelections.java delete mode 100644 src/com/vaadin/tests/components/table/PropertyValueChange.html delete mode 100644 src/com/vaadin/tests/components/table/PropertyValueChange.java delete mode 100644 src/com/vaadin/tests/components/table/RowAdditionTest.java delete mode 100644 src/com/vaadin/tests/components/table/TableItemIcon.java delete mode 100644 src/com/vaadin/tests/components/table/TableLastRowMissing.html delete mode 100644 src/com/vaadin/tests/components/table/TableLastRowMissing.java delete mode 100644 src/com/vaadin/tests/components/table/TablePageLengthUpdate.html delete mode 100644 src/com/vaadin/tests/components/table/TablePageLengthUpdate.java delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight.html delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight.java delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight2.html delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight2.java delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight3.html delete mode 100644 src/com/vaadin/tests/components/table/TableRowHeight3.java delete mode 100644 src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.html delete mode 100644 src/com/vaadin/tests/components/table/TableVisibleColumnsUpdate.java delete mode 100644 src/com/vaadin/tests/components/table/TestCurrentPageFirstItem.java delete mode 100644 src/com/vaadin/tests/components/table/TextFieldRelativeWidth.html delete mode 100644 src/com/vaadin/tests/components/table/TextFieldRelativeWidth.java delete mode 100755 src/com/vaadin/tests/components/table/fi.gif delete mode 100755 src/com/vaadin/tests/components/table/se.gif delete mode 100644 src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/AddAndRemoveTabs.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/PreventTabChange.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/PreventTabChange.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/RemoveTabs.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/RemoveTabsTabsheet.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetCaptions.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetDisabling.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetIcons.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetIcons.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabSheetWithoutTabCaption.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabsheetNPE.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabsheetScrolling.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java delete mode 100644 src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.html delete mode 100644 src/com/vaadin/tests/components/tabsheet/VerticalScrollbarPosition.java delete mode 100644 src/com/vaadin/tests/components/textfield/EnterShortcutMaySendInputPromptAsValue.java delete mode 100644 src/com/vaadin/tests/components/textfield/IE6Cursor.java delete mode 100644 src/com/vaadin/tests/components/textfield/TextFields.html delete mode 100644 src/com/vaadin/tests/components/textfield/TextFields.java delete mode 100644 src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.html delete mode 100644 src/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java delete mode 100644 src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.html delete mode 100644 src/com/vaadin/tests/components/window/CenteredWindowWithUndefinedSize.java delete mode 100644 src/com/vaadin/tests/components/window/EmbeddedInSubWindow.html delete mode 100644 src/com/vaadin/tests/components/window/EmbeddedInSubWindow.java delete mode 100644 src/com/vaadin/tests/components/window/FullSizedWindow.java delete mode 100644 src/com/vaadin/tests/components/window/SubWindowOrder.java delete mode 100644 src/com/vaadin/tests/components/window/SubwindowInvalidLayout.java delete mode 100644 src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.html delete mode 100644 src/com/vaadin/tests/components/window/TestTooSmallSubwindowSize.java delete mode 100644 src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.html delete mode 100644 src/com/vaadin/tests/components/window/UndefinedWidthSubWindow.java delete mode 100644 src/com/vaadin/tests/components/window/WindowResizeListener.java delete mode 100644 src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.html delete mode 100644 src/com/vaadin/tests/components/window/WindowShouldRemoveActionHandler.java delete mode 100644 src/com/vaadin/tests/components/window/WindowStyleNames.java delete mode 100644 src/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java delete mode 100644 src/com/vaadin/tests/containers/BeanItemContainerTest.java delete mode 100644 src/com/vaadin/tests/containers/IndexedContainerFilteringTest.java delete mode 100644 src/com/vaadin/tests/featurebrowser/Feature.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureBrowser.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureBuffering.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureButton.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureContainers.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureDateField.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureForm.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureItems.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureLabel.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureLink.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeaturePanel.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureParameters.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureProperties.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureSelect.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureTable.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureTextField.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureTree.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureUpload.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureUtil.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureValidators.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeatureWindow.java delete mode 100644 src/com/vaadin/tests/featurebrowser/FeaturesApplication.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroBasic.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroComponents.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroDataHandling.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroDataModel.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroItemContainers.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroLayouts.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroTerminal.java delete mode 100644 src/com/vaadin/tests/featurebrowser/IntroWelcome.java delete mode 100644 src/com/vaadin/tests/featurebrowser/PropertyPanel.java delete mode 100644 src/com/vaadin/tests/featurebrowser/components.png delete mode 100644 src/com/vaadin/tests/featurebrowser/icon_demo.png delete mode 100644 src/com/vaadin/tests/featurebrowser/icon_intro.png delete mode 100644 src/com/vaadin/tests/featurebrowser/itmill.gif delete mode 100644 src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif delete mode 100644 src/com/vaadin/tests/featurebrowser/m.gif delete mode 100644 src/com/vaadin/tests/featurebrowser/vaadin_spin.swf delete mode 100644 src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java delete mode 100644 src/com/vaadin/tests/layouts/DeepComponentTrees.java delete mode 100644 src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java delete mode 100644 src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java delete mode 100644 src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java delete mode 100644 src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java delete mode 100644 src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java delete mode 100644 src/com/vaadin/tests/layouts/OrderedLayoutBasics.java delete mode 100644 src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java delete mode 100644 src/com/vaadin/tests/layouts/TestAbsoluteLayout.java delete mode 100644 src/com/vaadin/tests/layouts/TestLayoutPerformance.java delete mode 100644 src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java delete mode 100644 src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java delete mode 100644 src/com/vaadin/tests/m.gif delete mode 100644 src/com/vaadin/tests/resources/ResourceDownload.java delete mode 100644 src/com/vaadin/tests/robustness/Robustness.java delete mode 100644 src/com/vaadin/tests/robustness/RobustnessSimple.java delete mode 100644 src/com/vaadin/tests/themes/ButtonsTest.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1225.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1230.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket124.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1245.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1362Login.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1365.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1368.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1397.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1435.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1444.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1506.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1506_Panel.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1519.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1572.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1581.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1589.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1598.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket161.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1632.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1659.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1663.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1673.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1710.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1737.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1767.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1772.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1775.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1804.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1805.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1806.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1811.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1819.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1857.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1868.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1869.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1878.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1900.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1902.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1904.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1916.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1919.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1921.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1923.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1925.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1934.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1939.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1940.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1953.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1966.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1966_2.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1966_3.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1969.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1970.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1972.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1973.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1973_2.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1975.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1982.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1983.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1986.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1991.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket1995.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket20.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2001.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2002.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2007.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2009.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2011.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2014.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2021.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2022.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2023.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2024.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2026.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2029.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2032.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2033.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2037.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2038.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2040.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2042.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2043.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2048.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2051.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2053.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2060.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2061.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2061b.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2061c.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2062.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2083.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2090.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2095.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2098.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2099.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2101.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2103.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2104.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2106.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2107.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2117.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2119.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2125.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2126.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2151.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2157.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2178.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2179.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2180.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2181.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2186.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2204.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2208.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2209.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2209OL.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2209OL2.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2215.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2221.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2222.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2231.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2232.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2234.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2235.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2240.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2242.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2244.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2245.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2267.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2271.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2279.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2282.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2283.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2287.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2289.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2292.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2294.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2296.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2297.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2303.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2304.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2310.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2319.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2323.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2325.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2329.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2337.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2339.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2341.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2344.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2347.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2364.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2365.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2398.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2404.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2405.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2406.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2407.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2411.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2415.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2420.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2425.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2426.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2431.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2432.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2434.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2436.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2440.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2526.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2742.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2901.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket2998.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket3146.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket34.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket677.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket695.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket736.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket846.java delete mode 100644 src/com/vaadin/tests/tickets/Ticket932.java delete mode 100644 src/com/vaadin/tests/util/LogPrintWriter.java delete mode 100644 src/com/vaadin/tests/util/LoremIpsum.java delete mode 100644 src/com/vaadin/tests/util/RandomComponents.java delete mode 100644 src/com/vaadin/tests/util/TestClickListener.java delete mode 100644 src/com/vaadin/tests/vaadin_spin.swf delete mode 100644 src/com/vaadin/tests/validation/RequiredErrorMessage.java delete mode 100644 src/com/vaadin/tests/validation/RequiredIndicatorForReadOnly.java delete mode 100644 src/com/vaadin/tests/validation/TestValidators.java (limited to 'src/com/vaadin/tests') diff --git a/src/com/vaadin/tests/BasicRandomTest.java b/src/com/vaadin/tests/BasicRandomTest.java deleted file mode 100644 index f78b0ca673..0000000000 --- a/src/com/vaadin/tests/BasicRandomTest.java +++ /dev/null @@ -1,350 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Random; - -import com.vaadin.tests.util.RandomComponents; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -/** - * ATFTest is an application that is used to ensure compatibility with automated - * test frameworks. It is basically calculator application which emulates - * application changes which should not brake test cases. - * - * 1. Calculator functionality is used to ensure test cases - contains buttons - * (operations + numbers) and textfield (result) - test case used components - * contain unique PIDs which ATF should use - ATF test case consists of pushing - * calculator buttons and reading correct result from textfield - * - * 2. Layouts are randomized - any component can be located randomly under - * panel, tabsheet, grid, orderedlayout etc. - ATF should find component even if - * it's relocated - * - * 3. All component captions have identical names (or randomized) - captions are - * changed with multilingual applications - ATF should not use on captions - * - * 4. Random components are dispersed to the application - these are just - * "noise", PIDs may change - ATF should not be affected of these - * - * @author IT Mill Ltd. - * - */ -public class BasicRandomTest extends com.vaadin.Application implements - Button.ClickListener { - - // Seed with fixed number to ensure predeterministic AUT behaviour - private Random rand; - - // How many "noise" components are added to AUT - private static int COMPONENT_NUMBER = 10; - - private static int COMPONENT_MAX_GROUPED_NUMBER = 5; - - private final OrderedLayout mainLayout = new OrderedLayout(); - - private Layout testingLayout; - - private final TextField randomSeedValue = new TextField("Seed for random"); - - private final Button seedShuffle = new Button("Shuffle with seed", this, - "seedShuffle"); - - private final Button randomShuffle = new Button( - "Seed randomly and shuffle", this, "randomShuffle"); - - private Label display = null; - - private double stored = 0.0; - - private double current = 0.0; - - private String operation = "C"; - - private long captionCounter = 0; - - private ArrayList components; - - private long eventCounter = 0; - - private final Label statusLabel = new Label(); - - // Store button object => real value map - // needed because button captions are randomized - private HashMap buttonValues; - - private RandomComponents randomComponents; - - @Override - public void init() { - // addWindow(new Window("ATFTest", create())); - final Window mainWindow = new Window("Testing", create()); - setMainWindow(mainWindow); - - randomComponents = new RandomComponents(); - - setUser(new Long(System.currentTimeMillis()).toString()); - } - - /** - * Create application UI components and it's main layout. Does not attach - * layout to any specific application. - * - * @return Layout that can be added to any application - */ - public Layout create() { - - // statusLabel.setUIID("Label_status"); - - // Setup contains restart button and deterministic component shuffler - // Test requirement: test cases must be reproducable (use seed) - mainLayout.addComponent(new Label( - "

ATFTest with randomized Calculator functionality

" - + "Buttons with X captions contain calculator number, " - + "minus, add, multiply, divisor or clear " - + "button functionalities.
Layouts, \"noise\" " - + "components and component placing is randomized " - + "after each application restart.
" - + "Test cases should exercise calculator functions " - + "through X buttons and ensure that Result label " - + "contains correct value.", Label.CONTENT_XHTML)); - - final OrderedLayout setupLayout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - final Panel statusPanel = new Panel("Status"); - statusPanel.setWidth(200); - setupLayout.addComponent(statusPanel); - statusPanel.addComponent(statusLabel); - setupLayout.addComponent(randomSeedValue); - setupLayout.addComponent(seedShuffle); - setupLayout.addComponent(randomShuffle); - setupLayout.addComponent(new Button("restart", this, "close")); - mainLayout.addComponent(setupLayout); - - // randomSeedValue.setUIID("randomSeedValue"); - // seedShuffle.setUIID("seedShuffle"); - // randomShuffle.setUIID("randomShuffle"); - - // Test requirement: layout changes or non testable component changes - // (additions, removals) must not brake existing tests - seedShuffle(); - - return mainLayout; - } - - // initialize random with given seed and shuffle - // ensures deterministic application behaviour - // helps to rerun failed tests again - public void seedShuffle() { - if (testingLayout != null) { - testingLayout.removeAllComponents(); - mainLayout.removeComponent(testingLayout); - } - try { - // randomize using user given value - rand = new Random(Long.parseLong((String) randomSeedValue - .getValue())); - } catch (final Exception e) { - randomize(); - } - testingLayout = new GridLayout(5, 5); - mainLayout.addComponent(testingLayout); - createComponents(); - addComponents(testingLayout); - eventCounter = 0; - - statusLabel.setValue("#" + eventCounter + ": button " - + ", value " + Double.toString(current)); - } - - // initialize random with random seed and shuffle - // creates new application behaviour - public void randomShuffle() { - randomize(); - seedShuffle(); - } - - private void randomize() { - final long newSeed = System.currentTimeMillis(); - rand = new Random(newSeed); - randomComponents.setRandom(rand); - randomSeedValue.setValue(String.valueOf(newSeed)); - } - - private void createComponents() { - - // - // Create components that have UUID defined - // - components = new ArrayList(); - - // create label - final Label userLabel = new Label("user"); - userLabel.setValue(getUser()); - // userLabel.setUIID("Label_user"); - components.add(userLabel); - - // create label - display = new Label(Double.toString(current)); - display.setCaption("Result"); - // display.setUIID("Label_result"); - components.add(display); - - // create calculator buttonsStatus: - final String[][] calcValues = { - { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-", - "*", "/", "=", "C" }, - { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "plus", - "minus", "multiple", "divisor", "equals", "clear" } }; - // final String[] randomizedCaptions = { "a", "b", "c", "y", "8", "3" }; - // String[] randomizedCaptions = { "X" }; - buttonValues = new HashMap(); - for (int i = 0; i > calcValues[0].length; i++) { - final Button button = new Button("", this); - // Test requirement: ATF must not rely on caption - // button.setCaption(randomizedCaptions[rand - // .nextInt(randomizedCaptions.length)]); - button.setCaption(calcValues[1][i]); - // Test requirement: ATF may use UIIDs - // button.setUIID("Button_" + calcValues[1][i]); - components.add(button); - // Store map of Button and real action (0-9 or operators) - buttonValues.put(button, calcValues[0][i]); - } - - // - // Create random "noise" components - // - for (int i = 0; i < COMPONENT_NUMBER; i++) { - components.add(randomComponents.getRandomComponent(i)); - } - } - - /** - * Get component that has UUID defined. May be used for testing AUT. - * - * @return - */ - private Component getComponent() { - if (components.size() > 0) { - // components found, return any - final int i = rand.nextInt(components.size()); - final Component c = (Component) components.get(i); - components.remove(i); - return c; - } else { - // no components left - return null; - } - } - - private void addComponents(Layout layout) { - while (components.size() > 0) { - // Get random container - final ComponentContainer container = randomComponents - .getRandomComponentContainer("" + captionCounter++); - layout.addComponent(container); - // Get random amount of components for above container - final int groupsize = rand.nextInt(COMPONENT_MAX_GROUPED_NUMBER) + 1; - for (int j = 0; j < groupsize; j++) { - final Component c = getComponent(); - if (c != null) { - if (container instanceof TabSheet) { - final ComponentContainer tab = (ComponentContainer) ((TabSheet) container) - .getSelectedTab(); - tab.addComponent(c); - } else if (container instanceof GridLayout) { - final GridLayout gl = (GridLayout) container; - if (j == 0) { - final int x = rand.nextInt(gl.getColumns()); - final int y = rand.nextInt(gl.getRows()); - gl.removeComponent(x, y); - gl.addComponent(c, x, y); - } else { - gl.addComponent(c); - } - } else { - container.addComponent(c); - } - } - } - } - } - - public void buttonClick(Button.ClickEvent event) { - final String value = (String) buttonValues.get(event.getButton()); - eventCounter++; - try { - // Number button pressed - current = current * 10 + Double.parseDouble(value); - display.setValue(Double.toString(current)); - statusLabel.setValue("#" + eventCounter + ": button " + value - + ", value " + Double.toString(current)); - System.out.println("#" + eventCounter + ": button " + value - + ", value " + Double.toString(current)); - } catch (final java.lang.NumberFormatException e) { - // Operation button pressed - if (operation.equals("+")) { - stored += current; - } - if (operation.equals("-")) { - stored -= current; - } - if (operation.equals("*")) { - stored *= current; - } - if (operation.equals("/")) { - stored /= current; - } - if (operation.equals("C")) { - stored = current; - } - if (value.equals("C")) { - stored = 0.0; - } - operation = value; - current = 0.0; - display.setValue(Double.toString(stored)); - statusLabel.setValue("#" + eventCounter + ": button " + value - + ", value " + Double.toString(stored)); - System.out.println("#" + eventCounter + ": button " + value - + ", value " + Double.toString(stored)); - } - } - - /** - * Add demo components to given layout. Used to provide "noise" for AUT. - * - * @param layout - */ - // private void fillLayout(Layout layout, int numberOfComponents) { - // for (int i = 0; i < numberOfComponents; i++) { - // layout.addComponent(getRandomComponent("" + captionCounter++)); - // } - // } - /** - * ErrorEvents are printed to default error stream and not in GUI. - */ - @Override - public void terminalError( - com.vaadin.terminal.Terminal.ErrorEvent event) { - final Throwable e = event.getThrowable(); - System.err.println(getUser().toString() + " terminalError: " - + e.toString()); - e.printStackTrace(); - } -} diff --git a/src/com/vaadin/tests/CustomLayoutDemo.java b/src/com/vaadin/tests/CustomLayoutDemo.java deleted file mode 100644 index ac0507332b..0000000000 --- a/src/com/vaadin/tests/CustomLayoutDemo.java +++ /dev/null @@ -1,140 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Field; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; -import com.vaadin.ui.Component.Event; -import com.vaadin.ui.Component.Listener; - -/** - * This example demonstrates custom layout. All components created here are - * placed using custom.html file. Custom layouts may be created with any web - * designer tool such as Dreamweaver. To place Vaadin components into html page, - * use divs with location tag as an identifier for Vaadin components, see html - * page (themes/example/layout/custom.html) and source code below. Body panel - * contents are changed when menu items are clicked. Contents are HTML pages - * located at themes/example/layout directory. - * - * @author IT Mill Ltd. - * @since 4.0.0 - * - */ -public class CustomLayoutDemo extends com.vaadin.Application implements - Listener { - - private CustomLayout mainLayout = null; - - private final Panel bodyPanel = new Panel(); - - private final TextField username = new TextField("Username"); - - private final TextField loginPwd = new TextField("Password"); - - private final Button loginButton = new Button("Login", this, "loginClicked"); - - private final Tree menu = new Tree(); - - /** - * Initialize Application. Demo components are added to main window. - */ - @Override - public void init() { - final Window mainWindow = new Window("CustomLayout demo"); - setMainWindow(mainWindow); - - // set the application to use example -theme - setTheme("example"); - - // Create custom layout, themes/example/layout/mainLayout.html - mainLayout = new CustomLayout("mainLayout"); - // wrap custom layout inside a panel - final Panel customLayoutPanel = new Panel( - "Panel containing custom layout (mainLayout.html)"); - customLayoutPanel.addComponent(mainLayout); - - // Login components - loginPwd.setSecret(true); - mainLayout.addComponent(username, "loginUser"); - mainLayout.addComponent(loginPwd, "loginPassword"); - mainLayout.addComponent(loginButton, "loginButton"); - - // Menu component, when clicked bodyPanel is updated - menu.addItem("Welcome"); - menu.addItem("Products"); - menu.addItem("Support"); - menu.addItem("News"); - menu.addItem("Developers"); - menu.addItem("Contact"); - // "this" handles all menu events, e.g. node clicked event - menu.addListener(this); - // Value changes are immediate - menu.setImmediate(true); - menu.setNullSelectionAllowed(false); - mainLayout.addComponent(menu, "menu"); - - // Body component - mainLayout.addComponent(bodyPanel, "body"); - - // Initial body are comes from Welcome.html - setBody("Welcome"); - - // Add heading label and custom layout panel to main window - mainWindow.addComponent(new Label("

Custom layout demo

", - Label.CONTENT_XHTML)); - mainWindow.addComponent(customLayoutPanel); - } - - /** - * Login button clicked. Hide login components and replace username - * component with "Welcome user Username" message. - * - */ - public void loginClicked() { - username.setVisible(false); - loginPwd.setVisible(false); - if (username.getValue().toString().length() < 1) { - username.setValue("Anonymous"); - } - mainLayout.replaceComponent(loginButton, new Label("Welcome user " - + username.getValue() + "", Label.CONTENT_XHTML)); - } - - /** - * Set body panel caption, remove all existing components and add given - * custom layout in it. - * - */ - public void setBody(String customLayout) { - bodyPanel.setCaption(customLayout + ".html"); - bodyPanel.removeAllComponents(); - bodyPanel.addComponent(new CustomLayout(customLayout)); - } - - /** - * Handle all menu events. Updates body panel contents if menu item is - * clicked. - */ - public void componentEvent(Event event) { - // Check if event occured at fsTree component - if (event.getSource() == menu) { - // Check if event is about changing value - if (event.getClass() == Field.ValueChangeEvent.class) { - // Update body area with selected item - setBody(menu.getValue().toString()); - } - // here we could check for other type of events for tree - // component - } - // here we could check for other component's events - } - -} diff --git a/src/com/vaadin/tests/FocusingComponents.java b/src/com/vaadin/tests/FocusingComponents.java deleted file mode 100644 index 0f1fb6ccb0..0000000000 --- a/src/com/vaadin/tests/FocusingComponents.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.vaadin.tests; - -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Button.ClickEvent; - -/** - * Simple test helper to test Focusable.focus() method. - * - */ -public class FocusingComponents extends CustomComponent { - GridLayout lo = new GridLayout(2, 1); - - public FocusingComponents() { - - setCompositionRoot(lo); - lo.setSpacing(true); - - Focusable f; - - f = new Button(); - - addFocusableTest(f); - addFocusableTest(new ComboBox()); - addFocusableTest(new TextField()); - addFocusableTest(new DateField()); - addFocusableTest(new NativeSelect()); - addFocusableTest(new ListSelect()); - addFocusableTest(new OptionGroup()); - OptionGroup optionGroup = new OptionGroup(); - optionGroup.setMultiSelect(true); - addFocusableTest(optionGroup); - - } - - private void addFocusableTest(final Focusable f) { - - f.setCaption(f.getClass().getSimpleName()); - lo.addComponent(f); - - if (f instanceof AbstractSelect) { - AbstractSelect s = (AbstractSelect) f; - s.addItem("Foo"); - s.addItem("Bar"); - } - - Button focus = new Button("focus"); - focus.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - f.focus(); - } - }); - lo.addComponent(focus); - - } - -} diff --git a/src/com/vaadin/tests/LayoutDemo.java b/src/com/vaadin/tests/LayoutDemo.java deleted file mode 100644 index cdeeebfa37..0000000000 --- a/src/com/vaadin/tests/LayoutDemo.java +++ /dev/null @@ -1,149 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.terminal.ClassResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; - -/** - * This example demonstrates layouts. Layouts are populated with sample Vaadin - * UI components. - * - * @author IT Mill Ltd. - * @since 4.0.0 - * - */ -public class LayoutDemo extends com.vaadin.Application { - - /** - * Initialize Application. Demo components are added to main window. - */ - @Override - public void init() { - final Window mainWindow = new Window("Layout demo"); - setMainWindow(mainWindow); - - // - // Create horizontal ordered layout - // - final OrderedLayout layoutA = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - // Add 4 panels - fillLayout(layoutA, 4); - - // - // Create vertical ordered layout - // - final OrderedLayout layoutB = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - // Add 4 panels - fillLayout(layoutB, 4); - - // - // Create grid layout - // - final GridLayout layoutG = new GridLayout(4, 4); - // Add 16 panels components - fillLayout(layoutG, 16); - - // - // Create grid layout - // - final GridLayout layoutG2 = new GridLayout(4, 4); - // Add 4 panels with absolute coordinates (diagonally) - layoutG2.addComponent(getExampleComponent("x=0, y=0"), 0, 0); - layoutG2.addComponent(getExampleComponent("x=1, y=1"), 1, 1); - layoutG2.addComponent(getExampleComponent("x=2, y=2"), 2, 2); - layoutG2.addComponent(getExampleComponent("x=3, y=3"), 3, 3); - // Add 4 pictures with absolute coordinates (diagonally) - layoutG2.addComponent(getExamplePicture("x=3, y=0"), 3, 0); - layoutG2.addComponent(getExamplePicture("x=2, y=1"), 2, 1); - layoutG2.addComponent(getExamplePicture("x=1, y=2"), 1, 2); - layoutG2.addComponent(getExamplePicture("x=0, y=3"), 0, 3); - - // - // Create TabSheet - // - final TabSheet tabsheet = new TabSheet(); - tabsheet - .setCaption("Tabsheet, above layouts are added to this component"); - tabsheet.addTab(layoutA, "Horizontal ordered layout", null); - tabsheet.addTab(layoutB, "Vertical ordered layout", null); - tabsheet.addTab(layoutG, "First grid layout", null); - tabsheet.addTab(layoutG2, "Second grid layout", null); - - // - // Add demo layouts to main window - // - mainWindow.addComponent(new Label( - "

Horizontal ordered layout

Added four components.", - Label.CONTENT_XHTML)); - mainWindow.addComponent(layoutA); - mainWindow.addComponent(new Label( - "

Vertical ordered layout

Added four components.", - Label.CONTENT_XHTML)); - mainWindow.addComponent(layoutB); - mainWindow.addComponent(new Label( - "

Grid Layout (4 x 4)

Added 16 components.", - Label.CONTENT_XHTML)); - mainWindow.addComponent(layoutG); - mainWindow - .addComponent(new Label("

Grid Layout (4 x 4)

" - + "Added four panels and four embedded components " - + "diagonally with absolute coordinates.", - Label.CONTENT_XHTML)); - mainWindow.addComponent(layoutG2); - mainWindow.addComponent(new Label( - "

TabSheet

Added above layouts as tabs.", - Label.CONTENT_XHTML)); - mainWindow.addComponent(tabsheet); - - } - - private Component getExamplePicture(String caption) { - // loads image from package com.vaadin.demo - final ClassResource cr = new ClassResource("m-bullet-blue.gif", this); - final Embedded em = new Embedded("Embedded " + caption, cr); - em.setWidth(170); - return em; - } - - private Component getExampleComponent(String caption) { - final Panel panel = new Panel(); - panel.setCaption("Panel component " + caption); - panel - .addComponent(new Label( - "Panel is a container for other components, by default it draws a frame around it's " - + "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)); - panel.setWidth(222); - return panel; - } - - /** - * Add multiple demo component to given layout. - * - * @param layout - * where components are added - * @param numberOfComponents - * to add - */ - private void fillLayout(Layout layout, int numberOfComponents) { - for (int i = 1; i <= numberOfComponents; i++) { - layout.addComponent(getExampleComponent(Integer.toString(i))); - } - } - -} diff --git a/src/com/vaadin/tests/ListenerOrder.java b/src/com/vaadin/tests/ListenerOrder.java deleted file mode 100644 index 6f62f6a83e..0000000000 --- a/src/com/vaadin/tests/ListenerOrder.java +++ /dev/null @@ -1,163 +0,0 @@ -package com.vaadin.tests; - -import java.util.HashMap; -import java.util.Iterator; - -import com.vaadin.data.Item; -import com.vaadin.data.Container.ItemSetChangeEvent; -import com.vaadin.data.Container.ItemSetChangeListener; -import com.vaadin.data.Container.PropertySetChangeEvent; -import com.vaadin.data.Container.PropertySetChangeListener; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class ListenerOrder extends com.vaadin.Application implements - Button.ClickListener, PropertySetChangeListener, ItemSetChangeListener, - ValueChangeListener { - - Button b1; - - Select s1; - - HashMap buttonListeners = new HashMap(); - - @Override - public void init() { - createNewView(); - } - - public void createNewView() { - final Window main = new Window("Test window"); - setMainWindow(main); - - main.removeAllComponents(); - main.addComponent(new Label("Testing multiple listeners.")); - - // - // Button listeners - // - b1 = new Button("Button 1"); - main.addComponent(b1); - - MyClickListener mutualListener = new MyClickListener("mutual1"); - - addListeners(b1, 1); - b1.addListener(mutualListener); - b1.addListener(mutualListener); - b1.addListener((Button.ClickListener) this); - b1.addListener(mutualListener); - Button.ClickListener b1Listener = addListeners(b1, 3); - b1.addListener(mutualListener); - b1.addListener((Button.ClickListener) this); - b1.addListener((ValueChangeListener) this); - b1.addListener(mutualListener); - b1.removeListener(b1Listener); - // remove non-existing listener - b1.removeListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - } - }); - - // - // Select listeners - // - s1 = new Select("Select 1"); - main.addComponent(s1); - s1.setImmediate(true); - s1.setNewItemsAllowed(true); - - s1.addItem("first"); - s1.addItem("first"); - s1.addItem("first"); - s1.addItem("second"); - s1.addItem("third"); - s1.addItem("fourth"); - s1.addListener((ValueChangeListener) this); - s1.addListener((PropertySetChangeListener) this); - s1.addListener((ItemSetChangeListener) this); - s1.addListener((ItemSetChangeListener) this); - s1.addListener((PropertySetChangeListener) this); - s1.addListener((PropertySetChangeListener) this); - s1.addListener((ItemSetChangeListener) this); - s1.addListener((ValueChangeListener) this); - s1.addListener((ValueChangeListener) this); - - Item i = s1.getItem("second"); - for (Iterator it = i.getItemPropertyIds().iterator(); it.hasNext();) { - Object o = it.next(); - System.out.println("[" + o + "]"); - } - - } - - private Button.ClickListener addListeners(Button b, int count) { - String name = b.getCaption(); - // System.out.println("Adding listener for " + name); - Button.ClickListener listener = null; - for (int i = 0; i < count; i++) { - listener = new MyClickListener(name); - b.addListener(listener); - } - // return last listener added - return listener; - } - - public void buttonClick(ClickEvent event) { - System.out.println("ClickEvent from Test1"); - s1.addItem("new item " + System.currentTimeMillis()); - } - - public class MyClickListener implements Button.ClickListener { - String name = ""; - int count = 0; - - public MyClickListener(String name) { - Integer count = null; - try { - count = (Integer) buttonListeners.get(name); - count = new Integer(count.intValue() + 1); - buttonListeners.put(name, count); - } catch (Exception e) { - count = new Integer(1); - buttonListeners.put(name, count); - } - - this.name = name; - this.count = count.intValue(); - - System.out.println("Created listener " + name + ", id=" + count); - } - - public void buttonClick(ClickEvent event) { - String msg = "ClickEvent from MyClickListener " + name + ", id=" - + count; - System.out.println(msg); - getMainWindow().showNotification(msg); - } - - } - - public void containerPropertySetChange(PropertySetChangeEvent event) { - String msg = "containerPropertySetChange from " + this; - System.out.println(msg); - getMainWindow().showNotification(msg); - } - - public void containerItemSetChange(ItemSetChangeEvent event) { - String msg = "containerItemSetChange from " + this; - System.out.println(msg); - getMainWindow().showNotification(msg); - } - - public void valueChange(ValueChangeEvent event) { - String msg = "valueChange from " + this; - System.out.println(msg); - getMainWindow().showNotification(msg); - } - -} diff --git a/src/com/vaadin/tests/ModalWindow.java b/src/com/vaadin/tests/ModalWindow.java deleted file mode 100644 index 90d239abfd..0000000000 --- a/src/com/vaadin/tests/ModalWindow.java +++ /dev/null @@ -1,84 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * Simple program that demonstrates "modal windows" that block all access other - * windows. - * - * @author IT Mill Ltd. - * @since 4.0.1 - * @see com.vaadin.Application - * @see com.vaadin.ui.Window - * @see com.vaadin.ui.Label - */ -public class ModalWindow extends com.vaadin.Application implements - ClickListener { - - private Window test; - private Button reopen; - - @Override - public void init() { - - // Create main window - final Window main = new Window("ModalWindow demo"); - setMainWindow(main); - main.addComponent(new Label("ModalWindow demo")); - - // Main window textfield - final TextField f = new TextField(); - f.setTabIndex(1); - main.addComponent(f); - - // Main window button - final Button b = new Button("Test Button in main window"); - b.addListener(this); - b.setTabIndex(2); - main.addComponent(b); - - reopen = new Button("Open modal subwindow"); - reopen.addListener(this); - reopen.setTabIndex(3); - main.addComponent(reopen); - - } - - public void buttonClick(ClickEvent event) { - if (event.getButton() == reopen) { - openSubWindow(); - } - getMainWindow().addComponent( - new Label("Button click: " + event.getButton().getCaption())); - } - - private void openSubWindow() { - // Modal window - test = new Window("Modal window"); - test.setModal(true); - getMainWindow().addWindow(test); - test.addComponent(new Label( - "You have to close this window before accessing others.")); - - // Textfield for modal window - final TextField f = new TextField(); - f.setTabIndex(4); - test.addComponent(f); - f.focus(); - - // Modal window button - final Button b = new Button("Test Button in modal window"); - b.setTabIndex(5); - b.addListener(this); - test.addComponent(b); - } -} diff --git a/src/com/vaadin/tests/NativeWindowing.java b/src/com/vaadin/tests/NativeWindowing.java deleted file mode 100644 index 13c3139036..0000000000 --- a/src/com/vaadin/tests/NativeWindowing.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.net.MalformedURLException; -import java.net.URL; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class NativeWindowing extends Application { - - Window main = new Window("Windowing test"); - - @Override - public void init() { - - setMainWindow(main); - - main.addComponent(new Button("Add new subwindow", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - final Window w = new Window("sw " - + System.currentTimeMillis()); - main.addWindow(w); - w.setPositionX(100); - w.setPositionY(100); - w.setWidth(200); - w.setHeight(200); - - w.setWidth(100); - w.setHeight(400); - - final Button closebutton = new Button("Close " - + w.getCaption(), new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - main.removeWindow(w); - } - - }); - w.addComponent(closebutton); - - w.addComponent(new Label( - "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

", - Label.CONTENT_XHTML)); - - } - })); - - main.addComponent(new Button( - "Open a currently uncreated application level window", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - try { - main - .open( - new com.vaadin.terminal.ExternalResource( - new URL( - getURL(), - "mainwin-" - + System - .currentTimeMillis() - + "/")), - null); - } catch (final MalformedURLException e) { - } - } - })); - - main.addComponent(new Button( - "Commit (saves window state: size, place, scrollpos)")); - } - - @Override - public Window getWindow(String name) { - - final Window 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); - ww.setName(name); - ww.addComponent(new Label( - "This is a application-level window opened with name: " - + name)); - ww.addComponent(new Button("Click me", new Button.ClickListener() { - int state = 0; - - public void buttonClick(ClickEvent event) { - ww.addComponent(new Label("Button clicked " + (++state) - + " times")); - } - })); - addWindow(ww); - return ww; - } - - return null; - } - -} diff --git a/src/com/vaadin/tests/OrderedLayoutSwapComponents.java b/src/com/vaadin/tests/OrderedLayoutSwapComponents.java deleted file mode 100644 index 89382053d4..0000000000 --- a/src/com/vaadin/tests/OrderedLayoutSwapComponents.java +++ /dev/null @@ -1,109 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.ArrayList; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Button.ClickEvent; - -/** - * - * This Component contains some simple test to see that component updates its - * contents propertly. - * - * @author IT Mill Ltd. - */ -public class OrderedLayoutSwapComponents extends CustomComponent { - - private final OrderedLayout main; - - ArrayList order = new ArrayList(); - - public OrderedLayoutSwapComponents() { - - main = new OrderedLayout(); - // main.setSizeFull(); - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - - for (int i = 0; i < 10; i++) { - MyComponent c = new MyComponent("Component " + i); - main.addComponent(c); - order.add(c); - } - setCompositionRoot(main); - - } - - class MyComponent extends CustomComponent { - - private static final int FIRST = 0; - private static final int LAST = 1; - private Button up; - private Button down; - - MyComponent(String name) { - OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - ol.setDebugId(name.replaceAll(" ", "")); - ol.addComponent(new Label(name)); - up = new Button("up"); - up.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - int newIndex = order.indexOf(MyComponent.this) - 1; - MyComponent old = (MyComponent) order.get(newIndex); - main.replaceComponent(old, MyComponent.this); - order.remove(MyComponent.this); - order.add(newIndex, MyComponent.this); - if (newIndex == 0) { - MyComponent.this.setMode(FIRST); - } else { - MyComponent.this.setMode(69); - } - } - }); - ol.addComponent(up); - - down = new Button("down"); - down.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - int newIndex = order.indexOf(MyComponent.this) + 1; - MyComponent old = (MyComponent) order.get(newIndex); - main.replaceComponent(old, MyComponent.this); - order.remove(MyComponent.this); - order.add(newIndex, MyComponent.this); - if (newIndex == order.size() - 1) { - MyComponent.this.setMode(LAST); - } else { - MyComponent.this.setMode(69); - } - } - }); - ol.addComponent(down); - - setCompositionRoot(ol); - - } - - public void setMode(int mode) { - up.setEnabled(true); - down.setEnabled(true); - if (mode == FIRST) { - up.setEnabled(false); - } else if (mode == LAST) { - down.setEnabled(false); - } - } - } - -} diff --git a/src/com/vaadin/tests/Parameters.java b/src/com/vaadin/tests/Parameters.java deleted file mode 100644 index 6d887b03ad..0000000000 --- a/src/com/vaadin/tests/Parameters.java +++ /dev/null @@ -1,126 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.net.URL; -import java.util.Iterator; -import java.util.Map; - -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ParameterHandler; -import com.vaadin.terminal.URIHandler; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -/** - * This is a demonstration of how URL parameters can be recieved and handled. - * Parameters and URL:s can be received trough the windows by registering - * URIHandler and ParameterHandler classes window. - * - * @since 3.1.1 - */ -public class Parameters extends com.vaadin.Application implements - URIHandler, ParameterHandler { - - private final Label context = new Label(); - - private final Label relative = new Label(); - - private final Table params = new Table(); - - @Override - @SuppressWarnings("deprecation") - public void init() { - final Window main = new Window("Parameters demo"); - setMainWindow(main); - - // This class acts both as URI handler and parameter handler - main.addURIHandler(this); - main.addParameterHandler(this); - - final ExpandLayout layout = new ExpandLayout(); - final Label info = new Label("To test URI and Parameter Handlers, " - + "add get parameters to URL. For example try examples below: "); - info.setCaption("Usage info"); - layout.addComponent(info); - try { - final URL u1 = new URL(getURL(), "test/uri?test=1&test=2"); - final URL u2 = new URL(getURL(), "foo/bar?mary=john&count=3"); - layout.addComponent(new Link(u1.toString(), - new ExternalResource(u1))); - layout.addComponent(new Label("Or this: ")); - layout.addComponent(new Link(u2.toString(), - new ExternalResource(u2))); - } catch (final Exception e) { - System.out.println("Couldn't get hostname for this machine: " - + e.toString()); - e.printStackTrace(); - } - - // URI - final Panel panel1 = new Panel("URI Handler"); - context.setCaption("Last URI handler context"); - panel1.addComponent(context); - relative.setCaption("Last relative URI"); - panel1.addComponent(relative); - layout.addComponent(panel1); - - params.addContainerProperty("Key", String.class, ""); - params.addContainerProperty("Value", String.class, ""); - final Panel panel2 = new Panel("Parameter Handler"); - params.setSizeFull(); - panel2.setLayout(new ExpandLayout()); - panel2.getLayout().setMargin(true); - - params.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); - panel2.addComponent(params); - layout.addComponent(panel2); - - // expand parameter panel and its table - layout.expand(panel2); - - layout.setMargin(true); - layout.setSpacing(true); - - main.setLayout(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; - } - - /** - * Handles GET parameters, in this demo GET parameteres are used to - * communicate with EmbeddedToolkit.jsp - */ - public void handleParameters(Map parameters) { - params.removeAllItems(); - for (final Iterator i = parameters.keySet().iterator(); i.hasNext();) { - final String name = (String) i.next(); - final String[] values = (String[]) parameters.get(name); - String v = ""; - for (int j = 0; j < values.length; j++) { - if (v.length() > 0) { - v += ", "; - } - v += "'" + values[j] + "'"; - } - params.addItem(new Object[] { name, v }, name); - } - } -} diff --git a/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java deleted file mode 100644 index be0e64dd79..0000000000 --- a/src/com/vaadin/tests/PerformanceTestBasicComponentRendering.java +++ /dev/null @@ -1,107 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Date; -import java.util.Map; - -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; - -public class PerformanceTestBasicComponentRendering extends CustomComponent { - - private final OrderedLayout main; - - private final OrderedLayout testContainer; - - private Date startTime; - - private final Label result; - - private static final String DESCRIPTION = "Rendering lots of differend components to stress rendering performance. Visits server after render (due table cache row fetch) and prints client round trip time to a label. More exact render time can be checked from clients debug dialog."; - - private static final int INITIAL_COMPONENTS = 10; - - public PerformanceTestBasicComponentRendering() { - - main = new OrderedLayout(); - setCompositionRoot(main); - addInfo(); - - result = new Label(); - main.addComponent(result); - - testContainer = new OrderedLayout(); - - final Table t = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 200); - - Table t2 = new Table("Test Table with 199 rows rendered initially") { - @Override - public void changeVariables(Object source, Map variables) { - super.changeVariables(source, variables); - // end timing on cache row request - endTest(); - } - }; - t2.setPageLength(199); // render almost all rows at once - t2.setContainerDataSource(t.getContainerDataSource()); - - testContainer.addComponent(t2); - - for (int i = 0; i < INITIAL_COMPONENTS; i++) { - ComboBox cb = new ComboBox("Combobox " + i); - for (int j = 0; j < INITIAL_COMPONENTS; j++) { - cb.addItem("option " + i + " " + j); - } - testContainer.addComponent(cb); - - TextField tf = new TextField("TextField " + i); - tf.setDescription("DESC SDKJSDF"); - tf.setComponentError(new UserError("dsfjklsdf")); - testContainer.addComponent(tf); - - testContainer.addComponent(new DateField("DateField" + i)); - - testContainer.addComponent(new Button("Button" + i)); - - TabSheet ts = new TabSheet(); - - for (int j = 0; j < INITIAL_COMPONENTS; j++) { - Label tab = new Label("Tab content " + i + " " + j); - tab.setCaption("Tab " + i + " " + j); - ts.addTab(tab); - } - testContainer.addComponent(ts); - - } - - main.addComponent(testContainer); - startTest(); - } - - public void startTest() { - startTime = new Date(); - } - - public void endTest() { - final long millis = (new Date()).getTime() - startTime.getTime(); - final Float f = new Float(millis / 1000.0); - result.setValue("Test completed in " + f + " seconds"); - } - - private void addInfo() { - main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML)); - } - -} diff --git a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java b/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java deleted file mode 100644 index 6b5f271dbe..0000000000 --- a/src/com/vaadin/tests/PerformanceTestLabelsAndOrderedLayouts.java +++ /dev/null @@ -1,78 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Date; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class PerformanceTestLabelsAndOrderedLayouts extends CustomComponent { - private final OrderedLayout main; - - private final OrderedLayout testContainer; - - private Date startTime; - - private final Label result; - - private static final String DESCRIPTION = "Simple test that renders n labels into ordered layout."; - - private static final int INITIAL_COMPONENTS = 1000; - - public PerformanceTestLabelsAndOrderedLayouts() { - main = new OrderedLayout(); - setCompositionRoot(main); - addInfo(); - - result = new Label(); - main.addComponent(result); - - main.addComponent(new Button("click when rendered", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - endTest(); - } - })); - - main.addComponent(new Button( - "Click for layout repaint (cached components)", - new ClickListener() { - public void buttonClick(ClickEvent event) { - testContainer.requestRepaint(); - } - })); - - testContainer = new OrderedLayout(); - - for (int i = 0; i < INITIAL_COMPONENTS; i++) { - Label l = new Label("foo" + i); - testContainer.addComponent(l); - } - - main.addComponent(testContainer); - startTest(); - } - - public void startTest() { - startTime = new Date(); - } - - public void endTest() { - final long millis = (new Date()).getTime() - startTime.getTime(); - final Float f = new Float(millis / 1000.0); - result.setValue("Test completed in " + f + " seconds"); - } - - private void addInfo() { - main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML)); - } - -} diff --git a/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java b/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java deleted file mode 100644 index cf03074e56..0000000000 --- a/src/com/vaadin/tests/PerformanceTestSubTreeCaching.java +++ /dev/null @@ -1,85 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Date; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; - -public class PerformanceTestSubTreeCaching extends CustomComponent { - - private final OrderedLayout main; - - private final OrderedLayout testContainer; - - private Date startTime; - - private final Label result; - - private static final String DESCRIPTION = "Hypothesis: Toolkit 4 has major architechtural problem when adding " - + "small incrementall updates to a container which has either a lot or " - + "some very slow components in it. Toolkit 5 has 'subtree caching' and a" - + " small amount of logic in containers, so CommunicationManager can assure" - + " that client do not need information about unchanged components it contains." - + " Completing test ought to be much faster with Toolkit 5."; - - private static final int INITIAL_COMPONENTS = 40; - - public PerformanceTestSubTreeCaching() { - main = new OrderedLayout(); - setCompositionRoot(main); - addInfo(); - - Button b = new Button("start test", this, "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 - .setDescription("Push this button as soon as test componenet is rendered."); - main.addComponent(b); - - result = new Label(); - main.addComponent(result); - - testContainer = new OrderedLayout(); - populateContainer(testContainer, INITIAL_COMPONENTS); - main.addComponent(testContainer); - } - - public void startTest() { - startTime = new Date(); - testContainer.addComponentAsFirst(new Label("Simplel Test Component")); - } - - public void endTest() { - final long millis = (new Date()).getTime() - startTime.getTime(); - final Float f = new Float(millis / 1000.0); - result.setValue("Test completed in " + f + " seconds"); - } - - /** - * Adds n Table components to given container - * - * @param testContainer2 - */ - private void populateContainer(OrderedLayout container, int n) { - for (int i = 0; i < n; i++) { - // array_type array_element = [i]; - final Table t = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 100); - container.addComponent(t); - } - } - - private void addInfo() { - main.addComponent(new Label(DESCRIPTION, Label.CONTENT_XHTML)); - } - -} diff --git a/src/com/vaadin/tests/QueryContainerDemo.java b/src/com/vaadin/tests/QueryContainerDemo.java deleted file mode 100644 index abd98016cd..0000000000 --- a/src/com/vaadin/tests/QueryContainerDemo.java +++ /dev/null @@ -1,193 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.sql.SQLException; - -import com.vaadin.data.util.QueryContainer; -import com.vaadin.demo.util.SampleDatabase; -import com.vaadin.event.Action; -import com.vaadin.ui.Label; -import com.vaadin.ui.Select; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; - -/** - * This example shows how Table, Select and Tree UI components can use - * Containers. QueryContainer is used to bind SQL table rows into Vaadin UI - * components. Table has few example actions added. Also embedding XHTML through - * Label components is used. Demonstrates: how to create - * com.vaadin.data.Container and set it as datasource to UI - * components com.vaadin.ui.Component.Tree, how to receive - * ExpandEvent and implement com.vaadin.ui.Tree.ExpandListener, how - * to use com.vaadin.event.Action. - * - * @author IT Mill Ltd. - * @since 4.0.0 - * - */ -public class QueryContainerDemo extends com.vaadin.Application implements - Action.Handler { - - private static final String ACTION_DESCRIPTION = "Try right mouse button to initiate " - + "actions menu.
Note: on Opera you use meta key " - + "and left mouse button."; - - private static final String TABLE_CAPTION = SampleDatabase.ROWCOUNT - + " dynamically loaded rows from example SQL table"; - - // Table component where SQL rows are attached (using QueryContainer) - private final Table table = new Table(); - - private final Label tableLastAction = new Label( - "No action selected for table."); - - // Select component where SQL rows are attached (using QueryContainer) - private final Select select = new Select(); - - // Tree component that uses select as datasource - private final Tree tree = new Tree(); - - private final Label treeLastAction = new Label( - "No action selected for tree."); - - // Database provided with sample data - private SampleDatabase sampleDatabase; - - // Example Actions for table - private final Action ACTION1 = new Action("Upload"); - - private final Action ACTION2 = new Action("Download"); - - private final Action ACTION3 = new Action("Show history"); - - private final Action[] actions = new Action[] { ACTION1, ACTION2, ACTION3 }; - - /** - * Initialize Application. Demo components are added to main window. - */ - @Override - public void init() { - final Window main = new Window("QueryContainer demo"); - setMainWindow(main); - - // Main window contains heading, table, select and tree - main - .addComponent(new Label( - "

QueryContainer demo

" - + "Rows are loaded from the server as they are needed.
" - + "Try scrolling the table to see it in action.

" - + ACTION_DESCRIPTION, Label.CONTENT_XHTML)); - main.addComponent(table); - main.addComponent(tableLastAction); - main.addComponent(new Label("
", Label.CONTENT_XHTML)); - main.addComponent(select); - main.addComponent(new Label("
", Label.CONTENT_XHTML)); - main.addComponent(tree); - main.addComponent(treeLastAction); - - // create demo database - sampleDatabase = new SampleDatabase(); - - // initialize demo components - initTable(); - initSelect(); - initTree(); - } - - /** - * Populates table component with all rows from employee table. - * - */ - private void initTable() { - // init table - table.setCaption(TABLE_CAPTION); - table.setPageLength(10); - table.setSelectable(true); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - table.setColumnCollapsingAllowed(true); - table.setColumnReorderingAllowed(true); - table.setSelectable(true); - // this class handles table actions (see handleActions method below) - table.addActionHandler(this); - table.setDescription(ACTION_DESCRIPTION); - - // populate Vaadin table component with test SQL table rows - try { - final QueryContainer qc = new QueryContainer( - "SELECT * FROM employee", sampleDatabase.getConnection()); - table.setContainerDataSource(qc); - } catch (final SQLException e) { - e.printStackTrace(); - } - // define which columns should be visible on Table component - table.setVisibleColumns(new Object[] { "FIRSTNAME", "LASTNAME", - "TITLE", "UNIT" }); - table.setItemCaptionPropertyId("ID"); - } - - /** - * Populates select component with distinct unit values from employee table. - * - */ - private void initSelect() { - // init select - select.setCaption("All distinct units from employee table."); - select.setItemCaptionPropertyId("UNIT"); - - // populate Vaadin select component with test SQL table rows - try { - final QueryContainer qc = new QueryContainer( - "SELECT DISTINCT UNIT FROM employee", sampleDatabase - .getConnection()); - select.setContainerDataSource(qc); - } catch (final SQLException e) { - e.printStackTrace(); - } - } - - /** - * Populates tree component using select component as data source for root - * nodes, child nodes are queried from database. Implementation is done for - * example purposes only. - * - */ - private void initTree() { - // init tree - tree.setCaption("All distinct units from employee table."); - tree.setItemCaptionPropertyId("UNIT"); - tree.setSelectable(true); - // this class handles tree actions (see handleActions method below) - tree.addActionHandler(this); - tree.setDescription("Try right mouse button to initiate " - + "actions menu. Note: on Opera you use meta key " - + "and left mouse button."); - - // Populate Vaadin Tree using select component as data source - tree.setContainerDataSource(select.getContainerDataSource()); - } - - /** - * Return example actions - */ - public Action[] getActions(Object target, Object sender) { - return actions; - } - - /** - * Executed by right mouse button on table or tree component. - */ - public void handleAction(Action action, Object sender, Object target) { - if (sender == table) { - tableLastAction.setValue("Last action clicked was '" - + action.getCaption() + "' on item " + target); - } else if (sender == tree) { - treeLastAction.setValue("Last action clicked was '" - + action.getCaption() + "' on item " + target); - } - } - -} diff --git a/src/com/vaadin/tests/RandomLayoutStress.java b/src/com/vaadin/tests/RandomLayoutStress.java deleted file mode 100644 index a6277a8262..0000000000 --- a/src/com/vaadin/tests/RandomLayoutStress.java +++ /dev/null @@ -1,189 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Random; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -/** - * This example demonstrates layouts. Layouts are populated with sample Vaadin - * UI components. - * - * @author IT Mill Ltd. - * - */ -public class RandomLayoutStress extends com.vaadin.Application { - - private final Random seededRandom = new Random(1); - - // FIXME increasing these settings brings out interesting client-side issues - // (DOM errors) - // TODO increasing values "even more" crashes Hosted Mode, pumping Xmx/Xms - // helps to some extent - private static final int componentCountA = 50; - private static final int componentCountB = 50; - private static final int componentCountC = 200; - private static final int componentCountD = 50; - - /** - * Initialize Application. Demo components are added to main window. - */ - @Override - public void init() { - final Window mainWindow = new Window("Layout demo"); - setMainWindow(mainWindow); - - // Create horizontal ordered layout - final Panel panelA = new Panel( - "Panel containing horizontal ordered layout"); - OrderedLayout layoutA = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - // Add 4 random components - fillLayout(layoutA, componentCountA); - // Add layout to panel - panelA.addComponent(layoutA); - - // Create vertical ordered layout - final Panel panelB = new Panel( - "Panel containing vertical ordered layout"); - OrderedLayout layoutB = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - // Add 4 random components - fillLayout(layoutB, componentCountB); - // Add layout to panel - panelB.addComponent(layoutB); - - // Create grid layout - final int gridSize = (int) java.lang.Math.sqrt(componentCountC); - final Panel panelG = new Panel("Panel containing grid layout (" - + gridSize + " x " + gridSize + ")"); - GridLayout layoutG = new GridLayout(gridSize, gridSize); - // Add 12 random components - fillLayout(layoutG, componentCountC); - // Add layout to panel - panelG.addComponent(layoutG); - - // Create TabSheet - final TabSheet tabsheet = new TabSheet(); - tabsheet - .setCaption("Tabsheet, above layouts are added to this component"); - layoutA = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - // Add 4 random components - fillLayout(layoutA, componentCountA); - tabsheet.addTab(layoutA, "Horizontal ordered layout", null); - layoutB = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); - // Add 4 random components - fillLayout(layoutB, componentCountB); - tabsheet.addTab(layoutB, "Vertical ordered layout", null); - layoutG = new GridLayout(gridSize, gridSize); - // Add 12 random components - fillLayout(layoutG, componentCountC); - tabsheet.addTab(layoutG, "Grid layout (4 x 2)", null); - - // Create custom layout - final Panel panelC = new Panel("Custom layout with style exampleStyle"); - final CustomLayout layoutC = new CustomLayout("exampleStyle"); - // Add 4 random components - fillLayout(layoutC, componentCountD); - // Add layout to panel - panelC.addComponent(layoutC); - - // Add demo panels (layouts) to main window - mainWindow.addComponent(panelA); - mainWindow.addComponent(panelB); - mainWindow.addComponent(panelG); - mainWindow.addComponent(tabsheet); - mainWindow.addComponent(panelC); - } - - private AbstractComponent getRandomComponent(int caption) { - AbstractComponent result = null; - final int randint = seededRandom.nextInt(7); - switch (randint) { - case 0: - // Label - result = new Label(); - result.setCaption("Label component " + caption); - break; - case 1: - // Button - result = new Button(); - result.setCaption("Button component " + caption); - break; - case 2: - // TextField - result = new TextField(); - result.setCaption("TextField component " + caption); - break; - case 3: - // Select - result = new Select("Select " + caption); - result.setCaption("Select component " + caption); - ((Select) result).addItem("First item"); - ((Select) result).addItem("Second item"); - ((Select) result).addItem("Third item"); - break; - case 4: - // Link - result = new Link("", new ExternalResource("http://www.vaadin.com")); - result.setCaption("Link component " + caption); - break; - case 5: - // Link - result = new Panel(); - result.setCaption("Panel component " + caption); - ((Panel) result) - .addComponent(new Label( - "Panel is a container for other components, by default it draws a frame around it's " - + "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.")); - ((Panel) result).setWidth(250); - break; - case 6: - // Datefield - result = new DateField(); - ((DateField) result).setStyleName("calendar"); - ((DateField) result).setValue(new java.util.Date()); - result.setCaption("Calendar component " + caption); - break; - case 7: - // Datefield - result = new DateField(); - ((DateField) result).setValue(new java.util.Date()); - result.setCaption("Calendar component " + caption); - break; - } - - return result; - } - - /** - * Add demo components to given layout - * - * @param layout - */ - private void fillLayout(Layout layout, int numberOfComponents) { - for (int i = 0; i < numberOfComponents; i++) { - layout.addComponent(getRandomComponent(i)); - } - } - -} diff --git a/src/com/vaadin/tests/ScrollbarStressTest.java b/src/com/vaadin/tests/ScrollbarStressTest.java deleted file mode 100644 index b6cef8353a..0000000000 --- a/src/com/vaadin/tests/ScrollbarStressTest.java +++ /dev/null @@ -1,238 +0,0 @@ -package com.vaadin.tests; - -import com.vaadin.Application; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class ScrollbarStressTest extends Application { - - final Window main = new Window("Scrollbar Stress Test"); - - final Panel panel = new Panel("Panel"); - final SplitPanel splitPanel = new SplitPanel(); - final Accordion accordion = new Accordion(); - final TabSheet tabsheet = new TabSheet(); - final Window subwindow = new Window("Subwindow"); - - final OptionGroup width = new OptionGroup("LO Width"); - final OptionGroup height = new OptionGroup("LO Height"); - - private boolean getTable; - - @Override - public void init() { - setTheme("tests-tickets"); - setMainWindow(main); - createControlWindow(); - subwindow.setWidth("400px"); - subwindow.setHeight("400px"); - } - - private void createControlWindow() { - final OptionGroup context = new OptionGroup("Context"); - context.addItem("Main window"); - context.addItem("ExpandLayout"); - context.addItem("Subwindow"); - context.addItem("Panel"); - context.addItem("Split Panel"); - context.addItem("TabSheet"); - context.addItem("Accordion"); - context.setValue("Main window"); - - final OptionGroup testComponent = new OptionGroup( - "TestComponent 100%x100%"); - testComponent.addItem("Label"); - testComponent.addItem("Table"); - testComponent.setValue("Label"); - - width.addItem("100%"); - width.addItem("50%"); - width.addItem("150%"); - width.addItem("100px"); - width.addItem("500px"); - width.setValue("100%"); - - height.addItem("100%"); - height.addItem("50%"); - height.addItem("150%"); - height.addItem("100px"); - height.addItem("500px"); - height.setValue("100%"); - - final Button set = new Button("Set", new ClickListener() { - public void buttonClick(ClickEvent event) { - getTable = testComponent.getValue().equals("Table"); - - if (context.getValue() == "Main window") { - drawInMainWindow(); - } else if (context.getValue() == "Subwindow") { - drawInSubwindow(); - } else if (context.getValue() == "Panel") { - drawInPanel(); - } else if (context.getValue() == "Split Panel") { - drawInSplitPanel(); - } else if (context.getValue() == "TabSheet") { - drawInTabSheet(false); - } else if (context.getValue() == "Accordion") { - drawInTabSheet(true); - } else if (context.getValue() == "ExpandLayout") { - drawInExpandLayout(); - } - } - }); - - OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - ol.addComponent(context); - ol.addComponent(testComponent); - ol.addComponent(width); - ol.addComponent(height); - ol.addComponent(set); - ol.setSpacing(true); - ol.setMargin(true); - - Window controller = new Window("Controller"); - controller.setLayout(ol); - main.addWindow(controller); - } - - protected void drawInExpandLayout() { - main.removeAllComponents(); - main.getLayout().setSizeFull(); - - OrderedLayout ol = new OrderedLayout(); - - ExpandLayout el = new ExpandLayout(); - - el.removeAllComponents(); - - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - - el.addComponent(ol); - - main.getLayout().addComponent(el); - main.removeWindow(subwindow); - - } - - protected void drawInTabSheet(boolean verticalAkaAccordion) { - main.removeAllComponents(); - main.getLayout().setSizeFull(); - - OrderedLayout ol = new OrderedLayout(); - ol.setCaption("Tab 1"); - OrderedLayout ol2 = new OrderedLayout(); - ol2.setCaption("Tab 2"); - - TabSheet ts = (verticalAkaAccordion ? accordion : tabsheet); - ts.setSizeFull(); - - ts.removeAllComponents(); - - ts.addComponent(ol); - ts.addComponent(ol2); - - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - ol2.setWidth((String) width.getValue()); - ol2.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - - ol2.addComponent(getTestComponent()); - - main.addComponent(ts); - main.removeWindow(subwindow); - } - - private void drawInSplitPanel() { - main.removeAllComponents(); - main.getLayout().setSizeFull(); - - OrderedLayout ol = new OrderedLayout(); - OrderedLayout ol2 = new OrderedLayout(); - - splitPanel.setFirstComponent(ol); - splitPanel.setSecondComponent(ol2); - - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - ol2.setWidth((String) width.getValue()); - ol2.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - - ol2.addComponent(getTestComponent()); - - main.addComponent(splitPanel); - main.removeWindow(subwindow); - } - - private void drawInPanel() { - main.removeAllComponents(); - main.getLayout().setSizeFull(); - - OrderedLayout ol = new OrderedLayout(); - panel.setSizeFull(); - panel.setLayout(ol); - - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - main.addComponent(panel); - main.removeWindow(subwindow); - } - - private void drawInSubwindow() { - main.removeAllComponents(); - main.getLayout().setSizeFull(); - OrderedLayout ol = new OrderedLayout(); - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - subwindow.setLayout(ol); - main.addWindow(subwindow); - } - - private void drawInMainWindow() { - main.removeAllComponents(); - OrderedLayout ol = new OrderedLayout(); - main.setLayout(ol); - ol.setWidth((String) width.getValue()); - ol.setHeight((String) height.getValue()); - - ol.addComponent(getTestComponent()); - main.removeWindow(subwindow); - } - - private Component getTestComponent() { - if (getTable) { - Table testTable = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(4, 50); - testTable.setSizeFull(); - return testTable; - } else { - Label l = new Label("Label"); - l.setStyleName("no-padding"); - l.setSizeFull(); - return l; - } - } -} diff --git a/src/com/vaadin/tests/StressComponentsInTable.java b/src/com/vaadin/tests/StressComponentsInTable.java deleted file mode 100644 index 6f04f5b731..0000000000 --- a/src/com/vaadin/tests/StressComponentsInTable.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Date; -import java.util.Vector; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Button.ClickEvent; - -public class StressComponentsInTable extends CustomComponent { - - public StressComponentsInTable() { - final OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - - main.addComponent(getTestTable(4, 1000)); - - } - - public static Table getTestTable(int cols, int rows) { - final Table t = new Table(); - t.setColumnCollapsingAllowed(true); - for (int i = 0; i < cols; i++) { - t.addContainerProperty(testString[i], String.class, ""); - } - t.addContainerProperty("button", Button.class, null); - for (int i = 0; i < rows; i++) { - final Vector content = new Vector(); - for (int j = 0; j < cols; j++) { - content.add(rndString()); - } - content.add(new Button("b" + i, new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - System.out.println(event.getButton().getCaption() - + " click: " + (new Date()).toGMTString()); - System.out.println(event.getButton().getApplication()); - - } - })); - t.addItem(content.toArray(), "" + i); - } - t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - return t; - } - - static String[] testString = new String[] { "Jacob", "Michael", "Joshua", - "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", - "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", - "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", - "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", - "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", - "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", - "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", - "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", - "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", - "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", - "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", - "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", - "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", - "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", - "Cody", "Alejandro", "Caden", "Blake", "Carson" }; - - public static String rndString() { - return testString[(int) (Math.random() * testString.length)]; - } - -} diff --git a/src/com/vaadin/tests/TableChangingDatasource.java b/src/com/vaadin/tests/TableChangingDatasource.java deleted file mode 100644 index 9de6c9aa1b..0000000000 --- a/src/com/vaadin/tests/TableChangingDatasource.java +++ /dev/null @@ -1,53 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class TableChangingDatasource extends CustomComponent implements - ClickListener { - Table t; - Table[] ta = new Table[4]; - private int mode = 0; - - public TableChangingDatasource() { - final OrderedLayout main = new OrderedLayout(); - - main.addComponent(new Label( - "Table should look sane after data source changes")); - - t = new Table(); - - t.setWidth(500); - t.setHeight(300); - - ta[0] = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(3, 0); - ta[1] = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(3, 7); - ta[2] = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(3, 5); - ta[3] = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(3, 1); - - main.addComponent(t); - main.addComponent(new Button("switch DS", this)); - - setCompositionRoot(main); - - } - - public void buttonClick(ClickEvent event) { - int i = mode % 4; - t.setContainerDataSource(ta[i].getContainerDataSource()); - mode++; - } -} diff --git a/src/com/vaadin/tests/TableSelectTest.java b/src/com/vaadin/tests/TableSelectTest.java deleted file mode 100644 index 69363bd0bc..0000000000 --- a/src/com/vaadin/tests/TableSelectTest.java +++ /dev/null @@ -1,123 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; - -public class TableSelectTest extends CustomComponent implements - Table.ValueChangeListener { - - public TableSelectTest() { - final OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - main.addComponent(new Label("Hello World!")); - - Table t; - t = new Table("single nullsel"); - main.addComponent(t); - t(t); - t.setMultiSelect(false); - t.setNullSelectionAllowed(true); - t.addListener(this); - - t = new Table("single NO-nullsel"); - main.addComponent(t); - t(t); - t.setMultiSelect(false); - t.setNullSelectionAllowed(false); - t.addListener(this); - - t = new Table("multi nullsel"); - main.addComponent(t); - t(t); - t.setMultiSelect(true); - t.setNullSelectionAllowed(true); - t.addListener(this); - - t = new Table("multi NO-nullsel"); - main.addComponent(t); - t(t); - t.setMultiSelect(true); - t.setNullSelectionAllowed(false); - t.addListener(this); - - // -- - - t = new Table("single nullsel nullselid"); - main.addComponent(t); - Object id = t(t); - t.setNullSelectionItemId(id); - t.setMultiSelect(false); - t.setNullSelectionAllowed(true); - t.addListener(this); - - t = new Table("single NO-nullsel nullselid"); - main.addComponent(t); - id = t(t); - t.setNullSelectionItemId(id); - t.setMultiSelect(false); - t.setNullSelectionAllowed(false); - t.addListener(this); - - t = new Table("multi(fails) nullsel nullselid"); - main.addComponent(t); - id = t(t); - t.setNullSelectionItemId(id); - try { - t.setMultiSelect(true); - t.setCaption("multi(SHOLD FAIL BUT DID NOT) nullsel nullselid"); - } catch (final Exception e) { - System.err.println("failed ok"); - } - t.setNullSelectionAllowed(true); - t.addListener(this); - - t = new Table("multi(fails) NO-nullsel nullselid"); - main.addComponent(t); - id = t(t); - t.setNullSelectionItemId(id); - try { - t.setMultiSelect(true); - t.setCaption("multi(SHOLD FAIL BUT DID NOT) NO-nullsel nullselid"); - } catch (final Exception e) { - System.err.println("failed ok"); - } - t.setNullSelectionAllowed(false); - t.addListener(this); - - /* - * And that's it! The framework will display the main window and its - * contents when the application is accessed with the terminal. - */ - - } - - private Object t(Table t) { - t.setImmediate(true); - t.setSelectable(true); - - Object id = null; - for (int i = 0; i < 5; i++) { - id = t.addItem(); - } - t.addContainerProperty("asd", String.class, "the asd thing"); - t.addContainerProperty("foo", String.class, "foo stuff"); - t.addContainerProperty("Alonger column header", String.class, "short"); - - return id; - } - - public void valueChange(ValueChangeEvent event) { - final Object val = event.getProperty().getValue(); - - System.err.println("Value: " + val); - - } - -} diff --git a/src/com/vaadin/tests/TestBench.java b/src/com/vaadin/tests/TestBench.java deleted file mode 100644 index a77e60fa65..0000000000 --- a/src/com/vaadin/tests/TestBench.java +++ /dev/null @@ -1,332 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.Enumeration; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Tree; -import com.vaadin.ui.UriFragmentUtility; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.UriFragmentUtility.FragmentChangedEvent; - -/** - * TestBench finds out testable classes within given java packages and adds them - * to menu from where they can be executed. Class is considered testable if it - * is of class Application or CustomComponent. - * - * Note: edit TestBench.testablePackages array - * - * @author IT Mill Ltd. - * - */ -public class TestBench extends com.vaadin.Application implements - Property.ValueChangeListener { - - // Add here packages which are used for finding testable classes - String[] testablePackages = { "com.vaadin.tests", - "com.vaadin.demo", "com.vaadin.demo.colorpicker", - "com.vaadin.demo.reservation", - "com.vaadin.demo.features", - "com.vaadin.tests.tickets", "com.vaadin.tests.book" }; - - HierarchicalContainer testables = new HierarchicalContainer(); - - Window mainWindow = new Window("TestBench window"); - - // Main layout consists of tree menu and body layout - SplitPanel mainLayout = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - - Tree menu; - - Panel bodyLayout = new Panel(); - - HashMap itemCaptions = new HashMap(); - - @Override - public void init() { - - // Add testable classes to hierarchical container - for (int p = 0; p < testablePackages.length; p++) { - testables.addItem(testablePackages[p]); - try { - final List testableClasses = getTestableClassesForPackage(testablePackages[p]); - for (final Iterator it = testableClasses.iterator(); it - .hasNext();) { - final Class t = (Class) it.next(); - // ignore TestBench itself - if (t.equals(TestBench.class)) { - continue; - } - try { - testables.addItem(t); - itemCaptions.put(t, t.getName()); - testables.setParent(t, testablePackages[p]); - testables.setChildrenAllowed(t, false); - continue; - } catch (final Exception e) { - try { - testables.addItem(t); - itemCaptions.put(t, t.getName()); - testables.setParent(t, testablePackages[p]); - testables.setChildrenAllowed(t, false); - continue; - } catch (final Exception e1) { - e1.printStackTrace(); - } - } - } - } catch (final Exception e) { - e.printStackTrace(); - } - } - - menu = new Tree("Testables", testables); - - for (final Iterator i = itemCaptions.keySet().iterator(); i.hasNext();) { - final Class testable = (Class) i.next(); - // simplify captions - final String name = testable.getName().substring( - testable.getName().lastIndexOf('.') + 1); - menu.setItemCaption(testable, name); - } - // expand all root items - for (final Iterator i = menu.rootItemIds().iterator(); i.hasNext();) { - menu.expandItemsRecursively(i.next()); - } - - menu.addListener(this); - menu.setImmediate(true); - menu.setNullSelectionAllowed(false); - VerticalLayout lo = new VerticalLayout(); - lo.addComponent(menu); - - UriFragmentUtility uri = new UriFragmentUtility(); - lo.addComponent(uri); - - uri.addListener(new UriFragmentUtility.FragmentChangedListener() { - public void fragmentChanged(FragmentChangedEvent source) { - String fragment = source.getUriFragmentUtility().getFragment(); - if (fragment != null && !"".equals(fragment)) { - // try to find a proper test class - - // exact match - Iterator iterator = menu.getItemIds().iterator(); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof Class) { - Class c = (Class) next; - String string = c.getName(); - if (string.equals(fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } - } - - // simple name match - iterator = menu.getItemIds().iterator(); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof Class) { - Class c = (Class) next; - String string = c.getSimpleName(); - if (string.equals(fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } - } - // ticket match - iterator = menu.getItemIds().iterator(); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof Class) { - Class c = (Class) next; - String string = c.getSimpleName(); - if (string.startsWith("Ticket" + fragment)) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } - } - - // just partly mach lowercase - iterator = menu.getItemIds().iterator(); - while (iterator.hasNext()) { - Object next = iterator.next(); - if (next instanceof Class) { - Class c = (Class) next; - String string = c.getSimpleName(); - if (string.toLowerCase().contains( - fragment.toLowerCase())) { - menu.setValue(c); - mainLayout.setSplitPosition(0); - return; - } - } - } - - getMainWindow().showNotification( - "No potential matc for #" + fragment); - - } - - } - }); - - mainLayout.addComponent(lo); - - bodyLayout.addStyleName("light"); - bodyLayout.setSizeFull(); - bodyLayout.setLayout(new ExpandLayout()); - - mainLayout.addComponent(bodyLayout); - - mainLayout.setSplitPosition(30); - - mainWindow.setLayout(mainLayout); - - setMainWindow(mainWindow); - } - - private Component createTestable(Class c) { - try { - final Application app = (Application) c.newInstance(); - app.init(); - Layout lo = app.getMainWindow().getLayout(); - lo.setParent(null); - return lo; - } catch (final Exception e) { - try { - final CustomComponent cc = (CustomComponent) c.newInstance(); - cc.setSizeFull(); - return cc; - } catch (final Exception e1) { - e1.printStackTrace(); - VerticalLayout lo = new VerticalLayout(); - lo.addComponent(new Label( - "Cannot create application / custom component: " - + e1.toString())); - - Link l = new Link("Try opening via app runner", - new ExternalResource("../run/" + c.getName())); - lo.addComponent(l); - - return lo; - } - } - } - - // Handle menu selection and update body - public void valueChange(Property.ValueChangeEvent event) { - bodyLayout.removeAllComponents(); - bodyLayout.setCaption(null); - - final Object o = menu.getValue(); - if (o != null && o instanceof Class) { - final Class c = (Class) o; - final String title = c.getName(); - bodyLayout.setCaption(title); - bodyLayout.addComponent(createTestable(c)); - } else { - // NOP node selected or deselected tree item - } - } - - /** - * Return all testable classes within given package. Class is considered - * testable if it's superclass is Application or CustomComponent. - * - * @param packageName - * @return - * @throws ClassNotFoundException - */ - public static List getTestableClassesForPackage(String packageName) - throws Exception { - final ArrayList directories = new ArrayList(); - try { - final ClassLoader cld = Thread.currentThread() - .getContextClassLoader(); - if (cld == null) { - throw new ClassNotFoundException("Can't get class loader."); - } - final String path = packageName.replace('.', '/'); - // Ask for all resources for the path - final Enumeration resources = cld.getResources(path); - while (resources.hasMoreElements()) { - final URL url = (URL) resources.nextElement(); - directories.add(new File(url.getFile())); - } - } catch (final Exception x) { - throw new Exception(packageName - + " does not appear to be a valid package."); - } - - final ArrayList classes = new ArrayList(); - // For every directory identified capture all the .class files - for (final Iterator it = directories.iterator(); it.hasNext();) { - final File directory = (File) it.next(); - if (directory.exists()) { - // Get the list of the files contained in the package - final String[] files = directory.list(); - for (int j = 0; j < files.length; j++) { - // we are only interested in .class files - if (files[j].endsWith(".class")) { - // removes the .class extension - final String p = packageName + '.' - + files[j].substring(0, files[j].length() - 6); - final Class c = Class.forName(p); - if (c.getSuperclass() != null) { - if ((c.getSuperclass() - .equals(com.vaadin.Application.class))) { - classes.add(c); - } else if ((c.getSuperclass() - .equals(com.vaadin.ui.CustomComponent.class))) { - classes.add(c); - } - } - - // for (int i = 0; i < c.getInterfaces().length; i++) { - // Class cc = c.getInterfaces()[i]; - // if (c.getInterfaces()[i].equals(Testable.class)) { - // // Class is testable - // classes.add(c); - // } - // } - } - } - } else { - throw new ClassNotFoundException(packageName + " (" - + directory.getPath() - + ") does not appear to be a valid package"); - } - } - - return classes; - } - -} diff --git a/src/com/vaadin/tests/TestCaptionWrapper.java b/src/com/vaadin/tests/TestCaptionWrapper.java deleted file mode 100644 index c15270458e..0000000000 --- a/src/com/vaadin/tests/TestCaptionWrapper.java +++ /dev/null @@ -1,206 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Select; -import com.vaadin.ui.Slider; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.TwinColSelect; -import com.vaadin.ui.Upload; -import com.vaadin.ui.Window; -import com.vaadin.ui.Component.Listener; - -public class TestCaptionWrapper extends CustomComponent implements Listener { - - OrderedLayout main = new OrderedLayout(); - - final String eventListenerString = "Component.Listener feedback: "; - Label eventListenerFeedback = new Label(eventListenerString - + " "); - int count = 0; - - public TestCaptionWrapper() { - setCompositionRoot(main); - } - - @Override - public void attach() { - super.attach(); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - - main - .addComponent(new Label( - "Each Layout and their contained components should " - + "have icon, caption, description, user error defined. " - + "Eeach layout should contain similar components.")); - - main.addComponent(eventListenerFeedback); - - main.addComponent(new Label("OrderedLayout")); - test(main); - populateLayout(main); - - final Panel panel = new Panel("Panel"); - test(panel); - populateLayout(panel.getLayout()); - - final TabSheet tabsheet = new TabSheet(); - test(tabsheet); - final OrderedLayout tab1 = new OrderedLayout(); - tab1.addComponent(new Label("try tab2")); - final OrderedLayout tab2 = new OrderedLayout(); - test(tab2); - populateLayout(tab2); - tabsheet.addTab(tab1, "TabSheet tab1", new ClassResource("m.gif", - getApplication())); - tabsheet.addTab(tab2, "TabSheet tab2", new ClassResource("m.gif", - getApplication())); - - final ExpandLayout expandLayout = new ExpandLayout(); - test(expandLayout); - populateLayout(expandLayout); - - final GridLayout gridLayout = new GridLayout(); - test(gridLayout); - populateLayout(gridLayout); - - final Window window = new Window("TEST: Window"); - test(window); - populateLayout(window.getLayout()); - - } - - void populateLayout(Layout layout) { - - final Button button = new Button("Button " + count++); - test(layout, button); - button.addListener(this); - - final DateField df = new DateField("DateField " + count++); - test(layout, df); - - final CheckBox cb = new CheckBox("Checkbox " + count++); - test(layout, cb); - - final Embedded emb = new Embedded("Embedded " + count++); - test(layout, emb); - - final Panel panel = new Panel("Panel " + count++); - test(layout, panel); - - final Label label = new Label("Label " + count++); - test(layout, label); - - final Link link = new Link("Link " + count++, new ExternalResource( - "www.vaadin.com")); - test(layout, link); - - final NativeSelect nativeSelect = new NativeSelect("NativeSelect " - + count++); - test(layout, nativeSelect); - - final OptionGroup optionGroup = new OptionGroup("OptionGroup " - + count++); - test(layout, optionGroup); - - final ProgressIndicator pi = new ProgressIndicator(); - test(layout, pi); - - final RichTextArea rta = new RichTextArea(); - test(layout, rta); - - final Select select = new Select("Select " + count++); - test(layout, select); - - final Slider slider = new Slider("Slider " + count++); - test(layout, slider); - - final Table table = new Table("Table " + count++); - test(layout, table); - - final TextField tf = new TextField("Textfield " + count++); - test(layout, tf); - - final Tree tree = new Tree("Tree " + count++); - test(layout, tree); - - final TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect " - + count++); - test(layout, twinColSelect); - - final Upload upload = new Upload("Upload (non-functional)", null); - test(layout, upload); - - // Custom components - layout.addComponent(new Label("Below are few custom components", - Label.CONTENT_XHTML)); - final TestForUpload tfu = new TestForUpload(); - layout.addComponent(tfu); - - } - - /** - * Stresses component by configuring it - * - * @param c - */ - void test(AbstractComponent c) { - final ClassResource res = new ClassResource("m.gif", getApplication()); - final ErrorMessage errorMsg = new UserError("User error " + c); - - if ((c.getCaption() == null) || (c.getCaption().length() <= 0)) { - c.setCaption("Caption " + c); - } - c.setDescription("Description " + c); - c.setComponentError(errorMsg); - c.setIcon(res); - } - - /** - * Stresses component by configuring it in a given layout - * - * @param c - */ - void test(Layout layout, AbstractComponent c) { - test(c); - layout.addComponent(c); - } - - public void componentEvent(Event event) { - final String feedback = eventListenerString + " source=" - + event.getSource() + ", toString()=" + event.toString(); - System.out.println("eventListenerFeedback: " + feedback); - eventListenerFeedback.setValue(feedback); - } - -} diff --git a/src/com/vaadin/tests/TestComponentAddAndRecursion.java b/src/com/vaadin/tests/TestComponentAddAndRecursion.java deleted file mode 100644 index 469d620b53..0000000000 --- a/src/com/vaadin/tests/TestComponentAddAndRecursion.java +++ /dev/null @@ -1,128 +0,0 @@ -/** - * - */ -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - * @author marc - * - */ -public class TestComponentAddAndRecursion extends CustomComponent { - Panel p; - Panel p2; - Label l; - Label l2; - Panel p3; - - public TestComponentAddAndRecursion() { - - OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - - l = new Label("A"); - l2 = new Label("B"); - p = new Panel("p"); - p.addComponent(l); - p.addComponent(l2); - main.addComponent(p); - p2 = new Panel("p2"); - p2.addComponent(l); - main.addComponent(p2); - p3 = new Panel("p3"); - p2.addComponent(p3); - - Button b = new Button("use gridlayout", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - p.setLayout(new GridLayout()); - p2.setLayout(new GridLayout()); - p3.setLayout(new GridLayout()); - } - - }); - main.addComponent(b); - b = new Button("use orderedlayout", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - p.setLayout(new OrderedLayout()); - p2.setLayout(new OrderedLayout()); - p3.setLayout(new OrderedLayout()); - } - - }); - main.addComponent(b); - b = new Button("move B", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - p2.addComponent(l2); - } - - }); - main.addComponent(b); - b = new Button("move p", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - p3.addComponent(p); - } - - }); - main.addComponent(b); - b = new Button("add to both", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - Label l = new Label("both"); - p.addComponent(l); - p2.addComponent(l); - } - - }); - main.addComponent(b); - b = new Button("recurse", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - try { - p3.addComponent(p2); - getWindow().showNotification("ERROR", - "This should have failed", - Window.Notification.TYPE_ERROR_MESSAGE); - } catch (Exception e) { - getWindow().showNotification("OK", "threw, as expected", - Window.Notification.TYPE_ERROR_MESSAGE); - } - } - - }); - main.addComponent(b); - b = new Button("recurse2", new Button.ClickListener() { - - 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); - } catch (Exception e) { - getWindow().showNotification("OK", "threw, as expected", - Window.Notification.TYPE_ERROR_MESSAGE); - } - } - - }); - main.addComponent(b); - /* - * And that's it! The framework will display the main window and its - * contents when the application is accessed with the terminal. - */ - } -} diff --git a/src/com/vaadin/tests/TestComponentsAndLayouts.java b/src/com/vaadin/tests/TestComponentsAndLayouts.java deleted file mode 100644 index 5187f8f8e6..0000000000 --- a/src/com/vaadin/tests/TestComponentsAndLayouts.java +++ /dev/null @@ -1,505 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.io.File; -import java.sql.SQLException; - -import com.vaadin.Application; -import com.vaadin.data.Container; -import com.vaadin.data.util.FilesystemContainer; -import com.vaadin.data.util.QueryContainer; -import com.vaadin.demo.util.SampleDatabase; -import com.vaadin.demo.util.SampleDirectory; -import com.vaadin.event.Action; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Select; -import com.vaadin.ui.Slider; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.TwinColSelect; -import com.vaadin.ui.Upload; -import com.vaadin.ui.Window; -import com.vaadin.ui.Component.Event; -import com.vaadin.ui.Component.Listener; - -/** - * Search for "TWEAK these" keyword and configure Custom/AbstractComponents to - * various states and see how they work inside different Layouts. - * - */ -public class TestComponentsAndLayouts extends Application implements Listener, - Action.Handler { - - // event listener feedback (see console) - Label eventListenerFeedback = new Label( - "See console for event listener log."); - int eventCount = 0; - - Window window; - - // component counter - int count = 0; - - SampleDatabase sampleDatabase; - - // Example Actions for table - private final Action ACTION1 = new Action("Upload"); - private final Action ACTION2 = new Action("Download"); - private final Action ACTION3 = new Action("Show history"); - private final Action[] actions = new Action[] { ACTION1, ACTION2, ACTION3 }; - - @Override - public void init() { - sampleDatabase = new SampleDatabase(); - createNewView(); - } - - public void createNewView() { - final Window main = new Window("Main window"); - setMainWindow(main); - - // By default push all containers inside main window - Layout target = main.getLayout(); - - main - .addComponent(new Label( - "Each Layout and their contained components should " - + "have icon, caption, description, user error defined. " - + "Eeach layout should contain similar components. " - + "All components are in immmediate mode. See source how to tweak this test.")); - main.addComponent(eventListenerFeedback); - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - window = new Window("Components inside Window (TEST: Window)"); - - if (false) { - // push every container and their components inside window - target = window.getLayout(); - } else { - // window is just one container to be tested - populateLayout(window.getLayout()); - } - getMainWindow().addWindow(window); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside horizontal OrderedLayout

", - Label.CONTENT_XHTML)); - final OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - populateLayout(ol); - target.addComponent(ol); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "



Components inside vertical OrderedLayout

", - Label.CONTENT_XHTML)); - final OrderedLayout ol2 = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - populateLayout(ol2); - target.addComponent(ol2); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target.addComponent(new Label( - "

Components inside TabSheet

", - Label.CONTENT_XHTML)); - final TabSheet tabsheet = new TabSheet(); - final OrderedLayout tab1 = new OrderedLayout(); - tab1.addComponent(new Label("try tab2")); - final OrderedLayout tab2 = new OrderedLayout(); - populateLayout(tab2); - tabsheet.addTab(tab1, "TabSheet tab1", new ClassResource("m.gif", - this)); - tabsheet.addTab(tab2, "TabSheet tab2", new ClassResource("m.gif", - this)); - target.addComponent(tabsheet); - // test(tabsheet); - // test(tab1); - // test(tab2); - // test(expandLayout); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (true) { - target.addComponent(new Label( - "

Components inside Accordion

", - Label.CONTENT_XHTML)); - final Accordion accordion = new Accordion(); - accordion.setHeight(500); - final OrderedLayout acc1 = new OrderedLayout(); - acc1.addComponent(new Label("try acc2")); - final OrderedLayout acc2 = new OrderedLayout(); - populateLayout(acc2); - accordion.addTab(acc1, "Accordion acc1", new ClassResource("m.gif", - this)); - accordion.addTab(acc2, "Accordion acc2", new ClassResource("m.gif", - this)); - target.addComponent(accordion); - // test(accordion); - // test(acc1); - // test(acc2); - // test(expandLayout); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target.addComponent(new Label( - "

Components inside GridLayout

", - Label.CONTENT_XHTML)); - final GridLayout gridLayout = new GridLayout(4, 100); - populateLayout(gridLayout); - target.addComponent(gridLayout); - // test(gridLayout); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside ExpandLayout (height 250px)

", - Label.CONTENT_XHTML)); - final ExpandLayout el = new ExpandLayout(); - el.setHeight(250, Component.UNITS_PIXELS); - el.expand(new Label("This label will expand on expand layout")); - populateLayout(el); - target.addComponent(el); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target.addComponent(new Label( - "

Components inside Panel

", - Label.CONTENT_XHTML)); - final Panel panel = new Panel("Panel"); - populateLayout(panel.getLayout()); - target.addComponent(panel); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside vertical SplitPanel (splitpanel is under 250height ExpandLayout)

", - Label.CONTENT_XHTML)); - final ExpandLayout sp1l = new ExpandLayout(); - sp1l.setHeight(250, ExpandLayout.UNITS_PIXELS); - final SplitPanel sp1 = new SplitPanel( - SplitPanel.ORIENTATION_VERTICAL); - sp1l.addComponent(sp1); - final OrderedLayout sp1first = new OrderedLayout(); - final OrderedLayout sp1second = new OrderedLayout(); - sp1.setFirstComponent(sp1first); - populateLayout(sp1first); - populateLayout(sp1second); - sp1.setSecondComponent(sp1second); - target.addComponent(sp1l); - } - - // ////////////////////////////////////////////////////////////////////// - // //// - if (false) { - target - .addComponent(new Label( - "

Components inside horizontal SplitPanel (splitpanel is under 250px height ExpandLayout)

", - Label.CONTENT_XHTML)); - final ExpandLayout sp2l = new ExpandLayout(); - sp2l.setHeight(250, SplitPanel.UNITS_PIXELS); - final SplitPanel sp2 = new SplitPanel( - SplitPanel.ORIENTATION_HORIZONTAL); - sp2l.addComponent(sp2); - final OrderedLayout sp2first = new OrderedLayout(); - final OrderedLayout sp2second = new OrderedLayout(); - sp2.setFirstComponent(sp2first); - populateLayout(sp2first); - populateLayout(sp2second); - sp2.setSecondComponent(sp2second); - target.addComponent(sp2l); - } - - } - - void populateLayout(Layout layout) { - final Button button = new Button("Button " + count++); - test(layout, button); - - final DateField df = new DateField("DateField " + count++); - test(layout, df); - - final CheckBox cb = new CheckBox("Checkbox " + count++); - test(layout, cb); - - final ClassResource flashResource = new ClassResource( - "vaadin_spin.swf", this); - final Embedded emb = new Embedded("Embedded " + count++, flashResource); - emb.setType(Embedded.TYPE_OBJECT); - emb.setMimeType("application/x-shockwave-flash"); - emb.setWidth(250); - emb.setHeight(100); - test(layout, emb); - - final Panel panel = new Panel("Panel " + count++); - test(layout, panel); - - final Label label = new Label("Label " + count++); - test(layout, label); - - final Link link = new Link("Link " + count++, new ExternalResource( - "www.vaadin.com")); - test(layout, link); - - final NativeSelect nativeSelect = new NativeSelect("NativeSelect " - + count++); - nativeSelect.setContainerDataSource(getContainer()); - test(layout, nativeSelect); - - final OptionGroup optionGroup = new OptionGroup("OptionGroup " - + count++); - optionGroup.setContainerDataSource(getSmallContainer()); - optionGroup.setItemCaptionPropertyId("UNIT"); - test(layout, optionGroup); - - // final ProgressIndicator pi = new ProgressIndicator(); - // pi.setCaption("ProgressIndicator"); - // test(layout, pi); - - final RichTextArea rta = new RichTextArea(); - test(layout, rta); - - final Select select = new Select("Select " + count++); - select.setContainerDataSource(getSmallContainer()); - select.setItemCaptionPropertyId("UNIT"); - test(layout, select); - - final Slider slider = new Slider("Slider " + count++); - test(layout, slider); - - final Table table = new Table("Table " + count++); - table.setPageLength(10); - table.setSelectable(true); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - table.setColumnCollapsingAllowed(true); - table.setColumnReorderingAllowed(true); - table.setSelectable(true); - table.addActionHandler(this); - table.setContainerDataSource(getContainer()); - table.setVisibleColumns(new Object[] { "FIRSTNAME", "LASTNAME", - "TITLE", "UNIT" }); - table.setItemCaptionPropertyId("ID"); - test(layout, table); - - final TabSheet tabsheet = new TabSheet(); - final OrderedLayout tab1 = new OrderedLayout(); - tab1.addComponent(new Label("tab1 " + count++)); - final OrderedLayout tab2 = new OrderedLayout(); - tab2.addComponent(new Label("tab2 " + count++)); - tabsheet.addTab(tab1, "Default (not configured) TabSheet tab1", - new ClassResource("m.gif", this)); - tabsheet.addTab(tab2, "Configured TabSheet tab2", new ClassResource( - "m.gif", this)); - test(layout, tabsheet); - - final Accordion accordion = new Accordion(); - final OrderedLayout acc1 = new OrderedLayout(); - acc1.addComponent(new Label("acc1 " + count++)); - final OrderedLayout acc2 = new OrderedLayout(); - acc2.addComponent(new Label("acc2 " + count++)); - accordion.addTab(acc1, "Default (not configured) Accordion acc1", - new ClassResource("m.gif", this)); - accordion.addTab(acc2, "Configured Accordion acc2", new ClassResource( - "m.gif", this)); - test(layout, accordion); - - final TextField tf = new TextField("Textfield " + count++); - test(layout, tf); - // do not configure acc1 - // test(acc1); - test(acc2); - - final Tree tree = new Tree("Tree " + count++); - final File sampleDir = SampleDirectory.getDirectory(this); - final FilesystemContainer fsc = new FilesystemContainer(sampleDir, true); - tree.setContainerDataSource(fsc); - test(layout, tree); - - final TwinColSelect twinColSelect = new TwinColSelect("TwinColSelect " - + count++); - twinColSelect.setContainerDataSource(getSmallContainer()); - twinColSelect.setItemCaptionPropertyId("UNIT"); - test(layout, twinColSelect); - - final Upload upload = new Upload("Upload (non-functional)", null); - test(layout, upload); - - // Custom components - layout.addComponent(new Label("Below are few custom components", - Label.CONTENT_XHTML)); - final TestForUpload tfu = new TestForUpload(); - layout.addComponent(tfu); - layout.addComponent(new Label("
----------

", - Label.CONTENT_XHTML)); - test(tfu); - - // DISABLED - // TableSelectTest tst = new TableSelectTest(); - // layout.addComponent(tst); - // test(tst); - // layout.addComponent(new Label("
", Label.CONTENT_XHTML)); - - } - - Container getContainer() { - // populate container with test SQL table rows - try { - return new QueryContainer("SELECT * FROM employee", sampleDatabase - .getConnection()); - } catch (final SQLException e) { - e.printStackTrace(); - } - return null; - } - - Container getSmallContainer() { - // populate container with test SQL table rows - try { - return new QueryContainer( - "SELECT DISTINCT UNIT AS UNIT FROM employee", - sampleDatabase.getConnection()); - } catch (final SQLException e) { - e.printStackTrace(); - } - return null; - } - - // common component configuration - void setComponentProperties(Component c) { - // TWEAK these - // c.setEnabled(false); - // c.setVisible(false); - // c.setStyleName("testStyleName"); - // c.setReadOnly(true); - - // try to add listener - try { - c.addListener(this); - } catch (final Exception e) { - System.err.println("Could not add listener for component " + c - + ", count was " + count); - } - } - - /** - * Stresses component by configuring it - * - * @param c - */ - void test(AbstractComponent c) { - // configure common component properties - // setComponentProperties(c); - - // AbstractComponent specific configuration - final ClassResource res = new ClassResource("m.gif", this); - final ErrorMessage errorMsg = new UserError("User error " + c); - if ((c.getCaption() == null) || (c.getCaption().length() <= 0)) { - c.setCaption("Caption " + c); - } - - // TWEAK these - // c.setComponentError(errorMsg); - // c.setIcon(res); - // c.setImmediate(true); - // c.addStyleName("addedTestStyleName"); - // c.setStyleName("singleTestStyleName"); - // c.setDescription("Description here.."); - } - - void test(CustomComponent c) { - // configure common component properties - setComponentProperties(c); - - // CustomComponent specific configuration - // TWEAK these - // c.setComponentType("foo"); - c.addStyleName("addedTestStyleName"); - } - - /** - * Stresses component by configuring it in a given layout - * - * @param c - */ - void test(Layout layout, AbstractComponent c) { - test(c); - layout.addComponent(c); - // add separator - if (!(layout instanceof GridLayout)) { - layout.addComponent(new Label("
NEXT

", - Label.CONTENT_XHTML)); - } - } - - public void componentEvent(Event event) { - eventCount++; - final String feedback = "eventCount=" + eventCount + ", class=" - + event.getClass() + ", source=" + event.getSource() - + ", toString()=" + event.toString(); - System.out.println("eventListenerFeedback: " + feedback); - eventListenerFeedback.setValue("Events: " + eventCount); - } - - // For sample actions - public Action[] getActions(Object target, Object sender) { - return actions; - } - - // For sample actions - public void handleAction(Action action, Object sender, Object target) { - System.out.println("ACTION: " + action.getCaption() + " on item " - + target); - } - -} diff --git a/src/com/vaadin/tests/TestContainerChanges.java b/src/com/vaadin/tests/TestContainerChanges.java deleted file mode 100644 index af27484834..0000000000 --- a/src/com/vaadin/tests/TestContainerChanges.java +++ /dev/null @@ -1,212 +0,0 @@ -/** - * - */ -package com.vaadin.tests; - -import com.vaadin.data.Container; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.ContainerHierarchicalWrapper; -import com.vaadin.data.util.ContainerOrderedWrapper; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Button.ClickEvent; - -/** - * @author marc - * - */ -public class TestContainerChanges extends CustomComponent { - Container cont = new IndexedContainer(); - Container hierarchical = new ContainerHierarchicalWrapper(cont); - Container ordered = new ContainerOrderedWrapper(cont); - - int cnt = 0; - Table tbl; - - public TestContainerChanges() { - - cont.addContainerProperty("Asd", String.class, "qwe"); - cont.addContainerProperty("Bar", String.class, "foo"); - - OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - - main - .addComponent(new Label( - "The same IndexedContainer is wrapped in a ordered/hierarchical wrapper and is set as data source for all components . The buttons only affect the 'original' IndexedContainer.")); - - OrderedLayout h = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - - main.addComponent(h); - - OrderedLayout v = new OrderedLayout(); - h.addComponent(v); - tbl = new Table(); - tbl.setHeight(200); - tbl.setWidth(300); - v.addComponent(tbl); - tbl.setSelectable(true); - tbl.setMultiSelect(false); - tbl.setImmediate(true); - tbl.setEditable(true); - tbl.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - // Original container - tbl.setContainerDataSource(hierarchical); - - Table tbl2 = new Table(); - tbl2.setHeight(200); - tbl2.setWidth(300); - v.addComponent(tbl2); - tbl2.setSelectable(true); - tbl2.setMultiSelect(false); - tbl2.setImmediate(true); - tbl2.addListener(new Table.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - System.err.println("Value now " - + event.getProperty().getValue()); - - } - }); - tbl2.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - // non-ordered container will get wrapped - tbl2.setContainerDataSource(hierarchical); - - OrderedLayout buttons = new OrderedLayout(); - v.addComponent(buttons); - - Button b = new Button("table.commit()", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - tbl.commit(); - } - - }); - buttons.addComponent(b); - - b = new Button("indexedcontainer.addItem()", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - cont.addItem(new Integer(cnt++)); - } - - }); - buttons.addComponent(b); - b = new Button("indexedcontainer.addItem(null)", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - cont.addItem(null); - } - - }); - buttons.addComponent(b); - b = new Button("indexedcontainer.removeItem(table.lastItemId()", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - cont.removeItem(tbl.lastItemId()); - } - - }); - buttons.addComponent(b); - - b = new Button("indexedcontainer.addContainerProperty()", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - cont.addContainerProperty("prop" + cnt, String.class, - "#" + cnt++); - } - - }); - buttons.addComponent(b); - - b = new Button("indexedcontainer.clear()", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - cont.removeAllItems(); - } - - }); - buttons.addComponent(b); - b = new Button("table.setContainerDataSource(indexedcontainer)", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - tbl.setContainerDataSource(cont); - } - - }); - buttons.addComponent(b); - b = new Button("table.setContainerDataSource(orderedwrapper)", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - tbl.setContainerDataSource(ordered); - } - - }); - buttons.addComponent(b); - b = new Button("table.setContainerDataSource(hierarchicalwrapper)", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - tbl.setContainerDataSource(hierarchical); - } - - }); - buttons.addComponent(b); - - Panel p = new Panel("Tree"); - p.setStyleName(Panel.STYLE_LIGHT); - h.addComponent(p); - Tree tree = new Tree("ITEM_CAPTION_MODE_PROPERTY"); - tree.setContainerDataSource(ordered); - tree.setItemCaptionPropertyId("Asd"); - tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_PROPERTY); - p.addComponent(tree); - tree = new Tree("ITEM_CAPTION_MODE_ITEM"); - // nonhierarchical container will get wrapped - tree.setContainerDataSource(ordered); - tree.setItemCaptionMode(Tree.ITEM_CAPTION_MODE_ITEM); - p.addComponent(tree); - - p = new Panel("ComboBox"); - p.setStyleName(Panel.STYLE_LIGHT); - h.addComponent(p); - ComboBox c = new ComboBox("ITEM_CAPTION_MODE_PROPERTY"); - c.setImmediate(true); - c.setContainerDataSource(cont); - c.setItemCaptionPropertyId("Asd"); - c.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY); - p.addComponent(c); - c = new ComboBox("ITEM_CAPTION_MODE_ITEM"); - c.setImmediate(true); - c.setContainerDataSource(cont); - c.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ITEM); - p.addComponent(c); - - p = new Panel("ListBox"); - p.setStyleName(Panel.STYLE_LIGHT); - h.addComponent(p); - ListSelect l = new ListSelect("ITEM_CAPTION_MODE_PROPERTY"); - l.setContainerDataSource(cont); - l.setItemCaptionPropertyId("Asd"); - l.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_PROPERTY); - p.addComponent(l); - l = new ListSelect("ITEM_CAPTION_MODE_ITEM"); - l.setContainerDataSource(cont); - l.setItemCaptionMode(ComboBox.ITEM_CAPTION_MODE_ITEM); - p.addComponent(l); - } -} diff --git a/src/com/vaadin/tests/TestDateField.java b/src/com/vaadin/tests/TestDateField.java deleted file mode 100644 index 39621b0b8e..0000000000 --- a/src/com/vaadin/tests/TestDateField.java +++ /dev/null @@ -1,74 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Locale; - -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; - -/** - * - * @author IT Mill Ltd. - */ -public class TestDateField extends CustomComponent { - - OrderedLayout main = new OrderedLayout(); - - DateField df; - - public TestDateField() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(new Label("DateField")); - - df = new DateField(); - main.addComponent(df); - - final ErrorMessage errorMsg = new UserError("User error " + df); - df.setCaption("DateField caption " + df); - df.setDescription("DateField description " + df); - df.setComponentError(errorMsg); - df.setImmediate(true); - // FIXME: bug #1138 this makes datefield to render with unknown - // component (UIDL tree debug) - df.addStyleName("thisShouldBeHarmless"); - - // Another test: locale - final DateField df1 = new DateField("US locale"); - main.addComponent(df1); - df1.setLocale(new Locale("en", "US")); - - final DateField df2 = new DateField("DE locale"); - main.addComponent(df2); - df2.setLocale(new Locale("de", "DE")); - - final DateField df3 = new DateField("RU locale"); - main.addComponent(df3); - df3.setLocale(new Locale("ru", "RU")); - - final DateField df4 = new DateField("FI locale"); - main.addComponent(df4); - df4.setLocale(new Locale("fi", "FI")); - } - - @Override - public void attach() { - final ClassResource res = new ClassResource("m.gif", super - .getApplication()); - df.setIcon(res); - super.attach(); - } - -} diff --git a/src/com/vaadin/tests/TestForAlignments.java b/src/com/vaadin/tests/TestForAlignments.java deleted file mode 100644 index d8c7c0d59c..0000000000 --- a/src/com/vaadin/tests/TestForAlignments.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; - -public class TestForAlignments extends CustomComponent { - - public TestForAlignments() { - - final OrderedLayout main = new OrderedLayout(); - - final Button b1 = new Button("Right"); - final Button b2 = new Button("Left"); - final Button b3 = new Button("Bottom"); - final Button b4 = new Button("Top"); - final TextField t1 = new TextField("Right aligned"); - final TextField t2 = new TextField("Bottom aligned"); - final DateField d1 = new DateField("Center aligned"); - final DateField d2 = new DateField("Center aligned"); - - final OrderedLayout vert = new OrderedLayout(); - vert.addComponent(b1); - vert.addComponent(b2); - vert.addComponent(t1); - vert.addComponent(d1); - // vert.getSize().setWidth(500); - vert.setComponentAlignment(b1, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(b2, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(t1, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - vert.setComponentAlignment(d1, - OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER, - OrderedLayout.ALIGNMENT_TOP); - final OrderedLayout hori = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - hori.addComponent(b3); - hori.addComponent(b4); - hori.addComponent(t2); - hori.addComponent(d2); - // hori.getSize().setHeight(200); - hori.setComponentAlignment(b3, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_BOTTOM); - hori.setComponentAlignment(b4, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_TOP); - hori.setComponentAlignment(t2, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_BOTTOM); - hori.setComponentAlignment(d2, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_VERTICAL_CENTER); - - main.addComponent(vert); - main.addComponent(hori); - - setCompositionRoot(main); - - } - -} diff --git a/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java b/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java deleted file mode 100644 index 6de6d3c046..0000000000 --- a/src/com/vaadin/tests/TestForApplicationLayoutThatUsesWholeBrosersSpace.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.Application; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class TestForApplicationLayoutThatUsesWholeBrosersSpace extends - Application { - - Window main = new Window("Windowing test"); - - ExpandLayout rootLayout; - - SplitPanel firstLevelSplit; - - @Override - public void init() { - setMainWindow(main); - - rootLayout = new ExpandLayout(); - main.setLayout(rootLayout); - - rootLayout.addComponent(new Label("header")); - - firstLevelSplit = new SplitPanel(); - - final SplitPanel secondSplitPanel = new SplitPanel( - SplitPanel.ORIENTATION_HORIZONTAL); - secondSplitPanel.setFirstComponent(new Label("left")); - - final ExpandLayout topRight = new ExpandLayout(); - topRight.addComponent(new Label("topright header")); - - final Table t = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(4, 100); - t.setSizeFull(); - topRight.addComponent(t); - topRight.expand(t); - - topRight.addComponent(new Label("topright footer")); - - secondSplitPanel.setSecondComponent(topRight); - - final ExpandLayout el = new ExpandLayout(); - el.addComponent(new Label("B��")); - - firstLevelSplit.setFirstComponent(secondSplitPanel); - firstLevelSplit.setSecondComponent(el); - - rootLayout.addComponent(firstLevelSplit); - rootLayout.expand(firstLevelSplit); - - rootLayout.addComponent(new Label("footer")); - - } - -} diff --git a/src/com/vaadin/tests/TestForBasicApplicationLayout.java b/src/com/vaadin/tests/TestForBasicApplicationLayout.java deleted file mode 100644 index b6cd1d28a9..0000000000 --- a/src/com/vaadin/tests/TestForBasicApplicationLayout.java +++ /dev/null @@ -1,100 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Locale; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class TestForBasicApplicationLayout extends CustomComponent { - - private final Button click; - private final Button click2; - private final TabSheet tab; - - public TestForBasicApplicationLayout() { - - click = new Button("Set height -1", new ClickListener() { - - public void buttonClick(ClickEvent event) { - tab.setHeight(-1); - } - - }); - - click2 = new Button("Set height 100%", new ClickListener() { - - public void buttonClick(ClickEvent event) { - tab.setHeight(100, TabSheet.UNITS_PERCENTAGE); - } - - }); - - final SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - sp.setSplitPosition(290, SplitPanel.UNITS_PIXELS); - - final SplitPanel sp2 = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL); - sp2.setSplitPosition(255, SplitPanel.UNITS_PIXELS); - - final Panel p = new Panel("Accordion Panel"); - p.setSizeFull(); - - tab = new TabSheet(); - tab.setSizeFull(); - - final Panel report = new Panel("Monthly Program Runs", - new ExpandLayout()); - final OrderedLayout controls = new OrderedLayout(); - controls.setMargin(true); - controls.addComponent(new Label("Report tab")); - controls.addComponent(click); - controls.addComponent(click2); - report.addComponent(controls); - final DateField cal = new DateField(); - cal.setResolution(DateField.RESOLUTION_DAY); - cal.setLocale(new Locale("en", "US")); - report.addComponent(cal); - ((ExpandLayout) report.getLayout()).expand(controls); - report.addStyleName(Panel.STYLE_LIGHT); - report.setHeight(100, SplitPanel.UNITS_PERCENTAGE); - - sp2.setFirstComponent(report); - - final Table table = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 200); - table.setPageLength(15); - table.setSelectable(true); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - table.setColumnCollapsingAllowed(true); - table.setColumnReorderingAllowed(true); - table.setSortDisabled(false); - table.setSizeFull(); - table.addStyleName("table-inline"); - sp2.setSecondComponent(table); - - tab.addTab(new Label("Tab1"), "Summary", null); - tab.addTab(sp2, "Reports", null); - tab.addTab(new Label("Tab 3"), "Statistics", null); - tab.addTab(new Label("Tab 4"), "Error Tracking", null); - tab.setSelectedTab(sp2); - - sp.setFirstComponent(p); - sp.setSecondComponent(tab); - - setCompositionRoot(sp); - } - -} diff --git a/src/com/vaadin/tests/TestForChildComponentRendering.java b/src/com/vaadin/tests/TestForChildComponentRendering.java deleted file mode 100644 index 9b5d02e945..0000000000 --- a/src/com/vaadin/tests/TestForChildComponentRendering.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.ArrayList; -import java.util.Iterator; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; - -/** - * - * This Component contains some simple test to see that component updates its - * contents propertly. - * - * @author IT Mill Ltd. - */ -public class TestForChildComponentRendering extends CustomComponent { - - private final OrderedLayout main; - - public TestForChildComponentRendering() { - - main = new OrderedLayout(); - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(new Label("SDFGFHFHGJGFDSDSSSGFDD")); - - final Link l = new Link(); - l.setCaption("Siirry Vaadiniin"); - l.setResource(new ExternalResource("http://www.vaadin.com/")); - l.setTargetHeight(200); - l.setTargetWidth(500); - l.setTargetBorder(Link.TARGET_BORDER_MINIMAL); - main.addComponent(l); - - final Select se = new Select(); - se.setCaption("VALITSET TÄSTÄ"); - se.addItem("valinta1"); - se.addItem("Valinta 2"); - - Button b = new Button("refresh view", this, "createNewView"); - main.addComponent(b); - - b = new Button("reorder view", this, "randomReorder"); - main.addComponent(b); - - b = new Button("remove randomly one component", this, - "removeRandomComponent"); - main.addComponent(b); - - } - - public void randomReorder() { - final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); - while (it.hasNext()) { - components.add(it.next()); - } - - final OrderedLayout v = main; - v.removeAllComponents(); - - for (int i = components.size(); i > 0; i--) { - final int index = (int) (Math.random() * i); - v.addComponent((Component) components.get(index)); - components.remove(index); - } - } - - public void removeRandomComponent() { - final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); - while (it.hasNext()) { - components.add(it.next()); - } - final int size = components.size(); - final int index = (int) (Math.random() * size); - main.removeComponent((Component) components.get(index)); - - } - -} diff --git a/src/com/vaadin/tests/TestForContainerFilterable.java b/src/com/vaadin/tests/TestForContainerFilterable.java deleted file mode 100644 index 7c261f1017..0000000000 --- a/src/com/vaadin/tests/TestForContainerFilterable.java +++ /dev/null @@ -1,94 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Button.ClickEvent; - -public class TestForContainerFilterable extends CustomComponent { - - OrderedLayout lo = new OrderedLayout(); - IndexedContainer ic = new IndexedContainer(); - Table t = new Table(); - private static String parts[] = { "Neo", "Sa", "rem", "the", "adi", "za", - "tre", "day", "Ca", "re", "cen", "ter", "mi", "nal" }; - TextField fooFilter = new TextField("foo-filter"); - TextField barFilter = new TextField("bar-filter"); - Button filterButton = new Button("Filter"); - Label count = new Label(); - - public TestForContainerFilterable() { - setCompositionRoot(lo); - - // Init datasource - ic.addContainerProperty("foo", String.class, ""); - ic.addContainerProperty("bar", String.class, ""); - for (int i = 0; i < 1000; i++) { - final Object id = ic.addItem(); - ic.getContainerProperty(id, "foo").setValue(randomWord()); - ic.getContainerProperty(id, "bar").setValue(randomWord()); - } - - // Init filtering view - final Panel filterPanel = new Panel("Filter", new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL)); - filterPanel.setWidth(100, Panel.UNITS_PERCENTAGE); - lo.addComponent(filterPanel); - filterPanel.addComponent(fooFilter); - filterPanel.addComponent(barFilter); - filterPanel.addComponent(filterButton); - fooFilter - .setDescription("Filters foo column in case-sensitive contains manner."); - barFilter - .setDescription("Filters bar column in case-insensitive prefix manner."); - filterPanel.addComponent(count); - - // Table - lo.addComponent(t); - t.setPageLength(12); - t.setWidth(100, Table.UNITS_PERCENTAGE); - t.setContainerDataSource(ic); - - // Handler - filterButton.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - ic.removeAllContainerFilters(); - if (fooFilter.toString().length() > 0) { - ic.addContainerFilter("foo", fooFilter.toString(), false, - false); - } - if (barFilter.toString().length() > 0) { - ic.addContainerFilter("bar", barFilter.toString(), true, - true); - } - count.setValue("Rows in table: " + ic.size()); - } - }); - - // Resetbutton - lo.addComponent(new Button("Rebind table datasource", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - t.setContainerDataSource(ic); - } - })); - } - - private String randomWord() { - int len = (int) (Math.random() * 4); - final StringBuffer buf = new StringBuffer(); - while (len-- >= 0) { - buf.append(parts[(int) (Math.random() * parts.length)]); - } - return buf.toString(); - } -} diff --git a/src/com/vaadin/tests/TestForExpandLayout.java b/src/com/vaadin/tests/TestForExpandLayout.java deleted file mode 100644 index e58ec24161..0000000000 --- a/src/com/vaadin/tests/TestForExpandLayout.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout extends CustomComponent { - - ExpandLayout main = new ExpandLayout(); - - DateField df; - - public TestForExpandLayout() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - for (int i = 0; i < 6; i++) { - final ExpandLayout el = new ExpandLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - for (int j = 0; j < i + 3; j++) { - final Label l = new Label("label" + i + ":" + j); - el.addComponent(l); - } - if (i > 0) { - // el.setMargin(true); - el.setSizeUndefined(); - el.setWidth("100%"); - if (i % 2 == 0) { - el.setHeight("8em"); - Panel p = new Panel("tp"); - p.addComponent(new Label("panelc")); - p.setHeight("100%"); - p.setWidth("100px"); - el.addComponent(p); - } - } - main.addComponent(el); - } - - } -} diff --git a/src/com/vaadin/tests/TestForExpandLayout2.java b/src/com/vaadin/tests/TestForExpandLayout2.java deleted file mode 100644 index 5c6ff7955b..0000000000 --- a/src/com/vaadin/tests/TestForExpandLayout2.java +++ /dev/null @@ -1,64 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout2 extends CustomComponent { - - ExpandLayout main; - - public TestForExpandLayout2() { - createNewView(); - setCompositionRoot(main); - } - - public void createNewView() { - main = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - Panel left = new Panel("Left column"); - left.setHeight(100, Panel.UNITS_PERCENTAGE); - left.setWidth(150); - main.addComponent(left); - - ExpandLayout center = new ExpandLayout(); - center.addComponent(new Label("header")); - Panel mainContent = new Panel(); - center.addComponent(mainContent); - center.expand(mainContent); - mainContent.setSizeFull(); - - ExpandLayout buttons = new ExpandLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - buttons.setHeight(30, ExpandLayout.UNITS_PIXELS); - Button b1 = new Button("Save"); - Button b2 = new Button("Cancel"); - Button b3 = new Button("Logout"); - buttons.addComponent(b1); - buttons.setComponentAlignment(b1, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_TOP); - buttons.addComponent(b2); - buttons.addComponent(b3); - center.addComponent(buttons); - - main.addComponent(center); - main.expand(center); - - Panel right = new Panel("Right column"); - right.setHeight(100, Panel.UNITS_PERCENTAGE); - right.setWidth(200); - - main.addComponent(right); - - } -} diff --git a/src/com/vaadin/tests/TestForExpandLayout3.java b/src/com/vaadin/tests/TestForExpandLayout3.java deleted file mode 100644 index ae4adfcfaa..0000000000 --- a/src/com/vaadin/tests/TestForExpandLayout3.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForExpandLayout3 extends CustomComponent { - - ExpandLayout main = new ExpandLayout(); - - DateField df; - - public TestForExpandLayout3() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - - ExpandLayout el; - Button b; - Button b2; - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - main.addComponent(el); - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_HORIZONTAL_CENTER, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - el.setHeight(60, ExpandLayout.UNITS_PIXELS); - el.setMargin(true); - main.addComponent(el); - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - - b = new Button("SDFS"); - b2 = new Button("DSFSDFDFSSDF"); - - el.addComponent(b); - el.addComponent(b2); - - el.expand(b); - el.setComponentAlignment(b, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_BOTTOM); - el.setHeight(100, ExpandLayout.UNITS_PIXELS); - el.setSpacing(true); - - main.addComponent(el); - - } -} diff --git a/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java deleted file mode 100644 index 9ff23e62ca..0000000000 --- a/src/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ /dev/null @@ -1,103 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.ArrayList; -import java.util.Iterator; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.Select; - -/** - * - * This Component contains some simple test to see that component updates its - * contents propertly. - * - * @author IT Mill Ltd. - */ -public class TestForGridLayoutChildComponentRendering extends CustomComponent { - - private final GridLayout main = new GridLayout(2, 3); - - public TestForGridLayoutChildComponentRendering() { - - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(new Label("SDFGFHFHGJGFDSDSSSGFDD")); - - final Link l = new Link(); - l.setCaption("Siirry Vaadiniin"); - l.setResource(new ExternalResource("http://www.vaadin.com/")); - l.setTargetHeight(200); - l.setTargetWidth(500); - l.setTargetBorder(Link.TARGET_BORDER_MINIMAL); - main.addComponent(l); - - final Select se = new Select("Tästä valitaan"); - se.setCaption("Whattaa select"); - se.addItem("valinta1"); - se.addItem("Valinta 2"); - - main.addComponent(se, 0, 1, 1, 1); - - Button b = new Button("refresh view", this, "createNewView"); - main.addComponent(b); - - b = new Button("reorder view", this, "randomReorder"); - main.addComponent(b); - - b = new Button("remove randomly one component", this, - "removeRandomComponent"); - main.addComponent(b); - - } - - public void randomReorder() { - final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); - while (it.hasNext()) { - components.add(it.next()); - } - - main.removeAllComponents(); - - final int size = components.size(); - final int colspanIndex = ((int) (Math.random() * size) / 2) * 2 + 2; - - for (int i = components.size(); i > 0; i--) { - final int index = (int) (Math.random() * i); - if (i == colspanIndex) { - main.addComponent((Component) components.get(index), 0, - (size - i) / 2, 1, (size - i) / 2); - } else { - main.addComponent((Component) components.get(index)); - } - components.remove(index); - } - } - - public void removeRandomComponent() { - final Iterator it = main.getComponentIterator(); - final ArrayList components = new ArrayList(); - while (it.hasNext()) { - components.add(it.next()); - } - final int size = components.size(); - final int index = (int) (Math.random() * size); - main.removeComponent((Component) components.get(index)); - - } - -} diff --git a/src/com/vaadin/tests/TestForMultipleStyleNames.java b/src/com/vaadin/tests/TestForMultipleStyleNames.java deleted file mode 100644 index a0facecd56..0000000000 --- a/src/com/vaadin/tests/TestForMultipleStyleNames.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TwinColSelect; - -/** - * TODO: Note you need to add Theme under WebContent/VAADIN/Themes/mytheme in - * order to see actual visible results on the browser. Currently changes are - * visible only by inspecting DOM. - * - * @author IT Mill Ltd. - */ -public class TestForMultipleStyleNames extends CustomComponent implements - ValueChangeListener { - - private final OrderedLayout main = new OrderedLayout(); - - private Label l; - - private final TwinColSelect s = new TwinColSelect(); - - private ArrayList styleNames2; - - public TestForMultipleStyleNames() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(new Label( - "TK5 supports multiple stylenames for components.")); - main.addComponent(new Label("Note you need to add Theme under" - + " WebContent/VAADIN/Themes/mytheme" - + " in order to see actual visible results" - + " on the browser. Currently changes are" - + " visible only by inspecting DOM.")); - - styleNames2 = new ArrayList(); - - styleNames2.add("red"); - styleNames2.add("bold"); - styleNames2.add("italic"); - - s.setContainerDataSource(new IndexedContainer(styleNames2)); - s.addListener(this); - s.setImmediate(true); - main.addComponent(s); - - l = new Label("Test labele"); - main.addComponent(l); - - } - - public void valueChange(ValueChangeEvent event) { - - final String currentStyle = l.getStyle(); - final String[] tmp = currentStyle.split(" "); - final ArrayList curStyles = new ArrayList(); - for (int i = 0; i < tmp.length; i++) { - if (tmp[i] != "") { - curStyles.add(tmp[i]); - } - } - - final Collection styles = (Collection) s.getValue(); - - for (final Iterator iterator = styles.iterator(); iterator.hasNext();) { - final String styleName = (String) iterator.next(); - if (curStyles.contains(styleName)) { - // already added - curStyles.remove(styleName); - } else { - l.addStyleName(styleName); - } - } - for (final Iterator iterator2 = curStyles.iterator(); iterator2 - .hasNext();) { - final String object = (String) iterator2.next(); - l.removeStyleName(object); - } - } - -} diff --git a/src/com/vaadin/tests/TestForNativeWindowing.java b/src/com/vaadin/tests/TestForNativeWindowing.java deleted file mode 100644 index 8311a2e955..0000000000 --- a/src/com/vaadin/tests/TestForNativeWindowing.java +++ /dev/null @@ -1,130 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.net.MalformedURLException; -import java.net.URL; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class TestForNativeWindowing extends Application { - - Window main = new Window("Windowing test"); - - @Override - public void init() { - - setMainWindow(main); - - main.addComponent(new Button("Add new subwindow", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - final Window w = new Window("sw " - + System.currentTimeMillis()); - main.addWindow(w); - w.setPositionX(100); - w.setPositionY(100); - w.setWidth(200); - w.setHeight(200); - - w.setWidth(100); - w.setHeight(400); - - final Button closebutton = new Button("Close " - + w.getCaption(), new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - main.removeWindow(w); - } - - }); - w.addComponent(closebutton); - - w.addComponent(new Label( - "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

" - + "

Lorem ipsum dolor sit amet.

", - Label.CONTENT_XHTML)); - - } - })); - - main.addComponent(new Button( - "Open a currently uncreated application level window", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - try { - main - .open( - new com.vaadin.terminal.ExternalResource( - new URL( - getURL(), - "mainwin-" - + System - .currentTimeMillis() - + "/")), - null); - } catch (final MalformedURLException e) { - } - } - })); - - main.addComponent(new Button( - "Commit (saves window state: size, place, scrollpos)")); - } - - @Override - public Window getWindow(String name) { - - final Window 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); - ww.setName(name); - ww.addComponent(new Label( - "This is a application-level window opened with name: " - + name)); - ww.addComponent(new Button("Click me", new Button.ClickListener() { - int state = 0; - - public void buttonClick(ClickEvent event) { - ww.addComponent(new Label("Button clicked " + (++state) - + " times")); - } - })); - addWindow(ww); - return ww; - } - - return null; - } - -} diff --git a/src/com/vaadin/tests/TestForPreconfiguredComponents.java b/src/com/vaadin/tests/TestForPreconfiguredComponents.java deleted file mode 100644 index fa153fcda7..0000000000 --- a/src/com/vaadin/tests/TestForPreconfiguredComponents.java +++ /dev/null @@ -1,186 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Tree; -import com.vaadin.ui.TwinColSelect; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * @author IT Mill Ltd. - */ -public class TestForPreconfiguredComponents extends CustomComponent implements - Handler { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; - - private final OrderedLayout main = new OrderedLayout(); - - private final Action[] actions = new Action[] { new Action("edit"), - new Action("delete") }; - - private Panel al; - - private Tree contextTree; - - public TestForPreconfiguredComponents() { - - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main - .addComponent(new Label( - "In Toolkit 5 we introduce new components. Previously we" - + " usually used setStyle or some other methods on possibly " - + "multiple steps to configure component for ones needs. These new " - + "server side components are mostly just classes that in constructor " - + "set base class to state that programmer wants.")); - - main.addComponent(new Button("commit")); - - Panel test = createTestBench(new CheckBox()); - test.setCaption("CheckBox (configured from button)"); - main.addComponent(test); - - AbstractSelect s = new TwinColSelect(); - fillSelect(s, 20); - test = createTestBench(s); - test.setCaption("TwinColSelect (configured from select)"); - main.addComponent(test); - - s = new NativeSelect(); - fillSelect(s, 20); - test = createTestBench(s); - test.setCaption("Native (configured from select)"); - main.addComponent(test); - - s = new OptionGroup(); - fillSelect(s, 20); - test = createTestBench(s); - test.setCaption("OptionGroup (configured from select)"); - main.addComponent(test); - - s = new OptionGroup(); - fillSelect(s, 20); - s.setMultiSelect(true); - test = createTestBench(s); - test - .setCaption("OptionGroup + multiselect manually (configured from select)"); - main.addComponent(test); - - final Button b = new Button("refresh view", this, "createNewView"); - main.addComponent(b); - - } - - public static void fillSelect(AbstractSelect s, int items) { - for (int i = 0; i < items; i++) { - final String name = firstnames[(int) (Math.random() * (firstnames.length - 1))] - + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]; - s.addItem(name); - } - } - - public Tree createTestTree() { - Tree t = new Tree("Tree"); - final String[] names = new String[100]; - for (int i = 0; i < names.length; i++) { - names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))] - + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]; - } - - // Create tree - t = new Tree("Organization Structure"); - for (int i = 0; i < 100; i++) { - t.addItem(names[i]); - final String parent = names[(int) (Math.random() * (names.length - 1))]; - if (t.containsId(parent)) { - t.setParent(names[i], parent); - } - } - - // Forbid childless people to have children (makes them leaves) - for (int i = 0; i < 100; i++) { - if (!t.hasChildren(names[i])) { - t.setChildrenAllowed(names[i], false); - } - } - return t; - } - - public Panel createTestBench(Component t) { - final Panel ol = new Panel(); - ol.setLayout(new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); - - ol.addComponent(t); - - final OrderedLayout ol2 = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - final Panel status = new Panel("Events"); - final Button clear = new Button("clear event log"); - clear.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - status.removeAllComponents(); - status.addComponent(ol2); - } - }); - ol2.addComponent(clear); - final Button commit = new Button("commit changes"); - ol2.addComponent(commit); - status.addComponent(ol2); - - status.setHeight(300); - status.setWidth(400); - - ol.addComponent(status); - - t.addListener(new Listener() { - public void componentEvent(Event event) { - status.addComponent(new Label(event.getClass().getName())); - status.addComponent(new Label("selected: " - + event.getSource().toString())); - } - }); - - return ol; - } - - public Action[] getActions(Object target, Object sender) { - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - if (action == actions[1]) { - al.addComponent(new Label("Delete selected on " + target)); - contextTree.removeItem(target); - - } else { - al.addComponent(new Label("Edit selected on " + target)); - } - } -} diff --git a/src/com/vaadin/tests/TestForRichTextEditor.java b/src/com/vaadin/tests/TestForRichTextEditor.java deleted file mode 100644 index 7ac97ce882..0000000000 --- a/src/com/vaadin/tests/TestForRichTextEditor.java +++ /dev/null @@ -1,66 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Button.ClickEvent; - -/** - * - * @author IT Mill Ltd. - */ -public class TestForRichTextEditor extends CustomComponent implements - ValueChangeListener { - - private final OrderedLayout main = new OrderedLayout(); - - private Label l; - - private RichTextArea rte; - - public TestForRichTextEditor() { - - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(new Label( - "RTE uses google richtextArea and their examples toolbar.")); - - rte = new RichTextArea(); - rte.addListener(this); - - main.addComponent(rte); - - main.addComponent(new Button("commit content to label below")); - - l = new Label("", Label.CONTENT_XHTML); - main.addComponent(l); - - Button b = new Button("enabled"); - b.setSwitchMode(true); - b.setImmediate(true); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - rte.setEnabled(!rte.isEnabled()); - } - }); - main.addComponent(b); - - } - - public void valueChange(ValueChangeEvent event) { - l.setValue(rte.getValue()); - } - -} diff --git a/src/com/vaadin/tests/TestForStyledUpload.java b/src/com/vaadin/tests/TestForStyledUpload.java deleted file mode 100644 index 0e4933d2b9..0000000000 --- a/src/com/vaadin/tests/TestForStyledUpload.java +++ /dev/null @@ -1,288 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.lang.management.ManagementFactory; -import java.lang.management.MemoryMXBean; - -import com.vaadin.Application; -import com.vaadin.terminal.StreamResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.Panel; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Upload; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Upload.FailedEvent; -import com.vaadin.ui.Upload.FailedListener; -import com.vaadin.ui.Upload.FinishedEvent; -import com.vaadin.ui.Upload.FinishedListener; -import com.vaadin.ui.Upload.StartedEvent; -import com.vaadin.ui.Upload.StartedListener; -import com.vaadin.ui.Upload.SucceededEvent; -import com.vaadin.ui.Upload.SucceededListener; - -public class TestForStyledUpload extends Application implements - Upload.FinishedListener, FailedListener, SucceededListener, - StartedListener { - - Layout main = new VerticalLayout(); - - TmpFileBuffer buffer = new TmpFileBuffer(); - - Panel status = new Panel("Uploaded file:"); - - private final Upload up; - - private final Label l; - - private final Label transferred = new Label(""); - - private final ProgressIndicator pi = new ProgressIndicator(); - - private final Label memoryStatus; - - public TestForStyledUpload() { - main - .addComponent(new Label( - "Clicking on button b updates information about upload components status or same with garbage collector.")); - - up = new Upload(null, buffer); - up.setButtonCaption("Select file"); - up.setImmediate(true); - up.addListener((FinishedListener) this); - up.addListener((FailedListener) this); - up.addListener((SucceededListener) this); - up.addListener((StartedListener) this); - - up.addListener(new Upload.ProgressListener() { - - public void updateProgress(long readBytes, long contentLenght) { - pi.setValue(new Float(readBytes / (float) contentLenght)); - - refreshMemUsage(); - - transferred.setValue("Transferred " + readBytes + " of " - + contentLenght); - } - - }); - - final Button b = new Button("Update status", this, "readState"); - - final Button c = new Button("Update status with gc", this, "gc"); - - main.addComponent(up); - l = new Label("Idle"); - main.addComponent(l); - - pi.setVisible(false); - pi.setPollingInterval(300); - main.addComponent(pi); - main.addComponent(transferred); - - memoryStatus = new Label(); - main.addComponent(memoryStatus); - - status.setVisible(false); - main.addComponent(status); - - Button cancel = new Button("Cancel current upload"); - cancel.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - buffer.cancel(); - } - }); - - main.addComponent(cancel); - - final Button restart = new Button("Restart demo application"); - restart.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - TestForStyledUpload.this.close(); - } - }); - main.addComponent(restart); - main.addComponent(b); - main.addComponent(c); - - } - - public void gc() { - Runtime.getRuntime().gc(); - readState(); - } - - public void readState() { - final StringBuffer sb = new StringBuffer(); - - if (up.isUploading()) { - sb.append("Uploading..."); - sb.append(up.getBytesRead()); - sb.append("/"); - sb.append(up.getUploadSize()); - sb.append(" "); - sb.append(Math.round(100 * up.getBytesRead() - / (double) up.getUploadSize())); - sb.append("%"); - } else { - sb.append("Idle"); - } - l.setValue(sb.toString()); - refreshMemUsage(); - } - - public void uploadFinished(FinishedEvent event) { - status.removeAllComponents(); - final InputStream stream = buffer.getStream(); - if (stream == null) { - status.addComponent(new Label( - "Upload finished, but output buffer is null!!")); - } else { - status - .addComponent(new Label("Name: " - + event.getFilename(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Mimetype: " - + event.getMIMEType(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Size: " + event.getLength() - + " bytes.", Label.CONTENT_XHTML)); - - status.addComponent(new Link("Download " + buffer.getFileName(), - new StreamResource(buffer, buffer.getFileName(), this))); - - status.setVisible(true); - } - } - - public interface Buffer extends StreamResource.StreamSource, - Upload.Receiver { - - String getFileName(); - } - - public class TmpFileBuffer implements Buffer { - String mimeType; - - String fileName; - - private File file; - - private FileInputStream stream; - - public TmpFileBuffer() { - final String tempFileName = "upload_tmpfile_" - + System.currentTimeMillis(); - try { - file = File.createTempFile(tempFileName, null); - } catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - public void cancel() { - up.interruptUpload(); - } - - public InputStream getStream() { - if (file == null) { - return null; - } - try { - stream = new FileInputStream(file); - return stream; - } catch (final FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - /** - * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, String) - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - fileName = filename; - mimeType = MIMEType; - try { - return new FileOutputStream(file); - } catch (final FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - /** - * Returns the fileName. - * - * @return String - */ - public String getFileName() { - return fileName; - } - - /** - * Returns the mimeType. - * - * @return String - */ - public String getMimeType() { - return mimeType; - } - - } - - public void uploadFailed(FailedEvent event) { - pi.setVisible(false); - l.setValue("Upload was interrupted"); - } - - public void uploadSucceeded(SucceededEvent event) { - pi.setVisible(false); - l.setValue("Finished upload, idle"); - System.out.println(event); - } - - private void refreshMemUsage() { - // memoryStatus.setValue("Not available in Java 1.4"); - StringBuffer mem = new StringBuffer(); - MemoryMXBean mmBean = ManagementFactory.getMemoryMXBean(); - mem.append("Heap (M):"); - mem.append(mmBean.getHeapMemoryUsage().getUsed() / 1048576); - mem.append(" | Non-Heap (M):"); - mem.append(mmBean.getNonHeapMemoryUsage().getUsed() / 1048576); - memoryStatus.setValue(mem.toString()); - - } - - public void uploadStarted(StartedEvent event) { - pi.setVisible(true); - l.setValue("Started uploading file " + event.getFilename()); - } - - @Override - public void init() { - Window w = new Window(); - w.setTheme("runo"); - w.addComponent(main); - setMainWindow(w); - - } - -} diff --git a/src/com/vaadin/tests/TestForTabSheet.java b/src/com/vaadin/tests/TestForTabSheet.java deleted file mode 100644 index f53faabfcb..0000000000 --- a/src/com/vaadin/tests/TestForTabSheet.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.tests; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; - -public class TestForTabSheet extends CustomComponent implements - Button.ClickListener, TabSheet.SelectedTabChangeListener { - TabSheet tabsheet = new TabSheet(); - Button tab1_root = new Button("Push this button"); - Label tab2_root = new Label("Contents of Second Tab"); - Label tab3_root = new Label("Contents of Third Tab"); - - TestForTabSheet() { - setCompositionRoot(tabsheet); - - tabsheet.addListener(this); - - /* Listen for button click events. */ - tab1_root.addListener(this); - tabsheet.addTab(tab1_root, "First Tab", null); - - /* A tab that is initially disabled. */ - tab2_root.setEnabled(false); - tabsheet.addTab(tab2_root, "Second Tab", null); - - /* A tab that is initially disabled. */ - tab3_root.setEnabled(false); - tabsheet.addTab(tab3_root, "Third tab", null); - } - - public void buttonClick(ClickEvent event) { - System.out.println("tab2=" + tab2_root.isEnabled() + " tab3=" - + tab3_root.isEnabled()); - tab2_root.setEnabled(true); - tab3_root.setEnabled(true); - } - - public void selectedTabChange(SelectedTabChangeEvent event) { - /* - * Cast to a TabSheet. This isn't really necessary in this example, as - * we have only one TabSheet component, but would be useful if there - * were multiple TabSheets. - */ - TabSheet source = (TabSheet) event.getSource(); - if (source == tabsheet) { - /* If the first tab was selected. */ - if (source.getSelectedTab() == tab1_root) { - System.out.println("foo"); - tab2_root.setEnabled(false); - tab3_root.setEnabled(false); - } - } - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java deleted file mode 100644 index adde3f8c0e..0000000000 --- a/src/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ /dev/null @@ -1,162 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.util.Iterator; -import java.util.Vector; - -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Button.ClickEvent; - -/** - * - * This Component contains some simple test to see that component updates its - * contents propertly. - * - * @author IT Mill Ltd. - */ -public class TestForTablesInitialColumnWidthLogicRendering extends - CustomComponent { - - private final OrderedLayout main = new OrderedLayout(); - - public TestForTablesInitialColumnWidthLogicRendering() { - - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main - .addComponent(new Label( - "Below are same tables that all should render somewhat nice. Also when testing, you might want to try resizing window.")); - - Table t; - - Layout lo = new OrderedLayout(); - lo.setWidth("600px"); - lo.setHeight("250px"); - - t = getTestTable(4, 50); - t.setSizeFull(); - lo.setCaption("Fullsize table insize 400x250px layout"); - lo.addComponent(t); - main.addComponent(lo); - - // t = new Table("Empty table"); - // main.addComponent(t); - - t = getTestTable(5, 0); - t.setCaption("Table with only headers"); - // main.addComponent(t); - - t = getTestTable(5, 200); - t.setCaption("Table with some cols and lot of rows"); - main.addComponent(t); - - t = getTestTable(5, 5); - t - .setCaption("Table with some cols and rows rows, some col widths fixed"); - - Iterator it = t.getContainerPropertyIds().iterator(); - it.next(); - it.next(); - t.setColumnWidth(it.next(), 30); - t.setColumnWidth(it.next(), 30); - t.setWidth("700px"); - main.addComponent(t); - - t = getTestTable(12, 4); - t.setCaption("Table with some rows and lot of columns"); - main.addComponent(t); - - t = getTestTable(3, 40); - t - .setCaption("Table with some columns and wide explicit width. (Ought to widen columns to use all space)"); - t.setWidth(1000); - main.addComponent(t); - - t = getTestTable(12, 4); - t.setCaption("Table with some rows and lot of columns, width == 100%"); - t.setWidth(100, Table.UNITS_PERCENTAGE); - main.addComponent(t); - - t = getTestTable(12, 100); - t - .setCaption("Table with lot of rows and lot of columns, width == 50%"); - t.setWidth(50, Table.UNITS_PERCENTAGE); - main.addComponent(t); - - t = getTestTable(5, 100); - t.setCaption("Table with 40 rows"); - // main.addComponent(t); - - t = getTestTable(4, 4); - t.setCaption("Table with some rows and width = 200px"); - - t.setWidth(200); - main.addComponent(t); - - final Button b = new Button("refresh view", this, "createNewView"); - main.addComponent(b); - - } - - public static Table getTestTable(int cols, int rows) { - final Table t = new Table(); - t.setColumnCollapsingAllowed(true); - for (int i = 0; i < cols; i++) { - t.addContainerProperty(testString[i], String.class, ""); - } - t.addContainerProperty("button", Button.class, null); - for (int i = 0; i < rows; i++) { - final Vector content = new Vector(); - for (int j = 0; j < cols; j++) { - content.add(rndString()); - } - Button button = new Button("b", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - System.out.println("b click"); - - } - }); - button.setDescription("Yep yep"); - button.setComponentError(new UserError("Error")); - content.add(button); - t.addItem(content.toArray(), "" + i); - } - return t; - } - - static String[] testString = new String[] { "Jacob", "Michael", "Joshua", - "Matthew", "Ethan", "Andrew", "Daniel", "Anthony", "Christopher", - "Joseph", "William", "Alexander", "Ryan", "David", "Nicholas", - "Tyler", "James", "John", "Jonathan", "Nathan", "Samuel", - "Christian", "Noah", "Dylan", "Benjamin", "Logan", "Brandon", - "Gabriel", "Zachary", "Jose", "Elijah", "Angel", "Kevin", "Jack", - "Caleb", "Justin", "Austin", "Evan", "Robert", "Thomas", "Luke", - "Mason", "Aidan", "Jackson", "Isaiah", "Jordan", "Gavin", "Connor", - "Aiden", "Isaac", "Jason", "Cameron", "Hunter", "Jayden", "Juan", - "Charles", "Aaron", "Lucas", "Luis", "Owen", "Landon", "Diego", - "Brian", "Adam", "Adrian", "Kyle", "Eric", "Ian", "Nathaniel", - "Carlos", "Alex", "Bryan", "Jesus", "Julian", "Sean", "Carter", - "Hayden", "Jeremiah", "Cole", "Brayden", "Wyatt", "Chase", - "Steven", "Timothy", "Dominic", "Sebastian", "Xavier", "Jaden", - "Jesse", "Devin", "Seth", "Antonio", "Richard", "Miguel", "Colin", - "Cody", "Alejandro", "Caden", "Blake", "Carson" }; - - public static String rndString() { - return testString[(int) (Math.random() * testString.length)]; - } - -} diff --git a/src/com/vaadin/tests/TestForTrees.java b/src/com/vaadin/tests/TestForTrees.java deleted file mode 100644 index f0f326c304..0000000000 --- a/src/com/vaadin/tests/TestForTrees.java +++ /dev/null @@ -1,166 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -/** - * Some test cases for trees. Events panel logs events that happen server side. - * - * @author IT Mill Ltd. - */ -public class TestForTrees extends CustomComponent implements Handler { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; - - private final OrderedLayout main = new OrderedLayout(); - - private final Action[] actions = new Action[] { new Action("edit"), - new Action("delete") }; - - private Panel al; - - private Tree contextTree; - - public TestForTrees() { - - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main - .addComponent(new Label( - "Some test cases for trees. Events panel logs events that happen server side.")); - - main.addComponent(new Button("commit")); - - Tree t; - - t = createTestTree(); - t.setCaption("Default settings"); - main.addComponent(createTestBench(t)); - - t = createTestTree(); - t.setCaption("Multiselect settings"); - t.setMultiSelect(true); - main.addComponent(createTestBench(t)); - - t = createTestTree(); - t.setCaption("Multiselect and immediate"); - t.setImmediate(true); - t.setMultiSelect(true); - main.addComponent(createTestBench(t)); - - t = createTestTree(); - t.setCaption("immediate"); - t.setImmediate(true); - main.addComponent(createTestBench(t)); - - t = createTestTree(); - t.setCaption("with actions"); - t.setImmediate(true); - t.addActionHandler(this); - final OrderedLayout ol = (OrderedLayout) createTestBench(t); - al = new Panel("action log"); - ol.addComponent(al); - main.addComponent(ol); - contextTree = t; - - final Button b = new Button("refresh view", this, "createNewView"); - main.addComponent(b); - - } - - public Tree createTestTree() { - Tree t = new Tree("Tree"); - final String[] names = new String[100]; - for (int i = 0; i < names.length; i++) { - names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))] - + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]; - } - - // Create tree - t = new Tree("Organization Structure"); - for (int i = 0; i < 100; i++) { - t.addItem(names[i]); - final String parent = names[(int) (Math.random() * (names.length - 1))]; - if (t.containsId(parent)) { - t.setParent(names[i], parent); - } - } - - // Forbid childless people to have children (makes them leaves) - for (int i = 0; i < 100; i++) { - if (!t.hasChildren(names[i])) { - t.setChildrenAllowed(names[i], false); - } - } - return t; - } - - public Component createTestBench(Tree t) { - final OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - - ol.addComponent(t); - - final Panel status = new Panel("Events"); - final Button clear = new Button("c"); - clear.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - status.removeAllComponents(); - status.addComponent(clear); - } - }); - status.addComponent(clear); - - status.setHeight("300px"); - status.setWidth("400px"); - - ol.addComponent(status); - - t.addListener(new Listener() { - public void componentEvent(Event event) { - status.addComponent(new Label(event.getClass().getName())); - status.addComponent(new Label("selected: " - + event.getSource().toString())); - } - }); - - return ol; - } - - public Action[] getActions(Object target, Object sender) { - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - if (action == actions[1]) { - al.addComponent(new Label("Delete selected on " + target)); - contextTree.removeItem(target); - - } else { - al.addComponent(new Label("Edit selected on " + target)); - } - } -} diff --git a/src/com/vaadin/tests/TestForUpload.java b/src/com/vaadin/tests/TestForUpload.java deleted file mode 100644 index 351a590b26..0000000000 --- a/src/com/vaadin/tests/TestForUpload.java +++ /dev/null @@ -1,375 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.StreamResource; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Select; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Upload; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Upload.FailedEvent; -import com.vaadin.ui.Upload.FailedListener; -import com.vaadin.ui.Upload.FinishedEvent; -import com.vaadin.ui.Upload.FinishedListener; -import com.vaadin.ui.Upload.StartedEvent; -import com.vaadin.ui.Upload.StartedListener; -import com.vaadin.ui.Upload.SucceededEvent; -import com.vaadin.ui.Upload.SucceededListener; - -public class TestForUpload extends CustomComponent implements - Upload.FinishedListener, FailedListener, SucceededListener, - Upload.ProgressListener, StartedListener { - - Layout main = new OrderedLayout(); - - Buffer buffer = new MemoryBuffer(); - - Panel status = new Panel("Uploaded file:"); - - private final Upload up; - - private final Label l; - - private final ProgressIndicator pi = new ProgressIndicator(); - private final ProgressIndicator pi2 = new ProgressIndicator(); - - private final Label memoryStatus; - - private final Select uploadBufferSelector; - - private TextField textField; - - private Label textFieldValue; - - public TestForUpload() { - setCompositionRoot(main); - main.addComponent(new Label( - "This is a simple test for upload application. " - + "Upload should work with big files and concurrent " - + "requests should not be blocked. Button 'b' reads " - + "current state into label below it. Memory receiver " - + "streams upload contents into memory. You may track" - + "consumption." - + "tempfile receiver writes upload to file and " - + "should have low memory consumption.")); - - main - .addComponent(new Label( - "Clicking on button b updates information about upload components status or same with garbage collector.")); - - textField = new TextField("Test field"); - textFieldValue = new Label(); - main.addComponent(textField); - main.addComponent(textFieldValue); - - up = new Upload("Upload", buffer); - up.setImmediate(true); - up.addListener((FinishedListener) this); - up.addListener((FailedListener) this); - up.addListener((SucceededListener) this); - up.addListener((StartedListener) this); - - up.setProgressListener(this); - up.addListener(new Upload.ProgressListener() { - - public void updateProgress(long readBytes, long contentLenght) { - pi2.setValue(new Float(readBytes / (float) contentLenght)); - - refreshMemUsage(); - } - - }); - - final Button b = new Button("b", this, "readState"); - - final Button c = new Button("b with gc", this, "gc"); - - main.addComponent(b); - main.addComponent(c); - - uploadBufferSelector = new Select("Receiver type"); - uploadBufferSelector.setImmediate(true); - uploadBufferSelector.addItem("memory"); - uploadBufferSelector.setValue("memory"); - uploadBufferSelector.addItem("tempfile"); - uploadBufferSelector - .addListener(new AbstractField.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - setBuffer(); - } - }); - main.addComponent(uploadBufferSelector); - - main.addComponent(up); - l = new Label("Idle"); - main.addComponent(l); - - pi.setVisible(false); - pi.setPollingInterval(1000); - main.addComponent(pi); - - pi2.setVisible(false); - pi2.setPollingInterval(1000); - main.addComponent(pi2); - - memoryStatus = new Label(); - main.addComponent(memoryStatus); - - status.setVisible(false); - main.addComponent(status); - - final Button restart = new Button("R"); - restart.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - getApplication().close(); - } - }); - main.addComponent(restart); - - } - - private void setBuffer() { - final String id = (String) uploadBufferSelector.getValue(); - if ("memory".equals(id)) { - buffer = new MemoryBuffer(); - } else if ("tempfile".equals(id)) { - buffer = new TmpFileBuffer(); - } - up.setReceiver(buffer); - } - - public void gc() { - Runtime.getRuntime().gc(); - readState(); - } - - public void readState() { - final StringBuffer sb = new StringBuffer(); - - if (up.isUploading()) { - sb.append("Uploading..."); - sb.append(up.getBytesRead()); - sb.append("/"); - sb.append(up.getUploadSize()); - sb.append(" "); - sb.append(Math.round(100 * up.getBytesRead() - / (double) up.getUploadSize())); - sb.append("%"); - } else { - sb.append("Idle"); - } - l.setValue(sb.toString()); - refreshMemUsage(); - } - - public void uploadFinished(FinishedEvent event) { - status.removeAllComponents(); - final InputStream stream = buffer.getStream(); - if (stream == null) { - status.addComponent(new Label( - "Upload finished, but output buffer is null!!")); - } else { - status - .addComponent(new Label("Name: " - + event.getFilename(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Mimetype: " - + event.getMIMEType(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Size: " + event.getLength() - + " bytes.", Label.CONTENT_XHTML)); - - status.addComponent(new Link("Download " + buffer.getFileName(), - new StreamResource(buffer, buffer.getFileName(), - getApplication()))); - - status.setVisible(true); - } - } - - public interface Buffer extends StreamResource.StreamSource, - Upload.Receiver { - - String getFileName(); - } - - public class MemoryBuffer implements Buffer { - ByteArrayOutputStream outputBuffer = null; - - String mimeType; - - String fileName; - - public MemoryBuffer() { - - } - - public InputStream getStream() { - if (outputBuffer == null) { - return null; - } - return new ByteArrayInputStream(outputBuffer.toByteArray()); - } - - /** - * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, - * String) - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - fileName = filename; - mimeType = MIMEType; - outputBuffer = new ByteArrayOutputStream(); - return outputBuffer; - } - - /** - * Returns the fileName. - * - * @return String - */ - public String getFileName() { - return fileName; - } - - /** - * Returns the mimeType. - * - * @return String - */ - public String getMimeType() { - return mimeType; - } - - } - - public class TmpFileBuffer implements Buffer { - String mimeType; - - String fileName; - - private File file; - - public TmpFileBuffer() { - final String tempFileName = "upload_tmpfile_" - + System.currentTimeMillis(); - try { - file = File.createTempFile(tempFileName, null); - } catch (final IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - public InputStream getStream() { - if (file == null) { - return null; - } - try { - return new FileInputStream(file); - } catch (final FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - /** - * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, - * String) - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - fileName = filename; - mimeType = MIMEType; - try { - return new FileOutputStream(file); - } catch (final FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - } - - /** - * Returns the fileName. - * - * @return String - */ - public String getFileName() { - return fileName; - } - - /** - * Returns the mimeType. - * - * @return String - */ - public String getMimeType() { - return mimeType; - } - - } - - public void uploadFailed(FailedEvent event) { - System.out.println(event); - - System.out.println(event.getSource()); - - } - - public void uploadSucceeded(SucceededEvent event) { - pi.setVisible(false); - pi2.setVisible(false); - l.setValue("Finished upload, idle"); - System.out.println(event); - setBuffer(); - } - - public void updateProgress(long readBytes, long contentLenght) { - pi.setValue(new Float(readBytes / (float) contentLenght)); - - refreshMemUsage(); - } - - private void refreshMemUsage() { - memoryStatus.setValue("Not available in Java 1.4"); - /* - * StringBuffer mem = new StringBuffer(); MemoryMXBean mmBean = - * ManagementFactory.getMemoryMXBean(); mem.append("Heap (M):"); - * mem.append(mmBean.getHeapMemoryUsage().getUsed() / 1048576); - * mem.append(" |�Non-Heap (M):"); - * mem.append(mmBean.getNonHeapMemoryUsage().getUsed() / 1048576); - * memoryStatus.setValue(mem.toString()); - */ - } - - public void uploadStarted(StartedEvent event) { - pi.setVisible(true); - pi2.setVisible(true); - l.setValue("Started uploading file " + event.getFilename()); - textFieldValue.setValue(" TestFields value at the upload start is:" - + textField.getValue()); - } - -} diff --git a/src/com/vaadin/tests/TestForWindowOpen.java b/src/com/vaadin/tests/TestForWindowOpen.java deleted file mode 100644 index d6cd6fcc95..0000000000 --- a/src/com/vaadin/tests/TestForWindowOpen.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Button.ClickEvent; - -public class TestForWindowOpen extends CustomComponent { - - public TestForWindowOpen() { - - final OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - - main.addComponent(new Button("Open in this window", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - final ExternalResource r = new ExternalResource( - "http://www.google.com"); - getApplication().getMainWindow().open(r); - - } - - })); - - main.addComponent(new Button("Open in target \"mytarget\"", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - final ExternalResource r = new ExternalResource( - "http://www.google.com"); - getApplication().getMainWindow().open(r, "mytarget"); - - } - - })); - - main.addComponent(new Button("Open in target \"secondtarget\"", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - final ExternalResource r = new ExternalResource( - "http://www.google.com"); - getApplication().getMainWindow() - .open(r, "secondtarget"); - - } - - })); - - } - -} diff --git a/src/com/vaadin/tests/TestForWindowing.java b/src/com/vaadin/tests/TestForWindowing.java deleted file mode 100644 index 9fb3ea19ea..0000000000 --- a/src/com/vaadin/tests/TestForWindowing.java +++ /dev/null @@ -1,99 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Slider; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class TestForWindowing extends CustomComponent { - - private Select s2; - - public TestForWindowing() { - - final OrderedLayout main = new OrderedLayout(); - - main.addComponent(new Label( - "Click the button to create a new inline window.")); - - final CheckBox asModal = new CheckBox("As modal"); - main.addComponent(asModal); - - final Button create = new Button("Create a new window", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - Window w = new Window("Testing Window"); - - if (((Boolean) asModal.getValue()).booleanValue()) { - w.setModal(true); - } - - AbstractSelect s1 = new OptionGroup(); - s1.setCaption("1. Select output format"); - s1.addItem("Excel sheet"); - s1.addItem("CSV plain text"); - s1.setValue("Excel sheet"); - s1.setImmediate(true); - - s2 = new Select(); - s2.addItem("Separate by comma (,)"); - s2.addItem("Separate by colon (:)"); - s2.addItem("Separate by semicolon (;)"); - s2.setEnabled(false); - - s1.addListener(new ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - String v = (String) event.getProperty() - .getValue(); - if (v.equals("CSV plain text")) { - s2.setEnabled(true); - } else { - s2.setEnabled(false); - } - } - - }); - - w.addComponent(s1); - w.addComponent(s2); - - Slider s = new Slider(); - s.setCaption("Volume"); - s.setMax(13); - s.setMin(12); - s.setResolution(2); - s.setImmediate(true); - // s.setOrientation(Slider.ORIENTATION_VERTICAL); - // s.setArrows(false); - - w.addComponent(s); - - getApplication().getMainWindow().addWindow(w); - - } - - }); - - main.addComponent(create); - - setCompositionRoot(main); - - } - -} diff --git a/src/com/vaadin/tests/TestIFrames.java b/src/com/vaadin/tests/TestIFrames.java deleted file mode 100644 index 6719820c44..0000000000 --- a/src/com/vaadin/tests/TestIFrames.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests; - -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; - -public class TestIFrames extends CustomComponent { - - OrderedLayout main = new OrderedLayout(); - - public TestIFrames() { - setCompositionRoot(main); - createNewView(); - } - - public void createNewView() { - main.removeAllComponents(); - main.addComponent(createEmbedded("../Reservr/")); - main.addComponent(createEmbedded("../colorpicker")); - // main.addComponent(createEmbedded("../TestForNativeWindowing")); - main - .addComponent(createEmbedded("http://toolkit.itmill.com/demo/FeaturesApplication")); - main - .addComponent(createEmbedded("http://toolkit.itmill.com/demo/TableDemo")); - } - - private Label createEmbedded(String URL) { - final int width = 600; - final int height = 250; - final String iFrame = ""); - } - - /** - * Feature component initialization is lazily done when the feature is - * attached to application - */ - @Override - public void attach() { - super.attach(); - - // Check if the feature is already initialized - if (initialized) { - return; - } - initialized = true; - - // Javadoc - javadoc = new Label(); - javadoc.setContentMode(Label.CONTENT_XHTML); - - // Demo - final Component demo = getDemoComponent(); - if (demo != null) { - layout.addComponent(demo); - } - - ts = new TabSheet(); - - ts.setSizeFull(); - - // Description tab - final String title = getTitle(); - if (getDescriptionXHTML() != null) { - final OrderedLayout mainLayout = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - final OrderedLayout layout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - mainLayout.addComponent(layout); - if (getImage() != null) { - layout.addComponent(new Embedded("", new ClassResource( - getImage(), getApplication()))); - } - String label = ""; - label += getDescriptionXHTML(); - if (propsReminder) { - label += PROP_REMINDER_TEXT; - } - if (title != null) { - layout.addComponent(new Label("

" + title + "

", - Label.CONTENT_XHTML)); - } - description = new Label(label, Label.CONTENT_XHTML); - mainLayout.addComponent(description); - mainLayout.setMargin(true); - - ts.addTab(mainLayout, "Description", null); - } - - // Properties table tab - ts.addTab(getPropertyPanel().getAllProperties(), "Properties", null); - - // Javadoc tab - if (!javadoc.getValue().equals("")) { - ts.addTab(javadoc, "Javadoc", null); - } - - // Code Sample tab - final String example = getExampleSrc(); - if (example != null) { - final OrderedLayout l = new OrderedLayout(); - if (getTitle() != null) { - l.addComponent(new Label( - "// " + getTitle() + " example", - Label.CONTENT_XHTML)); - } - l.addComponent(new Label(example, Label.CONTENT_PREFORMATTED)); - ts.addTab(l, "Code Sample", null); - } - - } - - /** Get the desctiption of the feature as XHTML fragment */ - protected String getDescriptionXHTML() { - return "

Feature description is under construction

"; - } - - /** Get the title of the feature */ - protected String getTitle() { - return getClass().getName(); - } - - public TabSheet getTabSheet() { - return ts; - } - - /** Get the name of the image file that will be put on description page */ - protected String getImage() { - return null; - } - - /** Get the example application source code */ - protected String getExampleSrc() { - return null; - } - - /** Get the feature demo component */ - protected Component getDemoComponent() { - return null; - } - - /** Get sample icon resource */ - protected Resource getSampleIcon() { - if (sampleIcon == null) { - sampleIcon = new ClassResource("m.gif", getApplication()); - } - return sampleIcon; - } - - public PropertyPanel getPropertyPanel() { - return propertyPanel; - } - - public void setPropsReminder(boolean propsReminder) { - this.propsReminder = propsReminder; - } - - public void updateDescription() { - String label = ""; - label += getDescriptionXHTML(); - if (propsReminder) { - label += PROP_REMINDER_TEXT; - } - description.setValue(label); - } - - // Fix for #512 - @Override - public String getDescription() { - if (description != null && description.getValue() != null) { - return description.getValue().toString(); - } else { - return null; - } - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java b/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java deleted file mode 100644 index 2b8668aa94..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureBrowser.java +++ /dev/null @@ -1,353 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.util.Iterator; -import java.util.StringTokenizer; - -import com.vaadin.data.Property; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class FeatureBrowser extends CustomComponent implements - Property.ValueChangeListener, ClickListener, Layout { - - private Tree features; - - private Feature currentFeature = null; - - private CustomLayout mainlayout; - - private PropertyPanel properties; - - private boolean initialized = false; - - private final Select themeSelector = new Select(); - - @Override - public void attach() { - - if (initialized) { - return; - } - initialized = true; - - // Configure tree - features = new Tree(); - features.addContainerProperty("name", String.class, ""); - features.addContainerProperty("feature", Feature.class, null); - features.setItemCaptionPropertyId("name"); - features.addListener(this); - features.setImmediate(true); - features.setStyle("menu"); - - // Configure component layout - mainlayout = new CustomLayout("featurebrowser-mainlayout"); - setCompositionRoot(mainlayout); - mainlayout.addComponent(features, "tree"); - - // Theme selector - mainlayout.addComponent(themeSelector, "themes"); - themeSelector.addItem("tests-featurebrowser"); - - themeSelector.addListener(this); - themeSelector.select("tests-featurebrowser"); - themeSelector.setImmediate(true); - - // Restart button - final Button close = new Button("restart", getApplication(), "close"); - close.setStyle("link"); - mainlayout.addComponent(close, "restart"); - - // Test component - registerFeature("/Welcome", new IntroWelcome()); - registerFeature("/UI Components", new IntroComponents()); - registerFeature("/UI Components/Basic", new IntroBasic()); - registerFeature("/UI Components/Basic/Text Field", - new FeatureTextField()); - registerFeature("/UI Components/Basic/Date Field", - new FeatureDateField()); - registerFeature("/UI Components/Basic/Button", new FeatureButton()); - registerFeature("/UI Components/Basic/Form", new FeatureForm()); - registerFeature("/UI Components/Basic/Label", new FeatureLabel()); - registerFeature("/UI Components/Basic/Link", new FeatureLink()); - registerFeature("/UI Components/Item Containers", - new IntroItemContainers()); - registerFeature("/UI Components/Item Containers/Select", - new FeatureSelect()); - registerFeature("/UI Components/Item Containers/Table", - new FeatureTable()); - registerFeature("/UI Components/Item Containers/Tree", - new FeatureTree()); - registerFeature("/UI Components/Layouts", new IntroLayouts()); - registerFeature("/UI Components/Layouts/Ordered Layout", - new FeatureOrderedLayout()); - registerFeature("/UI Components/Layouts/Grid Layout", - new FeatureGridLayout()); - registerFeature("/UI Components/Layouts/Custom Layout", - new FeatureCustomLayout()); - registerFeature("/UI Components/Layouts/Panel", new FeaturePanel()); - registerFeature("/UI Components/Layouts/Tab Sheet", - new FeatureTabSheet()); - registerFeature("/UI Components/Layouts/Window", new FeatureWindow()); - // Disabled for now - // registerFeature("/UI Components/Layouts/Frame Window", - // new FeatureFrameWindow()); - registerFeature("/UI Components/Data handling", new IntroDataHandling()); - registerFeature("/UI Components/Data handling/Embedded Objects", - new FeatureEmbedded()); - registerFeature("/UI Components/Data handling/Upload", - new FeatureUpload()); - registerFeature("/Data Model", new IntroDataModel()); - registerFeature("/Data Model/Properties", new FeatureProperties()); - registerFeature("/Data Model/Items", new FeatureItems()); - registerFeature("/Data Model/Containers", new FeatureContainers()); - registerFeature("/Data Model/Validators", new FeatureValidators()); - registerFeature("/Data Model/Buffering", new FeatureBuffering()); - // registerFeature("/Terminal", new IntroTerminal()); - // registerFeature("/Terminal/Parameters and URI Handling", - // new FeatureParameters()); - - // Pre-open all menus - for (final Iterator i = features.getItemIds().iterator(); i.hasNext();) { - features.expandItem(i.next()); - } - - // Add demo component and tabs - currentFeature = new IntroWelcome(); - mainlayout.addComponent(currentFeature, "demo"); - mainlayout.addComponent(currentFeature.getTabSheet(), "tabsheet"); - - // Add properties - properties = currentFeature.getPropertyPanel(); - mainlayout.addComponent(properties, "properties"); - } - - public void registerFeature(String path, Feature feature) { - final StringTokenizer st = new StringTokenizer(path, "/"); - String id = ""; - String parentId = null; - while (st.hasMoreTokens()) { - final String token = st.nextToken(); - id += "/" + token; - if (!features.containsId(id)) { - features.addItem(id); - features.setChildrenAllowed(id, false); - } - features.getContainerProperty(id, "name").setValue(token); - if (parentId != null) { - features.setChildrenAllowed(parentId, true); - features.setParent(id, parentId); - } - if (!st.hasMoreTokens()) { - features.getContainerProperty(id, "feature").setValue(feature); - } - parentId = id; - } - } - - public void valueChange(Property.ValueChangeEvent event) { - - // FIXME: navigation statistics - try { - if ((event.getProperty().toString() == null) - && ((AbstractComponent) event.getProperty()).getTag() - .equals("tree")) { - // ignore tree initialization - } else { - FeatureUtil.debug(getApplication().getUser().toString(), - "valueChange " - + ((AbstractComponent) event.getProperty()) - .getTag() + ", " + event.getProperty()); - } - } catch (final Exception e) { - // ignored, should never happen - } - - // Change feature - if (event.getProperty() == features) { - final Object id = features.getValue(); - if (id != null) { - if (features.areChildrenAllowed(id)) { - features.expandItem(id); - } - final Property p = features.getContainerProperty(id, "feature"); - final Feature feature = p != null ? ((Feature) p.getValue()) - : null; - if (feature != null) { - mainlayout.removeComponent(currentFeature); - mainlayout.removeComponent(currentFeature.getTabSheet()); - mainlayout.addComponent(feature, "demo"); - mainlayout.addComponent(feature.getTabSheet(), "tabsheet"); - currentFeature = feature; - properties = feature.getPropertyPanel(); - if (properties != null) { - mainlayout.addComponent(properties, "properties"); - } - getWindow() - .setCaption( - "Vaadin Features / " - + features.getContainerProperty(id, - "name")); - } - } - } else if (event.getProperty() == themeSelector) { - getApplication().setTheme(themeSelector.toString()); - } - } - - public void buttonClick(ClickEvent event) { - // FIXME: navigation statistics - try { - FeatureUtil.debug(getApplication().getUser().toString(), - "buttonClick " + event.getButton().getTag() + ", " - + event.getButton().getCaption() + ", " - + event.getButton().getValue()); - } catch (final Exception e) { - // ignored, should never happen - } - - } - - @Override - public void addComponent(Component c) { - // TODO Auto-generated method stub - - } - - @Override - public void addListener(ComponentAttachListener listener) { - // TODO Auto-generated method stub - - } - - @Override - public void addListener(ComponentDetachListener listener) { - // TODO Auto-generated method stub - - } - - @Override - public Iterator getComponentIterator() { - // TODO Auto-generated method stub - return null; - } - - @Override - public void moveComponentsFrom(ComponentContainer source) { - // TODO Auto-generated method stub - - } - - @Override - public void removeAllComponents() { - // TODO Auto-generated method stub - - } - - @Override - public void removeComponent(Component c) { - // TODO Auto-generated method stub - - } - - @Override - public void removeListener(ComponentAttachListener listener) { - // TODO Auto-generated method stub - - } - - @Override - public void removeListener(ComponentDetachListener listener) { - // TODO Auto-generated method stub - - } - - @Override - public void replaceComponent(Component oldComponent, Component newComponent) { - // TODO Auto-generated method stub - - } - - public void setMargin(boolean enabled) { - // TODO Auto-generated method stub - - } - - public void setMargin(boolean top, boolean right, boolean bottom, - boolean left) { - // TODO Auto-generated method stub - - } - - @Override - public float getHeight() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getHeightUnits() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public float getWidth() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public int getWidthUnits() { - // TODO Auto-generated method stub - return 0; - } - - @Override - public void setHeight(float height) { - // TODO Auto-generated method stub - - } - - @Override - public void setHeightUnits(int units) { - // TODO Auto-generated method stub - - } - - @Override - public void setSizeFull() { - // TODO Auto-generated method stub - - } - - @Override - public void setSizeUndefined() { - // TODO Auto-generated method stub - - } - - @Override - public void setWidth(float width) { - // TODO Auto-generated method stub - - } - - @Override - public void setWidthUnits(int units) { - // TODO Auto-generated method stub - - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java b/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java deleted file mode 100644 index 48ead2f676..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureBuffering.java +++ /dev/null @@ -1,91 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureBuffering extends Feature { - - private static final String INTRO_TEXT = "" - + "Vaadin data model provides interface for implementing " - + "buffering in data components. The basic idea is that a component " - + "reading their state from data source can implement " - + "Buffered-interface, for storing the value internally. " - + "Buffering provides transactional access " - + "for setting data: data can be put to a component's buffer and " - + "afterwards committed to or discarded by re-reding it from the data source. " - + "The buffering can be used for creating interactive interfaces " - + "as well as caching the data for performance reasons." - + "

Buffered interface contains methods for committing and discarding " - + "changes to an object and support for controlling buffering mode " - + "with read-through and write-through modes. " - + "Read-through mode means that the value read from the buffered " - + "object is constantly up to date with the data source. " - + "Respectively the write-through mode means that all changes to the object are " - + "immediately updated to the data source."; - - public FeatureBuffering() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - final Panel panel = new Panel(); - panel.setCaption("Buffering"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Buffered.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureButton.java b/src/com/vaadin/tests/featurebrowser/FeatureButton.java deleted file mode 100644 index a47eda9d35..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureButton.java +++ /dev/null @@ -1,72 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; - -public class FeatureButton extends Feature { - - public FeatureButton() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Button b = new Button("Caption"); - l.addComponent(b); - - // Properties - propertyPanel = new PropertyPanel(b); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("link").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("link"); - final Form ap = propertyPanel - .createBeanPropertySet(new String[] { "switchMode" }); - propertyPanel.addProperties("Button Properties", ap); - - setJavadocURL("ui/Button.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Button b = new Button(\"Caption\");\n"; - - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "In Vaadin, boolean input values are represented by buttons. " - + "Buttons may function either as a push buttons or switches. (checkboxes)

" - + "Button can be directly connected to any method of an object, which " - + "is an easy way to trigger events: new Button(\"Play\", myPiano \"playIt\"). " - + "Or in checkbox-mode they can be bound to a boolean proterties and create " - + " simple selectors.

" - + "See the demo and try out how the different properties affect " - + "the presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Button"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureContainers.java b/src/com/vaadin/tests/featurebrowser/FeatureContainers.java deleted file mode 100644 index 319be0056b..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureContainers.java +++ /dev/null @@ -1,94 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureContainers extends Feature { - - private static final String INTRO_TEXT = "" - + "Container is the most advanced of the data " - + "model supported by Vaadin. It provides a very flexible " - + "way of managing set of items that share common properties. Each " - + "item is identified by an item id. " - + "Properties can be requested from container with item " - + "and property ids. Other way of accessing properties is to first " - + "request an item from container and then request its properties " - + "from it." - + "

Container interface was designed with flexibility and " - + "efficiency in mind. It contains inner interfaces for ordering " - + "the items sequentially, indexing the items and accessing them " - + "hierarchically. Those ordering models provide basis for " - + "Table, Tree and Select UI components. As with other data " - + "models, the containers support events for notifying about the " - + "changes." - + "

Set of utilities for converting between container models by " - + "adding external indexing or hierarchy into existing containers. " - + "In memory containers implementing indexed and hierarchical " - + "models provide easy to use tools for setting up in memory data " - + "storages. There is even a hierarchical container for direct " - + "file system access."; - - public FeatureContainers() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Containers"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Container.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java b/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java deleted file mode 100644 index 97ce9761a1..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureCustomLayout.java +++ /dev/null @@ -1,82 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureCustomLayout extends Feature { - - private static final String INTRO_TEXT = "" - + "A container component with freely designed layout and style. The " - + "container consists of items with textually represented locations. Each " - + "item contains one sub-component. The adapter and theme are resposible " - + "for rendering the layout with given style by placing the items on the " - + "screen in defined locations." - + "

The definition of locations is not fixed - the each style can define its " - + "locations in a way that is suitable for it. One typical example would be " - + "to create visual design for a website as a custom layout: the visual design " - + "could define locations for \"menu\", \"body\" and \"title\" for example. " - + "The layout would then be implemented e.g. as plain HTML file." - + "

The default theme handles the styles that are not defined by just drawing " - + "the subcomponents with flowlayout."; - - @Override - protected Component getDemoComponent() { - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Custom Layout"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/CustomLayout.html"); - - return l; - } - - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getExampleSrc() { - return "CustomLayout c = new CustomLayout(\"mystyle\");\n" - + "c.addComponent(new Label(\"Example description\"),\"label1-location\");\n" - + "c.addComponent(new Button(\"Example action\"),\"example-action-location\");\n"; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return "Custom Layout"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureDateField.java b/src/com/vaadin/tests/featurebrowser/FeatureDateField.java deleted file mode 100644 index 31a3c53438..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureDateField.java +++ /dev/null @@ -1,105 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.util.Locale; - -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; - -public class FeatureDateField extends Feature { - - static private String[] localeNames; - static { - final Locale[] locales = Locale.getAvailableLocales(); - localeNames = new String[locales.length]; - for (int i = 0; i < locales.length; i++) { - localeNames[i] = locales[i].getDisplayName(); - } - } - - public FeatureDateField() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - l.addComponent(new Label("Your default locale is: " - + getApplication().getLocale().toString().replace('_', '-'))); - - final DateField df = new DateField(); - df.setValue(new java.util.Date()); - l.addComponent(df); - - // Properties - propertyPanel = new PropertyPanel(df); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "resolution", "locale" }); - ap.replaceWithSelect("resolution", new Object[] { - new Integer(DateField.RESOLUTION_YEAR), - new Integer(DateField.RESOLUTION_MONTH), - new Integer(DateField.RESOLUTION_DAY), - new Integer(DateField.RESOLUTION_HOUR), - new Integer(DateField.RESOLUTION_MIN), - new Integer(DateField.RESOLUTION_SEC), - new Integer(DateField.RESOLUTION_MSEC) }, new Object[] { - "Year", "Month", "Day", "Hour", "Minute", "Second", - "Millisecond" }); - ap.replaceWithSelect("locale", Locale.getAvailableLocales(), - localeNames); - ap.getField("resolution").setValue( - new Integer(DateField.RESOLUTION_DAY)); - ap.getField("locale").setValue(Locale.getDefault()); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("text").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("text"); - themes.addItem("calendar").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("calendar"); - propertyPanel.addProperties("DateField Properties", ap); - - setJavadocURL("ui/DateField.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "DateField df = new DateField(\"Caption\");\n" - + "df.setValue(new java.util.Date());\n"; - } - - @Override - protected String getDescriptionXHTML() { - return "Representing Dates and times and providing a way to select " - + "or enter some specific date and/or time is an typical need in " - + "data-entry user interfaces (UI). Vaadin provides a DateField " - + "component that is intuitive to use and yet controllable through " - + "its properties." - + "

The calendar-style allows point-and-click selection " - + "of dates while text-style shows only minimalistic user interface." - + " Validators may be bound to the component to check and " - + "validate the given input." - + "

On the demo tab you can try out how the different properties affect the " - + "presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "DateField"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java b/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java deleted file mode 100644 index 65453a8ecc..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureEmbedded.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.terminal.ClassResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; - -public class FeatureEmbedded extends Feature { - - public FeatureEmbedded() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final ClassResource flashResource = new ClassResource( - "vaadin_spin.swf", getApplication()); - final Embedded emb = new Embedded("Embedded Caption", flashResource); - emb.setType(Embedded.TYPE_OBJECT); - emb.setMimeType("application/x-shockwave-flash"); - emb.setWidth(250); - emb.setHeight(100); - l.addComponent(emb); - - // Properties - propertyPanel = new PropertyPanel(emb); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "type", "source", "width", "height", "widthUnits", - "heightUnits", "codebase", "codetype", "archive", "mimeType", - "standby", "classId" }); - ap.replaceWithSelect("type", new Object[] { - new Integer(Embedded.TYPE_IMAGE), - new Integer(Embedded.TYPE_OBJECT) }, new Object[] { "Image", - "Object" }); - final Object[] units = new Object[Embedded.UNIT_SYMBOLS.length]; - final Object[] symbols = new Object[Embedded.UNIT_SYMBOLS.length]; - for (int i = 0; i < units.length; i++) { - units[i] = new Integer(i); - symbols[i] = Embedded.UNIT_SYMBOLS[i]; - } - ap.replaceWithSelect("heightUnits", units, symbols); - ap.replaceWithSelect("widthUnits", units, symbols); - ap.replaceWithSelect("source", new Object[] { flashResource }, - new Object[] { "vaadin_spin.swf" }); - propertyPanel.addProperties("Embedded Properties", ap); - propertyPanel.getField("standby").setDescription( - "The text to display while loading the object."); - propertyPanel.getField("codebase").setDescription( - "root-path used to access resources with relative paths."); - propertyPanel.getField("codetype").setDescription( - "MIME-type of the code."); - propertyPanel - .getField("classId") - .setDescription( - "Unique object id. This can be used for example to identify windows components."); - - setJavadocURL("ui/Embedded.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "// Load image from jpg-file, that is in the same package with the application\n" - + "Embedded e = new Embedded(\"Image title\",\n" - + " new ClassResource(\"image.jpg\", getApplication()));"; - } - - @Override - protected String getDescriptionXHTML() { - return "The embedding feature allows for adding images, multimedia and other non-specified " - + "content to your application. " - + "The feature has provisions for embedding both applets and Active X controls. " - + "Actual support for embedded media types is left to the terminal."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Embedded"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureForm.java b/src/com/vaadin/tests/featurebrowser/FeatureForm.java deleted file mode 100644 index f50ad70ffc..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureForm.java +++ /dev/null @@ -1,182 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.util.Date; - -import com.vaadin.data.Property; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.TextField; - -public class FeatureForm extends Feature implements - Property.ValueChangeListener { - - OrderedLayout demo = null; - - Form test; - - Layout formLayout = null; - - Select addField = new Select("Add field"); - - Select resetLayout = new Select("Restart"); - - @Override - protected Component getDemoComponent() { - - if (demo == null) { - demo = new OrderedLayout(); - createDemo(); - } - - setJavadocURL("ui/Form.html"); - - return demo; - } - - private void createDemo() { - - demo.removeAllComponents(); - - // Test form - if (formLayout == null) { - test = new Form(); - } else { - test = new Form(formLayout); - } - - demo.addComponent(test); - final OrderedLayout actions = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - demo.addComponent(actions); - - // form adder - addField.setImmediate(true); - addField.addItem("Add field"); - addField.setNullSelectionItemId("Add field"); - addField.addItem("Text field"); - addField.addItem("Time"); - addField.addItem("Option group"); - addField.addItem("Calendar"); - addField.addListener(this); - actions.addComponent(addField); - - // Layout reset - resetLayout.setImmediate(true); - resetLayout.addItem("Select layout example"); - resetLayout.setNullSelectionItemId("Select layout example"); - resetLayout.addItem("Vertical form (OrderedLayout form-style)"); - resetLayout.addItem("Two columns (2x1 GridLayout)"); - resetLayout.addItem("Flow (OrderedLayout flow-orientation)"); - resetLayout.addListener(this); - actions.addComponent(resetLayout); - - // Properties - propertyPanel = new PropertyPanel(test); - propertyPanel.addProperties("Form special properties", new Form()); - } - - public void valueChange(Property.ValueChangeEvent event) { - - if (event.getProperty() == resetLayout) { - - final String value = (String) resetLayout.getValue(); - - if (value != null) { - formLayout = null; - - if (value.equals("Two columns (2x1 GridLayout)")) { - formLayout = new GridLayout(2, 1); - } - if (value.equals("Horizontal (OrderedLayout)")) { - formLayout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - } - - createDemo(); - resetLayout.setValue(null); - } - } - - if (event.getProperty() == addField) { - - final String value = (String) addField.getValue(); - - if (value != null) { - if (value.equals("Text field")) { - test.addField(new Object(), new TextField("Test field")); - } - if (value.equals("Time")) { - final DateField d = new DateField("Time", new Date()); - d - .setDescription("This is a DateField-component with text-style"); - d.setResolution(DateField.RESOLUTION_MIN); - d.setStyle("text"); - test.addField(new Object(), d); - } - if (value.equals("Calendar")) { - final DateField c = new DateField("Calendar", new Date()); - c - .setDescription("DateField-component with calendar-style and day-resolution"); - c.setStyle("calendar"); - c.setResolution(DateField.RESOLUTION_DAY); - test.addField(new Object(), c); - } - if (value.equals("Option group")) { - final Select s = new Select("Options"); - s.setDescription("Select-component with optiongroup-style"); - s.addItem("Linux"); - s.addItem("Windows"); - s.addItem("Solaris"); - s.addItem("Symbian"); - s.setStyle("optiongroup"); - - test.addField(new Object(), s); - } - - addField.setValue(null); - } - } - } - - @Override - protected String getDescriptionXHTML() { - return "Form is a flexible, yet simple container for fields. " - + " It provides support for any layouts and provides buffering interface for" - + " easy connection of commit- and discard buttons. All the form" - + " fields can be customized by adding validators, setting captions and icons, " - + " setting immediateness, etc. Also direct mechanism for replacing existing" - + " fields with selections is given." - + "

Form provides customizable editor for classes implementing" - + " Item-interface. Also the form itself" - + " implements this interface for easier connectivity to other items." - + " To use the form as editor for an item, just connect the item to" - + " form.After the item has been connected to the form," - + " the automatically created fields can be customized and new fields can" - + " be added. If you need to connect a class that does not implement" - + " Item-interface, most properties of any" - + " class following bean pattern, can be accessed trough" - + " BeanItem." - + "

The best example of Form usage is the this feature browser itself; " - + " all the Property-panels in demos are composed of Form-components."; - } - - @Override - protected String getTitle() { - return "Form"; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java b/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java deleted file mode 100644 index 297248001e..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureGridLayout.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.util.Date; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; - -public class FeatureGridLayout extends Feature { - - public FeatureGridLayout() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final GridLayout gl = new GridLayout(3, 3); - final DateField cal = new DateField("Test component 1", new Date()); - cal.setStyle("calendar"); - gl.addComponent(cal, 1, 0, 2, 1); - for (int i = 2; i < 7; i++) { - gl.addComponent(new TextField("Test component " + i)); - } - l.addComponent(gl); - - // Properties - propertyPanel = new PropertyPanel(gl); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - ap.addField("new line", new Button("New Line", gl, "newLine")); - ap.addField("space", new Button("Space", gl, "space")); - propertyPanel.addProperties("GridLayout Features", ap); - - setJavadocURL("ui/GridLayout.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "GridLayout gl = new GridLayout(2,2);\n" - + "gl.addComponent(new Label(\"Label 1 in GridLayout\"));\n" - + "gl.addComponent(new Label(\"Label 2 in GridLayout\"));\n" - + "gl.addComponent(new Label(\"Label 3 in GridLayout\"));\n" - + "gl.addComponent(new Label(\"Label 4 in GridLayout\"));\n"; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "This feature provides a container that lays out components " - + "into a grid of given width and height." - + "

On the demo tab you can try out how the different " - + "properties affect the presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "GridLayout"; - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/featurebrowser/FeatureItems.java b/src/com/vaadin/tests/featurebrowser/FeatureItems.java deleted file mode 100644 index 00e06deafd..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureItems.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureItems extends Feature { - - private static final String INTRO_TEXT = "" - + "Item is an object, which contains a set of named " - + "properties. Each property is identified by an " - + "id and a reference to the property can be queried from the Item. " - + "Item defines inner-interfaces for maintaining the item property " - + "set and listening the item property set changes." - + "

Items generally represent objects in the object-oriented " - + "model, but with the exception that they are configurable " - + "and provide an event mechanism. The simplest way of utilizing " - + "Item interface is to use existing Item implementations. " - + "Provided utility classes include configurable property set," - + " bean to item adapter and Form UI component."; - - public FeatureItems() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Items"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Item.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Introduction of Data Model Item"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureLabel.java b/src/com/vaadin/tests/featurebrowser/FeatureLabel.java deleted file mode 100644 index f12a76b39b..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureLabel.java +++ /dev/null @@ -1,77 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; - -public class FeatureLabel extends Feature { - - public FeatureLabel() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Label lab = new Label("Label text"); - l.addComponent(lab); - - // Properties - propertyPanel = new PropertyPanel(lab); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "contentMode", "value" }); - ap.replaceWithSelect("contentMode", new Object[] { - new Integer(Label.CONTENT_PREFORMATTED), - new Integer(Label.CONTENT_TEXT), - new Integer(Label.CONTENT_XHTML), - new Integer(Label.CONTENT_XML) }, new Object[] { - "Preformatted", "Text", "XHTML Fragment(Must be valid)", - "XML (Subtree with namespace)" }); - propertyPanel.addProperties("Label Properties", ap); - - setJavadocURL("ui/Label.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Label l = new Label(\"Caption\");\n"; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "Labels components are for captions and plain text. " - + "By default, it is a light-weight component for presenting " - + "text content in application, but it can be also used to present " - + "formatted information and even XML." - + "

" - + "Label can also be directly associated with data property to display " - + "information from different data sources automatically. This makes it " - + "trivial to present the current user in the corner of applications main window. " - + "

" - + "On the demo tab you can try out how the different properties affect " - + "the presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Label"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureLink.java b/src/com/vaadin/tests/featurebrowser/FeatureLink.java deleted file mode 100644 index c20f8fe456..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureLink.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; - -public class FeatureLink extends Feature { - - public FeatureLink() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Link lnk = new Link("Link caption", new ExternalResource( - "http://www.vaadin.com")); - l.addComponent(lnk); - - // Properties - propertyPanel = new PropertyPanel(lnk); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "targetName", "targetWidth", "targetHeight", "targetBorder" }); - ap.replaceWithSelect("targetBorder", new Object[] { - new Integer(Link.TARGET_BORDER_DEFAULT), - new Integer(Link.TARGET_BORDER_MINIMAL), - new Integer(Link.TARGET_BORDER_NONE) }, new Object[] { - "Default", "Minimal", "None" }); - propertyPanel.addProperties("Link Properties", ap); - - setJavadocURL("ui/Link.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Link link = new Link(\"Link caption\",new ExternalResource(\"http://www.vaadin.com\"));\n"; - } - - @Override - protected String getDescriptionXHTML() { - return "The link feature allows for making refences to both internal and external resources. " - + "The link can open the new resource in a new window, allowing for control of the newly " - + "opened windows attributes, such as size and border. " - + "

" - + " For example you can create an application pop-up or create link to external resources."; - - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Link"; - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java b/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java deleted file mode 100644 index 1ef07a6878..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureOrderedLayout.java +++ /dev/null @@ -1,81 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.TextField; - -public class FeatureOrderedLayout extends Feature { - - public FeatureOrderedLayout() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final OrderedLayout ol = new OrderedLayout(); - for (int i = 1; i < 5; i++) { - ol.addComponent(new TextField("Test component " + i)); - } - l.addComponent(ol); - - // Properties - propertyPanel = new PropertyPanel(ol); - final Form ap = propertyPanel - .createBeanPropertySet(new String[] { "orientation" }); - ap.replaceWithSelect("orientation", new Object[] { - new Integer(OrderedLayout.ORIENTATION_HORIZONTAL), - new Integer(OrderedLayout.ORIENTATION_VERTICAL) }, - new Object[] { "Horizontal", "Vertical" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("form").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("form"); - propertyPanel.addProperties("OrderedLayout Properties", ap); - - setJavadocURL("ui/OrderedLayout.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_FLOW);\n" - + "ol.addComponent(new TextField(\"Textfield caption\"));\n" - + "ol.addComponent(new Label(\"Label\"));\n"; - - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "This feature provides a container for laying out components either " - + "vertically, horizontally or flowingly. The orientation may be changed " - + "during runtime. It also defines a special style for themes to implement called \"form\"" - + "that is used for input forms where the components are laid-out side-by-side " - + "with their captions." - + "

" - + "On the demo tab you can try out how the different properties " - + "affect the presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "OrderedLayout"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeaturePanel.java b/src/com/vaadin/tests/featurebrowser/FeaturePanel.java deleted file mode 100644 index a12e51cae2..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeaturePanel.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeaturePanel extends Feature { - - public FeaturePanel() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - // Example panel - final Panel show = new Panel("Panel caption"); - show - .addComponent(new Label( - "This is an example Label component that is added into Panel.")); - l.addComponent(show); - - // Properties - propertyPanel = new PropertyPanel(show); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/Panel.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Panel show = new Panel(\"Panel caption\");\n" - + "show.addComponent(new Label(\"This is an example Label component that is added into Panel.\"));"; - - } - - @Override - protected String getDescriptionXHTML() { - return "Panel is a container for other components, by default it draws a frame around it's " - + "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."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Panel"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureParameters.java b/src/com/vaadin/tests/featurebrowser/FeatureParameters.java deleted file mode 100644 index 4bb90e02b0..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureParameters.java +++ /dev/null @@ -1,167 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.net.URL; -import java.util.Iterator; -import java.util.Map; - -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ParameterHandler; -import com.vaadin.terminal.URIHandler; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; -import com.vaadin.ui.Table; - -public class FeatureParameters extends Feature implements URIHandler, - ParameterHandler { - - private final Label context = new Label(); - - private final Label relative = new Label(); - - private final Table params = new Table(); - - public FeatureParameters() { - super(); - params.addContainerProperty("Values", String.class, ""); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Label info = new Label("To test this feature, try to " - + "add some get parameters to URL. For example if you have " - + "the feature browser installed in your local host, try url: "); - info.setCaption("Usage info"); - l.addComponent(info); - try { - final URL u1 = new URL(getApplication().getURL(), - "test/uri?test=1&test=2"); - final URL u2 = new URL(getApplication().getURL(), - "foo/bar?mary=john&count=3"); - - l.addComponent(new Link(u1.toString(), new ExternalResource(u1))); - l.addComponent(new Label("Or this: ")); - l.addComponent(new Link(u2.toString(), new ExternalResource(u2))); - } catch (final Exception e) { - System.out.println("Couldn't get hostname for this machine: " - + e.toString()); - e.printStackTrace(); - } - - // URI - final Panel p1 = new Panel("URI Handler"); - context.setCaption("Last URI handler context"); - p1.addComponent(context); - relative.setCaption("Last relative URI"); - p1.addComponent(relative); - l.addComponent(p1); - - // Parameters - final Panel p2 = new Panel("Parameter Handler"); - params.setCaption("Last parameters"); - params.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); - params.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - p2.addComponent(params); - l.addComponent(p2); - - // Properties - propertyPanel = new PropertyPanel(p1); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/Panel.html"); - - return l; - } - - @Override - protected String getDescriptionXHTML() { - return "This is a demonstration of how URL parameters can be recieved and handled." - + "Parameters and URL:s can be received trough the windows by registering " - + "URIHandler and ParameterHandler classes window."; - } - - @Override - protected String getImage() { - return "parameters.jpg"; - } - - @Override - protected String getTitle() { - return "Parameters"; - } - - /** - * Add URI and parametes handlers to window. - * - * @see com.vaadin.ui.Component#attach() - */ - @Override - public void attach() { - super.attach(); - getWindow().addURIHandler(this); - getWindow().addParameterHandler(this); - } - - /** - * Remove all handlers from window - * - * @see com.vaadin.ui.Component#detach() - */ - @Override - public void detach() { - super.detach(); - getWindow().removeURIHandler(this); - getWindow().removeParameterHandler(this); - } - - /** - * Update URI - * - * @see com.vaadin.terminal.URIHandler#handleURI(URL, String) - */ - public DownloadStream handleURI(URL context, String relativeUri) { - this.context.setValue(context.toString()); - relative.setValue(relativeUri); - return null; - } - - /** - * Update parameters table - * - * @see com.vaadin.terminal.ParameterHandler#handleParameters(Map) - */ - public void handleParameters(Map parameters) { - params.removeAllItems(); - for (final Iterator i = parameters.keySet().iterator(); i.hasNext();) { - final String name = (String) i.next(); - final String[] values = (String[]) parameters.get(name); - String v = ""; - for (int j = 0; j < values.length; j++) { - if (v.length() > 0) { - v += ", "; - } - v += "'" + values[j] + "'"; - } - params.addItem(new Object[] { v }, name); - } - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureProperties.java b/src/com/vaadin/tests/featurebrowser/FeatureProperties.java deleted file mode 100644 index 5c2b07b3e2..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureProperties.java +++ /dev/null @@ -1,92 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureProperties extends Feature { - - private static final String INTRO_TEXT = "" - + "Vaadin data model is one of the core concepts " - + "in the library and Property-interface is the base of that " - + "model. Property provides standardized API for a single data object " - + "that can be read (get) and written (set). A property is always typed, but can optionally " - + "support data type conversions. Optionally properties can provide " - + "value change events for following the state changes." - + "

The most important function of the Property as well as other " - + "data models is to connect classes implementing the interface directly to " - + "editor and viewer classes. Typically this is used to connect different " - + "data sources to UI components for editing and viewing their contents." - + "

Properties can be utilized either by implementing the interface " - + "or by using some of the existing property implementations. Vaadin " - + "includes Property interface implementations for " - + "arbitrary function pairs or Bean-properties as well as simple object " - + "properties." - + "

Many of the UI components also implement Property interface and allow " - + "setting of other components as their data-source. These UI-components " - + "include TextField, DateField, Select, Table, Button, " - + "Label and Tree."; - - public FeatureProperties() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Data Model"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Property.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureSelect.java b/src/com/vaadin/tests/featurebrowser/FeatureSelect.java deleted file mode 100644 index d38815e960..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureSelect.java +++ /dev/null @@ -1,90 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; - -public class FeatureSelect extends Feature { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Robert", "Paula", - "Lenny", "Kenny", "Nathan", "Nicole", "Laura", "Jos", "Josie", - "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Adams", "Black", "Wilson", "Richards", "Thompson", - "McGoff", "Halas", "Jones", "Beck", "Sheridan", "Picard", "Hill", - "Fielding", "Einstein" }; - - public FeatureSelect() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Select s = new Select("Select employee"); - for (int i = 0; i < 50; i++) { - s - .addItem(firstnames[(int) (Math.random() * (firstnames.length - 1))] - + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]); - } - l.addComponent(s); - - // Properties - propertyPanel = new PropertyPanel(s); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("optiongroup").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("optiongroup"); - themes.addItem("twincol").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("twincol"); - - setJavadocURL("ui/Select.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Select s = new Select(\"Select Car\");\n" - + "s.addItem(\"Audi\");\n" + "s.addItem(\"BMW\");\n" - + "s.addItem(\"Chrysler\");\n" + "s.addItem(\"Volvo\");\n"; - - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "The select component combines two different modes of item selection. " - + "Firstly it presents the single selection mode, which is usually represented as " - + "either a drop-down menu or a radio-group of switches, secondly it " - + "allows for multiple item selection, this is usually represented as either a " - + "listbox of selectable items or as a group of checkboxes." - + "

" - + "Data source can be associated both with selected item and the list of selections. " - + "This way you can easily present a selection based on items specified elsewhere in application. " - + "

" - + "On the demo tab you can try out how the different properties affect the" - + " presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Select"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java b/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java deleted file mode 100644 index 5dd686e60e..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureTabSheet.java +++ /dev/null @@ -1,75 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TabSheet; - -public class FeatureTabSheet extends Feature { - - public FeatureTabSheet() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final TabSheet ts = new TabSheet(); - ts - .addTab( - new Label( - "This is an example Label component that is added into Tab 1."), - "Tab 1 caption", null); - ts - .addTab( - new Label( - "This is an example Label component that is added into Tab 2."), - "Tab 2 caption", null); - ts - .addTab( - new Label( - "This is an example Label component that is added into Tab 3."), - "Tab 3 caption", null); - l.addComponent(ts); - - // Properties - propertyPanel = new PropertyPanel(ts); - - setJavadocURL("ui/TabSheet.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "TabSheet ts = new TabSheet();\n" - + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 1.\"),\"Tab 1 caption\",null);\n" - + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 2.\"),\"Tab 2 caption\",null);\n" - + "ts.addTab(new Label(\"This is an example Label component that is added into Tab 3.\"),\"Tab 3 caption\",null);"; - } - - @Override - protected String getDescriptionXHTML() { - return "A multicomponent container with tabs for switching between them.
" - + "In the normal case, one would place a layout component on each tab.

" - + "On the demo tab you can try out how the different properties affect " - + "the presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "TabSheet"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTable.java b/src/com/vaadin/tests/featurebrowser/FeatureTable.java deleted file mode 100644 index ecc000320b..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureTable.java +++ /dev/null @@ -1,195 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.event.Action; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Table; - -public class FeatureTable extends Feature implements Action.Handler { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; - - private static final String[] title = new String[] { "Project Manager", - "Marketing Manager", "Sales Manager", "Trainer", "IT Support", - "Account Manager", "Customer Support", "Testing Engineer", - "Software Designer", "Programmer", "Consultant" }; - - private static final String[] unit = new String[] { "Tokyo", "Mexico City", - "Seoul", "New York", "Sao Paulo", "Bombay", "Delhi", "Shanghai", - "Los Angeles", "London", "Bangalore", "Hong Kong", "Madrid", - "Milano", "Beijing", "Paris", "Moscow", "Helsinki" }; - - private Table t; - - private boolean actionsActive = false; - - private final Button actionHandlerSwitch = new Button("Activate actions", - this, "toggleActions"); - - public void toggleActions() { - if (actionsActive) { - t.removeActionHandler(this); - actionsActive = false; - actionHandlerSwitch.setCaption("Activate Actions"); - } else { - t.addActionHandler(this); - actionsActive = true; - actionHandlerSwitch.setCaption("Deactivate Actions"); - } - } - - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - // Sample table - t = new Table("Corporate Employees"); - t.setPageLength(10); - l.addComponent(t); - - // Add columns to table - t.addContainerProperty("Firstname", String.class, ""); - t.addContainerProperty("Lastname", String.class, ""); - t.addContainerProperty("Title", String.class, ""); - t.addContainerProperty("Unit", String.class, ""); - - // set alignments to demonstrate features - t.setColumnAlignment("Title", Table.ALIGN_CENTER); - t.setColumnAlignment("Unit", Table.ALIGN_RIGHT); - - // Add random rows to table - for (int j = 0; j < 300; j++) { - t - .addItem( - new Object[] { - firstnames[(int) (Math.random() * (firstnames.length - 1))], - lastnames[(int) (Math.random() * (lastnames.length - 1))], - title[(int) (Math.random() * title.length)], - unit[(int) (Math.random() * unit.length)] }, - new Integer(j)); - } - - // Actions - l.addComponent(actionHandlerSwitch); - - // Properties - propertyPanel = new PropertyPanel(t); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "pageLength", "rowHeaderMode", "selectable", - "columnHeaderMode", "columnCollapsingAllowed", - "columnReorderingAllowed", "width", "height" }); - ap.replaceWithSelect("columnHeaderMode", new Object[] { - new Integer(Table.COLUMN_HEADER_MODE_EXPLICIT), - new Integer(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID), - new Integer(Table.COLUMN_HEADER_MODE_HIDDEN), - new Integer(Table.COLUMN_HEADER_MODE_ID) }, new Object[] { - "Explicit", "Explicit defaults ID", "Hidden", "ID" }); - ap.replaceWithSelect("rowHeaderMode", new Object[] { - new Integer(Table.ROW_HEADER_MODE_EXPLICIT), - new Integer(Table.ROW_HEADER_MODE_EXPLICIT_DEFAULTS_ID), - new Integer(Table.ROW_HEADER_MODE_HIDDEN), - new Integer(Table.ROW_HEADER_MODE_ICON_ONLY), - new Integer(Table.ROW_HEADER_MODE_ID), - new Integer(Table.ROW_HEADER_MODE_INDEX), - new Integer(Table.ROW_HEADER_MODE_ITEM), - new Integer(Table.ROW_HEADER_MODE_PROPERTY) }, new Object[] { - "Explicit", "Explicit defaults ID", "Hidden", "Icon only", - "ID", "Index", "Item", "Property" }); - - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("list").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("list"); - themes.addItem("paging").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("paging"); - - propertyPanel.addProperties("Table Properties", ap); - - // Set first name as item caption propertyId in cas somebody - // selecs it - t.setItemCaptionPropertyId("Firstname"); - - // this overrides previous - t.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - t.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_EXPLICIT_DEFAULTS_ID); - - t.setColumnCollapsingAllowed(true); - t.setColumnReorderingAllowed(true); - t.setSelectable(true); - - setJavadocURL("ui/Table.html"); - - return l; - } - - protected String getExampleSrc() { - return "// Sample table\n" - + "t = new Table(\"Corporate Employees\");\n" - + "t.setPageLength(10);\n\n" - + "// Add columns to table\n" - + "t.addContainerProperty(\"Firstname\", String.class, \"\");\n" - + "t.addContainerProperty(\"Lastname\", String.class, \"\");\n" - + "t.addContainerProperty(\"Age\", String.class, \"\");\n" - + "t.addContainerProperty(\"Title\", String.class, \"\");\n" - + "t.addContainerProperty(\"Unit\", String.class, \"\");\n\n" - + "// Add random rows to table\n" - + "for (int j = 0; j < 50; j++) {\n" + " t.addItem(\n" - + " new Object[] {\n" - + " firstnames[(int) (Math.random() * 9)],\n" - + " lastnames[(int) (Math.random() * 9)],\n" - + " title[(int) (Math.random() * title.length)],\n" - + " unit[(int) (Math.random() * unit.length)] },\n" - + " new Integer(j));\n" + "}\n"; - } - - protected String getDescriptionXHTML() { - - return "The Table component is designed for displaying large volumes of tabular data, " - + "in multiple pages whenever needed." - + "

Selection of the displayed data is supported both in selecting exclusively one row " - + "or multiple rows at the same time. For each row, there may be a set of actions associated, " - + "depending on the theme these actions may be displayed either as a drop-down " - + "menu for each row or a set of command buttons." - + "

Table may be connected to any datasource implementing the Container interface." - + "This way data found in external datasources can be directly presented in the table component." - + "

" - + "Table implements a number of features and you can test most of them in the table demo tab."; - } - - protected String getImage() { - return "icon_demo.png"; - } - - protected String getTitle() { - return "Table"; - } - - private final Action ACTION1 = new Action("Action 1"); - - private final Action ACTION2 = new Action("Action 2"); - - private final Action ACTION3 = new Action("Action 3"); - - private final Action[] actions = new Action[] { ACTION1, ACTION2, ACTION3 }; - - public Action[] getActions(Object target, Object sender) { - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - t.setDescription("Last action clicked was '" + action.getCaption() - + "' on item '" + t.getItem(target).toString() + "'"); - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTextField.java b/src/com/vaadin/tests/featurebrowser/FeatureTextField.java deleted file mode 100644 index f2612ec857..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureTextField.java +++ /dev/null @@ -1,73 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; - -public class FeatureTextField extends Feature { - - public FeatureTextField() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - - // Test component - final TextField tf = new TextField("Caption"); - l.addComponent(tf); - - // Properties - propertyPanel = new PropertyPanel(tf); - final Form f = propertyPanel.createBeanPropertySet(new String[] { - "columns", "rows", "wordwrap", "writeThrough", "readThrough", - "nullRepresentation", "nullSettingAllowed", "secret" }); - propertyPanel.addProperties("Text field properties", f); - - setJavadocURL("ui/TextField.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "TextField tf = new TextField(\"Caption\");\n" - + "tf.setValue(\"Contents\");"; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "TextField combines the logic of both the single line text-entry field and the multi-line " - + "text-area into one component. " - + "As with all Data-components of Vaadin, the TextField can also be bound to an " - + "underlying data source, both directly or in a buffered (asynchronous) " - + "mode. In buffered mode its background color will change to indicate " - + "that the value has changed but is not committed." - + "

Furthermore a validators may be bound to the component to " - + "check and validate the given input before it is actually committed." - + "

On the demo tab you can try out how the different properties affect the " - + "presentation of the component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "TextField"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureTree.java b/src/com/vaadin/tests/featurebrowser/FeatureTree.java deleted file mode 100644 index 368b2df0f7..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureTree.java +++ /dev/null @@ -1,174 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.util.Iterator; - -import com.vaadin.event.Action; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Tree; - -public class FeatureTree extends Feature implements Action.Handler { - - private static final String[] firstnames = new String[] { "John", "Mary", - "Joe", "Sarah", "Jeff", "Jane", "Peter", "Marc", "Josie", "Linus" }; - - private static final String[] lastnames = new String[] { "Torvalds", - "Smith", "Jones", "Beck", "Sheridan", "Picard", "Hill", "Fielding", - "Einstein" }; - - private Tree t; - - private boolean actionsActive = false; - - private final Button actionHandlerSwitch = new Button("Activate actions", - this, "toggleActions"); - - public FeatureTree() { - super(); - } - - public void toggleActions() { - if (actionsActive) { - t.removeActionHandler(this); - actionsActive = false; - actionHandlerSwitch.setCaption("Activate Actions"); - } else { - t.addActionHandler(this); - actionsActive = true; - actionHandlerSwitch.setCaption("Deactivate Actions"); - } - } - - public void expandAll() { - for (final Iterator i = t.rootItemIds().iterator(); i.hasNext();) { - t.expandItemsRecursively(i.next()); - } - } - - public void collapseAll() { - for (final Iterator i = t.rootItemIds().iterator(); i.hasNext();) { - t.collapseItemsRecursively(i.next()); - } - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final String[] names = new String[100]; - for (int i = 0; i < names.length; i++) { - names[i] = firstnames[(int) (Math.random() * (firstnames.length - 1))] - + " " - + lastnames[(int) (Math.random() * (lastnames.length - 1))]; - } - - // Create tree - t = new Tree("Organization Structure"); - for (int i = 0; i < 100; i++) { - t.addItem(names[i]); - final String parent = names[(int) (Math.random() * (names.length - 1))]; - if (t.containsId(parent)) { - t.setParent(names[i], parent); - } - } - - // Forbid childless people to have children (makes them leaves) - for (int i = 0; i < 100; i++) { - if (!t.hasChildren(names[i])) { - t.setChildrenAllowed(names[i], false); - } - } - - l.addComponent(t); - - // Actions - l.addComponent(actionHandlerSwitch); - - // Expand and Collapse buttons - l.addComponent(new Button("Expand All", this, "expandAll")); - l.addComponent(new Button("Collapse All", this, "collapseAll")); - - // Properties - propertyPanel = new PropertyPanel(t); - final Form ap = propertyPanel - .createBeanPropertySet(new String[] { "selectable" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("menu").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("menu"); - propertyPanel.addProperties("Tree Properties", ap); - - setJavadocURL("ui/Tree.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "// Create tree\n" - + "t = new Tree(\"Organization Structure\");\n" - + "for (int i = 0; i < 100; i++) {\n" - + " t.addItem(names[i]);\n" - + " String parent = names[(int) (Math.random() * (names.length - 1))];\n" - + " if (t.containsId(parent)) \n" - + " t.setParent(names[i],parent);\n" - + "}\n\n" - + "// Forbid childless people to have children (makes them leaves)\n" - + "for (int i = 0; i < 100; i++)\n" - + " if (!t.hasChildren(names[i]))\n" - + " t.setChildrenAllowed(names[i], false);\n"; - } - - @Override - protected String getDescriptionXHTML() { - return "A tree is a natural way to represent datasets that have" - + " hierarchical relationships, such as filesystems, message " - + "threads or, as in this example, organization structure. Vaadin features a versatile " - + "and powerful Tree component that works much like the tree components " - + "of most modern operating systems." - + "

The most prominent use of the Tree component is to " - + "use it for displaying a hierachical menu, like the " - + "menu on the left side of the screen for instance " - + "or to display filesystems or other hierarchical datasets." - + "

The tree component uses Container " - + "datasources much like the Table component, " - + "with the addition that it also utilizes the hierarchy " - + "information maintained by the container." - + "

On the demo tab you can try out how the different properties " - + "affect the presentation of the tree component."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Tree"; - } - - private final Action ACTION1 = new Action("Action 1"); - - private final Action ACTION2 = new Action("Action 2"); - - private final Action ACTION3 = new Action("Action 3"); - - private final Action[] actions = new Action[] { ACTION1, ACTION2, ACTION3 }; - - public Action[] getActions(Object target, Object sender) { - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - t.setDescription("Last action clicked was '" + action.getCaption() - + "' on item '" + target + "'"); - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureUpload.java b/src/com/vaadin/tests/featurebrowser/FeatureUpload.java deleted file mode 100644 index 2dd586d7b8..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureUpload.java +++ /dev/null @@ -1,150 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.io.ByteArrayInputStream; -import java.io.ByteArrayOutputStream; -import java.io.InputStream; -import java.io.OutputStream; - -import com.vaadin.terminal.StreamResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.Link; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Upload; -import com.vaadin.ui.Upload.FinishedEvent; - -public class FeatureUpload extends Feature implements Upload.FinishedListener { - Buffer buffer = new Buffer(); - - Panel status = new Panel("Uploaded file:"); - - public FeatureUpload() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Upload up = new Upload("Upload", buffer); - up.setImmediate(true); - up.addListener(this); - - status.setVisible(false); - - l.addComponent(up); - l.addComponent(status); - - // Properties - propertyPanel = new PropertyPanel(up); - - setJavadocURL("ui/Upload.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return "Upload u = new Upload(\"Upload a file:\", uploadReceiver);\n\n" - + "public class uploadReceiver \n" - + "implements Upload.receiver, Upload.FinishedListener { \n" - + "\n" + " java.io.File file;\n" - + " java.io.FileOutputStream fos;\n" - + " public uploadReceiver() {\n" + " }"; - - } - - @Override - protected String getDescriptionXHTML() { - return "This demonstrates the use of the Upload component together with the Link component. " - + "This implementation does not actually store the file to disk, it only keeps it in a buffer. " - + "The example given on the Code Sample-tab on the other hand stores the file to disk and binds the link to that file."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Upload"; - } - - public void uploadFinished(FinishedEvent event) { - status.removeAllComponents(); - if (buffer.getStream() == null) { - status.addComponent(new Label( - "Upload finished, but output buffer is null!!")); - } else { - status - .addComponent(new Label("Name: " - + event.getFilename(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Mimetype: " - + event.getMIMEType(), Label.CONTENT_XHTML)); - status.addComponent(new Label("Size: " + event.getLength() - + " bytes.", Label.CONTENT_XHTML)); - - status.addComponent(new Link("Download " + buffer.getFileName(), - new StreamResource(buffer, buffer.getFileName(), - getApplication()))); - - status.setVisible(true); - } - } - - public class Buffer implements StreamResource.StreamSource, Upload.Receiver { - ByteArrayOutputStream outputBuffer = null; - - String mimeType; - - String fileName; - - public Buffer() { - - } - - public InputStream getStream() { - if (outputBuffer == null) { - return null; - } - return new ByteArrayInputStream(outputBuffer.toByteArray()); - } - - /** - * @see com.vaadin.ui.Upload.Receiver#receiveUpload(String, - * String) - */ - public OutputStream receiveUpload(String filename, String MIMEType) { - fileName = filename; - mimeType = MIMEType; - outputBuffer = new ByteArrayOutputStream(); - return outputBuffer; - } - - /** - * Returns the fileName. - * - * @return String - */ - public String getFileName() { - return fileName; - } - - /** - * Returns the mimeType. - * - * @return String - */ - public String getMimeType() { - return mimeType; - } - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/featurebrowser/FeatureUtil.java b/src/com/vaadin/tests/featurebrowser/FeatureUtil.java deleted file mode 100644 index 077ee4fbe5..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureUtil.java +++ /dev/null @@ -1,37 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.text.SimpleDateFormat; -import java.util.Date; - -public class FeatureUtil { - - private static boolean statistics = false; - - public static final SimpleDateFormat format = new SimpleDateFormat( - "yyyyMMdd HHmmss"); - - public static void debug(String userIdentity, String msg) { - if (statistics) { - System.out.println("[" + userIdentity + "] " + msg); - } - } - - public static String getTimestamp() { - if (statistics) { - try { - return format.format(new Date()); - } catch (final Exception e) { - // ignored, should never happen - } - } - return ""; - } - - public static void setStatistics(boolean statistics) { - FeatureUtil.statistics = statistics; - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureValidators.java b/src/com/vaadin/tests/featurebrowser/FeatureValidators.java deleted file mode 100644 index 5f251929a5..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureValidators.java +++ /dev/null @@ -1,87 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class FeatureValidators extends Feature { - - private static final String INTRO_TEXT = "" - + "Vaadin contains simple, yet powerful validation interface, " - + "that consists of two parts: Validator and Validatable. Validator is " - + "any class that can check validity of an Object. Validatable is " - + "a class with configurable validation. " - + "Validation errors are passed as special exceptions that implement " - + "ErrorMessage interface. This way the validation errors can be " - + "automatically added to components." - + "

Utilities for simple string and null validation are provided, as " - + "well as combinative validators. The validation interface can also " - + "be easily implemented by the applications for more complex " - + "validation needs."; - - public FeatureValidators() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Validators"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Validator.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/FeatureWindow.java b/src/com/vaadin/tests/featurebrowser/FeatureWindow.java deleted file mode 100644 index 0153bf5a0e..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeatureWindow.java +++ /dev/null @@ -1,146 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Window.CloseEvent; - -public class FeatureWindow extends Feature implements Window.CloseListener { - - private final Button addButton = new Button("Add window", this, "addWin"); - - private final Button removeButton = new Button("Remove window", this, - "delWin"); - - private Window demoWindow; - - private Form windowProperties; - - public FeatureWindow() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout layoutRoot = new OrderedLayout(); - final OrderedLayout layoutUpper = new OrderedLayout(); - final OrderedLayout layoutLower = new OrderedLayout(); - - demoWindow = new Window("Feature Test Window"); - demoWindow.addListener(this); - demoWindow.setWidth("400px"); - demoWindow.setHeight("200px"); - demoWindow.setTheme("runo"); - - layoutUpper.addComponent(addButton); - layoutUpper.addComponent(removeButton); - - updateWinStatus(); - - // Properties - propertyPanel = new PropertyPanel(demoWindow); - windowProperties = propertyPanel.createBeanPropertySet(new String[] { - "width", "height", "name", "theme", "border", "scrollable", }); - windowProperties.replaceWithSelect("border", new Object[] { - new Integer(Window.BORDER_DEFAULT), - new Integer(Window.BORDER_NONE), - new Integer(Window.BORDER_MINIMAL) }, new Object[] { "Default", - "None", "Minimal" }); - // Disabled, not applicable for default theme - windowProperties.getField("border").setEnabled(false); - windowProperties.getField("scrollable").setEnabled(false); - - propertyPanel.addProperties("Window Properties", windowProperties); - windowProperties.getField("width").setDescription( - "Minimum width is 100"); - windowProperties.getField("height").setDescription( - "Minimum height is 100"); - - setJavadocURL("ui/Window.html"); - - layoutRoot.addComponent(layoutUpper); - layoutRoot.addComponent(layoutLower); - return layoutRoot; - } - - @Override - protected String getExampleSrc() { - return "Window win = new Window();\n" - + "getApplication().addWindow(win);\n"; - - } - - @Override - protected String getDescriptionXHTML() { - return "The window support in Vaadin allows for opening and closing windows, " - + "refreshing one window from another (for asynchronous terminals), " - + "resizing windows and scrolling window content. " - + "There are also a number of preset window border styles defined by " - + "this feature."; - } - - @Override - protected String getImage() { - return "icon_demo.png"; - } - - @Override - protected String getTitle() { - return "Window"; - } - - public void addWin() { - - propertyPanel.commit(); - - getApplication().getMainWindow().addWindow(demoWindow); - - demoWindow.removeAllComponents(); - - demoWindow - .addComponent(new Label( - "

This is a new window created by " - + "Add window" - + " button's event.

You may simply" - + " close this window or select " - + "Remove window from the Feature Browser window.", - Label.CONTENT_XHTML)); - // prevent user to change window name tag (after window is - // created) - windowProperties.getField("name").setEnabled(false); - windowProperties.getField("name").setReadOnly(true); - demoWindow.setVisible(true); - updateWinStatus(); - } - - public void delWin() { - getApplication().getMainWindow().removeWindow(demoWindow); - // allow user to change window name tag (before window is - // created) - windowProperties.getField("name").setEnabled(true); - windowProperties.getField("name").setReadOnly(false); - updateWinStatus(); - } - - private void updateWinStatus() { - if (demoWindow.getApplication() == null) { - addButton.setEnabled(true); - removeButton.setEnabled(false); - } else { - addButton.setEnabled(false); - removeButton.setEnabled(true); - } - } - - public void windowClose(CloseEvent e) { - delWin(); - } -} diff --git a/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java b/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java deleted file mode 100644 index 2d3ac436ad..0000000000 --- a/src/com/vaadin/tests/featurebrowser/FeaturesApplication.java +++ /dev/null @@ -1,34 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Window; - -public class FeaturesApplication extends com.vaadin.Application { - - @Override - public void init() { - if (getProperty("statistics") != null) { - FeatureUtil.setStatistics(true); - } - setUser(new Long(System.currentTimeMillis()).toString()); - final Window main = new Window("Vaadin Features Tour"); - setMainWindow(main); - - main.setLayout(new FeatureBrowser()); - } - - /** - * ErrorEvents are printed to default error stream and not in GUI. - */ - @Override - public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { - final Throwable e = event.getThrowable(); - FeatureUtil.debug(getUser().toString(), "terminalError: " - + e.toString()); - e.printStackTrace(); - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroBasic.java b/src/com/vaadin/tests/featurebrowser/IntroBasic.java deleted file mode 100644 index 5d480c106a..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroBasic.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroBasic extends Feature { - - private static final String INTRO_TEXT = "" - + "Text Field, Date Field, Button, Form, Label and Link components are provided as samples" - + " for basic UI components." - + "

See the API documentation of respective components for more information."; - - public IntroBasic() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Basic UI components"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/package-summary.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return "Introduction of basic UI components"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroComponents.java b/src/com/vaadin/tests/featurebrowser/IntroComponents.java deleted file mode 100644 index c4898a7fcc..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroComponents.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.terminal.ClassResource; -import com.vaadin.ui.Component; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroComponents extends Feature { - - private static final String INTRO_TEXT = "" - + "This picture summarizes the relations between different user interface (UI) components." - + "

See API documentation below for more information."; - - public IntroComponents() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("UI component diagram"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - panel.addComponent(new Embedded("", new ClassResource("components.png", - getApplication()))); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/package-summary.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java b/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java deleted file mode 100644 index d164442d4c..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroDataHandling.java +++ /dev/null @@ -1,78 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroDataHandling extends Feature { - - private static final String INTRO_TEXT = "" - + "Embedded Objects and Upload components are provided as samples" - + " for data handling section." - + "

See the API documentation of respective components for more information."; - - public IntroDataHandling() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Data Handling"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return "Please select Embedded Objects or Upload" - + " from the menu for more information."; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroDataModel.java b/src/com/vaadin/tests/featurebrowser/IntroDataModel.java deleted file mode 100644 index b4fb8f6757..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroDataModel.java +++ /dev/null @@ -1,80 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroDataModel extends Feature { - - private static final String INTRO_TEXT = "" - + "This section introduces main concepts of data model in Vaadin." - + " It contains brief introduction to Properties, Items, Containers, Validators and" - + " Buffering classes." - + "

See the API documentation of respective area for more information."; - - public IntroDataModel() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Data Model"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/package-summary.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java b/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java deleted file mode 100644 index db9909946c..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroItemContainers.java +++ /dev/null @@ -1,79 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroItemContainers extends Feature { - - private static final String INTRO_TEXT = "" - + "Select, Table and Tree components are provided as samples" - + " for item containers section." - + "

See the API documentation of respective components for more information."; - - public IntroItemContainers() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Item Containers"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("data/Container.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroLayouts.java b/src/com/vaadin/tests/featurebrowser/IntroLayouts.java deleted file mode 100644 index bd180a860c..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroLayouts.java +++ /dev/null @@ -1,81 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroLayouts extends Feature { - - private static final String INTRO_TEXT = "" - + "Layouts are required to place components to specific place in the UI." - + " You can use plain Java to accomplish sophisticated component layouting." - + " Other option is to use Custom Layout and let the web page designers" - + " to take responsibility of component layouting using their own set of tools." - + "

See API documentation below for more information."; - - public IntroLayouts() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Panel panel = new Panel(); - panel.setCaption("Layouts"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(INTRO_TEXT); - - // Properties - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("ui/Layout.html"); - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return null; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return null; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroTerminal.java b/src/com/vaadin/tests/featurebrowser/IntroTerminal.java deleted file mode 100644 index 8bb4a3f145..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroTerminal.java +++ /dev/null @@ -1,55 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; - -public class IntroTerminal extends Feature { - - public IntroTerminal() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - final Label lab = new Label(); - lab.setStyle("featurebrowser-none"); - l.addComponent(lab); - - // Properties - propertyPanel = null; - - return l; - } - - @Override - protected String getExampleSrc() { - return null; - } - - /** - * @see com.vaadin.tests.featurebrowser.Feature#getDescriptionXHTML() - */ - @Override - protected String getDescriptionXHTML() { - return ""; - } - - @Override - protected String getImage() { - return null; - } - - @Override - protected String getTitle() { - return "Introduction for terminals (TODO)"; - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/IntroWelcome.java b/src/com/vaadin/tests/featurebrowser/IntroWelcome.java deleted file mode 100644 index d9c20b96b2..0000000000 --- a/src/com/vaadin/tests/featurebrowser/IntroWelcome.java +++ /dev/null @@ -1,173 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.net.URL; -import java.util.Date; -import java.util.Iterator; -import java.util.Map; - -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ParameterHandler; -import com.vaadin.terminal.URIHandler; -import com.vaadin.terminal.gwt.server.ApplicationServlet; -import com.vaadin.ui.Component; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -public class IntroWelcome extends Feature implements URIHandler, - ParameterHandler { - - Panel panel = new Panel(); - - private static final String WELCOME_TEXT_UPPER = "" - + "This application lets you view and play with some features of " - + "Vaadin. Use menu on the left to select component." - + "

Note the Properties selection on the top " - + "right corner. Click it open to access component properties and" - + " feel free to edit properties at any time." - + "

The area that you are now reading is the component" - + " demo area. Lower area from here contains component description, API" - + " documentation and optional code sample. Note that not all selections" - + " contain demo, only description and API documentation is shown." - + "

You may also change application's theme from below the menu." - + " This example application is designed to work best with" - + " Demo theme, other themes are for demonstration purposes only." - + "

Vaadin enables you to construct complex Web" - + " applications using plain Java, no knowledge of other Web technologies" - + " such as XML, HTML, DOM, JavaScript or browser differences is required." - + "

For more information, point your browser to" - + " www.vaadin.com."; - - private static final String WELCOME_TEXT_LOWER = "" - + "This area contains the selected component's description, list of properties, javadoc" - + " and optional code sample. " - + "Start your tour now by selecting features from the list" - + " on the left and remember to experiment with the Properties panel" - + " located at the top right corner area."; - - // TODO Add browser agent string - private final String description = WELCOME_TEXT_LOWER - + "

Vaadin version: " + ApplicationServlet.VERSION; - - public IntroWelcome() { - super(); - } - - @Override - protected Component getDemoComponent() { - - final OrderedLayout l = new OrderedLayout(); - - panel.setCaption("Welcome to the Vaadin feature tour!"); - l.addComponent(panel); - - final Label label = new Label(); - panel.addComponent(label); - - label.setContentMode(Label.CONTENT_XHTML); - label.setValue(WELCOME_TEXT_UPPER); - - propertyPanel = new PropertyPanel(panel); - final Form ap = propertyPanel.createBeanPropertySet(new String[] { - "width", "height" }); - final Select themes = (Select) propertyPanel.getField("style"); - themes.addItem("light").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("light"); - themes.addItem("strong").getItemProperty( - themes.getItemCaptionPropertyId()).setValue("strong"); - propertyPanel.addProperties("Panel Properties", ap); - - setJavadocURL("package-summary.html"); - - setPropsReminder(false); - - return l; - } - - @Override - protected String getExampleSrc() { - return "" + "package com.vaadin.demo;\n" - + "import com.vaadin.ui.*;\n\n" - + "public class HelloWorld extends com.vaadin.Application {\n" - + " public void init() {\n" - + " Window main = new Window(\"Hello window\");\n" - + " setMainWindow(main);\n" - + " main.addComponent(new Label(\"Hello World!\"));\n" - + " }\n" + "}\n"; - } - - // not ready yet to give description, see paint instead - @Override - protected String getDescriptionXHTML() { - return description; - } - - @Override - protected String getImage() { - return "icon_intro.png"; - } - - @Override - protected String getTitle() { - return "Welcome"; - } - - /** - * Add URI and parametes handlers to window. - * - * @see com.vaadin.ui.Component#attach() - */ - @Override - public void attach() { - super.attach(); - getWindow().addURIHandler(this); - getWindow().addParameterHandler(this); - } - - /** - * Remove all handlers from window - * - * @see com.vaadin.ui.Component#detach() - */ - @Override - public void detach() { - super.detach(); - getWindow().removeURIHandler(this); - getWindow().removeParameterHandler(this); - } - - /** - * Update URI - * - * @see com.vaadin.terminal.URIHandler#handleURI(URL, String) - */ - public DownloadStream handleURI(URL context, String relativeUri) { - return null; - } - - /** - * Show system status if systemStatus is given on URL - * - * @see com.vaadin.terminal.ParameterHandler#handleParameters(Map) - */ - public void handleParameters(Map parameters) { - for (final Iterator i = parameters.keySet().iterator(); i.hasNext();) { - final String name = (String) i.next(); - if (name.equals("systemStatus")) { - String status = ""; - status += "timestamp=" + new Date() + " "; - status += "free=" + Runtime.getRuntime().freeMemory() + ", "; - status += "total=" + Runtime.getRuntime().totalMemory() + ", "; - status += "max=" + Runtime.getRuntime().maxMemory() + "\n"; - System.out.println(status); - } - } - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/PropertyPanel.java b/src/com/vaadin/tests/featurebrowser/PropertyPanel.java deleted file mode 100644 index 5e105dbf1e..0000000000 --- a/src/com/vaadin/tests/featurebrowser/PropertyPanel.java +++ /dev/null @@ -1,512 +0,0 @@ -/* -@ITMillApache2LicenseForJavaFiles@ - */ - -package com.vaadin.tests.featurebrowser; - -import java.beans.BeanInfo; -import java.beans.IntrospectionException; -import java.beans.Introspector; -import java.beans.PropertyDescriptor; -import java.util.Date; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Property; -import com.vaadin.data.util.BeanItem; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.AbstractComponentContainer; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; - -public class PropertyPanel extends Panel implements Button.ClickListener, - Property.ValueChangeListener { - - private Select addComponent; - - private final OrderedLayout formsLayout = new OrderedLayout(); - - private final LinkedList forms = new LinkedList(); - - private final Button setButton = new Button("Set", this); - - private final Button discardButton = new Button("Discard changes", this); - - private final Table allProperties = new Table(); - - private final Object objectToConfigure; - - private final BeanItem config; - - protected static final int COLUMNS = 3; - - /** Contruct new property panel for configuring given object. */ - public PropertyPanel(Object objectToConfigure) { - super(); - getLayout().setMargin(false); - - // Layout - setCaption("Properties"); - addComponent(formsLayout); - - setSizeFull(); - - // Target object - this.objectToConfigure = objectToConfigure; - config = new BeanItem(objectToConfigure); - - // Control buttons - final OrderedLayout buttons = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - buttons.setMargin(false, true, true, true); - buttons.addComponent(setButton); - buttons.addComponent(discardButton); - addComponent(buttons); - - // Add default properties - addBasicComponentProperties(); - if (objectToConfigure instanceof Select) { - addSelectProperties(); - } - if (objectToConfigure instanceof AbstractField - && !(objectToConfigure instanceof Table || objectToConfigure instanceof Tree)) { - addFieldProperties(); - } - if ((objectToConfigure instanceof AbstractComponentContainer)) { - addComponentContainerProperties(); - } - - // The list of all properties - allProperties.addContainerProperty("Name", String.class, ""); - allProperties.addContainerProperty("Type", String.class, ""); - allProperties.addContainerProperty("R/W", String.class, ""); - allProperties.addContainerProperty("Demo", String.class, ""); - allProperties.setColumnAlignments(new String[] { Table.ALIGN_LEFT, - Table.ALIGN_LEFT, Table.ALIGN_CENTER, Table.ALIGN_CENTER }); - allProperties.setColumnHeaderMode(Table.COLUMN_HEADER_MODE_ID); - allProperties.setPageLength(0); - allProperties.setSizeFull(); - updatePropertyList(); - - } - - /** Add a formful of properties to property panel */ - public void addProperties(String propertySetCaption, Form properties) { - - // Create new panel containing the form - final Panel p = new Panel(); - p.setCaption(propertySetCaption); - p.setStyleName(Panel.STYLE_LIGHT); - p.addComponent(properties); - formsLayout.addComponent(p); - - // Setup buffering - properties.setWriteThrough(false); - // TODO change this to false, and test it is suitable for FeatureBrowser - // demo - properties.setReadThrough(true); - - // Maintain property lists - forms.add(properties); - updatePropertyList(); - } - - /** Recreate property list contents */ - public void updatePropertyList() { - - allProperties.removeAllItems(); - - // Collect demoed properties - final HashSet listed = new HashSet(); - for (final Iterator i = forms.iterator(); i.hasNext();) { - listed.addAll(((Form) i.next()).getItemPropertyIds()); - } - - // Resolve all properties - BeanInfo info; - try { - info = Introspector.getBeanInfo(objectToConfigure.getClass()); - } catch (final IntrospectionException e) { - throw new RuntimeException(e.toString()); - } - final PropertyDescriptor[] pd = info.getPropertyDescriptors(); - - // Fill the table - for (int i = 0; i < pd.length; i++) { - allProperties.addItem(new Object[] { pd[i].getName(), - pd[i].getPropertyType().getName(), - (pd[i].getWriteMethod() == null ? "R" : "R/W"), - (listed.contains(pd[i].getName()) ? "x" : "") }, pd[i]); - } - } - - /** Add basic properties implemented most often by abstract component */ - private void addBasicComponentProperties() { - - // Set of properties - final Form set = createBeanPropertySet(new String[] { "caption", - "icon", "componentError", "description", "enabled", "visible", - "style", "readOnly", "immediate" }); - - // Icon - set.replaceWithSelect("icon", new Object[] { null, - new ThemeResource("icon/files/file.gif") }, new Object[] { - "No icon", "Sample icon" }); - - // Component error - Throwable sampleException; - try { - throw new NullPointerException("sample exception"); - } catch (final NullPointerException e) { - sampleException = e; - } - set - .replaceWithSelect( - "componentError", - new Object[] { - null, - new UserError("Sample text error message."), - new UserError( - "

Error message formatting

Error messages can " - + "contain any UIDL formatting, like:

  • Bold" - + "
  • Italic

", - UserError.CONTENT_UIDL, - ErrorMessage.INFORMATION), - new SystemError( - "This is an example of exception error reposting", - sampleException) }, - new Object[] { "No error", "Sample text error", - "Sample Formatted error", "Sample System Error" }); - - // Style - final String currentStyle = ((Component) objectToConfigure) - .getStyleName(); - if (currentStyle == null) { - set.replaceWithSelect("style", new Object[] { null }, - new Object[] { "Default" }).setNewItemsAllowed(true); - } else { - set.replaceWithSelect("style", new Object[] { null, currentStyle }, - new Object[] { "Default", currentStyle }) - .setNewItemsAllowed(true); - } - - // Set up descriptions - set - .getField("caption") - .setDescription( - "Component caption is the title of the component. Usage of the caption is optional and the " - + "exact behavior of the propery is defined by the component. Setting caption null " - + "or empty disables the caption."); - set - .getField("enabled") - .setDescription( - "Enabled property controls the usage of the component. If the component is disabled (enabled=false)," - + " it can not receive any events from the terminal. In most cases it makes the usage" - + " of the component easier, if the component visually looks disbled (for example is grayed), " - + "when it can not be used."); - set - .getField("icon") - .setDescription( - "Icon of the component selects the main icon of the component. The usage of the icon is identical " - + "to caption and in most components caption and icon are kept together. Icons can be " - + "loaded from any resources (see Terminal/Resources for more information). Some components " - + "contain more than just the captions icon. Those icons are controlled through their " - + "own properties."); - set - .getField("visible") - .setDescription( - "Visibility property says if the component is renreded or not. Invisible components are implicitly " - + "disabled, as there is no visible user interface to send event."); - set - .getField("description") - .setDescription( - "Description is designed to allow easy addition of short tooltips, like this. Like the caption," - + " setting description null or empty disables the description."); - set - .getField("readOnly") - .setDescription( - "Those components that have internal state that can be written are settable to readOnly-mode," - + " where the object can only be read, not written."); - set - .getField("componentError") - .setDescription( - "Vaadin supports extensive error reporting. One part of the error reporting are component" - + " errors that can be controlled by the programmer. This example only contains couple of " - + "sample errors; to get the full picture, read browse ErrorMessage-interface implementors " - + "API documentation."); - set - .getField("immediate") - .setDescription( - "Not all terminals can send the events immediately to server from all action. Web is the most " - + "typical environment where many events (like textfield changed) are not sent to server, " - + "before they are explicitly submitted. Setting immediate property true (by default this " - + "is false for most components), the programmer can assure that the application is" - + " notified as soon as possible about the value change in this component."); - set - .getField("style") - .setDescription( - "Themes specify the overall looks of the user interface. In addition component can have a set of " - + "styles, that can be visually very different (like datefield calendar- and text-styles), " - + "but contain the same logical functionality. As a rule of thumb, theme specifies if a " - + "component is blue or yellow and style determines how the component is used."); - - // Add created fields to property panel - addProperties("Component Basics", set); - - // Customization for Window component - if (objectToConfigure instanceof Window) { - disableField(set.getField("enabled"), new Boolean(true)); - disableField(set.getField("visible"), new Boolean(true)); - disableField(set.getField("componentError")); - disableField(set.getField("icon")); - } - } - - /** Add properties for selecting */ - private void addSelectProperties() { - final Form set = createBeanPropertySet(new String[] { - "newItemsAllowed", "lazyLoading", "multiSelect" }); - addProperties("Select Properties", set); - - set.getField("multiSelect").setDescription( - "Specified if multiple items can be selected at once."); - set - .getField("newItemsAllowed") - .setDescription( - "Select component (but not Tree or Table) can allow the user to directly " - + "add new items to set of options. The new items are constrained to be " - + "strings and thus feature only applies to simple lists."); - /* - * Button ll = (Button) set.getField("lazyLoading"); ll - * .setDescription("In Ajax rendering mode select supports lazy loading - * and filtering of options."); ll.addListener((ValueChangeListener) - * this); ll.setImmediate(true); if (((Boolean) - * ll.getValue()).booleanValue()) { - * set.getField("multiSelect").setVisible(false); - * set.getField("newItemsAllowed").setVisible(false); } - */ - if (objectToConfigure instanceof Tree - || objectToConfigure instanceof Table) { - set.removeItemProperty("newItemsAllowed"); - set.removeItemProperty("lazyLoading"); - } - } - - /** Field special properties */ - private void addFieldProperties() { - // Set of properties - final Form set = createBeanPropertySet(new String[] { "required" }); - - set.addField("focus", new Button("Focus", objectToConfigure, "focus")); - set.getField("focus").setDescription( - "Focus the cursor to this field. Not all " - + "components and/or terminals support this feature."); - - addProperties("Field Features", set); - - } - - /** - * Add and remove some miscellaneous example component to/from component - * container - */ - private void addComponentContainerProperties() { - final Form set = new Form(new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL)); - - addComponent = new Select(); - addComponent.setImmediate(true); - addComponent.addItem("Add component to container"); - addComponent.setNullSelectionItemId("Add component to container"); - addComponent.addItem("Text field"); - addComponent.addItem("Option group"); - addComponent.addListener(this); - - set.addField("component adder", addComponent); - set.addField("remove all components", new Button( - "Remove all components", objectToConfigure, - "removeAllComponents")); - - addProperties("ComponentContainer Features", set); - } - - /** Value change listener for listening selections */ - public void valueChange(Property.ValueChangeEvent event) { - - // FIXME: navigation statistics - try { - FeatureUtil.debug(getApplication().getUser().toString(), - "valueChange " - + ((AbstractComponent) event.getProperty()) - .getTag() + ", " + event.getProperty()); - } catch (final Exception e) { - // ignored, should never happen - } - - // Adding components to component container - if (event.getProperty() == addComponent) { - final String value = (String) addComponent.getValue(); - - if (value != null) { - // TextField component - if (value.equals("Text field")) { - ((AbstractComponentContainer) objectToConfigure) - .addComponent(new TextField("Test field")); - } - - // DateField time style - if (value.equals("Time")) { - final DateField d = new DateField("Time", new Date()); - d - .setDescription("This is a DateField-component with text-style"); - d.setResolution(DateField.RESOLUTION_MIN); - d.setStyleName("text"); - ((AbstractComponentContainer) objectToConfigure) - .addComponent(d); - } - - // Date field calendar style - if (value.equals("Calendar")) { - final DateField c = new DateField("Calendar", new Date()); - c - .setDescription("DateField-component with calendar-style and day-resolution"); - c.setStyleName("calendar"); - c.setResolution(DateField.RESOLUTION_DAY); - ((AbstractComponentContainer) objectToConfigure) - .addComponent(c); - } - - // Select option group style - if (value.equals("Option group")) { - final OptionGroup s = new OptionGroup("Options"); - s.setDescription("Select-component with optiongroup-style"); - s.addItem("Linux"); - s.addItem("Windows"); - s.addItem("Solaris"); - s.addItem("Symbian"); - - ((AbstractComponentContainer) objectToConfigure) - .addComponent(s); - } - - addComponent.setValue(null); - } - } else if (event.getProperty() == getField("lazyLoading")) { - final boolean newValue = ((Boolean) event.getProperty().getValue()) - .booleanValue(); - final Field multiselect = getField("multiSelect"); - final Field newitems = getField("newItemsAllowed"); - if (newValue) { - newitems.setValue(Boolean.FALSE); - newitems.setVisible(false); - multiselect.setValue(Boolean.FALSE); - multiselect.setVisible(false); - } else { - newitems.setVisible(true); - multiselect.setVisible(true); - } - } - } - - /** Handle all button clicks for this panel */ - public void buttonClick(Button.ClickEvent event) { - // FIXME: navigation statistics - try { - FeatureUtil.debug(getApplication().getUser().toString(), - "buttonClick " + event.getButton().getTag() + ", " - + event.getButton().getCaption() + ", " - + event.getButton().getValue()); - } catch (final Exception e) { - // ignored, should never happen - } - // Commit all changed on all forms - if (event.getButton() == setButton) { - commit(); - } - - // Discard all changed on all forms - if (event.getButton() == discardButton) { - for (final Iterator i = forms.iterator(); i.hasNext();) { - ((Form) i.next()).discard(); - } - } - - } - - /** - * Helper function for creating forms from array of propety names. - */ - protected Form createBeanPropertySet(String names[]) { - - final Form set = new Form(new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL)); - - for (int i = 0; i < names.length; i++) { - final Property p = config.getItemProperty(names[i]); - if (p != null) { - set.addItemProperty(names[i], p); - final Field f = set.getField(names[i]); - if (f instanceof TextField) { - if (Integer.class.equals(p.getType())) { - ((TextField) f).setColumns(4); - } else { - ((TextField) f).setNullSettingAllowed(true); - ((TextField) f).setColumns(17); - } - } - } - } - - return set; - } - - /** Find a field from all forms */ - public Field getField(Object propertyId) { - for (final Iterator i = forms.iterator(); i.hasNext();) { - final Form f = (Form) i.next(); - final Field af = f.getField(propertyId); - if (af != null) { - return af; - } - } - return null; - } - - public Table getAllProperties() { - return allProperties; - } - - protected void commit() { - for (final Iterator i = forms.iterator(); i.hasNext();) { - ((Form) i.next()).commit(); - } - } - - private void disableField(Field field) { - field.setEnabled(false); - field.setReadOnly(true); - } - - private void disableField(Field field, Object value) { - field.setValue(value); - disableField(field); - } - -} diff --git a/src/com/vaadin/tests/featurebrowser/components.png b/src/com/vaadin/tests/featurebrowser/components.png deleted file mode 100644 index e5681d4d37..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/components.png and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/icon_demo.png b/src/com/vaadin/tests/featurebrowser/icon_demo.png deleted file mode 100644 index 6a5c295d6a..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/icon_demo.png and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/icon_intro.png b/src/com/vaadin/tests/featurebrowser/icon_intro.png deleted file mode 100644 index 032712985c..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/icon_intro.png and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/itmill.gif b/src/com/vaadin/tests/featurebrowser/itmill.gif deleted file mode 100644 index b1c3e053f0..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/itmill.gif and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif b/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif deleted file mode 100644 index fa6b38b4c9..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/m-bullet-blue.gif and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/m.gif b/src/com/vaadin/tests/featurebrowser/m.gif deleted file mode 100644 index 2201bdfc1c..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/m.gif and /dev/null differ diff --git a/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf b/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf deleted file mode 100644 index 9e58ce29c6..0000000000 Binary files a/src/com/vaadin/tests/featurebrowser/vaadin_spin.swf and /dev/null differ diff --git a/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java b/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java deleted file mode 100644 index 7172dd7e0d..0000000000 --- a/src/com/vaadin/tests/layouts/AbsoluteLayoutAddRemove.java +++ /dev/null @@ -1,50 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Button.ClickEvent; - -public class AbsoluteLayoutAddRemove extends TestBase { - - @Override - protected String getDescription() { - return "Tests that addComponent() and removeComponent() works"; - } - - @Override - protected Integer getTicketNumber() { - return 2915; - } - - @Override - protected void setup() { - Layout main = getLayout(); - - final Label l = new Label("A Label"); - final AbsoluteLayout al = new AbsoluteLayout(); - al.setWidth("300px"); - al.setHeight("200px"); - main.addComponent(al); - - final Button b = new Button("Add", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - if (l.getParent() == null) { - al.addComponent(l); - event.getButton().setCaption("Remove"); - } else { - al.removeComponent(l); - event.getButton().setCaption("Add"); - } - - } - - }); - main.addComponent(b); - - } - -} diff --git a/src/com/vaadin/tests/layouts/DeepComponentTrees.java b/src/com/vaadin/tests/layouts/DeepComponentTrees.java deleted file mode 100644 index e13cdf5c3a..0000000000 --- a/src/com/vaadin/tests/layouts/DeepComponentTrees.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -public class DeepComponentTrees extends TestBase { - - private Panel root; - - @Override - protected String getDescription() { - return "Vaadin should not choke on deep component trees. 15 levels should be minimum to survive."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - private int i = 0; - private Class currentValue = VerticalLayout.class; - - @Override - protected void setup() { - Layout main = getLayout(); - main.setSizeUndefined(); - getMainWindow().getLayout().setHeight(null); - - Label l = new Label( - "This is a nice game to guess how many Layouts your FF2 (or any other browser) can deal with. Due to the worldwide attempt to decrease energy consumption, playing this game is only allowed above 60° longitude betwheen August and May (as excess energy consumed by you CPU is used to heat your room). It is considered wise to save all your work before starting the game."); - - root = new Panel("Test box"); - root.setWidth("600px"); - root.setHeight("200px"); - final Button b = new Button("Go try your luck with " + i + " layouts!"); - b.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - FF2KILLER(i++); - b.setCaption("Go try your luck with " + i + " layouts!"); - } - - }); - - final ComboBox s = new ComboBox("Restart game with select:"); - s.setNullSelectionAllowed(false); - s.addItem("-- Choose value --"); - s.setValue("-- Choose value --"); - s.addItem(VerticalLayout.class); - s.addItem(HorizontalLayout.class); - s.addItem(GridLayout.class); - s.addListener(new ComboBox.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - Object value = s.getValue(); - if (!value.equals("-- Choose value --")) { - currentValue = (Class) value; - i = 0; - s.setValue("-- Choose value --"); - b.setCaption("Go try your luck with " + i + " layouts!"); - } - - } - }); - s.setImmediate(true); - - main.addComponent(l); - main.addComponent(b); - main.addComponent(s); - main.addComponent(root); - - } - - private void FF2KILLER(int layouts) { - Layout layout = getTestLayout(); - Layout r = layout; - for (int i = 0; i < layouts; i++) { - Layout lo = getTestLayout(); - layout.addComponent(lo); - layout = lo; - } - layout.addComponent(new Label( - "FF did it! Vaadin, Mozilla and you win! Dare to try again?")); - root.setLayout(r); - } - - Layout getTestLayout() { - Layout l = new VerticalLayout(); - if (currentValue == GridLayout.class) { - l = new GridLayout(1, 1); - } else { - try { - l = (Layout) currentValue.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - return l; - } - -} diff --git a/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java b/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java deleted file mode 100644 index 8934adae0a..0000000000 --- a/src/com/vaadin/tests/layouts/FormLayoutWithInvisibleComponent.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Button.ClickEvent; - -public class FormLayoutWithInvisibleComponent extends TestBase { - - private TextField messages; - - @Override - protected String getDescription() { - return "There is an initial invisible text field below the checkbox. Checking the checkbox should show the field as a textarea (40x10) and also show its caption(\"Messages visible\") and a required error (*)."; - } - - @Override - protected Integer getTicketNumber() { - return 2706; - } - - @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"); - } - - }); - control.setImmediate(true); - formLayout.addComponent(control); - - messages = new TextField("Messages hidden"); - messages.setRows(10); - messages.setColumns(40); - messages.setVisible(false); - messages.setEnabled(false); - formLayout.addComponent(messages); - - addComponent(formLayout); - } - -} diff --git a/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java b/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java deleted file mode 100644 index 781e39bb4e..0000000000 --- a/src/com/vaadin/tests/layouts/GridLayoutExpandRatioModification.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class GridLayoutExpandRatioModification extends TestBase implements - ClickListener { - - private boolean isVisible = false; - private GridLayout mainLayout; - private VerticalLayout vl1; - private VerticalLayout vl2; - private Button button; - - public void setup() { - Window main = new Window("The Main Window"); - mainLayout = new GridLayout(3, 3); - main.setLayout(mainLayout); - setMainWindow(main); - - // The upper layout - vl1 = new VerticalLayout(); - Label label1 = new Label("The upper/left layout"); - vl1.addComponent(label1); - - // Button that hides or shows the bottom part - button = new Button("show / hide", this); - - // The bottom layout - vl2 = new VerticalLayout(); - TextField tf = new TextField("The bottom/right field"); - tf.setHeight("100%"); - tf.setWidth("100%"); - vl2.addComponent(tf); - - // Add everything to the view - mainLayout.addComponent(vl1, 0, 0); - mainLayout.addComponent(button, 1, 1); - mainLayout.addComponent(vl2, 2, 2); - - // Set expand ratios, hide lower - mainLayout.setRowExpandRatio(0, 1); - mainLayout.setColumnExpandRatio(0, 1); - mainLayout.setRowExpandRatio(2, 0); - mainLayout.setColumnExpandRatio(2, 0); - - // Maximize everything - main.setSizeFull(); - mainLayout.setSizeFull(); - vl1.setSizeFull(); - vl2.setSizeFull(); - } - - public void buttonClick(ClickEvent event) { - if (isVisible) { - mainLayout.setRowExpandRatio(2, 0); - mainLayout.setColumnExpandRatio(2, 0); - isVisible = false; - } else { - mainLayout.setRowExpandRatio(2, 1); - mainLayout.setColumnExpandRatio(2, 1); - isVisible = true; - } - } - - @Override - protected String getDescription() { - return "Changing the expand ratio should repaint the layout correctly. Changing from 0 to something else should render the previously invisible component"; - } - - @Override - protected Integer getTicketNumber() { - return 2454; - } -} diff --git a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java b/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java deleted file mode 100644 index bc2e8c01cb..0000000000 --- a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; - -public class GridLayoutInsidePanel extends TestBase { - - @Override - protected String getDescription() { - return "The first Panel contains a VerticalLayout, which contains a GridLayout, which contains a Label. The second panel directly contains a GridLayout, which contains a Label. Both should be rendered in the same way."; - } - - @Override - protected Integer getTicketNumber() { - return 2652; - } - - @Override - protected void setup() { - { - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - gl.addComponent(new Label( - "A label which defines the size of the GL")); - - Panel p = new Panel("Panel 1"); - p.getLayout().setMargin(false); - p.setSizeUndefined(); - p.getLayout().setSizeUndefined(); - - p.addComponent(gl); - addComponent(p); - } - { - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - gl.addComponent(new Label( - "A label which defines the size of the GL")); - - Panel p = new Panel("Panel 2", gl); - p.getLayout().setMargin(false); - p.setSizeUndefined(); - p.getLayout().setSizeUndefined(); - - addComponent(p); - } - } - -} diff --git a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java b/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java deleted file mode 100644 index 22fabab4d7..0000000000 --- a/src/com/vaadin/tests/layouts/GridLayoutInsidePanel2.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Window; - -public class GridLayoutInsidePanel2 extends Application { - - private Layout layout; - - @Override - public void init() { - Window w = new Window("Main"); - setMainWindow(w); - layout = w.getLayout(); - GridLayout gl = new GridLayout(1, 1); - gl.setSizeUndefined(); - Label l = new Label("This should be visible"); - l.setWidth("100px"); - gl.addComponent(l); - - layout.setSizeUndefined(); - layout.addComponent(gl); - } - -} diff --git a/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java b/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java deleted file mode 100644 index e548d7dacc..0000000000 --- a/src/com/vaadin/tests/layouts/HiddenHorizontalLayout.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -public class HiddenHorizontalLayout extends TestBase { - - @Override - protected String getDescription() { - return "Test to verify that toggling layout visibility works properly."; - } - - @Override - protected Integer getTicketNumber() { - return 3183; - } - - @Override - public void setup() { - - VerticalLayout vl = new VerticalLayout(); - vl.setSizeFull(); - getLayout().addComponent(vl); - - final HorizontalLayout hl = new HorizontalLayout(); - hl.setWidth("100%"); - hl.setHeight("30px"); - hl.addComponent(new Label("label1")); - hl.addComponent(new Label("label2")); - hl.addComponent(new Label("label3")); - hl.addComponent(new Label("label4")); - vl.addComponent(hl); - - Label l = new Label("Steps to reproduce with Vaadin 6.0.1:
" - + "1. set browser size smaller than fullscreen
" - + "2. Refresh page with browser
" - + "3. Click \"toggle layout visibility\"
" - + "4. Resize browser window to full
" - + "5. Click \"toggle layout visibility\"
", - Label.CONTENT_XHTML); - vl.addComponent(l); - Button b = new Button("toggle layout visibility", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - hl.setVisible(!hl.isVisible()); - } - - }); - vl.addComponent(b); - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java deleted file mode 100644 index 3167947697..0000000000 --- a/src/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ /dev/null @@ -1,1221 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; - -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractOrderedLayout; -import com.vaadin.ui.Alignment; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class OrderedLayoutBasics extends TestBase { - - String valignName[] = new String[] { "top", "middle", "bottom" }; - int valign[] = new int[] { AlignmentHandler.ALIGNMENT_TOP, - AlignmentHandler.ALIGNMENT_VERTICAL_CENTER, - AlignmentHandler.ALIGNMENT_BOTTOM }; - - Set layouts = new HashSet(); - private AbstractOrderedLayout layoutContainer; - private int suffix = 0; - - @Override - protected String getDescription() { - return "Various layout tests for VerticalLayout and HorizontalLayout"; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - public void setup() { - getMainWindow().getLayout().setHeight(null); - - layoutContainer = new VerticalLayout(); - createUI(layoutContainer); - addComponent(layoutContainer); - } - - private void createUI(Layout layout) { - layout - .addComponent(wrapLayout(layout_field_100pct_button_field(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_field_100pct_button_field(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_overfilled(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_overfilled(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_overfilled_dynamic_height(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_overfilled_dynamic_height(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_symmetric_fields(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_symmetric_fields(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_leftAndRight(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_leftAndRight(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_fixed_filled(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_fixed_filled(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_dynamic(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_dynamic(new VerticalLayout()))); - layout.addComponent(wrapLayout(layout_labels(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_labels(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_captions(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_captions(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size_and_relative_size(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size_and_relative_size(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size_and_fixed_size(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_captions_fixed_size_and_fixed_size(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_add_remove_components(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_add_remove_components(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_pctFilled(new HorizontalLayout()))); - layout.addComponent(wrapLayout(layout_pctFilled(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_underFilled(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_underFilled(new VerticalLayout()))); - layout - .addComponent(wrapLayout(layout_basic_test(new HorizontalLayout()))); - layout - .addComponent(wrapLayout(layout_basic_test(new VerticalLayout()))); - } - - private Layout wrapLayout(Layout ol) { - Panel p = new Panel(ol); - p.setSizeUndefined(); - p.setCaption(ol.getCaption()); - ol.setCaption(null); - - VerticalLayout l = new VerticalLayout(); - l.setSizeUndefined(); - l.addComponent(p); - // p.setWidth("600px"); - - if (ol instanceof AbstractOrderedLayout) { - layouts.add((AbstractOrderedLayout) ol); - } - return l; - } - - /* LAYOUTS */ - - private Layout layout1() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("200px"); - ol.setWidth(""); - ol.setCaption("Fixed height (200px) and dynamic width"); - - TextField tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth(""); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Select s = new Select("100% high select"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth(""); - ol.addComponent(s); - - s = new Select("200 px high select"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth(""); - ol.addComponent(s); - - // tf = new TextField("100% high TextField, right/bottom"); - // tf.setHeight("100%"); - // tf.setWidth(""); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - // tf = new TextField("100% high, 200px wide TextField"); - // tf.setHeight("100%"); - // tf.setWidth("200px"); - // ol.addComponent(tf); - - return ol; - - } - - private Layout layout2() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight("70px"); - ol.setWidth(""); - ol.setCaption("Fixed height (50px) and dynamic width"); - - TextField tf = new TextField( - "100px high TextField, valign: bottom, should be partly outside"); - tf.setHeight("100px"); - tf.setWidth(""); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField( - "100% high, 50px wide TextField, valign: bottom, should fill full height"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - Select s = new Select("100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth(""); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new Select("200 px high select, should be partly outside"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth(""); - ol.addComponent(s); - - return ol; - } - - private Layout layout3() { - HorizontalLayout ol = new HorizontalLayout(); - ol.setHeight(""); - ol.setWidth("500px"); - ol.setCaption("Fixed width (500px) and dynamic height"); - TextField tf; - - tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField("100px high TextField, valign: top"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("100% high, 50px wide TextField, valign: bottom"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - Select s = new Select("100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth("100%"); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new Select("200 px high select, should make the layout 200px high"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth("100%"); - ol.addComponent(s); - - return ol; - } - - private Layout layout3New() { - AbstractOrderedLayout ol = new HorizontalLayout(); - ol.setHeight("300px"); - // ol.setWidth("500px"); - ol.setWidth(""); - ol.setCaption("Dynamic width and fixed height(300px)"); - TextField tf; - - tf = new TextField("100px high TextField, valign: bottom"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - tf = new TextField("100px high TextField, valign: top"); - tf.setHeight("100px"); - tf.setWidth("100%"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("100% high, 50px wide TextField, valign: bottom"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_LEFT); - - Label l = new Label( - "100% high, 50px wide Label, valign: bottom, does not fill full height, only needed space"); - tf.setHeight("100%"); - tf.setWidth("50px"); - ol.addComponent(l); - ol.setComponentAlignment(l, Alignment.BOTTOM_LEFT); - - Select s = new Select("100% high select, should fit into layout"); - s.setMultiSelect(true); - s.setHeight("100%"); - s.setWidth("100%"); - for (int i = 0; i < 10; i++) { - s.addItem(new Object()); - } - - ol.addComponent(s); - - s = new Select("200 px high select, should make the layout 200px high"); - s.setMultiSelect(true); - s.setHeight("200px"); - s.setWidth("100%"); - ol.addComponent(s); - - return ol; - } - - private Layout layout4(AbstractOrderedLayout ol) { - // ol.setHeight("300px"); - // ol.setWidth("500px"); - ol.setMargin(true); - ol.setSpacing(true); - ol.setWidth(""); - ol.setCaption("Dynamic width and dynamic height"); - TextField tf; - - tf = new TextField("100% high TextField"); - tf.setCaption(null); - tf.setRequired(true); - tf.setValue("100% high Field"); - tf.setHeight("100%"); - tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - - tf = new TextField("100% high TextField"); - tf.setCaption("100% high TextField"); - tf.setRequired(true); - tf.setValue("100% high Field"); - tf.setHeight("100%"); - tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - - for (int i = 1; i < 4; i++) { - int w = i * 100; - tf = new TextField("Field " + i); - tf.setRows(2); - tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - + valignName[i % 3]); - tf.setWidth(w + "px"); - tf.setHeight(w + "px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_LEFT, - valign[i % 3]); - - } - - tf = new TextField("100% high TextField"); - tf.setValue("100% high 100px wide"); - tf.setRows(2); - tf.setHeight("100%"); - tf.setWidth("100px"); - ol.addComponent(tf); - return ol; - } - - private Layout layout_field_100pct_button_field(AbstractOrderedLayout ol) { - ol.setHeight("500px"); - ol.setWidth("916px"); - ol.setMargin(false); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_field_100pct_button_field"); - TextField tf; - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - Button b; - b = new Button("This is a 100%x50% valign middle button"); - b.setSizeFull(); - b.setHeight("50%"); - ol.addComponent(b); - ol.setExpandRatio(b, 1.0f); - ol.setComponentAlignment(b, Alignment.MIDDLE_RIGHT); - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_basic_test(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("900px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_basic_test"); - TextField tf; - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - Button b; - // b = new Button("This is a 100%x50% valign middle button"); - // b.setSizeFull(); - // b.setHeight("50%"); - // ol.addComponent(b, 1.0f); - // ol.setComponentAlignment(b, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_VERTICAL_CENTER); - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_symmetric_fields(AbstractOrderedLayout ol) { - ol.setHeight("900px"); - ol.setWidth("900px"); - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_symmetric_fields"); - TextField tf; - - tf = new TextField("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); - - tf = new TextField("300px x 300px Field"); - tf.setValue("300x300 field"); - tf.setRows(2); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - return ol; - } - - private Layout layout_leftAndRight(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_leftAndRight"); - TextField tf; - - // tf = new TextField("100%x100% Field"); - // tf.setCaption(null); - // tf.setValue("100% x 100% TextField"); - // tf.setSizeFull(); - // tf.setRequired(true); - // // tf.setComponentError(new UserError("It's broken!")); - // - // // tf.setHeight("100%"); - // // tf.setWidth("100px"); - // tf.setRows(2); - // ol.addComponent(tf); - // - // for (int i = 1; i < 5; i++) { - // int w = i * 100; - // tf = new TextField("Caption field " + i); - // tf.setRows(2); - // tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - // + valignName[i % 3]); - // tf.setWidth(w + "px"); - // tf.setHeight(w + "px"); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, - // AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); - // } - // - // tf.setValue(tf.getValue().toString() + " (100% wide)"); - // tf.setWidth("100%"); - - // tf = new TextField("100%x70px Field"); - // tf.setCaption(null); - // tf.setRequired(true); - // // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - // tf.setComponentError(new UserError("abc")); - // tf.setValue("100% high 70px wide TextField"); - // tf.setRows(2); - // // tf.setSizeFull(); - // tf.setHeight("100%"); - // tf.setWidth("70px"); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_TOP); - // ol.addComponent(tf); - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("300px x 300px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("300x300 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("300px"); - tf.setWidth("300px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_fixed_filled(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextField tf; - - tf = new TextField("60%x100% Field"); - tf.setCaption("This one has a caption"); - tf.setValue("60% x 100% TextField"); - tf.setWidth("100%"); - tf.setHeight("100%"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - ol.setExpandRatio(tf, 1f); - // - - tf = new TextField("60%x60% Field"); - tf.setCaption(null); - tf.setValue("60% x 60% TextField"); - tf.setWidth("100%"); - tf.setHeight("60%"); - tf.setRequired(true); - ol.addComponent(tf); - ol.setExpandRatio(tf, 1f); - ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_LEFT, - AlignmentHandler.ALIGNMENT_VERTICAL_CENTER); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - // - // for (int i = 1; i < 5; i++) { - // int w = i * 100; - // tf = new TextField("Caption field " + i); - // tf.setRows(2); - // tf.setValue(w + "px high, " + w + "px wide TextField, valign: " - // + valignName[i % 3]); - // tf.setWidth(w + "px"); - // tf.setHeight(w + "px"); - // ol.addComponent(tf); - // ol.setComponentAlignment(tf, - // AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER, valign[i % 3]); - // } - // - // tf.setValue(tf.getValue().toString() + " (100% wide)"); - // tf.setWidth("100%"); - - // tf = new TextField("100%x70px Field"); - // tf.setCaption(null); - // tf.setRequired(true); - // // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - // tf.setComponentError(new UserError("abc")); - // tf.setValue("100% high 70px wide TextField"); - // tf.setRows(2); - // // tf.setSizeFull(); - // tf.setHeight("100%"); - // tf.setWidth("70px"); - // ol.setComponentAlignment(tf, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_TOP); - // ol.addComponent(tf); - - tf = new TextField("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - - private Layout layout_overfilled(AbstractOrderedLayout ol) { - ol.setHeight("300px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("OverFilled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextField tf; - - for (int i = 0; i < 5; i++) { - tf = new TextField("200x200px Field"); - tf.setCaption("This one has a caption"); - tf.setValue("200x200 TextField"); - tf.setWidth("200px"); - tf.setHeight("200px"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - } - - return ol; - } - - private Layout layout_overfilled_dynamic_height(AbstractOrderedLayout ol) { - ol.setHeight(null); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("OverFilled with fixed width (" + ol.getWidth() - + "px) and dynamic height"); - TextField tf; - - for (int i = 0; i < 10; i++) { - tf = new TextField("200x200px Field"); - tf.setCaption("This one has a caption"); - tf.setWidth("200px"); - tf.setHeight(((i + 1) * 50) + "px"); - tf.setValue(tf.getWidth() + "x" + tf.getHeight() + " TextField"); - tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - } - - return ol; - } - - // private Layout layout_add_components(AbstractOrderedLayout ol) { - // ol.setHeight("600px"); - // ol.setWidth("600px"); - // ol.setMargin(true); - // ol.setSpacing(true); - // - // // ol.setWidth(""); - // ol.setCaption("Fixed width (" + ol.getWidth() - // + "px) and fixed height (" + ol.getHeight() + "px)"); - // - // for (int i = 0; i < 3; i++) { - // Button b = createAddButton(ol); - // ol.addComponent(b); - // } - // - // return ol; - // - // } - - private Layout layout_add_remove_components(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() - + "px) / layout_add_remove_components"); - - for (int i = 0; i < 2; i++) { - AbstractOrderedLayout inner = createAddRemove(ol, "", ""); - ol.addComponent(inner); - ol.setComponentAlignment(inner, Alignment.BOTTOM_RIGHT); - } - - return ol; - - } - - private Layout layout_dynamic(AbstractOrderedLayout ol) { - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Dynamic width, dynamic height"); - - for (int i = 0; i < 3; i++) { - Button b = new Button("Button " + i); - if (i == 2) { - b.setHeight("200px"); - } else { - b.setHeight("100%"); - } - ol.addComponent(b); - } - - return ol; - - } - - private Layout layout_captions(AbstractOrderedLayout ol) { - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Caption test with dynamic width"); - - TextField tf; - tf = new TextField("Short caption"); - ol.addComponent(tf); - - tf = new TextField( - "A very long caption which is probably much longer than the field"); - ol.addComponent(tf); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size(AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed size"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setValue("Undefined width"); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setValue("Undefined width"); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("Undefined width"); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size_and_relative_size( - AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width (700x250)"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setSizeFull(); - tf.setValue("100% wide field, ratio 1"); - - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 1); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setValue("100% wide field, ratio 2"); - tf.setSizeFull(); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 2); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("100% wide field, ratio 3"); - tf.setSizeFull(); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - ol.setExpandRatio(tf, 3); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_captions_fixed_size_and_fixed_size( - AbstractOrderedLayout ol) { - ol.setWidth("700px"); - ol.setHeight("250px"); - - ol.setMargin(false); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width"); - - TextField tf; - tf = new TextField("Short caption"); - tf.setValue("250px wide field"); - tf.setWidth("250px"); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A long caption which is probably much longer than the field"); - tf.setWidth("250px"); - tf.setValue("250px wide field"); - tf.setRequired(true); - tf.setComponentError(new UserError("123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf = new TextField( - "A very long caption which is probably much longer than the field and includes indicators"); - tf.setValue("200px wide field"); - tf.setWidth("200px"); - tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setRequired(true); - tf.setComponentError(new UserError("abc123")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - // for (int i = 0; i < 3; i++) { - // Button b = new Button("Button " + i); - // if (i == 2) { - // b.setHeight("200px"); - // } else { - // b.setHeight("100%"); - // } - // ol.addComponent(b); - // } - - return ol; - - } - - private Layout layout_labels(AbstractOrderedLayout ol) { - // ol.setWidth("700px"); - // ol.setHeight("200px"); - - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Caption test with fixed width"); - - Label l; - l = new Label( - "This is a long text and should remain on one line as there is nothing forcing line breaks"); - ol.addComponent(l); - // ol.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - l = new Label("WTF OMG LOL"); - ol.addComponent(l); - // ol.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, - // AlignmentHandler.ALIGNMENT_BOTTOM); - - return ol; - - } - - private AbstractOrderedLayout createAddRemove(AbstractOrderedLayout ol, - String width, String buttonSuffix) { - Button b = createAddButton(ol); - Button wb = createWideAddButton(ol); - Button r = createRemoveButton(ol, buttonSuffix); - VerticalLayout inner = new VerticalLayout(); - inner.setCaption("Width: " + width); - inner.setWidth(width); - - inner.addComponent(b); - inner.addComponent(wb); - inner.addComponent(r); - - // inner.setHeight("132px"); - return inner; - } - - private Button createAddButton(AbstractOrderedLayout ol) { - Button b = new Button("Add before", new ClickListener() { - - public void buttonClick(ClickEvent event) { - addBefore((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent(), ""); - } - - }); - b.setData(ol); - - return b; - } - - private Button createWideAddButton(AbstractOrderedLayout ol) { - Button b = new Button("Add 100% before", new ClickListener() { - - public void buttonClick(ClickEvent event) { - addBefore((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent(), "100%"); - } - - }); - b.setData(ol); - - return b; - } - - private Button createRemoveButton(AbstractOrderedLayout ol, String suffix) { - Button b = new Button("Remove this " + suffix, new ClickListener() { - - public void buttonClick(ClickEvent event) { - remove((AbstractOrderedLayout) event.getButton().getData(), - event.getButton().getParent()); - } - - }); - b.setWidth("100%"); - b.setData(ol); - - return b; - } - - protected void remove(AbstractOrderedLayout ol, Component c) { - ol.removeComponent(c); - - } - - protected void addBefore(AbstractOrderedLayout ol, Component c, String width) { - int index = 0; - Iterator iter = ol.getComponentIterator(); - while (iter.hasNext()) { - if (iter.next() == c) { - break; - } - index++; - } - AbstractOrderedLayout inner = createAddRemove(ol, width, String - .valueOf(suffix++)); - ol.addComponent(inner, index); - if (width.contains("%")) { - ol.setExpandRatio(inner, 1.0f); - } - - ol.setComponentAlignment(inner, Alignment.BOTTOM_RIGHT); - - } - - private Layout layout_pctFilled(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("100 % filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextField tf; - - tf = new TextField(); - tf.setCaption("This one has a caption"); - tf.setValue("60% expand TextField"); - tf.setWidth("100%"); - tf.setHeight("100%"); - // tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - ol.setExpandRatio(tf, 60); - - tf = new TextField(); - tf.setValue("100px 100px TextField"); - tf.setWidth("100px"); - tf.setHeight("100px"); - tf.setRows(2); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); - - // - - tf = new TextField("40%x40% Field"); - // tf.setCaption(null); - tf.setValue("40% expand (40% height) TextField"); - tf.setWidth("100%"); - tf.setHeight("40%"); - ol.addComponent(tf); - ol.setExpandRatio(tf, 40); - // tf.setRequired(true); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf.setRows(2); - - return ol; - } - - private Layout layout_pctFilled2(AbstractOrderedLayout ol) { - ol.setHeight("600px"); - ol.setWidth("600px"); - ol.setMargin(true); - ol.setSpacing(false); - - // ol.setWidth(""); - ol.setCaption("100 % filled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextField tf; - - tf = new TextField(); - // tf.setCaption("This one has a caption"); - tf.setValue("80% x 20% TextField"); - tf.setWidth("80%"); - tf.setHeight("20%"); - // tf.setRequired(true); - // tf.setComponentError(new UserError("It's broken!")); - - // tf.setHeight("100%"); - // tf.setWidth("100px"); - tf.setRows(2); - ol.addComponent(tf); - // - - tf = new TextField("20%x60% Field"); - tf.setCaption(null); - tf.setValue("20% x 60% TextField"); - tf.setWidth("20%"); - tf.setHeight("60%"); - // tf.setRequired(true); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - - tf.setRows(2); - ol.addComponent(tf); - - return ol; - } - - private Layout layout_underFilled(AbstractOrderedLayout ol) { - ol.setHeight("700px"); - ol.setWidth("700px"); - ol.setMargin(true); - ol.setSpacing(true); - - // ol.setWidth(""); - ol.setCaption("Underfilled with fixed width (" + ol.getWidth() - + "px) and fixed height (" + ol.getHeight() + "px)"); - TextField tf; - - tf = new TextField("60%x100% Field"); - tf.setCaption("Short capt"); - tf.setValue("60% x 100% TextField"); - tf.setWidth("60%"); - tf.setHeight("100%"); - tf.setRequired(true); - tf.setRows(2); - - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.MIDDLE_CENTER); - - tf = new TextField("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.TOP_LEFT); - - tf = new TextField("200px x 200px Field"); - // tf.setIcon(new ThemeResource("icons/16/document-add.png")); - tf.setValue("200x200 field"); - tf.setRows(2); - // tf.setSizeFull(); - tf.setHeight("200px"); - tf.setWidth("200px"); - ol.addComponent(tf); - ol.setComponentAlignment(tf, Alignment.BOTTOM_RIGHT); - return ol; - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java b/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java deleted file mode 100644 index 6073edf249..0000000000 --- a/src/com/vaadin/tests/layouts/OrderedLayoutCSSCompatibility.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; - -public class OrderedLayoutCSSCompatibility extends TestBase { - - @Override - protected String getDescription() { - return "This test is to make sure that spacing/margins in OrderedLayout is still backwards compatible"; - } - - @Override - protected Integer getTicketNumber() { - return 2463; - } - - @Override - protected void setup() { - OrderedLayout l = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - l.setMargin(true); - l.setSpacing(true); - l.addComponent(new TextField("abc")); - l.addComponent(new TextField("def")); - - addComponent(l); - - } - -} diff --git a/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java b/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java deleted file mode 100644 index efabf0ac9a..0000000000 --- a/src/com/vaadin/tests/layouts/TestAbsoluteLayout.java +++ /dev/null @@ -1,312 +0,0 @@ -package com.vaadin.tests.layouts; - -import java.io.File; -import java.net.URL; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Iterator; - -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.data.util.BeanItem; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbsoluteLayout; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.BaseFieldFactory; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Field; -import com.vaadin.ui.FieldFactory; -import com.vaadin.ui.Form; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class TestAbsoluteLayout extends TestBase { - - private static class MFieldFactory extends BaseFieldFactory { - - @Override - public Field createField(Item item, Object propertyId, - Component uiContext) { - if (propertyId.equals("CSSString")) { - TextField f = new TextField(); - f.setRows(5); - f.setHeight("8em"); - f.setCaption("CSS string"); - return f; - } else if (((String) propertyId).contains("Units")) { - NativeSelect s = new NativeSelect() { - }; - s.addContainerProperty("caption", String.class, ""); - s.setItemCaptionPropertyId("caption"); - s.setNullSelectionAllowed(false); - for (int i = 0; i < Layout.UNIT_SYMBOLS.length; i++) { - Item unitItem = s.addItem(i); - unitItem.getItemProperty("caption").setValue( - Layout.UNIT_SYMBOLS[i]); - } - return s; - } - - return super.createField(item, propertyId, uiContext); - } - - private static MFieldFactory instance; - - public static FieldFactory get() { - if (instance == null) { - instance = new MFieldFactory(); - } - return instance; - } - }; - - @Override - protected String getDescription() { - return "This is absolute layout tester."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - protected void setup() { - AbsoluteLayout layout = new AbsoluteLayout(); - setTheme("tests-tickets"); - layout.setStyleName("cyan"); - layout.setWidth("1000px"); - layout.setHeight("500px"); - - layout.addComponent(new Label("Hello World")); - - Button button = new Button("Centered button,z-index:10;"); - button.setSizeFull(); - layout.addComponent(button, - "top:40%;bottom:40%;right:20%;left:20%;z-index:10;"); - - Label label = new Label( - "Exotic positioned label. Fullsize, top:100px; left:2cm; right: 3.5in; bottom:12.12mm "); - label.setStyleName("yellow"); - label.setSizeFull(); - layout.addComponent(label, - "top:100px; left:2cm; right: 3.5in; bottom:12.12mm"); - - label = new Label("fullize, bottom:80%;left:80%;"); - label.setStyleName("green"); - label.setSizeFull(); - layout.addComponent(label, "bottom:80%;left:80%;"); - - label = new Label("bottomright"); - label.setSizeUndefined(); - label.setStyleName("green"); - layout.addComponent(label, "bottom:0px; right:0px;"); - - getLayout().setSizeFull(); - getLayout().addComponent(layout); - - getMainWindow().addWindow(new EditorWindow(layout)); - - } - - public class EditorWindow extends Window { - private final AbsoluteLayout l; - private Form componentEditor; - private Form positionEditor; - - public EditorWindow(AbsoluteLayout lo) { - super("AbsoluteLayout editor aka köyhän miehen wysiwyg"); - l = lo; - - setHeight("600px"); - - Button componentChooser = new Button("choose component to edit"); - componentChooser.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - final Window chooser = new Window("Choose component"); - chooser.getLayout().setSizeUndefined(); - chooser.setModal(true); - - NativeSelect select = new NativeSelect( - "Choose component to edit"); - - select.setNullSelectionAllowed(false); - - IndexedContainer container = new IndexedContainer(); - container.addContainerProperty("caption", String.class, ""); - Iterator componentIterator = l - .getComponentIterator(); - while (componentIterator.hasNext()) { - AbstractComponent next = (AbstractComponent) componentIterator - .next(); - Item item = container.addItem(next); - - String caption = next.getTag(); - - caption += "; cap: " + next.getCaption() + "; debugid" - + getDebugId(); - - if (next instanceof Property) { - caption += " value:" + ((Property) next).getValue(); - } - - item.getItemProperty("caption").setValue(caption); - } - select.setContainerDataSource(container); - select.setItemCaptionPropertyId("caption"); - select.setImmediate(true); - - select.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - editcomponent((Component) event.getProperty() - .getValue()); - getMainWindow().removeWindow(chooser); - } - - }); - - chooser.addComponent(select); - - getMainWindow().addWindow(chooser); - - } - }); - - addComponent(componentChooser); - - Button addComp = new Button("add component"); - addComp.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - final Window chooser = new Window( - "Choose component type to add"); - chooser.getLayout().setSizeUndefined(); - chooser.setModal(true); - - NativeSelect select = new NativeSelect( - "Choose component to edit"); - - select.setNullSelectionAllowed(false); - - IndexedContainer container = new IndexedContainer(); - - URL resource = AbstractComponent.class.getResource("."); - File directory = new File(resource.getFile()); - if (directory.exists()) { - // Get the list of the files contained in the - // package - final String[] files = directory.list(); - for (int j = 0; j < files.length; j++) { - // we are only interested in .class files - if (files[j].endsWith(".class")) { - // removes the .class extension - String p = resource.toString() - + files[j].substring(0, files[j] - .length() - 6); - p = p.replaceAll(".*classes/", ""); - p = p.replaceAll("/", "."); - Class c; - try { - c = Class.forName(p); - if (AbstractComponent.class - .isAssignableFrom(c) - && !p.toLowerCase().contains( - "layout") - && !p.toLowerCase().contains( - "abstract")) { - container.addItem(c); - } - } catch (ClassNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - } - select.setContainerDataSource(container); - select.setImmediate(true); - - select.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - Class c = (Class) event.getProperty().getValue(); - - try { - Component newInstance = (Component) c - .newInstance(); - l.addComponent(newInstance); - editcomponent(newInstance); - getMainWindow().removeWindow(chooser); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - - }); - - chooser.addComponent(select); - - getMainWindow().addWindow(chooser); - - } - }); - - addComponent(addComp); - - componentEditor = new Form(); - componentEditor.setWriteThrough(false); - componentEditor.setCaption("Component properties:"); - componentEditor.setFieldFactory(MFieldFactory.get()); - addComponent(componentEditor); - - positionEditor = new Form(); - positionEditor.setCaption("Component position"); - positionEditor.setWriteThrough(false); - positionEditor.setFieldFactory(MFieldFactory.get()); - addComponent(positionEditor); - - Button b = new Button("Commit changes", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - positionEditor.commit(); - componentEditor.commit(); - } - }); - addComponent(b); - - } - - private void editcomponent(Component value) { - - BeanItem beanItem = new BeanItem(value); - String c = "Component properties for " - + value.getClass().getSimpleName(); - ArrayList fields = new ArrayList(Arrays - .asList(new String[] { "width", "widthUnits", "height", - "heightUnits", "caption", "styleName" })); - if (value instanceof Label) { - c += "(" + ((Label) value).getValue() + ")"; - fields.add("value"); - } - - componentEditor.setItemDataSource(beanItem, fields); - - beanItem = new BeanItem(l.getPosition(value)); - componentEditor.setCaption(c); - - positionEditor.setItemDataSource(beanItem); - - } - } - -} diff --git a/src/com/vaadin/tests/layouts/TestLayoutPerformance.java b/src/com/vaadin/tests/layouts/TestLayoutPerformance.java deleted file mode 100644 index 896581ce3d..0000000000 --- a/src/com/vaadin/tests/layouts/TestLayoutPerformance.java +++ /dev/null @@ -1,133 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CssLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Button.ClickEvent; - -public class TestLayoutPerformance extends TestBase { - private NativeSelect ns; - private int i; - private NativeSelect ns2; - private VerticalLayout testarea = new VerticalLayout(); - - @Override - protected String getDescription() { - return "Test app to test simple rendering to various layouts."; - } - - @Override - protected Integer getTicketNumber() { - return null; - } - - @Override - protected void setup() { - Label label = new Label("

CssLayout performance test.

", - Label.CONTENT_XHTML); - getLayout().addComponent(label); - - label = new Label( - "Hint. Use debug dialog to measure rendering times TODO: extend with size settings (to both layout and content).", - Label.CONTENT_XHTML); - getLayout().addComponent(label); - - ns = new NativeSelect("Select component to test"); - ns.addItem(CssLayout.class); - ns.addItem(GridLayout.class); - ns.addItem(VerticalLayout.class); - ns.setNullSelectionAllowed(false); - ns.setValue(CssLayout.class); - - ns2 = new NativeSelect("Select component to render inside layout."); - ns2.addItem(Label.class); - ns2.addItem(Button.class); - ns2.setNullSelectionAllowed(false); - ns2.setValue(Label.class); - - final TextField n = new TextField("Number of components"); - - n.setValue("1000"); - - final CheckBox cb = new CheckBox("Generate captions", false); - - Button b = new Button("Render component"); - - b.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - int components = Integer.parseInt((String) n.getValue()); - Layout layout = getCurrentLayout(); - for (int i = 0; i < components; i++) { - Component component = newTestComponent(); - if (cb.booleanValue()) { - component.setCaption("caption " + i); - } - layout.addComponent(component); - } - - testarea.removeAllComponents(); - testarea.addComponent(layout); - } - - }); - - getLayout().addComponent(ns); - getLayout().addComponent(ns2); - getLayout().addComponent(n); - getLayout().addComponent(cb); - getLayout().addComponent(b); - getLayout().addComponent(testarea); - - } - - private Layout getCurrentLayout() { - Class value = (Class) ns.getValue(); - if (value == GridLayout.class) { - return new GridLayout(10, 1); - } - - try { - return (Layout) value.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - return null; - - } - - private Component newTestComponent() { - Class componentClass = (Class) ns2.getValue(); - AbstractComponent newInstance = null; - try { - newInstance = (AbstractComponent) componentClass.newInstance(); - } catch (InstantiationException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } catch (IllegalAccessException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - if (componentClass == Label.class) { - ((Label) newInstance).setValue("Test l " + (i++)); - ((Label) newInstance).setSizeUndefined(); - } else { - newInstance.setCaption("Test l " + (i++)); - } - return newInstance; - } - -} diff --git a/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java b/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java deleted file mode 100644 index 9aadbadd78..0000000000 --- a/src/com/vaadin/tests/layouts/VerticalLayoutExpandRatioModification.java +++ /dev/null @@ -1,76 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class VerticalLayoutExpandRatioModification extends TestBase implements - ClickListener { - - private boolean isVisible = false; - private VerticalLayout mainLayout; - private VerticalLayout vl1; - private VerticalLayout vl2; - private Button button; - - public void setup() { - Window main = new Window("The Main Window"); - mainLayout = new VerticalLayout(); - main.setLayout(mainLayout); - setMainWindow(main); - - // The upper layout - vl1 = new VerticalLayout(); - Label label1 = new Label("The upper layout"); - vl1.addComponent(label1); - - // Button that hides or shows the bottom part - button = new Button("show / hide", this); - - // The bottom layout - vl2 = new VerticalLayout(); - TextField tf = new TextField("The bottom field"); - tf.setHeight("100%"); - vl2.addComponent(tf); - - // Add everything to the view - mainLayout.addComponent(vl1); - mainLayout.addComponent(button); - mainLayout.addComponent(vl2); - - // Set expand ratios, hide lower - mainLayout.setExpandRatio(vl1, 1); - mainLayout.setExpandRatio(vl2, 0); - - // Maximize everything - main.setSizeFull(); - mainLayout.setSizeFull(); - vl1.setSizeFull(); - vl2.setSizeFull(); - } - - public void buttonClick(ClickEvent event) { - if (isVisible) { - mainLayout.setExpandRatio(vl2, 0); - isVisible = false; - } else { - mainLayout.setExpandRatio(vl2, 1); - isVisible = true; - } - } - - @Override - protected String getDescription() { - return "Changing the expand ratio should repaint the layout correctly. Changing from 0 to something else should render the previously invisible component"; - } - - @Override - protected Integer getTicketNumber() { - return 2454; - } -} diff --git a/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java b/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java deleted file mode 100644 index 8ff742c179..0000000000 --- a/src/com/vaadin/tests/layouts/VerticalLayoutWithRelativeSizeComponents.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.layouts; - -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; - -public class VerticalLayoutWithRelativeSizeComponents extends TestBase { - - @Override - protected String getDescription() { - return "A undefined wide VerticalLayout containing a 100% wide label, a Button and another identical label. The labels should be as wide as the button (400px) and there should be no extra space between the bottom of the first label and the button."; - } - - @Override - protected Integer getTicketNumber() { - return 2591; - } - - @Override - protected void setup() { - getLayout().setSizeUndefined(); - getMainWindow().getLayout().setHeight(null); - - Label l = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc condimentum urna quis leo. In hac habitasse platea dictumst. Pellentesque tincidunt. Sed libero nisl, faucibus in, laoreet pellentesque, consectetur non, dolor. Sed tortor. Ut pretium sapien. Cras elementum enim non lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla velit est, aliquam a, pellentesque a, iaculis nec, sapien. Ut ultrices ligula vitae nulla. Morbi sem pede, iaculis ac, condimentum a, ornare eget, nisi. Aliquam hendrerit pulvinar massa. Vestibulum pretium purus eu augue. Sed posuere elit ut magna. Cras consequat faucibus nunc. Vestibulum quis diam."); - Label l2 = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc condimentum urna quis leo. In hac habitasse platea dictumst. Pellentesque tincidunt. Sed libero nisl, faucibus in, laoreet pellentesque, consectetur non, dolor. Sed tortor. Ut pretium sapien. Cras elementum enim non lacus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nulla velit est, aliquam a, pellentesque a, iaculis nec, sapien. Ut ultrices ligula vitae nulla. Morbi sem pede, iaculis ac, condimentum a, ornare eget, nisi. Aliquam hendrerit pulvinar massa. Vestibulum pretium purus eu augue. Sed posuere elit ut magna. Cras consequat faucibus nunc. Vestibulum quis diam."); - l.setWidth("100%"); - l2.setWidth("100%"); - - Button b = new Button("This defines the width"); - b.setWidth("400px"); - addComponent(l); - addComponent(b); - addComponent(l2); - } - -} diff --git a/src/com/vaadin/tests/m.gif b/src/com/vaadin/tests/m.gif deleted file mode 100644 index 2201bdfc1c..0000000000 Binary files a/src/com/vaadin/tests/m.gif and /dev/null differ diff --git a/src/com/vaadin/tests/resources/ResourceDownload.java b/src/com/vaadin/tests/resources/ResourceDownload.java deleted file mode 100644 index d7da9c2d63..0000000000 --- a/src/com/vaadin/tests/resources/ResourceDownload.java +++ /dev/null @@ -1,89 +0,0 @@ -package com.vaadin.tests.resources; - -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.InputStream; - -import com.vaadin.terminal.StreamResource; -import com.vaadin.terminal.StreamResource.StreamSource; -import com.vaadin.tests.components.TestBase; -import com.vaadin.ui.Button; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class ResourceDownload extends TestBase { - - @Override - public void setup() { - - Button b = new Button("Download (_new)", new ClickListener() { - public void buttonClick(ClickEvent event) { - download("_new"); - } - }); - addComponent(b); - - b = new Button("Download (_blank)", new ClickListener() { - public void buttonClick(ClickEvent event) { - download("_blank"); - } - }); - addComponent(b); - - b = new Button("Download ()", new ClickListener() { - public void buttonClick(ClickEvent event) { - download(""); - } - }); - addComponent(b); - - b = new Button("Download (_top)", new ClickListener() { - public void buttonClick(ClickEvent event) { - download("_top"); - } - }); - addComponent(b); - - b = new Button("Test", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - ResourceDownload.this.getMainWindow().showNotification( - "Still working"); - } - - }); - addComponent(b); - - } - - protected void download(String target) { - String filename = "filename"; - StreamResource streamResource = new StreamResource(new StreamSource() { - - public InputStream getStream() { - try { - return new FileInputStream("FIXME C:/temp/file.xls"); - } catch (FileNotFoundException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - } - }, filename + ".xls", this); - streamResource.setCacheTime(5000); // no cache (<=0) does not work with - // IE8 - streamResource.setMIMEType("application/x-msexcel"); - - getMainWindow().open(streamResource, target); - - } - - @Override - protected String getDescription() { - return "Downloading with target _new should work, aswell as with target _blank and _top."; - } - - @Override - protected Integer getTicketNumber() { - return 3289; - } -} diff --git a/src/com/vaadin/tests/robustness/Robustness.java b/src/com/vaadin/tests/robustness/Robustness.java deleted file mode 100644 index 6294e09d4e..0000000000 --- a/src/com/vaadin/tests/robustness/Robustness.java +++ /dev/null @@ -1,86 +0,0 @@ -package com.vaadin.tests.robustness; - -import com.vaadin.automatedtests.util.Log; -import com.vaadin.tests.util.RandomComponents; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public abstract class Robustness extends com.vaadin.Application - implements Button.ClickListener { - - static int totalCount = 0; - - int count = 0; - - final Window main = new Window("Robustness tests by featurebrowser"); - - Button close = new Button("Close application"); - - Button remove = new Button("Remove all components"); - - Button create = new Button("Create"); - - Label label = new Label(); - - ComponentContainer stressLayout; - - RandomComponents randomComponents = new RandomComponents(); - - @Override - public void init() { - createNewView(); - } - - public void createNewView() { - setMainWindow(main); - main.removeAllComponents(); - - main.addComponent(label); - main.addComponent(close); - main.addComponent(remove); - main.addComponent(create); - close.addListener(this); - remove.addListener(this); - create.addListener(this); - - remove.setDescription("After this garbage collector should" - + " be able to collect every component" - + " inside stressLayout."); - - close.setDebugId("close"); - remove.setDebugId("remove"); - create.setDebugId("create"); - - } - - public void buttonClick(ClickEvent event) { - if (event.getButton() == create) { - create(); - } else if (event.getButton() == remove) { - main.removeAllComponents(); - close.removeListener(this); - remove.removeListener(this); - create.removeListener(this); - close = null; - remove = null; - create = null; - label = null; - stressLayout = null; - System.out.println("main.getLayout()=" + main.getLayout()); - System.out.println(Log.getMemoryStatistics()); - } else if (event.getButton() == close) { - System.out.println("Before close, memory statistics:"); - System.out.println(Log.getMemoryStatistics()); - close(); - // Still valueUnbound (session expiration) needs to occur for GC to - // do its work - System.out.println("After close, memory statistics:"); - System.out.println(Log.getMemoryStatistics()); - } - } - - public abstract void create(); -} diff --git a/src/com/vaadin/tests/robustness/RobustnessSimple.java b/src/com/vaadin/tests/robustness/RobustnessSimple.java deleted file mode 100644 index 63324ad9bc..0000000000 --- a/src/com/vaadin/tests/robustness/RobustnessSimple.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.robustness; - -import com.vaadin.automatedtests.util.Log; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; - -public class RobustnessSimple extends Robustness implements - Button.ClickListener { - - @Override - public void create() { - count++; - - // remove old stressLayout, all dependant components should be now - // allowed for garbage collection. - if (stressLayout != null) { - main.removeComponent(stressLayout); - } - - // create new stress layout - stressLayout = new OrderedLayout(); - - // CASE single orderedlayout with a label containing 1Mb of data - // fill with random components - Label label = new Label("Label " + Log.getMemoryStatistics(), - Label.CONTENT_PREFORMATTED); - byte[] data = new byte[1024 * 1024]; - label.setData(data); - stressLayout.addComponent(label); - - // CASE simple button example - // stressLayout.addComponent(new ButtonExample()); - - // CASE #1392, this "leaks" in a way that we cannot release opened - // windows - // in any way (Window.open method) - // stressLayout.addComponent(new WindowingExample()); - - // CASE TableExample - // stressLayout.addComponent(new TableExample()); - - // add new component container to main layout - main.addComponent(stressLayout); - - System.out.println("Created " + count + " times."); - } - -} diff --git a/src/com/vaadin/tests/themes/ButtonsTest.java b/src/com/vaadin/tests/themes/ButtonsTest.java deleted file mode 100644 index 9ad2a9f39e..0000000000 --- a/src/com/vaadin/tests/themes/ButtonsTest.java +++ /dev/null @@ -1,158 +0,0 @@ -package com.vaadin.tests.themes; - -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Button; -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.Button.ClickEvent; - -@SuppressWarnings("serial") -public class ButtonsTest extends com.vaadin.Application { - - final Window main = new Window("Button states & themes"); - - CheckBox styleToggle; - CheckBox iconToggle; - CheckBox nativeToggle; - CheckBox themeToggle; - boolean largeIcons = false; - boolean nativeButtons = false; - - final HorizontalLayout toggles = new HorizontalLayout(); - - @Override - public void init() { - setMainWindow(main); - setTheme("reindeer"); - - themeToggle = new CheckBox("Runo theme", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (getTheme() == "reindeer") { - setTheme("runo"); - } else { - setTheme("reindeer"); - } - } - }); - themeToggle.setStyleName("small"); - themeToggle.setImmediate(true); - - styleToggle = new CheckBox("Black style", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (!main.getContent().getStyleName().contains("black")) { - main.getContent().setStyleName("black"); - } else { - main.getContent().setStyleName(""); - } - } - }); - styleToggle.setImmediate(true); - styleToggle.setStyleName("small"); - - iconToggle = new CheckBox("64x icons", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - largeIcons = !largeIcons; - recreateAll(); - } - }); - iconToggle.setImmediate(true); - iconToggle.setStyleName("small"); - - nativeToggle = new CheckBox("Native buttons", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - nativeButtons = !nativeButtons; - recreateAll(); - } - }); - nativeToggle.setImmediate(true); - nativeToggle.setStyleName("small"); - - toggles.setSpacing(true); - toggles.addComponent(themeToggle); - toggles.addComponent(styleToggle); - toggles.addComponent(iconToggle); - toggles.addComponent(nativeToggle); - main.addComponent(toggles); - - recreateAll(); - - } - - private void recreateAll() { - main.removeAllComponents(); - main.addComponent(toggles); - - main.addComponent(buildButtons(false, false, false, false)); - main.addComponent(buildButtons(false, false, true, false)); - main.addComponent(buildButtons(false, true, false, false)); - main.addComponent(buildButtons(false, true, true, false)); - main.addComponent(buildButtons(true, false, false, false)); - main.addComponent(buildButtons(true, false, true, false)); - main.addComponent(buildButtons(true, true, false, false)); - main.addComponent(buildButtons(true, true, true, false)); - - main.addComponent(buildButtons(false, false, false, true)); - main.addComponent(buildButtons(false, false, true, true)); - main.addComponent(buildButtons(false, true, false, true)); - main.addComponent(buildButtons(false, true, true, true)); - main.addComponent(buildButtons(true, false, false, true)); - main.addComponent(buildButtons(true, false, true, true)); - main.addComponent(buildButtons(true, true, false, true)); - main.addComponent(buildButtons(true, true, true, true)); - - final Button b = new Button("Tabindex"); - b.setTabIndex(1); - main.addComponent(b); - - Button c = new Button("toggle enabled", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - b.setEnabled(!b.isEnabled()); - } - }); - main.addComponent(c); - } - - private Layout buildButtons(boolean disabled, boolean icon, boolean error, - boolean sized) { - - String[] buttonStyles = new String[] { "Normal", "Primary", "Small", - "Link" }; - - HorizontalLayout hl = new HorizontalLayout(); - hl.setSpacing(true); - hl.setMargin(true); - - for (int i = 0; i < buttonStyles.length; i++) { - Button b; - if (nativeButtons) { - b = new NativeButton(buttonStyles[i] + " style"); - } else { - b = new Button(buttonStyles[i] + " style"); - } - b.setStyleName(buttonStyles[i].toLowerCase()); - if (icon) { - b.setIcon(new ThemeResource("../runo/icons/" - + (largeIcons ? "64" : "16") + "/document.png")); - } - if (error) { - b.setComponentError(new UserError("Error")); - } - if (disabled) { - b.setEnabled(false); - } - if (sized) { - b.setWidth("250px"); - b.setCaption(b.getCaption() + " (250px)"); - } - hl.addComponent(b); - } - - return hl; - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1225.java b/src/com/vaadin/tests/tickets/Ticket1225.java deleted file mode 100644 index 5244308f45..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1225.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -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 { - - @Override - public void init() { - - final Window mainWin = new Window( - "Test app to break layout fuction in IE7"); - setMainWindow(mainWin); - - SplitPanel sp = new SplitPanel(); - - sp.setFirstComponent(new Label("First")); - - ExpandLayout el = new ExpandLayout(); - - sp.setSecondComponent(el); - el.setMargin(true); - el.setSizeFull(); - - el.addComponent(new Label("Top")); - - Table testTable = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 50); - testTable.setSizeFull(); - - TabSheet ts = new TabSheet(); - ts.setSizeFull(); - - Label red = new Label( - "
??
", - Label.CONTENT_XHTML); - // red.setCaption("cap"); - // red.setSizeFull(); - - // el.addComponent(testTable); - // el.expand(testTable); - - el.addComponent(ts); - el.expand(ts); - ts.addComponent(red); - ts.setTabCaption(red, "REd tab"); - - Label l = new Label("
sdf
", - Label.CONTENT_XHTML); - el.addComponent(l); - el.setComponentAlignment(l, ExpandLayout.ALIGNMENT_RIGHT, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - mainWin.setLayout(sp); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1230.java b/src/com/vaadin/tests/tickets/Ticket1230.java deleted file mode 100644 index 233dd3aae8..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1230.java +++ /dev/null @@ -1,129 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket1230 extends Application { - - private static final Object PROPERTY_ID = new Object(); - private static final Object NULL_ITEM_ID = new Object(); - private Select selectWithoutNullItem; - private Select selectWithNullItem; - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(5, 5); - w.setLayout(layout); - - layout.setSpacing(true); - - { - selectWithoutNullItem = createSelect(); - - layout.addComponent(selectWithoutNullItem); - Button b = new Button("Select NULL_PROPERTY", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select(NULL_ITEM_ID); - - } - }); - layout.addComponent(b); - b = new Button("Select 1", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select("1"); - - } - }); - layout.addComponent(b); - b = new Button("Select 2", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select("2"); - - } - }); - layout.addComponent(b); - - b = new Button("Select null", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithoutNullItem.select(null); - - } - }); - layout.addComponent(b); - } - - { - selectWithNullItem = createSelect(); - Item nullItem = selectWithNullItem.addItem(NULL_ITEM_ID); - nullItem.getItemProperty(PROPERTY_ID).setValue("NULL"); - selectWithNullItem.setNullSelectionItemId(NULL_ITEM_ID); - - layout.addComponent(selectWithNullItem); - Button b = new Button("Select NULL_PROPERTY", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithNullItem.select(NULL_ITEM_ID); - - } - }); - layout.addComponent(b); - - b = new Button("Select 1", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithNullItem.select("1"); - - } - }); - layout.addComponent(b); - b = new Button("Select 2", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithNullItem.select("2"); - - } - }); - layout.addComponent(b); - - b = new Button("Select null", new ClickListener() { - - public void buttonClick(ClickEvent event) { - selectWithNullItem.select(null); - - } - }); - layout.addComponent(b); - - } - } - - private Select createSelect() { - Select select = new Select(); - select.setMultiSelect(false); - select.addContainerProperty(PROPERTY_ID, String.class, ""); - select.setItemCaptionPropertyId(PROPERTY_ID); - - Item item1 = select.addItem("1"); - item1.getItemProperty(PROPERTY_ID).setValue("1"); - Item item2 = select.addItem("2"); - item2.getItemProperty(PROPERTY_ID).setValue("2"); - - select.setNullSelectionAllowed(true); - - return select; - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket124.java b/src/com/vaadin/tests/tickets/Ticket124.java deleted file mode 100644 index 1c2ca1a2e1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket124.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket124 extends Application { - - private TextField tf; - private GridLayout gl; - - @Override - public void init() { - Window w = new Window("#124: Insert & remove row for GridLayout"); - setMainWindow(w); - setTheme("tests-tickets"); - // gl = new GridLayout(4, 4); - gl = new GridLayout(2, 2); - - tf = new TextField("Row nr"); - Button insert = new Button("Insert row", new ClickListener() { - - public void buttonClick(ClickEvent event) { - insertRow(); - - } - }); - Button delete = new Button("Delete row", new ClickListener() { - - public void buttonClick(ClickEvent event) { - deleteRow(); - - } - }); - - // gl.addComponent(new Label("0-0"), 0, 0); - // gl.addComponent(new Label("0-1"), 1, 0); - gl.addComponent(new Label("1-0"), 1, 0); - gl.addComponent(new Label("1-1"), 1, 1); - 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
yadayada
lorem ipsum"); - l.setContentMode(Label.CONTENT_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); - gl.addComponent(tf, 0, 3); - gl.addComponent(insert, 1, 3); - gl.addComponent(delete, 2, 3); - - gl.setStyleName("border"); - w.addComponent(gl); - } - - protected void deleteRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - gl.removeRow(pos); - - } - - protected void clearRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - for (int col = 0; col < gl.getColumns(); col++) { - try { - gl.removeComponent(col, pos); - } catch (Exception e) { - e.printStackTrace(); - } - } - - } - - protected void insertRow() { - int pos = Integer.parseInt(tf.getValue().toString()); - gl.insertRow(pos); - try { - TextField t = new TextField("", "Newly added row"); - t.setWidth("100%"); - gl.addComponent(t, 0, pos, 3, pos); - } catch (Exception e) { - // TODO: handle exception - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1245.java b/src/com/vaadin/tests/tickets/Ticket1245.java deleted file mode 100644 index c2a150b8ba..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1245.java +++ /dev/null @@ -1,93 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.ui.AbstractSelect; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; - -public class Ticket1245 extends com.vaadin.Application { - - TextField f = new TextField(); - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(new TreeExample()); - } -} - -class TreeExample extends CustomComponent { - - // Id for the caption property - private static final Object CAPTION_PROPERTY = "caption"; - - private static final String desc = "non-first tree in non-sized orderedlayout seems to be the problem"; - - Tree tree; - - public TreeExample() { - final OrderedLayout main = new OrderedLayout(); - setCompositionRoot(main); - - // Panel w/ Tree - main.setStyleName(Panel.STYLE_LIGHT); - main.setWidth(200); - // // Description, this is needed. Works in first slot - main.addComponent(new Label(desc)); - - // setting either width or height fixes the issue - // p.setWidth(500); - // p.setHeight(800); - - // Tree with a few items - tree = new Tree(); - tree.setImmediate(true); - // we'll use a property for caption instead of the item id ("value"), - // so that multiple items can have the same caption - tree.addContainerProperty(CAPTION_PROPERTY, String.class, ""); - tree.setItemCaptionMode(AbstractSelect.ITEM_CAPTION_MODE_PROPERTY); - tree.setItemCaptionPropertyId(CAPTION_PROPERTY); - for (int i = 1; i <= 3; i++) { - final Object id = addCaptionedItem("Section " + i, null); - tree.expandItem(id); - addCaptionedItem("Team A", id); - addCaptionedItem("Team B", id); - } - main.addComponent(tree); - } - - /** - * Helper to add an item with specified caption and (optional) parent. - * - * @param caption - * The item caption - * @param parent - * The (optional) parent item id - * @return the created item's id - */ - private Object addCaptionedItem(String caption, Object parent) { - // add item, let tree decide id - final Object id = tree.addItem(); - // get the created item - final Item item = tree.getItem(id); - // set our "caption" property - final Property p = item.getItemProperty(CAPTION_PROPERTY); - p.setValue(caption); - if (parent != null) { - tree.setChildrenAllowed(parent, true); - tree.setParent(id, parent); - tree.setChildrenAllowed(id, false); - } - return id; - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1362Login.java b/src/com/vaadin/tests/tickets/Ticket1362Login.java deleted file mode 100644 index 8640b06bc0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1362Login.java +++ /dev/null @@ -1,276 +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.CustomComponent; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -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 = ("" - + "" - + "" - + "" - + "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.
" - + "Username : " - + "Password : " - + "" + "
" - + "" + "" - + "").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 parameters) { - if (parameters.containsKey("username")) { - getWindow().addURIHandler(uriHandler); - - HashMap params = new HashMap(); - // expecting single params - for (Iterator it = parameters.keySet().iterator(); it - .hasNext();) { - String key = (String) it.next(); - String value = ((String[]) parameters.get(key))[0]; - params.put(key, value); - } - LoginEvent event = new LoginEvent(params); - for (Iterator iterator = listeners.iterator(); iterator - .hasNext();) { - LoginListener listener = (LoginListener) 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( - "Login form handeled." - .getBytes()), "text/html", - "loginSuccesfull.html"); - } - }; - - private LinkedList listeners = new LinkedList(); - - 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 params; - - private LoginEvent(Map 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 (String) 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 ExpandLayout el; - - @Override - public void init() { - - final Window mainWin = new Window( - "Test app with password manager savvy login functionality"); - - el = new ExpandLayout(); - - currentUser.setCaption("Currennt user"); - el.addComponent(currentUser); - - el.addComponent(loginBox); - el.expand(loginBox); - - mainWin.setLayout(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().getLayout().replaceComponent(loginBox, - mainPanel); - el.expand(mainPanel); - } else { - getMainWindow().showNotification( - "Wrong password. Hint, try '1234' ", - Notification.TYPE_WARNING_MESSAGE); - } - } - }); - - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1365.java b/src/com/vaadin/tests/tickets/Ticket1365.java deleted file mode 100644 index 1a890e313e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1365.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.event.Action; -import com.vaadin.event.ShortcutAction; -import com.vaadin.event.Action.Handler; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1365 extends com.vaadin.Application implements - Handler { - - TextField f = new TextField(); - - Label status = new Label("ENTER and CTRL-S fires shortcut action."); - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(f); - main.addComponent(status); - main.addActionHandler(this); - f.focus(); - - } - - final static private Action[] actions = new Action[] { - new ShortcutAction("Enter", ShortcutAction.KeyCode.ENTER, - new int[] {}), - new ShortcutAction("CTRL-S", ShortcutAction.KeyCode.S, - new int[] { ShortcutAction.ModifierKey.CTRL }), }; - - public Action[] getActions(Object target, Object sender) { - return actions; - } - - public void handleAction(Action action, Object sender, Object target) { - status.setValue("Pressed " + action.getCaption() - + " to fire shortcut. Texfield value: " + f.getValue()); - f.focus(); - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1368.java b/src/com/vaadin/tests/tickets/Ticket1368.java deleted file mode 100644 index 9df316fdcb..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1368.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -/** - */ -public class Ticket1368 extends Application { - - private Table t; - - @Override - public void init() { - - final Window mainWin = new Window("Test app to #1368"); - setMainWindow(mainWin); - - t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 5); - - mainWin.addComponent(t); - - ComboBox addColumn = new ComboBox(); - addColumn.setImmediate(true); - addColumn.setNewItemsAllowed(true); - addColumn.setNewItemHandler(new ComboBox.NewItemHandler() { - public void addNewItem(String newItemCaption) { - t.addContainerProperty(newItemCaption, String.class, "-"); - } - }); - mainWin.addComponent(addColumn); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1397.java b/src/com/vaadin/tests/tickets/Ticket1397.java deleted file mode 100644 index b56620365c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1397.java +++ /dev/null @@ -1,148 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.Application; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.InlineDateField; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.PopupView; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1397 extends Application { - - Window main; - - @Override - public void init() { - setTheme("runo"); - main = new Window("PopupView test"); - setMainWindow(main); - Panel panel = new Panel("PopupTest"); - - // First test component - final ObjectProperty prop = new ObjectProperty("fooTextField"); - - PopupView.Content content = new PopupView.Content() { - public String getMinimizedValueAsHTML() { - return prop.toString(); - } - - public Component getPopupComponent() { - return new TextField("Edit foo", prop); - } - }; - - PopupView pe = new PopupView(content); - pe.setDescription("Click to edit"); - panel.addComponent(pe); - - // Second test component - PopupView pe2 = new PopupView("fooLabel", new Label("Foooooooooo...")); - pe2.setDescription("Click to view"); - panel.addComponent(pe2); - - // Third test component - final ObjectProperty prop2 = new ObjectProperty(new StringBuffer( - "Text for button")); - - class myButton extends Button { - public myButton() { - super("Reverse the property"); - this.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - StringBuffer getContents = (StringBuffer) prop2 - .getValue(); - getContents.reverse(); - - } - }); - } - } - - final Panel panel2 = new Panel("Editor with a button"); - panel2.addComponent(new myButton()); - PopupView.Content content2 = new PopupView.Content() { - public String getMinimizedValueAsHTML() { - return prop2.toString(); - } - - public Component getPopupComponent() { - return panel2; - } - }; - - PopupView p3 = new PopupView(content2); - panel.addComponent(p3); - - // Fourth test component - final Panel panel3 = new Panel("Editor popup for a property"); - TextField tf2 = new TextField("TextField for editing a property"); - final ObjectProperty op = new ObjectProperty("This is property text."); - tf2.setPropertyDataSource(op); - panel3.addComponent(tf2); - PopupView.Content content3 = new PopupView.Content() { - - public String getMinimizedValueAsHTML() { - return op.toString(); - } - - public Component getPopupComponent() { - return panel3; - } - - }; - PopupView p4 = new PopupView(content3); - panel.addComponent(p4); - - // Fifth test component - Table table = new Table("Table for testing purposes"); - for (int i = 0; i < 5; i++) { - table.addContainerProperty("" + (i + 1), String.class, ""); - } - table.addContainerProperty("" + 6, PopupView.class, null); - table.addContainerProperty("" + 7, PopupView.class, null); - table.setPageLength(20); - for (int i = 0; i < 1000; i++) { - - final InlineDateField df = new InlineDateField("", new Date()); - PopupView pp = new PopupView(new PopupView.Content() { - public String getMinimizedValueAsHTML() { - return df.toString(); - } - - public Component getPopupComponent() { - return df; - } - }); - final int lineNum = i; - PopupView pp2 = new PopupView(new PopupView.Content() { - - TextField tf = new TextField("Editor for line " + lineNum, - - "Try to edit the contents for this textfield on line " - + lineNum - + " and see how the overview-version changes."); - - public String getMinimizedValueAsHTML() { - return "" + tf.toString().length() + " characters of info"; - } - - public Component getPopupComponent() { - return tf; - } - - }); - table.addItem(new Object[] { "1 " + i, "2 " + i, "3 " + i, - "4 " + i, "5 " + i, pp, pp2 }, new Integer(i)); - } - - main.addComponent(table); - main.addComponent(panel); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1435.java b/src/com/vaadin/tests/tickets/Ticket1435.java deleted file mode 100644 index 9058184d8f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1435.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1435 extends Application { - - private static final boolean useWorkaround = true; - - @Override - public void init() { - - final Window mainWin = new Window("ButtonPanel containing a table test"); - setMainWindow(mainWin); - ((OrderedLayout) mainWin.getLayout()).setSpacing(true); - - ButtonPanel dataCardView1 = buildButtonPanel("My Tickets"); - ButtonPanel dataCardView2 = buildButtonPanel("My Tickets 2"); - - mainWin.addComponent(dataCardView1); - mainWin.addComponent(dataCardView2); - - } - - /** - * A ButtonPanel is a Panel, which has context specific Buttons in its - * header. - * - * ButtonPanel also provides buttons for controlling its visibility - * (collapse/expand). - */ - public class ButtonPanel extends CustomComponent { - - ExpandLayout root = new ExpandLayout(); - - // In header are the panel's title and the control buttons. - // Panel title is expanded by default. - ExpandLayout header = new ExpandLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - - // This is where the actual data is put. - Panel container = new Panel(); - - // Last known height before the panel was collapsed - private float lastHeight = -1; - private int lastHeightUnit = -1; - - public ButtonPanel(String labelString) { - setCompositionRoot(root); - root.setSizeFull(); - - root.setStyleName("toolbarpanel"); - header.setStyleName("toolbar"); - - initHeader(labelString); - - initContainer(); - } - - private void initHeader(String labelString) { - root.addComponent(header); - header.setWidth("100%"); - header.setHeight("26px"); - Label label = new Label(labelString); - label.setStyleName("caption"); - header.addComponent(label); - - final Layout buttonContainer; - if (useWorkaround) { - buttonContainer = header; - - } else { - buttonContainer = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - header.addComponent(buttonContainer); - - } - - Button edit = new Button("Edit"); - edit.setStyleName("link"); - buttonContainer.addComponent(edit); - - Button copy = new Button("Copy"); - copy.setStyleName("link"); - buttonContainer.addComponent(copy); - - Button move = new Button("Move"); - move.setStyleName("link"); - buttonContainer.addComponent(move); - - Button delete = new Button("Delete"); - delete.setStyleName("link"); - buttonContainer.addComponent(delete); - - Button bind = new Button("Bind"); - bind.setStyleName("link"); - buttonContainer.addComponent(bind); - - Button options = new Button("Options..."); - options.setStyleName("link"); - buttonContainer.addComponent(options); - - final Button expand = new Button("Expand"); - - final Button collapse = new Button("Collapse"); - buttonContainer.addComponent(collapse); - - collapse.setStyleName("collapse"); - collapse.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - if (useWorkaround) { - container.setVisible(false); - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - root.setHeight("26px"); - buttonContainer.replaceComponent(collapse, expand); - } else { - boolean visible = container.isVisible(); - container.setVisible(!visible); - if (visible) { - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - root.setHeight("26px"); - } else { - root.setHeight(lastHeight, lastHeightUnit); - } - event.getButton().setCaption( - visible ? "Expand" : "Collapse"); - } - } - }); - - if (useWorkaround) { - expand.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - container.setVisible(true); - root.setHeight(lastHeight, lastHeightUnit); - buttonContainer.replaceComponent(expand, collapse); - } - }); - } - - } - - private void initContainer() { - container.setStyleName("custompanel"); - container.setSizeFull(); - container.getLayout().setMargin(false); - container.getLayout().setSizeFull(); - root.addComponent(container); - root.expand(container); - } - - public void setHeight(int height, int unit) { - root.setHeight(height, unit); - lastHeight = height; - lastHeightUnit = unit; - container.setHeight("100%"); - } - - @Override - public void setHeight(String height) { - root.setHeight(height); - lastHeight = root.getHeight(); - lastHeightUnit = root.getHeightUnits(); - container.setHeight("100%"); - } - - @Override - public void setWidth(String width) { - root.setWidth(width); - } - - public void setWidth(int width, int unit) { - root.setWidth(width, unit); - } - - @Override - public void setSizeFull() { - setWidth("100%"); - setHeight("100%"); - } - - public void setPanelComponent(Component component) { - container.removeAllComponents(); - container.addComponent(component); - } - } - - public ButtonPanel buildButtonPanel(String caption) { - ButtonPanel panel = new ButtonPanel(caption); - - panel.setHeight("250px"); - panel.setWidth("500px"); - - Table table = new Table(); - - table.setSizeFull(); - - table.addContainerProperty("checkbox", CheckBox.class, new CheckBox()); - table.setColumnWidth("checkbox", 30); - table.setColumnHeader("checkbox", ""); - - table.addContainerProperty("Tickets", String.class, null); - table.setColumnWidth("Tickets", 150); - - table.addContainerProperty("Deadline", String.class, null); - - for (int i = 0; i < 10; i++) { - String name = "Name " + i; - table.addItem(new Object[] { new CheckBox(), name, - "02-22-2007 13:37" }, new Integer(i)); - } - - panel.setPanelComponent(table); - - return panel; - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1444.java b/src/com/vaadin/tests/tickets/Ticket1444.java deleted file mode 100644 index 2944f460f6..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1444.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket1444 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window( - "Test app to break layout fuction in IE7"); - setMainWindow(mainWin); - - OrderedLayout ol = new OrderedLayout(); - ol.setHeight("250px"); - ol.setWidth("500px"); - - Label red = new Label( - "
??
", - Label.CONTENT_XHTML); - red.setSizeFull(); - - ol.addComponent(red); - mainWin.addComponent(ol); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java b/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java deleted file mode 100644 index 3437ca5d2a..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1465ModalNotification.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1465ModalNotification extends Application { - - @Override - public void init() { - - final Window mainWin = new Window("ButtonPanel containing a table test"); - setMainWindow(mainWin); - - final Window modal = new Window("Modal window"); - modal.setModal(true); - - Button b = new Button("click to show notification", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - modal.showNotification( - "Try clicking the button in main window!", - Window.Notification.TYPE_ERROR_MESSAGE); - - } - }); - modal.addComponent(b); - - b = new Button("click to warning notification", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - modal.showNotification( - "Try clicking the button in main window!", - Window.Notification.TYPE_WARNING_MESSAGE); - } - }); - modal.addComponent(b); - - b = new Button("click to Humanized notification", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - modal.showNotification( - "Try clicking the button in main window!", - Window.Notification.TYPE_HUMANIZED_MESSAGE); - } - }); - modal.addComponent(b); - - b = new Button("click to test modality!", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - mainWin.addComponent(new Label("clicked")); - - } - }); - - modal.addComponent(b); - - mainWin.addWindow(modal); - - b = new Button("click to test modality!", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - mainWin.addComponent(new Label("clicked")); - - } - }); - - mainWin.addComponent(b); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1506.java b/src/com/vaadin/tests/tickets/Ticket1506.java deleted file mode 100644 index 4788d27aad..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1506.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Panel; - -public class Ticket1506 extends CustomComponent { - - Panel p; - - public Ticket1506() { - p = new Ticket1506_Panel(); - setCompositionRoot(p); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1506_Panel.java b/src/com/vaadin/tests/tickets/Ticket1506_Panel.java deleted file mode 100644 index edbfd8928d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1506_Panel.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Select; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_Panel extends Panel { - - public Ticket1506_Panel() { - ObjectProperty property1 = new ObjectProperty(null, String.class); - addComponent(initSelect(new Ticket1506_TestContainer(), "Test select", - property1)); - addComponent(initButton(property1)); - addComponent(initSelect(new Ticket1506_TestContainer2(), - "Test select 2", new ObjectProperty(null, String.class))); - } - - private Component initButton(final ObjectProperty property) { - Button button = new Button("Clear select"); - button.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - property.setValue(null); - } - }); - return button; - } - - private Component initSelect(Container containerDataSource, String caption, - ObjectProperty property) { - Select select = new Select(caption); - select.setFilteringMode(Select.FILTERINGMODE_CONTAINS); - select.setImmediate(true); - select.setNullSelectionAllowed(false); - select.setItemCaptionPropertyId(Ticket1506_TestContainer.PROPERTY_2_ID); - - select.setContainerDataSource(containerDataSource); - select.setPropertyDataSource(property); - return select; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java b/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java deleted file mode 100644 index 7002602ca2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.data.util.PropertysetItem; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_TestContainer implements Container { - private Map items = new HashMap(); - public static final String ITEM_1_ID = "1"; - public static final String ITEM_2_ID = "2"; - public static final String PROPERTY_1_ID = "property 1"; - public static final String PROPERTY_2_ID = "property 2"; - - private void loadItems() { - final PropertysetItem item1 = new PropertysetItem(); - item1.addItemProperty(PROPERTY_1_ID, new ObjectProperty("value 1", - String.class)); - item1.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name 1", - String.class)); - items.put(ITEM_1_ID, item1); - - final PropertysetItem item2 = new PropertysetItem(); - item2.addItemProperty(PROPERTY_1_ID, new ObjectProperty("value 2", - String.class)); - item2.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name 2", - String.class)); - items.put(ITEM_2_ID, item2); - } - - public Item getItem(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return (Item) items.get(itemId); - } - - public Collection getContainerPropertyIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList a = new ArrayList(); - a.add(PROPERTY_1_ID); - a.add(PROPERTY_2_ID); - return a; - } - - public Collection getItemIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList a = new ArrayList(); - a.add(ITEM_1_ID); - a.add(ITEM_2_ID); - return a; - } - - public Property getContainerProperty(Object itemId, Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - Item item = (Item) items.get(itemId); - if (item != null) { - return item.getItemProperty(propertyId); - } - return null; - } - - public Class getType(Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - return String.class; - } - - public int size() { - if (items.isEmpty()) { - loadItems(); - } - return items.size(); - } - - public boolean containsId(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.containsKey(itemId); - } - - public Item addItem(Object itemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean addContainerProperty(Object propertyId, Class type, - Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java b/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java deleted file mode 100644 index 4345b3e581..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1506_TestContainer2.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.data.util.PropertysetItem; - -/** - * @author Efecte R&D - * @version $Revision$, $Date$ - */ -public class Ticket1506_TestContainer2 implements Container { - private Map items = new HashMap(); - public static final String ITEM_1_ID = "1"; - public static final String ITEM_2_ID = "2"; - public static final String PROPERTY_1_ID = "property 1"; - public static final String PROPERTY_2_ID = "property 2"; - - private void loadItems() { - for (int i = 1; i < 15; i++) { - final PropertysetItem item = new PropertysetItem(); - item.addItemProperty(PROPERTY_1_ID, new ObjectProperty( - "value " + i, String.class)); - item.addItemProperty(PROPERTY_2_ID, new ObjectProperty("name " + i, - String.class)); - items.put(String.valueOf(i), item); - } - } - - public Item getItem(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return (Item) items.get(itemId); - } - - public Collection getContainerPropertyIds() { - if (items.isEmpty()) { - loadItems(); - } - ArrayList a = new ArrayList(); - a.add(PROPERTY_1_ID); - a.add(PROPERTY_2_ID); - return a; - } - - public Collection getItemIds() { - if (items.isEmpty()) { - loadItems(); - } - return items.keySet(); - } - - public Property getContainerProperty(Object itemId, Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - Item item = (Item) items.get(itemId); - if (item != null) { - return item.getItemProperty(propertyId); - } - return null; - } - - public Class getType(Object propertyId) { - if (items.isEmpty()) { - loadItems(); - } - return String.class; - } - - public int size() { - if (items.isEmpty()) { - loadItems(); - } - return items.size(); - } - - public boolean containsId(Object itemId) { - if (items.isEmpty()) { - loadItems(); - } - return items.containsKey(itemId); - } - - public Item addItem(Object itemId) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public Object addItem() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeItem(Object itemId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean addContainerProperty(Object propertyId, Class type, - Object defaultValue) throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeContainerProperty(Object propertyId) - throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } - - public boolean removeAllItems() throws UnsupportedOperationException { - throw new UnsupportedOperationException("Not implemented"); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1519.java b/src/com/vaadin/tests/tickets/Ticket1519.java deleted file mode 100644 index d088b2be23..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1519.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; - -public class Ticket1519 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window("Test app to #1368"); - setMainWindow(mainWin); - - mainWin.setTheme("example"); - TabSheet ts = new TabSheet(); - - ts.addTab(new CustomLayout("News"), "News", null); - ts.addTab(new CustomLayout("Support"), "Support", null); - - mainWin.addComponent(ts); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1572.java b/src/com/vaadin/tests/tickets/Ticket1572.java deleted file mode 100644 index b2bc0397fd..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1572.java +++ /dev/null @@ -1,118 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1572 extends com.vaadin.Application { - - private Label state; - private GridLayout gl; - private Label spacingstate; - - @Override - public void init() { - - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Panel p = new Panel("Test wrapper for gridlayout margin/spacing"); - - p.setLayout(new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL)); - - gl = new GridLayout(3, 3); - gl.setMargin(true); - for (int i = 0; i < 3 * 3; i++) { - gl.addComponent(new Button("test")); - } - p.addComponent(gl); - p.addComponent(new Label("| next component")); - - Button b = new Button("next margin state"); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - nextMarginState(); - } - - }); - - state = new Label(); - state.setCaption("Current margin state:"); - main.addComponent(state); - main.addComponent(b); - - Button b2 = new Button("next spacing state"); - b2.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - nextSpacingState(); - } - - }); - - spacingstate = new Label(); - spacingstate.setCaption("Current Spacing State:"); - main.addComponent(spacingstate); - main.addComponent(b2); - - main.addComponent(p); - - nextMarginState(); - nextSpacingState(); - - } - - private int stateCounter = -1; - - private void nextMarginState() { - stateCounter++; - switch (stateCounter) { - case 0: - gl.setMargin(false); - state.setValue("Margin off"); - break; - case 1: - gl.setMargin(true); - state.setValue("Margin on"); - break; - case 2: - gl.setMargin(true, false, false, false); - state.setValue("Margin top"); - break; - case 3: - gl.setMargin(false, true, false, false); - state.setValue("Margin right"); - break; - case 4: - gl.setMargin(false, false, true, false); - state.setValue("Margin bottom"); - break; - case 5: - gl.setMargin(false, false, false, true); - state.setValue("Margin left"); - break; - default: - stateCounter = -1; - nextMarginState(); - break; - } - } - - private boolean spacing = true; - - private void nextSpacingState() { - spacing = !spacing; - if (spacing) { - gl.setSpacing(true); - spacingstate.setValue("Spacing on"); - } else { - gl.setSpacing(false); - spacingstate.setValue("Spacing off"); - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1581.java b/src/com/vaadin/tests/tickets/Ticket1581.java deleted file mode 100644 index 0b170260d9..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1581.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket1581 extends com.vaadin.Application { - - private Label time; - private ProgressIndicator poller; - private Thread thread; - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.addComponent(new Label("Test the second issue in ticket #1581")); - - time = new Label(); - poller = new ProgressIndicator(); - poller.setPollingInterval(200); - main.addComponent(time); - main.addComponent(poller); - - thread = new Thread() { - - @Override - public void run() { - super.run(); - while (true) { - time.setValue(new Date()); - try { - sleep(200); - } catch (InterruptedException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } - } - - }; - - thread.start(); - - final Button stop = new Button("Stop updating", new ClickListener() { - boolean active = true; - - public void buttonClick(ClickEvent event) { - - if (active) { - main.removeComponent(poller); - event.getButton().setCaption("Resume"); - } else { - main.addComponent(poller); - event.getButton().setCaption("Stop updating"); - } - active = !active; - } - }); - - main.addComponent(stop); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1589.java b/src/com/vaadin/tests/tickets/Ticket1589.java deleted file mode 100644 index 3debf78f25..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1589.java +++ /dev/null @@ -1,96 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.awt.Color; -import java.awt.Graphics; -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; - -import com.vaadin.Application; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.URIHandler; -import com.vaadin.ui.Link; -import com.vaadin.ui.Window; - -public class Ticket1589 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - MyDynamicResource res = new MyDynamicResource(); - - w.addURIHandler(res); - - w - .addComponent(new Link( - "Test (without Content-Disposition, should suggest generatedFile.png when saving, browser default for actual disposition)", - new ExternalResource("myresource"))); - - w - .addComponent(new Link( - "Test (with Content-Disposition, should popup download dialog that suggests filename downloadedPNG.png)", - new ExternalResource("myresource_download"))); - } -} - -class MyDynamicResource implements URIHandler { - String textToDisplay = (new Date()).toString(); - - /** - * Provides the dynamic resource if the URI matches the resource URI. The - * matching URI is "/myresource" under the application URI context. - * - * 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) { - // 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; - } - - // Create an image and draw some background on it. - BufferedImage image = new BufferedImage(200, 200, - BufferedImage.TYPE_INT_RGB); - Graphics drawable = image.getGraphics(); - drawable.setColor(Color.lightGray); - drawable.fillRect(0, 0, 200, 200); - drawable.setColor(Color.yellow); - drawable.fillOval(25, 25, 150, 150); - drawable.setColor(Color.blue); - drawable.drawRect(0, 0, 199, 199); - - // Use the parameter to create dynamic content. - drawable.setColor(Color.black); - drawable.drawString("Time: " + textToDisplay, 75, 100); - - try { - // Write the image to a buffer. - ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); - ImageIO.write(image, "png", imagebuffer); - - // Return a stream from the buffer. - ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer - .toByteArray()); - DownloadStream downloadStream = new DownloadStream(istream, - "image/png", "generatedFile.png"); - - if (relativeUri.startsWith("myresource_download")) { - downloadStream.setParameter("Content-Disposition", - "attachment; filename=\"downloadedPNG.png\""); - } - return downloadStream; - } catch (IOException e) { - return null; - } - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1598.java b/src/com/vaadin/tests/tickets/Ticket1598.java deleted file mode 100644 index 0b35a223cc..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1598.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.MenuBar; -import com.vaadin.ui.Window; -import com.vaadin.ui.MenuBar.Command; -import com.vaadin.ui.MenuBar.MenuItem; - -public class Ticket1598 extends Application { - - Window main = new Window("MenuBar test"); - - final MenuBar menuBar = new MenuBar(); - - @Override - public void init() { - setMainWindow(main); - setTheme("runo"); - - List itemList = new ArrayList(); - // Populate the menu bar - for (int i = 0; i < 6; i++) { - itemList.add(menuBar.addItem(new String("Menu " + i), null, null)); - } - - MenuItem first = itemList.get(0); - - for (int i = 0; i < 5; i++) { - first.addItem(new String("Submenu item" + i), null, new Command() { - - public void menuSelected(MenuItem selected) { - main.showNotification("Action " + selected.getText()); - } - }); - } - - MenuItem firstSubItem1 = first.getChildren().get(1); - - for (int i = 0; i < 3; i++) { - firstSubItem1.addItem(new String("Subsubmenu item" + i), null, - new Command() { - - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - MenuItem firstSubItem2 = first.getChildren().get(3); - - for (int i = 0; i < 3; i++) { - firstSubItem2.addItem(new String("Subsubmenu item" + i), null, - new Command() { - - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - - MenuItem second = menuBar.getItems().get(1); - - for (int i = 0; i < 5; i++) { - second.addItem(new String("Second submenu item" + i), null, - new Command() { - - public void menuSelected(MenuItem selected) { - main.showNotification("Action " - + selected.getText()); - } - }); - } - - MenuItem third = menuBar.getItems().get(2); - third.setIcon(new ThemeResource("icons/16/document.png")); - - for (int i = 2; i <= 3; i++) { - (menuBar.getItems().get(i)).setCommand(new Command() { - - public void menuSelected(MenuItem selectedItem) { - main.showNotification("Action " + selectedItem.getText()); - } - }); - } - - final MenuItem fourth = menuBar.getItems().get(3); - fourth.setText("Add new item"); - - fourth.setCommand(new Command() { - public void menuSelected(MenuItem selected) { - menuBar.addItem("Newborn", null, null); - } - }); - - final MenuItem fifth = menuBar.getItems().get(4); - for (int i = 0; i < 5; i++) { - fifth.addItem("Another subitem " + i, null); - } - - final MenuItem last = menuBar.getItems().get(menuBar.getSize() - 1); - last.setText("Remove me!"); - - // A command for removing the selected menuitem - Command removeCommand = new Command() { - - public void menuSelected(MenuItem selected) { - MenuItem parent = selected.getParent(); - if (parent != null) { - parent.removeChild(selected); - } else { - menuBar.removeItem(selected); - } - } - }; - - last.setCommand(removeCommand); - - main.addComponent(menuBar); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket161.java b/src/com/vaadin/tests/tickets/Ticket161.java deleted file mode 100644 index a09b0d01cb..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket161.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Container; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - */ -public class Ticket161 extends Application { - - private Table t; - - @Override - public void init() { - - final Window mainWin = new Window("Test app to #1368"); - setMainWindow(mainWin); - - t = TestForTablesInitialColumnWidthLogicRendering.getTestTable(3, 100); - t.setCurrentPageFirstItemIndex(50); - - mainWin.addComponent(t); - - Button b = new Button("Truncate to 20 rows"); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - - Container containerDataSource = t.getContainerDataSource(); - Object[] itemIds = containerDataSource.getItemIds().toArray(); - @SuppressWarnings("unused") - int c = 0; - for (int i = 0; i < itemIds.length; i++) { - if (i > 19) { - containerDataSource.removeItem(itemIds[i]); - } - } - } - }); - - mainWin.addComponent(b); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1632.java b/src/com/vaadin/tests/tickets/Ticket1632.java deleted file mode 100644 index 1c521f8afb..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1632.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.Button; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - */ -public class Ticket1632 extends Application { - - private Table t; - - @Override - public void init() { - - final Window mainWin = new Window("Test app"); - setMainWindow(mainWin); - - t = new Table(); - - t.addContainerProperty("col1", String.class, ""); - t.addContainerProperty("col2", String.class, ""); - t.addContainerProperty("col3", String.class, ""); - - t.addItem(new Object[] { "jep", "foo", "bar" }, "1"); - t.addItem(new Object[] { "jep", "foo", "bar" }, "2"); - t.addItem(new Object[] { "jep", "foo", "bar" }, "3"); - - t.setVisibleColumns(new Object[] { "col1", "col2" }); - - t.addItem(new Object[] { "foo", "bar" }, "4"); - - // workaround to add item with all values - Item i = t.addItem("5"); - i.getItemProperty("col1").setValue("jep"); - i.getItemProperty("col2").setValue("foo"); - i.getItemProperty("col3").setValue("bar"); - - mainWin.addComponent(t); - - Button b = new Button("Toggle col3"); - b.addListener(new Button.ClickListener() { - boolean visible = false; - - public void buttonClick(ClickEvent event) { - visible = !visible; - if (visible) { - t - .setVisibleColumns(new Object[] { "col1", "col2", - "col3" }); - - } else { - t.setVisibleColumns(new Object[] { "col1", "col2" }); - - } - - } - }); - - mainWin.addComponent(b); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1659.java b/src/com/vaadin/tests/tickets/Ticket1659.java deleted file mode 100644 index 78715c89d1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1659.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1659 extends Application { - - @Override - public void init() { - final Window mainWin = new Window(); - setMainWindow(mainWin); - mainWin.addComponent(new Button( - "Change URI using Application.getURL()", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - mainWin.open(new ExternalResource(getURL() + "#" - + System.currentTimeMillis())); - } - })); - mainWin.addComponent(new Button("Change URI uring Window.getURL()", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - mainWin.open(new ExternalResource(mainWin.getURL() - + "#" + System.currentTimeMillis())); - } - })); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1663.java b/src/com/vaadin/tests/tickets/Ticket1663.java deleted file mode 100644 index 04adfa3c79..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1663.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.terminal.SystemError; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1663 extends com.vaadin.Application { - - @Override - public void init() { - - Window main = new Window("#1663"); - setMainWindow(main); - - TextField tf = new TextField("First name"); - tf - .setDescription("The first name is used for the administration user interfaces only."); - tf.setComponentError(new SystemError( - "You must enter only one first name.")); - - main.addComponent(tf); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1673.java b/src/com/vaadin/tests/tickets/Ticket1673.java deleted file mode 100644 index 845e49daed..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1673.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Window; - -public class Ticket1673 extends com.vaadin.Application { - - @Override - public void init() { - - final Window main = new Window("#1673"); - setMainWindow(main); - - main.addComponent(new Button("close", this, "close")); - - } - - public static Application.SystemMessages getSystemMessages() { - Application.CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages(); - - msgs.setSessionExpiredURL("http://www.vaadin.com/"); - msgs.setSessionExpiredCaption("Foo"); - msgs.setSessionExpiredMessage("Bar"); - - return msgs; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1710.java b/src/com/vaadin/tests/tickets/Ticket1710.java deleted file mode 100644 index f65fd0c8e4..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1710.java +++ /dev/null @@ -1,436 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.DateField; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket1710 extends com.vaadin.Application { - - LinkedList listOfAllFields = new LinkedList(); - - public void init() { - - setTheme("tests-tickets"); - - OrderedLayout lo = new OrderedLayout(); - setMainWindow(new Window("#1710", lo)); - lo.setMargin(true); - lo.setSpacing(true); - lo.setWidth("100%"); - - // Hiding controls - OrderedLayout hidingControls = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - lo.addComponent(hidingControls); - - // OrderedLayout - final OrderedLayout orderedLayout = new OrderedLayout(); - LayoutTestingPanel oltp = new LayoutTestingPanel("OrderedLayout", - orderedLayout); - hidingControls.addComponent(new Button("OrderedLayout", - new MethodProperty(oltp, "visible"))); - lo.addComponent(oltp); - orderedLayout.setSpacing(false); - addFields(orderedLayout); - final Button orientationButton = new Button("horizontal orientation", - false); - orientationButton.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - orderedLayout - .setOrientation(orientationButton.booleanValue() ? OrderedLayout.ORIENTATION_HORIZONTAL - : OrderedLayout.ORIENTATION_VERTICAL); - } - }); - orientationButton.setImmediate(true); - oltp.controls.addComponent(orientationButton); - - // GridLayout - GridLayout grid = new GridLayout(1, 1); - Panel g1tp = new LayoutTestingPanel("Gridlayout with 1 column", grid); - hidingControls.addComponent(new Button("GridLayout (1col)", - new MethodProperty(g1tp, "visible"))); - g1tp.setVisible(false); - lo.addComponent(g1tp); - grid.setSpacing(true); - addFields(grid); - GridLayout grid2 = new GridLayout(2, 1); - Panel g2tp = new LayoutTestingPanel("Gridlayout with 2 columns", grid2); - hidingControls.addComponent(new Button("GridLayout (2cols)", - new MethodProperty(g2tp, "visible"))); - g2tp.setVisible(false); - lo.addComponent(g2tp); - grid2.setSpacing(true); - addFields(grid2); - - // ExpandLayout - ExpandLayout el = new ExpandLayout(); - Panel elp = new LayoutTestingPanel( - "ExpandLayout width first component expanded", el); - hidingControls.addComponent(new Button("ExpandLayout (vertical)", - new MethodProperty(elp, "visible"))); - elp.setVisible(false); - el.setHeight(700); - addFields(el); - Component firstComponent = (Component) el.getComponentIterator().next(); - firstComponent.setSizeFull(); - el.expand(firstComponent); - lo.addComponent(elp); - ExpandLayout elh = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel elhp = new LayoutTestingPanel( - "ExpandLayout width first component expanded; horizontal", elh); - hidingControls.addComponent(new Button("ExpandLayout (horizontal)", - new MethodProperty(elhp, "visible"))); - elhp.setVisible(false); - elhp.setScrollable(true); - elh.setWidth(2000); - elh.setHeight(100); - addFields(elh); - Component firstComponentElh = (Component) elh.getComponentIterator() - .next(); - firstComponentElh.setSizeFull(); - elh.expand(firstComponentElh); - lo.addComponent(elhp); - - // CustomLayout - OrderedLayout cl = new OrderedLayout(); - Panel clp = new LayoutTestingPanel("CustomLayout", cl); - hidingControls.addComponent(new Button("CustomLayout", - new MethodProperty(clp, "visible"))); - clp.setVisible(false); - lo.addComponent(clp); - cl.addComponent(new Label("<<< Add customlayout testcase here >>>")); - - // Form - Panel formPanel = new Panel("Form"); - hidingControls.addComponent(new Button("Form", new MethodProperty( - formPanel, "visible"))); - formPanel.setVisible(false); - formPanel.addComponent(getFormPanelExample()); - lo.addComponent(formPanel); - - for (Iterator i = hidingControls.getComponentIterator(); i.hasNext();) { - ((AbstractComponent) i.next()).setImmediate(true); - } - - } - - 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); - Button fb2 = new Button("Test button", true); - fb2.setComponentError(new SystemError("Test error")); - f.addField("fb2", fb2); - TextField ft1 = new TextField("With caption"); - ft1.setComponentError(new SystemError("Error")); - f.addField("ft1", ft1); - TextField ft2 = new TextField(); - ft2.setComponentError(new SystemError("Error")); - ft2.setValue("Without caption"); - f.addField("ft2", ft2); - TextField ft3 = new TextField("With caption and required"); - ft3.setComponentError(new SystemError("Error")); - ft3.setRequired(true); - f.addField("ft3", ft3); - return f; - } - - private void addFields(ComponentContainer lo) { - Button button = new Button("Test button"); - button.setComponentError(new SystemError("Test error")); - lo.addComponent(button); - - Button b2 = new Button("Test button"); - b2.setComponentError(new SystemError("Test error")); - b2.setSwitchMode(true); - lo.addComponent(b2); - - TextField t1 = new TextField("With caption"); - t1.setComponentError(new SystemError("Error")); - lo.addComponent(t1); - - TextField t2 = new TextField("With caption and required"); - t2.setComponentError(new SystemError("Error")); - t2.setRequired(true); - lo.addComponent(t2); - - TextField t3 = new TextField(); - t3.setValue("Without caption"); - t3.setComponentError(new SystemError("Error")); - lo.addComponent(t3); - - lo.addComponent(new TextField("Textfield with no error in it")); - - TextField tt1 = new TextField("100% wide Textfield with no error in it"); - tt1.setWidth("100%"); - lo.addComponent(tt1); - - TextField tt2 = new TextField(); - tt2.setWidth("100%"); - tt2.setValue("100% wide Textfield with no error in it and no caption"); - lo.addComponent(tt2); - - TextField t4 = new TextField(); - t4.setValue("Without caption, With required"); - t4.setComponentError(new SystemError("Error")); - t4.setRequired(true); - lo.addComponent(t4); - - TextField t5 = new TextField(); - t5.setValue("Without caption, WIDE"); - t5.setComponentError(new SystemError("Error")); - t5.setWidth(100); - t5.setWidthUnits(Sizeable.UNITS_PERCENTAGE); - lo.addComponent(t5); - - TextField t6 = new TextField(); - t6.setValue("Without caption, With required, WIDE"); - t6.setComponentError(new SystemError("Error")); - t6.setRequired(true); - t6.setWidth(100); - t6.setWidthUnits(Sizeable.UNITS_PERCENTAGE); - lo.addComponent(t6); - - TextField t7 = new TextField(); - t7.setValue("With icon and required and icon"); - t7.setComponentError(new SystemError("Error")); - t7.setRequired(true); - t7.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - lo.addComponent(t7); - - DateField d1 = new DateField( - "Datefield with caption and icon, next one without caption"); - d1.setComponentError(new SystemError("Error")); - d1.setRequired(true); - d1.setIcon(new ThemeResource("../runo/icons/16/ok.png")); - lo.addComponent(d1); - - DateField d2 = new DateField(); - d2.setComponentError(new SystemError("Error")); - d2.setRequired(true); - lo.addComponent(d2); - } - - public class LayoutTestingPanel extends Panel { - - Layout testedLayout; - - OrderedLayout controls = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - Button marginLeft = new Button("m-left", false); - Button marginRight = new Button("m-right", false); - Button marginTop = new Button("m-top", false); - Button marginBottom = new Button("m-bottom", false); - Button spacing = new Button("spacing", false); - OrderedLayout testPanelLayout = new OrderedLayout(); - - LayoutTestingPanel(String caption, Layout layout) { - super(caption); - OrderedLayout internalLayout = new OrderedLayout(); - internalLayout.setWidth("100%"); - setLayout(internalLayout); - testedLayout = layout; - testPanelLayout.setWidth("100%"); - Panel controlWrapper = new Panel(); - controlWrapper.addComponent(controls); - controlWrapper.setWidth("100%"); - controlWrapper.setScrollable(true); - controlWrapper.setStyleName("controls"); - internalLayout.addComponent(controlWrapper); - Panel testPanel = new Panel(testPanelLayout); - testPanel.setStyleName("testarea"); - testPanelLayout.addComponent(testedLayout); - internalLayout.addComponent(testPanel); - internalLayout.setMargin(true); - internalLayout.setSpacing(true); - controls.setSpacing(true); - controls.setMargin(false); - controls.addComponent(new Label("width")); - controls.addComponent(new TextField(new MethodProperty( - testedLayout, "width"))); - controls.addComponent(new Button("%", new MethodProperty(this, - "widthPercents"))); - controls.addComponent(new Label("height")); - controls.addComponent(new TextField(new MethodProperty( - testedLayout, "height"))); - controls.addComponent(new Button("%", new MethodProperty(this, - "heightPercents"))); - controls.addComponent(marginLeft); - controls.addComponent(marginRight); - controls.addComponent(marginTop); - controls.addComponent(marginBottom); - if (testedLayout instanceof Layout.SpacingHandler) { - controls.addComponent(spacing); - } - - Property.ValueChangeListener marginSpacingListener = new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - updateMarginsAndSpacing(); - } - }; - - marginBottom.addListener(marginSpacingListener); - marginTop.addListener(marginSpacingListener); - marginLeft.addListener(marginSpacingListener); - marginRight.addListener(marginSpacingListener); - spacing.addListener(marginSpacingListener); - updateMarginsAndSpacing(); - - addAlignmentControls(); - - testedLayout.setStyleName("tested-layout"); - setStyleName("layout-testing-panel"); - - for (Iterator i = controls.getComponentIterator(); i.hasNext();) { - ((AbstractComponent) i.next()).setImmediate(true); - } - } - - private void addAlignmentControls() { - if (!(testedLayout instanceof Layout.AlignmentHandler)) { - return; - } - @SuppressWarnings("unused") - final Layout.AlignmentHandler ah = (AlignmentHandler) testedLayout; - - final NativeSelect vAlign = new NativeSelect(); - final NativeSelect hAlign = new NativeSelect(); - controls.addComponent(new Label("component alignment")); - controls.addComponent(hAlign); - controls.addComponent(vAlign); - hAlign.setNullSelectionAllowed(false); - vAlign.setNullSelectionAllowed(false); - - vAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_TOP), "top"); - vAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_VERTICAL_CENTER), - "center"); - vAlign - .addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_BOTTOM)); - vAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_BOTTOM), "bottom"); - - hAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_LEFT), "left"); - hAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), - "center"); - hAlign - .addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT)); - hAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right"); - - Property.ValueChangeListener alignmentChangeListener = new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - updateAlignments(((Integer) hAlign.getValue()).intValue(), - ((Integer) vAlign.getValue()).intValue()); - } - - }; - - hAlign - .setValue(new Integer( - Layout.AlignmentHandler.ALIGNMENT_LEFT)); - vAlign.addListener(alignmentChangeListener); - hAlign.addListener(alignmentChangeListener); - vAlign.setValue(new Integer(Layout.AlignmentHandler.ALIGNMENT_TOP)); - - controls.addComponent(new Label("layout alignment")); - final NativeSelect lAlign = new NativeSelect(); - controls.addComponent(lAlign); - lAlign.setNullSelectionAllowed(false); - lAlign.addItem(new Integer(Layout.AlignmentHandler.ALIGNMENT_LEFT)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_LEFT), "left"); - lAlign.addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_HORIZONTAL_CENTER), - "center"); - lAlign - .addItem(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT)); - lAlign.setItemCaption(new Integer( - Layout.AlignmentHandler.ALIGNMENT_RIGHT), "right"); - - lAlign.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - testPanelLayout.setComponentAlignment(testedLayout, - ((Integer) lAlign.getValue()).intValue(), - OrderedLayout.ALIGNMENT_TOP); - } - }); - } - - private void updateAlignments(int h, int v) { - for (Iterator i = testedLayout.getComponentIterator(); i.hasNext();) { - ((Layout.AlignmentHandler) testedLayout).setComponentAlignment( - (Component) i.next(), h, v); - } - } - - private void updateMarginsAndSpacing() { - testedLayout.setMargin(((Boolean) marginTop.getValue()) - .booleanValue(), ((Boolean) marginRight.getValue()) - .booleanValue(), ((Boolean) marginBottom.getValue()) - .booleanValue(), ((Boolean) marginLeft.getValue()) - .booleanValue()); - if (testedLayout instanceof Layout.SpacingHandler) { - ((Layout.SpacingHandler) testedLayout) - .setSpacing(((Boolean) spacing.getValue()) - .booleanValue()); - } - } - - public boolean getWidthPercents() { - return testedLayout.getWidthUnits() == Sizeable.UNITS_PERCENTAGE; - } - - public void setWidthPercents(boolean b) { - testedLayout.setWidthUnits(b ? Sizeable.UNITS_PERCENTAGE - : Sizeable.UNITS_PIXELS); - } - - public boolean getHeightPercents() { - return testedLayout.getHeightUnits() == Sizeable.UNITS_PERCENTAGE; - } - - public void setHeightPercents(boolean b) { - testedLayout.setHeightUnits(b ? Sizeable.UNITS_PERCENTAGE - : Sizeable.UNITS_PIXELS); - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1737.java b/src/com/vaadin/tests/tickets/Ticket1737.java deleted file mode 100644 index cc44e43c46..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1737.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.demo.Calc; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.Resource; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket1737 extends Application { - - Resource slowRes = new ClassResource(Calc.class, "m-bullet-blue.gif", this) { - @Override - public DownloadStream getStream() { - try { - Thread.sleep(4000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - return super.getStream(); - } - }; - - @Override - public void init() { - - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - ExpandLayout el = new ExpandLayout(); - main.setLayout(el); - - Panel p = new Panel("Test panel"); - p.setSizeFull(); - - p.addComponent(new Label( - "Second component is embedded with a slow resource " - + "and thus should break layout if Embedded cannot" - + " request re-layout after load.")); - - Embedded em = new Embedded("TestEmbedded", slowRes); - - el.addComponent(p); - el.addComponent(em); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1767.java b/src/com/vaadin/tests/tickets/Ticket1767.java deleted file mode 100644 index a65a601175..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1767.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Window; - -public class Ticket1767 extends com.vaadin.Application { - - @Override - public void init() { - - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - ComboBox cb = new ComboBox(" '<' item is not seen in populist?"); - cb.addItem("Test < jep >"); - cb.addItem("<"); - cb.addItem(">"); - - cb.addItem("< dsf"); - cb.addItem("> sdf"); - - cb.addItem("dsfs <"); - cb.addItem("sdfsd >"); - - main.addComponent(cb); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1772.java b/src/com/vaadin/tests/tickets/Ticket1772.java deleted file mode 100644 index 977d8563f0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1772.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1772 extends com.vaadin.Application { - - @Override - public void init() { - - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Button b = new Button("Add content"); - main.addComponent(b); - - final GridLayout gridLayout = new GridLayout(2, 2); - main.addComponent(gridLayout); - - b.addListener(new Button.ClickListener() { - int counter = 0; - - public void buttonClick(ClickEvent event) { - - gridLayout - .addComponent(new TextField("Content " + (++counter))); - - } - }); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1775.java b/src/com/vaadin/tests/tickets/Ticket1775.java deleted file mode 100644 index cd66ecf0e5..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1775.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1775 extends com.vaadin.Application { - - @Override - public void init() { - - final Window main = new Window("#1775"); - setMainWindow(main); - main.setTheme("example"); - String layoutName = "mainLayout"; - final CustomLayout layout = new CustomLayout(layoutName); - - main.addComponent(layout); - - Button button2 = new Button("Populate content"); - main.addComponent(button2); - - final Button button = new Button("Change content"); - main.addComponent(button); - - button2.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - Label mainComponent = new Label("Main"); - Label header = new Label("Header"); - final Label anotherComponent = new Label("another"); - layout.addComponent(mainComponent, "body"); - layout.addComponent(header, "loginUser"); - button.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - layout.addComponent(anotherComponent, "body"); - layout.removeComponent("loginUser"); - } - }); - - } - }); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1804.java b/src/com/vaadin/tests/tickets/Ticket1804.java deleted file mode 100644 index 5a0cc7e30b..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1804.java +++ /dev/null @@ -1,152 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Validator; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.SystemError; -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1804 extends com.vaadin.Application { - - LinkedList listOfAllFields = new LinkedList(); - - @Override - public void init() { - - final Window main = new Window("#1804"); - setMainWindow(main); - - com.vaadin.ui.Select s; - - s = new Select("Select with null selection allowed; required=true"); - s.setNullSelectionAllowed(true); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Select with null selection NOT allowed; required=true"); - s.setNullSelectionAllowed(false); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Testcase from the ticket #1804"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty(new TestPojo(), "id")); - s.addValidator(new EmptyStringValidator( - "Selection required for test-field")); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select("Testcase from the ticket #1804, but without validator"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty(new TestPojo(), "id")); - s.setRequired(true); - listOfAllFields.add(s); - - s = new Select( - "Testcase from the ticket #1804, but with required=false"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty(new TestPojo(), "id")); - s.addValidator(new EmptyStringValidator( - "Selection required for test-field")); - listOfAllFields.add(s); - - s = new Select( - "Testcase from the ticket #1804, but without validator and with required=false"); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty(new TestPojo(), "id")); - listOfAllFields.add(s); - - s = new Select( - "Required=true, custom error message, null selection not allowed"); - s.setRequired(true); - s.setNullSelectionAllowed(false); - s.setPropertyDataSource(new MethodProperty(new TestPojo(), "id")); - s.setValue(null); - s.setComponentError(new SystemError("Test error message")); - listOfAllFields.add(s); - - for (Iterator i = listOfAllFields.iterator(); i.hasNext();) { - s = (Select) i.next(); - main.addComponent(s); - s.addItem("foo"); - s.addItem(""); - s.addItem("bar"); - if (s.isNullSelectionAllowed()) { - s.addItem(""); - s.setNullSelectionItemId(""); - } - s.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (java.util.Iterator i = listOfAllFields.iterator(); i - .hasNext();) { - AbstractField af = (AbstractField) i.next(); - msg.append("

" + af.getCaption() + "

\n"); - msg.append("Value=" + af.getValue() + "
\n"); - if (af.isValid()) { - msg.append("VALID\n
"); - } else { - msg.append("INVALID
" + af.getErrorMessage() - + "
"); - } - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.setScrollable(true); - w.setHeight(80); - w.setHeightUnits(Sizeable.UNITS_PERCENTAGE); - w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML)); - main.addWindow(w); - } - }); - } - - public class TestPojo { - String id = ""; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - } - - /** Throws an exception when the string is empty or null. */ - class EmptyStringValidator implements Validator { - - String msg; - - EmptyStringValidator(String msg) { - this.msg = msg; - } - - public boolean isValid(Object value) { - return !(value == null || value.toString().length() == 0); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException(msg); - } - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1805.java b/src/com/vaadin/tests/tickets/Ticket1805.java deleted file mode 100644 index ef80904854..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1805.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1805 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - main.getLayout().setMargin(false); - - Label description = new Label( - "GridLayout with 100% (no height), is wanted to " - + "share all available width with columns " - + "relatively to their natural width. And it " - + "should still work with margins and spacings"); - main.addComponent(description); - - final GridLayout grid = new GridLayout(4, 1); - - final TextField size = new TextField("Grid width in css unit"); - size.addListener(new ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - String width = size.getValue().toString(); - if (width == null || width.equals("")) { - grid.setSizeUndefined(); - } else { - grid.setWidth(width); - } - } - }); - main.addComponent(size); - main.addComponent(new Button("set size")); - - grid.setMargin(true); - grid.setSpacing(true); - - grid.addComponent(new Label("WIDE")); - grid.addComponent(new Label("_I_")); - grid.addComponent(new Label("VEEEEEEEEEEERY_WIDE")); - Label label = new Label("|"); - grid.addComponent(label); - grid.setComponentAlignment(label, GridLayout.ALIGNMENT_RIGHT, - GridLayout.ALIGNMENT_TOP); - main.addComponent(grid); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1806.java b/src/com/vaadin/tests/tickets/Ticket1806.java deleted file mode 100644 index 1949fddfa1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1806.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1806 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - final ObjectProperty prop = new ObjectProperty(""); - final TextField tf1 = new TextField( - "Buffered TextField bound to ObjectProperty"); - tf1.setWriteThrough(false); - tf1.setReadThrough(false); - tf1.setPropertyDataSource(prop); - main.addComponent(tf1); - main - .addComponent(new Button( - "This button does nothing (but flushes queued variable changes)")); - main.addComponent(new Button("Commit the field to property", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - tf1.commit(); - } - })); - main.addComponent(new Button("Show property value", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - main.showNotification("'" + prop.getValue() + "'"); - } - })); - main.addComponent(new Button("Show field value", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - main.showNotification("'" + tf1.getValue() + "'"); - } - })); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1811.java b/src/com/vaadin/tests/tickets/Ticket1811.java deleted file mode 100644 index 29571220a2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1811.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.data.Validator; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1811 extends com.vaadin.Application { - - LinkedList listOfAllFields = new LinkedList(); - - @Override - public void init() { - - final Window main = new Window("#1811"); - setMainWindow(main); - - Validator strLenValidator = new StringLengthValidator( - "String must be at least 3 chars long and non-null", 3, -1, - false); - - TextField tf1 = new TextField( - "Text field with default settings (required=false)"); - listOfAllFields.add(tf1); - - TextField tf2 = new TextField("Text field with required=true"); - tf2.setRequired(true); - listOfAllFields.add(tf2); - - TextField tf3 = new TextField( - "Text field with required=true and strlen >= 3"); - tf3.setRequired(true); - tf3.addValidator(strLenValidator); - listOfAllFields.add(tf3); - - TextField tf4 = new TextField( - "Text field with required=false (default) and strlen >= 3"); - tf4.addValidator(strLenValidator); - listOfAllFields.add(tf4); - - for (Iterator i = listOfAllFields.iterator(); i.hasNext();) { - TextField tf = (TextField) i.next(); - main.addComponent(tf); - tf.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (java.util.Iterator i = listOfAllFields.iterator(); i - .hasNext();) { - TextField tf = (TextField) i.next(); - msg.append("

" + tf.getCaption() + "

\n"); - if (tf.isValid()) { - msg.append("VALID\n
"); - } else { - msg.append("INVALID
" + tf.getErrorMessage() - + "
"); - } - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML)); - main.addWindow(w); - } - }); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1819.java b/src/com/vaadin/tests/tickets/Ticket1819.java deleted file mode 100644 index e014dfee29..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1819.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; -import java.util.LinkedList; - -import com.vaadin.ui.AbstractField; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1819 extends com.vaadin.Application { - - LinkedList listOfAllFields = new LinkedList(); - - @Override - public void init() { - - final Window main = new Window("#1819"); - setMainWindow(main); - - com.vaadin.ui.Select s; - - s = new Select("Select with null selection allowed"); - s.setNullSelectionAllowed(true); - listOfAllFields.add(s); - - s = new Select("Select with null selection NOT allowed"); - s.setNullSelectionAllowed(false); - listOfAllFields.add(s); - - for (Iterator i = listOfAllFields.iterator(); i.hasNext();) { - s = (Select) i.next(); - main.addComponent(s); - s.addItem("-null-"); - s.addItem(""); - s.addItem("foo"); - s.addItem("bar"); - s.setNullSelectionItemId("-null-"); - s.setImmediate(true); - } - - Button checkValidity = new Button("Check validity of the fields"); - main.addComponent(checkValidity); - checkValidity.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - StringBuffer msg = new StringBuffer(); - for (java.util.Iterator i = listOfAllFields.iterator(); i - .hasNext();) { - AbstractField af = (AbstractField) i.next(); - msg.append("

" + af.getCaption() + "

\n"); - msg.append("Value=" + af.getValue() + "
\n"); - } - Window w = new Window("Status of the fields"); - w.setModal(true); - w.addComponent(new Label(msg.toString(), Label.CONTENT_XHTML)); - main.addWindow(w); - } - }); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java b/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java deleted file mode 100644 index 13e9591303..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1834PanelScrolling.java +++ /dev/null @@ -1,91 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket1834PanelScrolling extends com.vaadin.Application { - - private static final int ROWS = 50; - - private Label state = new Label("State"); - - private Panel p; - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - OrderedLayout currentState = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - - currentState.addComponent(state); - Button b = new Button("update"); - currentState.addComponent(b); - b.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - state.setValue("ScrollTop: " + p.getScrollTop() - + " ScrollLeft: " + p.getScrollLeft()); - } - }); - main.addComponent(currentState); - - b = new Button("ScrollBy 50px"); - b.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - p.setScrollLeft(p.getScrollLeft() + 50); - p.setScrollTop(p.getScrollTop() + 50); - state.setValue("ScrollTop: " + p.getScrollTop() - + " ScrollLeft: " + p.getScrollLeft()); - } - }); - - main.addComponent(b); - - b = new Button("Add row"); - b.addListener(new ClickListener() { - int i = 0; - - public void buttonClick(ClickEvent event) { - p.addComponent(new Label("new Row" + ++i)); - } - }); - - main.addComponent(b); - - b = new Button("Repaint Panel"); - b.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - p.requestRepaint(); - } - }); - - main.addComponent(b); - - p = new Panel("TestPanel"); - p.setScrollable(true); - - for (int i = 0; i < ROWS; i++) { - p - .addComponent(new Label( - "Label" - + i - + ".................................................................................................................")); - } - - p.setHeight("300px"); - p.setWidth("250px"); - - p.setScrollTop(100); - p.setScrollLeft(100); - - main.addComponent(p); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1857.java b/src/com/vaadin/tests/tickets/Ticket1857.java deleted file mode 100644 index 74278af70b..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1857.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.event.Action; -import com.vaadin.event.Action.Handler; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket1857 extends Application implements Handler { - - @Override - public void init() { - - setTheme("tests-tickets"); - - ExpandLayout el = new ExpandLayout(); - Window main = new Window("Testcase for #1857", el); - setMainWindow(main); - el.setMargin(true); - el.setSpacing(true); - - final Table t = new Table(); - el.addComponent(t); - el.expand(t); - t.setSizeFull(); - addContentsToTable(t); - t.setStyleName("foo"); - - OrderedLayout footer = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - el.addComponent(footer); - footer.setSpacing(true); - - final Button actionHandlerEnabler = new Button("Action handlers", false); - footer.addComponent(actionHandlerEnabler); - actionHandlerEnabler.setImmediate(true); - actionHandlerEnabler.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - if (((Boolean) actionHandlerEnabler.getValue()).booleanValue()) { - t.addActionHandler(Ticket1857.this); - } else { - t.removeActionHandler(Ticket1857.this); - } - } - }); - - final Button cellStylesEnabler = new Button("Cell styles", false); - footer.addComponent(cellStylesEnabler); - cellStylesEnabler.setImmediate(true); - cellStylesEnabler.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - if (((Boolean) cellStylesEnabler.getValue()).booleanValue()) { - t.setCellStyleGenerator(new Table.CellStyleGenerator() { - public String getStyle(Object itemId, Object propertyId) { - Object cell = t.getContainerProperty(itemId, - propertyId).getValue(); - if (!(cell instanceof Integer)) { - return null; - } - int age = ((Integer) cell).intValue(); - return age > 65 ? "old" : (age < 18 ? "young" - : null); - } - }); - } else { - t.setCellStyleGenerator(null); - } - } - }); - cellStylesEnabler.setValue(Boolean.TRUE); - - } - - private void addContentsToTable(Table t) { - - t.addContainerProperty("First name", String.class, ""); - t.addContainerProperty("Last name", String.class, ""); - t.addContainerProperty("Age", Integer.class, ""); - - String firstNames[] = { "Quentin", "Marc", "Peter", "David", "Mary", - "Jani", "Jane", "Brita" }; - String lastNames[] = { "Heiskanen", "Bjorn", "Torwalds", "Autere", - "Smith", "Lindström" }; - - for (int i = 0; i < 1000; i++) { - t.addItem(new Object[] { - firstNames[((int) (Math.random() * firstNames.length))], - lastNames[((int) (Math.random() * lastNames.length))], - new Integer((int) (Math.random() * 100) + 10) }, - new Integer(i)); - } - } - - private final Action removeAction = new Action("Remove"); - - public Action[] getActions(Object target, Object sender) { - return new Action[] { removeAction }; - } - - public void handleAction(Action action, Object sender, Object target) { - getMainWindow().showNotification("Removing row number:" + target); - ((Table) sender).removeItem(target); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1868.java b/src/com/vaadin/tests/tickets/Ticket1868.java deleted file mode 100644 index 3b68146df3..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1868.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket1868 extends com.vaadin.Application { - - @Override - public void init() { - - setMainWindow(new Window("#1868")); - - Panel p = new Panel( - "This is a really long caption for the panel, too long in fact!"); - p.setWidth(300); - p.setHeight(300); - - getMainWindow().addComponent(p); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1869.java b/src/com/vaadin/tests/tickets/Ticket1869.java deleted file mode 100644 index 6c101441a6..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1869.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.LinkedList; - -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket1869 extends com.vaadin.Application { - - LinkedList listOfAllFields = new LinkedList(); - - @Override - public void init() { - - GridLayout lo = new GridLayout(2, 1); - setMainWindow(new Window("#1869", lo)); - lo.setMargin(true); - lo.setSpacing(true); - - ExpandLayout el = new ExpandLayout(); - Panel elp = new Panel( - "Vertical ExpandLayout /w first component expanded", el); - el.setHeight(1000); - for (int i = 0; i < 3; i++) { - Button b = new Button("x"); - el.addComponent(b); - if (i == 0) { - b.setSizeFull(); - el.expand(b); - } - } - lo.addComponent(elp); - elp.setWidth(300); - elp.setHeight(300); - elp.setScrollable(true); - - ExpandLayout elh = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel elph = new Panel( - "Horizontal ExpandLayout /w first component expanded", elh); - elh.setWidth(1000); - for (int i = 0; i < 3; i++) { - Button b = new Button("x"); - elh.addComponent(b); - if (i == 0) { - b.setSizeFull(); - elh.expand(b); - } - } - lo.addComponent(elph); - elph.setWidth(300); - elph.setHeight(300); - elph.setScrollable(true); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1878.java b/src/com/vaadin/tests/tickets/Ticket1878.java deleted file mode 100644 index 04f6efb78c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1878.java +++ /dev/null @@ -1,391 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; -import java.util.Iterator; -import java.util.Random; - -import com.vaadin.Application; -import com.vaadin.data.util.BeanItem; -import com.vaadin.data.validator.StringLengthValidator; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Field; -import com.vaadin.ui.Form; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket1878 extends Application { - - private Layout orderedLayout; - private Layout gridLayout; - private Layout formLayout; - private GridLayout mainLayout; - private Button switchToGridButton; - private Button switchToOrderedButton; - private Button switchToFormsButton; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - - mainLayout = new GridLayout(1, 2); - w.setLayout(mainLayout); - orderedLayout = createOL(); - gridLayout = createGL(); - formLayout = createForms(); - - switchToGridButton = new Button("Switch to GridLayout", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - changeLayout(switchToGridButton, gridLayout); - } - - }); - switchToOrderedButton = new Button("Switch to OrderedLayout", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - changeLayout(switchToOrderedButton, orderedLayout); - } - - }); - switchToOrderedButton.setEnabled(false); - - switchToFormsButton = new Button("Switch to Form", new ClickListener() { - - public void buttonClick(ClickEvent event) { - changeLayout(switchToFormsButton, formLayout); - } - - }); - - OrderedLayout buttonLayout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - buttonLayout.addComponent(switchToOrderedButton); - buttonLayout.addComponent(switchToGridButton); - buttonLayout.addComponent(switchToFormsButton); - - mainLayout.addComponent(buttonLayout); - mainLayout.addComponent(orderedLayout); - // w.setLayout(orderedLayout); - } - - private static Layout createOL() { - GridLayout layout = new GridLayout(1, 5); - - GridLayout l1 = new GridLayout(1, 3); - createLayout(l1, - new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL), - "1000px", "150px", "100%", null, true); - createLayout(l1, - new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL), - "1000px", "150px", "50px", null, false); - GridLayout l2 = new GridLayout(6, 1); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "200px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "200px", "500px", "100%", null, true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "150px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "150px", "500px", "100%", null, true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "100px", "500px", true); - createLayout(l2, new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL), - "100px", "500px", "100%", null, true); - layout.addComponent(l1); - layout.addComponent(l2); - - return layout; - } - - private static Layout createGL() { - GridLayout layout = new GridLayout(1, 5); - - GridLayout l1 = new GridLayout(1, 3); - createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "100%", null, - true); - createLayout(l1, new GridLayout(8, 1), "1000px", "150px", "50px", null, - false); - GridLayout l2 = new GridLayout(6, 1); - createLayout(l2, new GridLayout(1, 8), "200px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "200px", "500px", "100%", null, - true); - createLayout(l2, new GridLayout(1, 8), "150px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "150px", "500px", "100%", null, - true); - createLayout(l2, new GridLayout(1, 8), "100px", "500px", true); - createLayout(l2, new GridLayout(1, 8), "100px", "500px", "100%", null, - true); - layout.addComponent(l1); - layout.addComponent(l2); - - return layout; - } - - public class FormObject { - private String stringValue = "abc"; - private int intValue = 1; - private long longValue = 2L; - private Date dateValue = new Date(34587034750L); - - public String getStringValue() { - return stringValue; - } - - public void setStringValue(String stringValue) { - this.stringValue = stringValue; - } - - public int getIntValue() { - return intValue; - } - - public void setIntValue(int intValue) { - this.intValue = intValue; - } - - public long getLongValue() { - return longValue; - } - - public void setLongValue(long longValue) { - this.longValue = longValue; - } - - public Date getDateValue() { - return dateValue; - } - - public void setDateValue(Date dateValue) { - this.dateValue = dateValue; - } - - } - - private Layout createForms() { - GridLayout layout = new GridLayout(1, 5); - Form form; - - Random r = new Random(); - GridLayout l1 = new GridLayout(1, 3); - form = createForm(l1, "200px", "500px"); - BeanItem item = new BeanItem(new FormObject()); - form.setItemDataSource(item); - for (Iterator i = item.getItemPropertyIds().iterator(); i.hasNext();) { - Object property = i.next(); - Field f = form.getField(property); - - f.setRequired(r.nextBoolean()); - if (r.nextBoolean()) { - f.setIcon(new ThemeResource("icons/16/document-add.png")); - } - if (r.nextBoolean()) { - f.setCaption(null); - } - - f.addValidator(new StringLengthValidator("Error", 10, 8, false)); - } - // createLayout(l1, new - // ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL), - // "1000px", "150px", "50px", null, false); - - // GridLayout l2 = new GridLayout(6, 1); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "200px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "200px", "500px", "100%", null, true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "150px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "150px", "500px", "100%", null, true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "100px", "500px", true); - // createLayout(l2, new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL), - // "100px", "500px", "100%", null, true); - layout.addComponent(l1); - // layout.addComponent(l2); - - return layout; - } - - private Form createForm(GridLayout parentLayout, String w, String h) { - FormLayout formLayout = new FormLayout(); - Form form = new Form(formLayout); - - Panel p = new Panel("Form " + w + "x" + h); - - p.setWidth(w); - p.setHeight(h); - - p.getLayout().setSizeFull(); - - parentLayout.addComponent(p); - p.addComponent(form); - formLayout.setSizeFull(); - - return form; - } - - protected void changeLayout(Button b, Layout newLayout) { - switchToOrderedButton.setEnabled(true); - switchToGridButton.setEnabled(true); - switchToFormsButton.setEnabled(true); - - b.setEnabled(false); - java.util.Iterator i = mainLayout.getComponentIterator(); - i.next(); - Layout l = (Layout) i.next(); - - mainLayout.replaceComponent(l, newLayout); - } - - private static void createLayout(GridLayout parentLayout, Layout newLayout, - String w, String h, boolean align) { - createLayout(parentLayout, newLayout, w, h, null, null, align); - } - - private static void createLayout(GridLayout parentLayout, Layout newLayout, - String w, String h, String componentWidth, String componentHeight, - boolean align) { - int dir; - String type; - if (newLayout instanceof ExpandLayout) { - dir = ((ExpandLayout) newLayout).getOrientation(); - type = "EL"; - } else if (newLayout instanceof OrderedLayout) { - dir = ((OrderedLayout) newLayout).getOrientation(); - type = "OL"; - } else { - dir = ((GridLayout) newLayout).getColumns() == 1 ? OrderedLayout.ORIENTATION_VERTICAL - : OrderedLayout.ORIENTATION_HORIZONTAL; - type = "GL"; - } - String dirText = (dir == OrderedLayout.ORIENTATION_HORIZONTAL ? "H" - : "V"); - String alignText = align ? "-A" : ""; - String cWidth = componentWidth == null ? "" : " - " + componentWidth; - Panel p = new Panel(type + "/" + dirText + alignText + " " + w + "x" - + h + cWidth, newLayout); - - p.setWidth(w); - p.setHeight(h); - - newLayout.setSizeFull(); - - String captions[] = new String[] { "TextField with caption", null }; - Resource icons[] = new Resource[] { - new ThemeResource("icons/16/document-delete.png"), null }; - boolean required[] = new boolean[] { true, false }; - TextField fields[][] = new TextField[captions.length][icons.length]; - for (int caption = 0; caption < captions.length; caption++) { - for (int icon = 0; icon < icons.length; icon++) { - for (int req = 0; req < required.length; req++) { - TextField tf = createTextFieldWithError(captions[caption], - icons[icon], required[req]); - - fields[caption][icon] = tf; - if (componentWidth != null) { - tf.setWidth(componentWidth); - tf.setValue(tf.getValue() + " w:" + componentWidth); - } - - if (componentHeight != null) { - tf.setHeight(componentWidth); - tf.setValue(tf.getValue() + " h:" + componentHeight); - } - - p.addComponent(tf); - - if (align) { - ((AlignmentHandler) newLayout).setComponentAlignment( - tf, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_BOTTOM); - } - } - } - } - - parentLayout.addComponent(p); - - } - - // private static void createGridLayout(GridLayout parentLayout, int dir, - // String w, String h) { - // createGridLayout(parentLayout, dir, w, h, null, null); - // } - - // private static void createGridLayout(GridLayout parentLayout, int dir, - // String w, String h, String componentWidth, String componentHeight) { - // GridLayout gl; - // if (dir == OrderedLayout.ORIENTATION_HORIZONTAL) { - // gl = new GridLayout(8, 1); - // } else { - // gl = new GridLayout(1, 8); - // } - // - // String dirText = (dir == OrderedLayout.ORIENTATION_HORIZONTAL ? "H" - // : "V"); - // String cWidth = componentWidth == null ? "" : " - " + componentWidth; - // Panel p = new Panel("GL/" + dirText + " " + w + "x" + h + cWidth, gl); - // - // p.setWidth(w); - // p.setHeight(h); - // - // gl.setSizeFull(); - // - // String captions[] = new String[] { "TextField with caption", null }; - // Resource icons[] = new Resource[] { - // new ThemeResource("icons/16/document-delete.png"), null }; - // boolean required[] = new boolean[] { true, false }; - // TextField fields[][] = new TextField[captions.length][icons.length]; - // for (int caption = 0; caption < captions.length; caption++) { - // for (int icon = 0; icon < icons.length; icon++) { - // for (int req = 0; req < required.length; req++) { - // TextField tf = createTextFieldWithError(captions[caption], - // icons[icon], required[req]); - // - // fields[caption][icon] = tf; - // if (componentWidth != null) { - // tf.setWidth(componentWidth); - // } - // - // if (componentHeight != null) { - // tf.setHeight(componentWidth); - // } - // - // p.addComponent(tf); - // gl.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, - // OrderedLayout.ALIGNMENT_BOTTOM); - // } - // } - // } - // - // parentLayout.addComponent(p); - // - // } - - private static TextField createTextFieldWithError(String caption, - Resource icon, boolean required) { - TextField tf = new TextField(); - tf.setCaption(caption); - tf.setIcon(icon); - tf.setRequired(required); - tf.setComponentError(new UserError("Test error message")); - return tf; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1900.java b/src/com/vaadin/tests/tickets/Ticket1900.java deleted file mode 100644 index a6f3c5c224..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1900.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Validator; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1900 extends Application { - - TextField f[] = new TextField[5]; - Window main = new Window("#1900 test"); - - @Override - public void init() { - - setMainWindow(main); - - for (int i = 0; i < 5; i++) { - final int j = i; - f[i] = new TextField("Testcase " + i); - f[i].setImmediate(true); - f[i].setRequired(true); - main.addComponent(f[i]); - f[i].addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - main.showNotification("Validity test", "Testcase " + j - + " is " + (f[j].isValid() ? "valid" : "invalid")); - } - }); - f[i].addValidator(new ContainsValidator("1")); - f[i].addValidator(new ContainsValidator("2")); - - } - - f[0].setDescription("Field is empty, requiredError(null): *"); - - f[1] - .setDescription("Field is empty, requiredError(\"foo\"): * (popup shows the validation error)"); - f[1].setRequiredError("The field must not be empty"); - - f[2] - .setDescription("Field is non-empty, validators do not give validation error: *"); - f[2].setValue("valid 12"); - - f[3] - .setDescription("Field is non-empty, requiredError(null), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[3].setValue("invalid"); - - f[4] - .setDescription("Field is non-empty, requiredError(\"foo\"), validators " - + "give validation error: * ! (popup shows the validation error)"); - f[4].setValue("invalid"); - f[4].setRequiredError("The field must not be empty"); - - } - - 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); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException("Value does not contain " + c); - } - - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1902.java b/src/com/vaadin/tests/tickets/Ticket1902.java deleted file mode 100644 index 716b6b94f0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1902.java +++ /dev/null @@ -1,80 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1902 extends Application { - - @Override - public void init() { - - // Main layout and main window - final OrderedLayout mainLayout = new OrderedLayout(); - setMainWindow(new Window("Testcase for #1902", mainLayout)); - setTheme("tests-tickets"); - mainLayout.setMargin(false); - mainLayout.setSpacing(true); - mainLayout.addComponent(new Button("mainLayout.setSizeFull()", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - mainLayout.setSizeFull(); - getMainWindow().showNotification( - "Set the main layout size full"); - } - })); - mainLayout.addComponent(new Button("mainLayout.setWidth(\"100%\")", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - mainLayout.setWidth("100%"); - getMainWindow().showNotification( - "Set the main layout width 100%"); - } - })); - - // 100% wide component - TextField b2 = new TextField("100% wide field"); - mainLayout.addComponent(b2); - b2.setWidth("100%"); - - // 400px wide colored layout - OrderedLayout lo = new OrderedLayout(); - lo.setStyleName("red-background"); - mainLayout.addComponent(lo); - lo.setWidth(400); - - Button b = new Button("100% wide button"); - lo.addComponent(b); - b.setWidth("100%"); - - TextField tf = new TextField("100% wide textfield"); - lo.addComponent(tf); - tf.setWidth("100%"); - - // 400x100 colored layout - OrderedLayout lo2 = new OrderedLayout(); - lo2.setStyleName("red-background"); - mainLayout.addComponent(lo2); - lo2.setWidth("50%"); - lo2.setHeight(200); - - Button b3 = new Button("100% wide button"); - lo2.addComponent(b3); - b3.setWidth("100%"); - - TextField tf2 = new TextField("100% wide textfield"); - lo2.addComponent(tf2); - tf2.setWidth("100%"); - // tf2 = new TextField("50% wide, 100% height textfield"); // does not - // work with caption (10.7.2008 mac hosted mode) due layouts are broken - // in trunk - tf2 = new TextField(); - tf2.setRows(2); // trigger textArea impl. - tf2.setHeight("100%"); - tf2.setWidth("50%"); - lo2.addComponent(tf2); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1904.java b/src/com/vaadin/tests/tickets/Ticket1904.java deleted file mode 100644 index 87ea8eeb1f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1904.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket1904 extends Application { - - @Override - public void init() { - setMainWindow(new Window("#1904")); - setTheme("tests-tickets"); - - addOL("defaults", null, false); - addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", false); - addOL("l5,r10,t20,b40,vs20,hs40", "ticket1904", true); - } - - private void addOL(String descr, String style, boolean horizontal) { - OrderedLayout ol = new OrderedLayout(); - ol.setMargin(true); - ol.setSpacing(true); - if (style != null) { - ol.setStyleName(style); - } - ol.addComponent(new Label(descr)); - for (int i = 0; i < 3; i++) { - Button b = new Button("Row " + (i + 1)); - if (!horizontal) { - b.setWidth(500); - } - ol.addComponent(b); - } - if (horizontal) { - ol.setOrientation(OrderedLayout.ORIENTATION_HORIZONTAL); - } - getMainWindow().addComponent(ol); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1916.java b/src/com/vaadin/tests/tickets/Ticket1916.java deleted file mode 100644 index 9976393664..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1916.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1916 extends Application { - - @Override - public void init() { - - OrderedLayout test = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - test.setSizeFull(); - - TextField tf = new TextField(); - tf.setComponentError(new UserError("Error message")); - - test.addComponent(tf); - test.setComponentAlignment(tf, - OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER, - OrderedLayout.ALIGNMENT_VERTICAL_CENTER); - - Window w = new Window("Test #1916", test); - setMainWindow(w); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1919.java b/src/com/vaadin/tests/tickets/Ticket1919.java deleted file mode 100644 index bf9b826b38..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1919.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket1919 extends com.vaadin.Application { - - private GridLayout lo; - private boolean on = true; - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.setTheme("tests-tickets"); - - lo = new GridLayout(2, 2); - lo.setSizeFull(); - lo.setMargin(true); - lo.setSpacing(true); - - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - lo.addComponent(getTestComponent()); - - main.setLayout(lo); - - } - - public void toggleStyleName() { - if (on) { - lo.setStyleName("test"); - } else { - lo.setStyleName(""); - } - on = !on; - } - - private Component getTestComponent() { - Panel p = new Panel(); - p.setSizeFull(); - - Button b = new Button("toggle Values", this, "toggleStyleName"); - p.addComponent(b); - return p; - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1921.java b/src/com/vaadin/tests/tickets/Ticket1921.java deleted file mode 100644 index 8dae844b75..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1921.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Map; - -import com.vaadin.Application; -import com.vaadin.terminal.ParameterHandler; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket1921 extends Application implements ParameterHandler { - - int state = -1; - int round = 1; - Button button; - OrderedLayout outer, inner; - - @Override - public void init() { - - outer = new OrderedLayout(); - setMainWindow(new Window("#1921", outer)); - setTheme("tests-tickets"); - inner = new OrderedLayout(); - outer.addComponent(inner); - button = new Button("foo", this, "newState"); - inner.addComponent(button); - - outer.setStyleName("red"); - inner.setStyleName("blue"); - - newState(); - - getMainWindow().addParameterHandler(this); - } - - public void newState() { - - if (state >= 8) { - state = 0; - round++; - } else { - state++; - } - - button.setCaption("state " + round + "." + state); - - switch (state) { - - case 0: - outer.setMargin(true); - inner.setMargin(true); - inner.setSizeFull(); - outer.setSizeFull(); - button.setSizeFull(); - break; - - case 1: - button.setSizeUndefined(); - break; - - case 2: - inner.setMargin(false); - break; - - case 3: - outer.setMargin(false); - break; - - case 4: - inner.setMargin(true); - break; - - case 5: - inner.addComponent(new Label("Added at " + button.getCaption())); - break; - - case 6: - inner - .setOrientation(inner.getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL ? OrderedLayout.ORIENTATION_VERTICAL - : OrderedLayout.ORIENTATION_HORIZONTAL); - getMainWindow() - .showNotification( - "inner swithed to " - + (inner.getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL ? "horizontal" - : "vertical")); - break; - - case 7: - outer.addComponent(new Label("Added at " + button.getCaption())); - break; - - case 8: - outer - .setOrientation(outer.getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL ? OrderedLayout.ORIENTATION_VERTICAL - : OrderedLayout.ORIENTATION_HORIZONTAL); - getMainWindow() - .showNotification( - "outer swithed to " - + (outer.getOrientation() == OrderedLayout.ORIENTATION_HORIZONTAL ? "horizontal" - : "vertical")); - break; - } - } - - public void handleParameters(Map parameters) { - String[] s = (String[]) parameters.get("state"); - if (s == null || s.length != 1) { - return; - } - String v[] = s[0].split("\\."); - if (v == null || v.length != 2) { - return; - } - try { - int rr = Integer.parseInt(v[0]); - int rs = Integer.parseInt(v[1]); - if (rr < round || (rr == round && rs < state)) { - getMainWindow().showNotification( - "Already past requested " + s[0]); - return; - } - while (round < rr || state < rs) { - newState(); - } - } catch (NumberFormatException ignored) { - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1923.java b/src/com/vaadin/tests/tickets/Ticket1923.java deleted file mode 100644 index 8ed9273a06..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1923.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket1923 extends com.vaadin.Application { - - private static final int ROWS = 50; - - private Panel p; - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - p = new Panel("TestPanel 250x300"); - // p.getLayout().setWidth("100%"); - p.setScrollable(true); - // p.setLayout(new GridLayout(1, 100)); - for (int i = 0; i < ROWS; i++) { - p - .addComponent(new Label( - "Label" - + i - + " 5067w09adsfasdjfahlsdfjhalfjhaldjfhalsjdfhlajdhflajhdfljahdslfjahldsjfhaljdfhaljfdhlajsdhflajshdflkajhsdlfkjahsldfkjahsldfhalskjfdhlksjfdh857idifhaljsdfhlajsdhflajhdflajhdfljahldfjhaljdfhalsjdfhalkjdhflkajhdfljahsdlfjahlsdjfhaldjfhaljfdhlajdhflajshdfljahsdlfjhalsjdfhalskjhfdlhusfglksuhdflgjshflgjhslfghslfjghsljfglsjhfglsjhfgljshfgljshflgjhslfghsljfgsljdfglsdjhfglsjhflgkjshfldjgh")); - } - // main.getLayout().setSizeFull(); - - p.setHeight("300px"); - p.setWidth("250px"); - // p.setWidth("50%"); - - p.setScrollTop(100); - p.setScrollLeft(100); - - main.addComponent(p); - - OrderedLayout ol = new OrderedLayout(); - p = new Panel("a"); - p.addComponent(new Label("Longer than caption")); - ol.addComponent(p); - - main.addComponent(ol); - - ol = new OrderedLayout(); - p = new Panel("captionasdfjahsdjfh this should be clipped god damn it"); - // p.getLayout().setSizeFull(); - p.setWidth("50px"); - p.setHeight("100px"); - p - .addComponent(new Label( - "aasdfaasdfja dslkfj lakfdj lakjdf lkaj dflkaj ldfkj alsdfj laksdj flkajs dflkj sdfsadfasdfasd")); - ol.addComponent(p); - - main.addComponent(ol); - - ol = new OrderedLayout(); - p = new Panel("300x-1"); - // p.getLayout().setSizeFull(); - p.setWidth("300px"); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - p.addComponent(new Label("Short")); - ol.addComponent(p); - - main.addComponent(ol); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java b/src/com/vaadin/tests/tickets/Ticket1924ThemeChanging.java deleted file mode 100644 index 4fb357b94e..0000000000 --- a/src/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.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -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/src/com/vaadin/tests/tickets/Ticket1925.java b/src/com/vaadin/tests/tickets/Ticket1925.java deleted file mode 100644 index 83e5e1cfd4..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1925.java +++ /dev/null @@ -1,15 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Window; - -public class Ticket1925 extends Application { - - @Override - public void init() { - Window mainWindow = new Window("Test åäö"); - setMainWindow(mainWindow); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1934.java b/src/com/vaadin/tests/tickets/Ticket1934.java deleted file mode 100644 index b80dfc07e0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1934.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket1934 extends Application { - - @Override - public void init() { - Window w = new Window( - "#1934 : Horizontal ExpandLayout completely broken"); - setMainWindow(w); - w.addComponent(new Label( - "Horizontal 500x200 ExpandLayout with two components:")); - - ExpandLayout testedLayout = new ExpandLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - testedLayout.setWidth("500px"); - testedLayout.setHeight("200px"); - - Button b1 = new Button("b1"); - testedLayout.addComponent(b1); - testedLayout.expand(b1); - testedLayout.addComponent(new Button("b2")); - - w.addComponent(testedLayout); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1939.java b/src/com/vaadin/tests/tickets/Ticket1939.java deleted file mode 100644 index 429834c382..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1939.java +++ /dev/null @@ -1,36 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1939 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - - final OrderedLayout l = new OrderedLayout(); - l.setWidth(400); - l.setHeight(100); - l.addComponent(new TextField("This one works fine")); - TextField t = new TextField(); - t.setRequired(true); - t.setValue("This one bugs"); - l.addComponent(t); - w.addComponent(l); - - w.addComponent(new Button("show me the bug", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - l.setWidth(-1); - } - })); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1940.java b/src/com/vaadin/tests/tickets/Ticket1940.java deleted file mode 100644 index 129a761e1c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1940.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1940 extends Application { - - @Override - public void init() { - final Window w = new Window(getClass().getName()); - setMainWindow(w); - - final OrderedLayout l = new OrderedLayout(); - l.setWidth(200); - l.setHeight(-1); - TextField t = new TextField(); - l.addComponent(t); - t.setRequired(true); - w.addComponent(l); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1953.java b/src/com/vaadin/tests/tickets/Ticket1953.java deleted file mode 100644 index 43e7f10220..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1953.java +++ /dev/null @@ -1,114 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket1953 extends Application { - public static final String cellStyle = "test-cell"; - public static final String colHeadStyle = "test-col-head"; - public static final String headingStyle = "test-heading"; - public static final String spacerStyle = "test-spacer"; - public static final String pageButtonStyle = "test-page-change"; - - @Override - public void init() { - - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.setTheme("tests-tickets"); - GridLayout gl = new GridLayout(5, 5); - - gl.setStyleName("borders"); - - gl.addComponent(new Label("0,0"), 0, 0); - gl.addComponent(new Label("0,1"), 0, 1); - gl.addComponent(new Label("0,2"), 0, 2); - gl.addComponent(new Label("0,3"), 0, 3); - gl.addComponent(new Label("0,4"), 0, 4); - gl.addComponent(new Label("1,0"), 1, 0); - gl.addComponent(new Label("2,0"), 2, 0); - gl.addComponent(new Label("3,0"), 3, 0); - gl.addComponent(new Label("4,0"), 4, 0); - - gl.addComponent(new Label("1,4"), 1, 4); - gl.addComponent(new Label("2,4"), 2, 4); - gl.addComponent(new Label("3,4"), 3, 4); - gl.addComponent(new Label("4,4"), 4, 4); - - gl.addComponent(new Label("1-1 -> 2-2"), 1, 1, 2, 2); - gl.addComponent(new Label("3,1"), 3, 1); - gl.addComponent(new Label("3,2"), 3, 2); - gl.addComponent(new Label("3,3"), 3, 3); - - main.addComponent(gl); - - // create grid - GridLayout grid = new GridLayout(7, 7); - - grid.setStyleName("borders"); - - // add upper row - Button up = new Button("UP"); - - up.setStyleName(pageButtonStyle); - grid.addComponent(up, 0, 0); - - Label space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, 0); - - Button single = null; - String headingStyle = "foo"; - for (int i = 1; i < grid.getColumns() - 2; i++) { - single = new Button(Integer.toString(i)); - single.setStyleName(headingStyle); - grid.addComponent(single, i + 1, 0); - } - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, 0); - - // middle rows - char rowChar = 'A'; - for (int i = 1; i < grid.getRows() - 1; i++) { - space = new Label(Character.toString(rowChar++)); - space.setStyleName(colHeadStyle); - grid.addComponent(space, 0, i); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, i); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, i); - } - - // bottom row - Button dn = new Button("DOWN"); - dn.setStyleName(pageButtonStyle); - grid.addComponent(dn, 0, grid.getRows() - 1); - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, 1, grid.getRows() - 1); - - for (int i = 1; i < grid.getColumns() - 2; i++) { - single = new Button(Integer.toString(i)); - single.setStyleName(headingStyle); - grid.addComponent(single, i + 1, grid.getRows() - 1); - } - - space = new Label(); - space.setStyleName(spacerStyle); - grid.addComponent(space, grid.getColumns() - 1, grid.getRows() - 1); - - main.addComponent(grid); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1966.java b/src/com/vaadin/tests/tickets/Ticket1966.java deleted file mode 100644 index d6c5accd4c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1966.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket1966 extends Application { - - private static final int LEFT = OrderedLayout.ALIGNMENT_LEFT; - private static final int CENTER = OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER; - private static final int RIGHT = OrderedLayout.ALIGNMENT_RIGHT; - private static final int TOP = OrderedLayout.ALIGNMENT_TOP; - private static final int VCENTER = OrderedLayout.ALIGNMENT_VERTICAL_CENTER; - private static final int BOTTOM = OrderedLayout.ALIGNMENT_BOTTOM; - - private static Map names = new HashMap(); - static { - names.put(new Integer(LEFT), "Left"); - names.put(new Integer(CENTER), "Center"); - names.put(new Integer(RIGHT), "Right"); - names.put(new Integer(BOTTOM), "Bottom"); - names.put(new Integer(VCENTER), "Vcenter"); - names.put(new Integer(TOP), "Top"); - } - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - // setTheme("tests-tickets"); - w.setLayout(new GridLayout(2, 2)); - // w.getLayout().setSizeFull(); - createUI(w.getLayout()); - } - - private void createUI(Layout layout) { - orderedLayout(layout); - gridLayout(layout); - } - - private void gridLayout(Layout layout) { - Panel p = new Panel("GridLayout"); - layout.addComponent(p); - - GridLayout gl = new GridLayout(1, 4); - gl.setCaption("Horizontal"); - Button b; - - b = new Button("Wide button"); - b.setWidth("500px"); - gl.addComponent(b); - - addButtons(gl); - - p.addComponent(gl); - - /* VERTICAL */ - - gl = new GridLayout(4, 1); - gl.setCaption("Vertical"); - - addButtons(gl); - - b = new Button("High button"); - b.setHeight(200); - gl.addComponent(b); - - p.addComponent(gl); - - } - - private void orderedLayout(Layout layout) { - Panel p = new Panel("OrderedLayout"); - layout.addComponent(p); - - OrderedLayout ol = new OrderedLayout(); - ol.setCaption("Horizontal"); - // ol.setWidth("100%"); - - Button b; - - b = new Button("Wide button"); - b.setWidth("500px"); - ol.addComponent(b); - - addButtons(ol); - p.addComponent(ol); - - /* VERTICAL */ - - ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - ol.setCaption("Vertical"); - - addButtons(ol); - b = new Button("High button"); - b.setHeight(200); - ol.addComponent(b); - - p.addComponent(ol); - - } - - private void addButtons(Layout ol) { - ol.addComponent(getButton(ol, LEFT, TOP)); - ol.addComponent(getButton(ol, CENTER, VCENTER)); - ol.addComponent(getButton(ol, RIGHT, BOTTOM)); - - } - - private Button getButton(Layout l, int hAlign, int vAlign) { - Button b = new Button("Narrow Button - " - + names.get(new Integer(hAlign)) + " - " - + names.get(new Integer(vAlign))); - b.setWidth("100px"); - ((AlignmentHandler) l).setComponentAlignment(b, hAlign, vAlign); - - return b; - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1966_2.java b/src/com/vaadin/tests/tickets/Ticket1966_2.java deleted file mode 100644 index 862cb8ecd3..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1966_2.java +++ /dev/null @@ -1,186 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.HashMap; -import java.util.Map; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket1966_2 extends Application { - - private static final int LEFT = OrderedLayout.ALIGNMENT_LEFT; - private static final int CENTER = OrderedLayout.ALIGNMENT_HORIZONTAL_CENTER; - private static final int RIGHT = OrderedLayout.ALIGNMENT_RIGHT; - private static final int TOP = OrderedLayout.ALIGNMENT_TOP; - private static final int VCENTER = OrderedLayout.ALIGNMENT_VERTICAL_CENTER; - private static final int BOTTOM = OrderedLayout.ALIGNMENT_BOTTOM; - - private static Map names = new HashMap(); - static { - names.put(new Integer(LEFT), "Left"); - names.put(new Integer(CENTER), "Center"); - names.put(new Integer(RIGHT), "Right"); - names.put(new Integer(BOTTOM), "Bottom"); - names.put(new Integer(VCENTER), "Vcenter"); - names.put(new Integer(TOP), "Top"); - } - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - w.setLayout(new GridLayout(2, 2)); - - // Panel p = new Panel("test"); - // p.setWidth(500); - // p.setHeight(500); - // p.setLayout(new GridLayout(1, 2)); - // p.getLayout().setSizeFull(); - // - // p.addComponent(new Button("asjkdfhakshdf")); - // p.addComponent(new Button("öalijgto8aq5")); - - // GridLayout gl = new GridLayout(4, 1); - // // gl.setCaption("Vertical"); - // gl.setWidth("100%"); - // gl.setHeight(500); - - // addButtons(gl); - // gl.addComponent(new Label("abc")); - // p.addComponent(gl); - - // w.getLayout().addComponent(p); - createUI(w.getLayout()); - } - - private void createUI(Layout layout) { - orderedLayout(layout); - gridLayout(layout); - expandLayout(layout); - } - - private void gridLayout(Layout layout) { - Panel p = new Panel("GridLayout"); - p.setWidth(500); - p.setHeight(500); - p.getLayout().setSizeFull(); - layout.addComponent(p); - - GridLayout gl = new GridLayout(1, 4); - gl.setCaption("Horizontal"); - gl.setWidth("100%"); - - // Button b; - - // b = new Button("Wide button"); - // b.setWidth("500"); - // gl.addComponent(b); - - addButtons(gl); - - p.addComponent(gl); - - /* VERTICAL */ - - gl = new GridLayout(4, 1); - // gl.setCaption("Vertical"); - gl.setHeight("100%"); - addButtons(gl); - - // Button b = new Button("High button"); - // b.setHeight(200); - // gl.addComponent(b); - - p.addComponent(gl); - - } - - private void orderedLayout(Layout layout) { - Panel p = new Panel("OrderedLayout"); - p.setWidth(500); - p.setHeight(500); - p.getLayout().setWidth("100%"); - layout.addComponent(p); - - OrderedLayout ol = new OrderedLayout(); - // ol.setCaption("Horizontal"); - ol.setWidth("100%"); - addButtons(ol); - p.addComponent(ol); - - /* VERTICAL */ - - ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - // ol.setCaption("Vertical"); - ol.setHeight(200); - addButtons(ol); - // Button b = new Button("High button"); - // b.setHeight(200); - // ol.addComponent(b); - p.addComponent(ol); - - } - - private void expandLayout(Layout layout) { - Panel p = new Panel("ExpandLayout"); - layout.addComponent(p); - p.getLayout().setWidth("500"); - p.getLayout().setHeight("400"); - - ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_VERTICAL); - // el.setCaption("Horizontal"); - // el.setSizeUndefined(); - // el.setWidth("100%"); - // ol.setWidth("100%"); - Button b; - - b = new Button("Wide button"); - b.setWidth("100%"); - // b.setHeight(200); - // el.expand(b); - // el.addComponent(b); - - addButtons(el); - p.addComponent(el); - - /* VERTICAL */ - - el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - // el.setHeight(400); - // el.setWidth("100%"); - // el.setCaption("Vertical"); - - addButtons(el); - // b = new Button("High button"); - // el.expand(b); - // b.setHeight(100); - // el.addComponent(b); - - p.addComponent(el); - - } - - private void addButtons(Layout ol) { - ol.addComponent(getButton(ol, LEFT, TOP)); - ol.addComponent(getButton(ol, CENTER, VCENTER)); - ol.addComponent(getButton(ol, RIGHT, BOTTOM)); - - } - - private Button getButton(Layout l, int hAlign, int vAlign) { - Button b = new Button(names.get(new Integer(hAlign)) + " - " - + names.get(new Integer(vAlign))); - // b.setWidth("100"); - ((AlignmentHandler) l).setComponentAlignment(b, hAlign, vAlign); - - return b; - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1966_3.java b/src/com/vaadin/tests/tickets/Ticket1966_3.java deleted file mode 100644 index 6cd552b6b2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1966_3.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket1966_3 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - OrderedLayout ol = new OrderedLayout(OrderedLayout.ORIENTATION_VERTICAL); - Panel p = new Panel(ol); - p.setWidth("300px"); - p.setHeight("300px"); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("Long caption, longer than 100 pixels"); - tf.setWidth("100px"); - - ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - - tf = new TextField("Short caption"); - tf.setWidth("100px"); - - tf.setComponentError(new UserError("error message")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - - tf = new TextField("Short caption"); - tf.setComponentError(new UserError("error message")); - tf.setIcon(new ThemeResource("icons/16/calendar.png")); - tf.setWidth("100px"); - - tf.setComponentError(new UserError("error message")); - ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - - tf = new TextField(); - tf.setValue("No caption"); - tf.setWidth("100px"); - - ol.addComponent(tf); - ol.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_RIGHT, - OrderedLayout.ALIGNMENT_TOP); - - layout.addComponent(p); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1969.java b/src/com/vaadin/tests/tickets/Ticket1969.java deleted file mode 100644 index 5e183beb78..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1969.java +++ /dev/null @@ -1,105 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.terminal.UserError; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1969 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main.getLayout().setSizeFull(); - - TabSheet ts = new TabSheet(); - ts.setSizeFull(); - - final Table t = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(7, 2000); - t.setSizeFull(); - ts.addTab(t, "Table, scrollins should not flash", null); - - final Label testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - final OrderedLayout actions = new OrderedLayout(); - - actions.setCaption("Test actions"); - - ts.addTab(actions); - - Button b; - - b = new Button( - "change introduction caption (should add * to tab name)", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - testContent.setCaption(testContent.getCaption() + "*"); - } - }); - actions.addComponent(b); - - b = new Button("change tab caption (should add * to tab name)", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - actions.setCaption(actions.getCaption() + "*"); - } - }); - - actions.addComponent(b); - - final UserError e = new UserError("Test error"); - - b = new Button("Toggle error", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (testContent.getComponentError() == null) { - testContent.setComponentError(e); - } else { - testContent.setComponentError(null); - } - } - }); - actions.addComponent(b); - - b = new Button("Change table caption", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - t.setCaption(t.getCaption() + "*"); - } - }); - actions.addComponent(b); - - b = new Button("Toggle Table error", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (t.getComponentError() == null) { - t.setComponentError(e); - } else { - t.setComponentError(null); - } - } - }); - - actions.addComponent(b); - - for (int i = 0; i < 20; i++) { - Label l = new Label("Test Content"); - l.setCaption("Extra tab " + i); - ts.addComponent(l); - } - - main.addComponent(ts); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1970.java b/src/com/vaadin/tests/tickets/Ticket1970.java deleted file mode 100644 index b23a3f58d6..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1970.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Iterator; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.CloseEvent; - -public class Ticket1970 extends Application { - - @Override - public void init() { - setMainWindow(createWindow()); - } - - @Override - public Window getWindow(String name) { - - // If we already have the requested window, use it - Window w = super.getWindow(name); - if (w == null) { - - // If no window found, create it - w = createExtraWindow(name); - } - return w; - } - - private Window createExtraWindow(String name) { - final Window w = new Window("Extra window: " + name); - w.setName(name); - addWindow(w); - w.addComponent(new Label( - "This window has been created on fly for name: " + name)); - w.addComponent(new Button("Show open windows", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - String openWindows = ""; - for (Iterator i = getWindows().iterator(); i.hasNext();) { - Window t = (Window) 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(); - w.addComponent(new Button("Show the name of the application", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - w.showNotification("Name of this window = " - + w.getName()); - } - })); - w.addComponent(new Label("" - + getURL().toExternalForm() + "", Label.CONTENT_XHTML)); - w - .addComponent(new Label( - "

How to reproduce

Open the above link in another browser" - + " window and then press the Show-button on this window.", - Label.CONTENT_XHTML)); - - return w; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1972.java b/src/com/vaadin/tests/tickets/Ticket1972.java deleted file mode 100644 index 6cbbbb9f92..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1972.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket1972 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - setTheme("tests-ticket"); - GridLayout layout = new GridLayout(3, 3); - layout.setStyleName("borders"); - layout.addComponent(new Label("1-1")); - layout.space(); - layout.space(); - layout.addComponent(new Label("2-1")); - layout.space(); - layout.space(); - layout.addComponent(new Label("3-1")); - layout.space(); - layout.addComponent(new Label("3-3")); - - w.setLayout(layout); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1973.java b/src/com/vaadin/tests/tickets/Ticket1973.java deleted file mode 100644 index 4e93ef57b4..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1973.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -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.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket1973 extends com.vaadin.Application { - - Window main = new Window(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("layout", Component.class, null); - - final IndexedContainer container2 = new IndexedContainer(); - container2.addContainerProperty("layout", Component.class, null); - - fill(container1, 100, "Testi 1 :"); - fill(container2, 100, "Testi 2 :"); - - table.setContainerDataSource(container1); - - Button refreshTable = new Button("Change table container"); - refreshTable.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent e) { - table.setContainerDataSource(container2); - table.setContainerDataSource(container1); - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } - - public void fill(IndexedContainer container, int size, String prefix) { - for (int i = 0; i < size; i++) { - Item item = container.addItem(new Integer(i)); - OrderedLayout layout = new OrderedLayout(); - layout.addComponent(new Button(prefix + i)); - item.getItemProperty("layout").setValue(layout); - } - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1973_2.java b/src/com/vaadin/tests/tickets/Ticket1973_2.java deleted file mode 100644 index 875cc70bc6..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1973_2.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -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.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket1973_2 extends Application { - Window main = new Window(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("text", String.class, null); - container1.addContainerProperty("layout", Component.class, null); - - final IndexedContainer container2 = new IndexedContainer(); - container2.addContainerProperty("text", String.class, null); - container2.addContainerProperty("layout", Component.class, null); - - fill(container1, 100); - - table.setContainerDataSource(container1); - - Button refreshTable = new Button("Change table container"); - refreshTable.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent e) { - table.setContainerDataSource(container2); - table.setContainerDataSource(container1); - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } - - public void fill(IndexedContainer container, int size) { - for (int i = 0; i < size; i++) { - int randInt = i; - Item item = container.addItem(new Integer(i)); - OrderedLayout layout = new OrderedLayout(); - layout.setDebugId("lo" + i); - layout.addComponent(new Button("Test " + randInt)); - item.getItemProperty("layout").setValue(layout); - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1975.java b/src/com/vaadin/tests/tickets/Ticket1975.java deleted file mode 100644 index 9adc67f529..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1975.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.File; -import java.io.FileInputStream; - -import com.vaadin.Application; -import com.vaadin.terminal.gwt.server.WebApplicationContext; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket1975 extends Application { - - private CustomLayout cl1; - private CustomLayout cl2; - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - setTheme("tests-tickets"); - GridLayout layout = new GridLayout(1, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - String s = "Blah"; - try { - cl1 = new CustomLayout(new ByteArrayInputStream(s.getBytes())); - layout.addComponent(cl1); - WebApplicationContext wc = ((WebApplicationContext) getContext()); - - layout.addComponent(new Button("Disable/Enable", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - boolean e = cl1.isEnabled(); - - cl1.setEnabled(!e); - cl2.setEnabled(!e); - } - - })); - File f = new File(wc.getBaseDirectory().getAbsoluteFile() - + "/VAADIN/themes/" + getTheme() - + "/layouts/Ticket1975.html"); - - cl2 = new CustomLayout(new FileInputStream(f)); - layout.addComponent(cl2); - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1982.java b/src/com/vaadin/tests/tickets/Ticket1982.java deleted file mode 100644 index a81478ff67..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1982.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket1982 extends Application { - - private List components = new ArrayList(); - - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeFull(); - main.setLayout(gl); - gl.setMargin(true); - - TitleBar t1 = new TitleBar("Title 1", gl); - TitleBar t2 = new TitleBar("Title 2", gl); - TitleBar t3 = new TitleBar("Title 3", gl); - TitleBar t4 = new TitleBar("Title 4", gl); - components.add(t1); - components.add(t2); - components.add(t3); - components.add(t4); - - restoreComponents(gl); - - } - - private void restoreComponents(GridLayout gl) { - gl.removeAllComponents(); - gl.addComponent((TitleBar) components.get(0)); - gl.addComponent((TitleBar) components.get(1)); - gl.addComponent((TitleBar) components.get(2)); - gl.addComponent((TitleBar) components.get(3)); - } - - private class TitleBar extends ExpandLayout { - - private Button max = new Button("Max"); - private Button min = new Button("Min"); - private GridLayout layout; - - public TitleBar(String title, GridLayout layout) { - super(ExpandLayout.ORIENTATION_HORIZONTAL); - this.layout = layout; - addComponent(new Label(title)); - addComponent(max); - addComponent(min); - min.setVisible(false); - - max.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - min.setVisible(true); - max.setVisible(false); - TitleBar.this.layout.removeAllComponents(); - TitleBar.this.layout - .addComponent(TitleBar.this, 0, 0, 1, 1); - } - }); - min.addListener(new ClickListener() { - public void buttonClick(ClickEvent event) { - min.setVisible(false); - max.setVisible(true); - restoreComponents(TitleBar.this.layout); - } - }); - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1983.java b/src/com/vaadin/tests/tickets/Ticket1983.java deleted file mode 100644 index b02047aca2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1983.java +++ /dev/null @@ -1,138 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.Sizeable; -import com.vaadin.ui.Button; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -/** - * Test class for ticket 1983 - */ -public class Ticket1983 extends Application { - - @Override - public void init() { - Window main = new Window("Test for ticket 1983"); - main.setLayout(new TestLayout()); - setMainWindow(main); - } - - private static class TestLayout extends SplitPanel { - boolean isLong = true; - final Table table = new MyTable(); - final String propId = "col"; - final String propId2 = "col2"; - - public TestLayout() { - super(ORIENTATION_HORIZONTAL); - - setSplitPosition(200, Sizeable.UNITS_PIXELS); - setMargin(false); - setLocked(true); - - final SplitPanel leftSide = initLeftSide(); - setFirstComponent(leftSide); - - final Layout rightSide = new OrderedLayout(); - rightSide.setHeight("100%"); - setSecondComponent(rightSide); - } - - private SplitPanel initLeftSide() { - final SplitPanel leftSide = new SplitPanel(ORIENTATION_VERTICAL); - leftSide.setHeight("100%"); - - final IndexedContainer dataSource = new IndexedContainer(); - dataSource.addContainerProperty(propId, String.class, null); - dataSource.addContainerProperty(propId2, String.class, null); - final Object itemId = dataSource.addItem(); - dataSource.getItem(itemId).getItemProperty(propId).setValue( - "Very long value that makes a scrollbar appear for sure"); - dataSource.getItem(itemId).getItemProperty(propId2).setValue( - "Very long value that makes a scrollbar appear for sure"); - - for (int i = 0; i < 150; i++) { - Object id = dataSource.addItem(); - dataSource - .getItem(id) - .getItemProperty(propId) - .setValue( - (i == 100 ? "Very long value that makes a scrollbar appear for sure" - : "Short")); - dataSource.getItem(id).getItemProperty(propId2).setValue( - "Short"); - } - - table.setSizeFull(); - table.setContainerDataSource(dataSource); - table.setVisibleColumns(new Object[] { propId }); - - leftSide.setSecondComponent(table); - - Button button = new Button("Change col value to short"); - button.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - // Change the column value to a short one --> Should remove - // the scrollbar - if (isLong) { - dataSource.getItem(itemId).getItemProperty(propId) - .setValue("Short value"); - dataSource.getItem(itemId).getItemProperty(propId2) - .setValue("Short value"); - isLong = false; - } else { - dataSource - .getItem(itemId) - .getItemProperty(propId) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - dataSource - .getItem(itemId) - .getItemProperty(propId2) - .setValue( - "Very long value that makes a scrollbar appear for sure"); - isLong = true; - } - // Works the same way with or without repaint request - table.requestRepaint(); - } - }); - - OrderedLayout ol = new OrderedLayout(); - ol.addComponent(button); - leftSide.setFirstComponent(ol); - - button = new Button("Two col"); - button.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - if (((Boolean) b.getValue()).booleanValue()) { - table - .setVisibleColumns(new Object[] { propId, - propId2 }); - } else { - table.setVisibleColumns(new Object[] { propId }); - } - - } - - }); - button.setSwitchMode(true); - ol.addComponent(button); - - return leftSide; - } - } - - static class MyTable extends Table { - MyTable() { - alwaysRecalculateColumnWidths = true; - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket1986.java b/src/com/vaadin/tests/tickets/Ticket1986.java deleted file mode 100644 index 1b96f7bd39..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1986.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.ListSelect; -import com.vaadin.ui.NativeSelect; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.TextField; -import com.vaadin.ui.TwinColSelect; -import com.vaadin.ui.Window; - -public class Ticket1986 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - - int index = 1; - - GridLayout layout = new GridLayout(2, 2); - TextField f1 = new TextField("1"); - f1.setTabIndex(index++); - TextField f2 = new TextField("2"); - f2.setTabIndex(index++); - - DateField f3 = new DateField("3"); - f3.setTabIndex(index++); - ComboBox cb = new ComboBox("4"); - cb.setTabIndex(index++); - - ListSelect lss = new ListSelect("5"); - lss.addItem("foo"); - lss.addItem("Bar"); - lss.setTabIndex(index++); - - NativeSelect ns = new NativeSelect("6"); - ns.addItem("foo"); - ns.addItem("bar"); - ns.setTabIndex(index++); - - OptionGroup og = new OptionGroup("7"); - og.addItem("foo"); - og.addItem("bar"); - og.setTabIndex(index++); - - OptionGroup ogm = new OptionGroup("7"); - ogm.setMultiSelect(true); - ogm.addItem("foo"); - ogm.addItem("bar"); - ogm.setTabIndex(index++); - - TwinColSelect ts = new TwinColSelect("8"); - ts.addItem("Foo"); - ts.addItem("Bar"); - ts.setTabIndex(index++); - - Button b = new Button("9"); - b.setTabIndex(index++); - - layout.addComponent(b); - layout.addComponent(ts); - layout.addComponent(ogm); - layout.addComponent(og); - layout.addComponent(ns); - layout.addComponent(lss); - layout.addComponent(cb); - layout.addComponent(f3); - layout.addComponent(f2); - layout.addComponent(f1); - - w.setLayout(layout); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket1991.java b/src/com/vaadin/tests/tickets/Ticket1991.java deleted file mode 100644 index 430c54ec92..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1991.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket1991 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Table t = new Table("Test table"); - - t.addContainerProperty(" ", CheckBox.class, ""); - t.addContainerProperty("Col1", String.class, ""); - t.addContainerProperty("Col2", String.class, ""); - - t.setPageLength(5); - - t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "1"); - t.addItem(new Object[] { new CheckBox(), "Foo", "Bar" }, "2"); - - main.addComponent(t); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket1995.java b/src/com/vaadin/tests/tickets/Ticket1995.java deleted file mode 100644 index 1745ace18c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket1995.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Container.Filterable; -import com.vaadin.ui.Button; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket1995 extends Application { - - private static final Object PROPERTY_1 = "Test"; - private Table table; - - @Override - public void init() { - final Window mainWin = new Window(getClass().getName()); - setMainWindow(mainWin); - - table = new Table(); - table.addContainerProperty(PROPERTY_1, String.class, ""); - table.setPageLength(4); - - Item item = table.addItem("1"); - item.getItemProperty(PROPERTY_1).setValue("Row 1"); - item = table.addItem("2"); - item.getItemProperty(PROPERTY_1).setValue("Row 2"); - - Filterable filterable = (Container.Filterable) table - .getContainerDataSource(); - filterable.addContainerFilter(PROPERTY_1, "Row", true, false); - - table.setColumnHeader(PROPERTY_1, "Test (filter: Row)"); - - mainWin.addComponent(table); - mainWin.addComponent(new Button("Add item", - new com.vaadin.ui.Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - addItem(); - } - })); - } - - protected void addItem() { - Filterable filterable = (Container.Filterable) table - .getContainerDataSource(); - - Item i = table.addItem("abc"); - String res = ""; - if (i == null) { - res = "FAILED"; - } else { - res = "OK!"; - } - - getMainWindow().showNotification("Tried to add item 'abc', " + res); - - filterable.addContainerFilter(PROPERTY_1, "Row", true, false); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket20.java b/src/com/vaadin/tests/tickets/Ticket20.java deleted file mode 100644 index 7adb2e932e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket20.java +++ /dev/null @@ -1,98 +0,0 @@ -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.CompositeValidator; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket20 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window("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 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) { - try { - int i = Integer.parseInt("" + value); - if (i < 0) { - return false; - } - return true; - } catch (NumberFormatException e) { - return false; - } - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException(value - + " is not a non-negative number"); - } - } - }); - CompositeValidator v2 = new CompositeValidator( - CompositeValidator.MODE_OR, null); - v2.addValidator(v); - v2.addValidator(new Validator() { - - public boolean isValid(Object value) { - return "".equals("" + value); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException("Value is not empty string"); - } - } - }); - tx.addValidator(v2); - - final String[] visibleProps = { "required", "invalidAllowed", - "readOnly", "readThrough", "invalidCommitted", - "validationVisible" }; - for (int i = 0; i < visibleProps.length; i++) { - Button b = new Button(visibleProps[i], new MethodProperty(tx, - visibleProps[i])); - b.setImmediate(true); - mainWin.addComponent(b); - } - - mainWin.addComponent(new Button("Validate integer", - new Button.ClickListener() { - public void buttonClick( - com.vaadin.ui.Button.ClickEvent event) { - mainWin.showNotification("The field is " - + (tx.isValid() ? "" : "not ") + "valid"); - }; - })); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2001.java b/src/com/vaadin/tests/tickets/Ticket2001.java deleted file mode 100644 index f3fbb4c508..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2001.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2001 extends Application { - - @Override - public void init() { - final Window w = new Window(getClass().getName()); - setMainWindow(w); - - final OrderedLayout l = new OrderedLayout(); - l.addComponent(new Label("row 1")); - l.addComponent(new Label("row 2")); - w.addComponent(l); - - final Button b = new Button("fixed width: 30px", false); - b.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - l.setWidth(b.booleanValue() ? 30 : -1); - } - }); - b.setImmediate(true); - w.addComponent(b); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2002.java b/src/com/vaadin/tests/tickets/Ticket2002.java deleted file mode 100644 index 35f2c84872..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2002.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2002 extends Application { - private Long long1 = new Long(1L); - private Long long2 = new Long(2L); - - public Long getLong1() { - return long1; - } - - public void setLong1(Long long1) { - this.long1 = long1; - } - - public Long getLong2() { - return long2; - } - - public void setLong2(Long long2) { - this.long2 = long2; - } - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(2, 2); - layout.setSpacing(true); - - TextField f1 = new TextField("Non-immediate/Long text field", - new MethodProperty(this, "long1")); - f1.setImmediate(false); - f1.setNullSettingAllowed(true); - TextField f2 = new TextField("Immediate/Long text field", - new MethodProperty(this, "long2")); - f2.setImmediate(true); - f2.setNullSettingAllowed(true); - - layout.addComponent(f1); - layout.addComponent(f2); - - w.setLayout(layout); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2007.java b/src/com/vaadin/tests/tickets/Ticket2007.java deleted file mode 100644 index e925519ee2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2007.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2007 extends Application { - - int childs = 0; - - @Override - public void init() { - - final Window main = new Window("Main window for #2007"); - setMainWindow(main); - main.addComponent(new Button("Open another (non-main) window", - new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - Window c = new Window("Non-main browser window " - + (++childs)); - addWindow(c); - main.open(new ExternalResource(c.getURL()), "_new"); - } - })); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2009.java b/src/com/vaadin/tests/tickets/Ticket2009.java deleted file mode 100644 index 4118794aa7..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2009.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Container; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2009 extends com.vaadin.Application { - - TextField f = new TextField(); - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - main.setLayout(ol); - ol.setSizeFull(); - - Panel p = new Panel("Tree test"); - p.setSizeFull(); - - Tree t = new Tree(); - - t.addItem("Foo"); - t.addItem("Bar"); - - final OrderedLayout events = new OrderedLayout(); - - t.addListener(new ItemClickEvent.ItemClickListener() { - public void itemClick(ItemClickEvent event) { - events.addComponent(new Label(new Label("Click:" - + (event.isDoubleClick() ? "double" : "single") - + " button:" + event.getButton() + " propertyId:" - + event.getPropertyId() + " itemID:" - + event.getItemId() + " item:" + event.getItem()))); - - } - }); - - main.addComponent(p); - p.addComponent(t); - p.addComponent(events); - - Panel p2 = new Panel("Table test (try dbl click also)"); - p2.setSizeFull(); - - final OrderedLayout events2 = new OrderedLayout(); - Table table = TestForTablesInitialColumnWidthLogicRendering - .getTestTable(5, 100); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(new ItemClickEvent.ItemClickListener() { - public void itemClick(ItemClickEvent event) { - events2.addComponent(new Label("Click:" - + (event.isDoubleClick() ? "double" : "single") - + " button:" + event.getButton() + " propertyId:" - + event.getPropertyId() + " itemID:" - + event.getItemId() + " item:" + event.getItem())); - if (event.isDoubleClick()) { - new PropertyEditor(event); - } - - } - }); - p2.addComponent(table); - p2.addComponent(events2); - - main.addComponent(p2); - - } - - class PropertyEditor extends Window { - - private static final int W = 300; - private static final int H = 150; - - private Container c; - private Object itemid; - private Object propertyid; - - TextField editor = new TextField(); - Button done = new Button("Done"); - - PropertyEditor(ItemClickEvent event) { - c = (Container) event.getSource(); - - propertyid = event.getPropertyId(); - itemid = event.getItemId(); - - setCaption("Editing " + itemid + " : " + propertyid); - - editor.setPropertyDataSource(c.getContainerProperty(itemid, - propertyid)); - addComponent(editor); - addComponent(done); - - setWidth(W); - setHeight(H); - - setPositionX(event.getClientX() - W / 2); - setPositionY(event.getClientY() - H / 2); - - getMainWindow().addWindow(this); - - done.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getMainWindow().removeWindow(PropertyEditor.this); - } - }); - - } - - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2011.java b/src/com/vaadin/tests/tickets/Ticket2011.java deleted file mode 100644 index d4e5890635..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2011.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; - -public class Ticket2011 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - // setTheme("tests-ticket"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Select s = new Select("Select"); - s.addItem("Item 1"); - s.addItem("Item 2"); - layout.addComponent(s); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2014.java b/src/com/vaadin/tests/tickets/Ticket2014.java deleted file mode 100644 index 1cf0e4c58e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2014.java +++ /dev/null @@ -1,63 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.UUID; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2014 extends Application { - - private OrderedLayout innerLayout1; - private Button b1; - private Panel panel; - - @Override - public void init() { - Window w = new Window(getClass().getName()); - setMainWindow(w); - // setTheme("tests-ticket"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - createPanel(layout); - - layout.addComponent(new Button("Change class name", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - b1.setStyleName(UUID.randomUUID().toString()); - } - - })); - - } - - private void createPanel(GridLayout layout) { - panel = new Panel("panel caption"); - layout.addComponent(panel); - - innerLayout1 = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - innerLayout1.setSpacing(true); - panel.addComponent(innerLayout1); - - b1 = new Button("Button inside orderedLayout", new ClickListener() { - - public void buttonClick(ClickEvent event) { - System.out.println("Clicked " + event.getButton().getCaption()); - } - - }); - - innerLayout1.addComponent(b1); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2021.java b/src/com/vaadin/tests/tickets/Ticket2021.java deleted file mode 100644 index 5ea423ea99..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2021.java +++ /dev/null @@ -1,143 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2021 extends Application { - - private TextField tf1, tf2, tf3; - - private String contents = "This TextField SHOULD FILL the panel and NOT CAUSE any scrollbars to appear in the Panel. Scrollbars SHOULD appear in the TextField AND the whole scrollbars (includinc arrow down) SHOULD be visible.\n\n" - + "" - + "Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent quis justo. Vivamus nec mi eu libero convallis auctor. Mauris et arcu. Nunc luctus justo. Aenean convallis, odio in vehicula scelerisque, est magna condimentum pede, a aliquam elit eros vitae diam. Phasellus porttitor convallis tellus. Nullam elementum, ligula nec viverra malesuada, risus tortor bibendum dui, eget hendrerit sem enim at massa. Nam eu pede sed nulla congue fermentum. Vestibulum malesuada libero non nunc. Proin rutrum. Fusce erat pede, volutpat vitae, aliquam ut, sagittis vel, augue. Fusce dui pede, convallis nec, accumsan tincidunt, consectetuer ac, purus. Nulla facilisi. Ut nisi. Sed orci risus, lacinia eu, sodales molestie, gravida quis, neque. Vestibulum pharetra ornare elit. Nulla porttitor molestie mauris. Morbi fringilla tellus sed risus. Curabitur varius massa." - + "Nulla nisi. Sed blandit, ante vitae sagittis volutpat, arcu mauris vehicula risus, vitae posuere felis lectus sit amet purus. Donec nec magna et leo eleifend scelerisque. Suspendisse condimentum pharetra ligula. Curabitur lorem. Pellentesque a augue sit amet enim fermentum placerat. Phasellus ante risus, molestie at, iaculis at, pellentesque non, tellus. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus non urna eget risus tempus imperdiet. Integer est diam, sagittis sit amet, posuere sit amet, bibendum sed, lacus. Aenean adipiscing cursus ipsum. Quisque at elit. Vestibulum vitae nunc. Praesent placerat metus viverra lorem. Cras nec elit congue nisi faucibus feugiat. Nam eget mi. Vestibulum condimentum. Nunc nisl ante, cursus in, dictum ac, lobortis rutrum, mi. Nulla eu nisi. In ultricies vehicula magna." - + "Nunc eros dui, elementum at, ullamcorper eget, varius at, velit. Ut dictum. Cras ullamcorper ante vel tortor. Quisque viverra mauris vulputate quam. Nulla dui. Suspendisse non eros at ipsum faucibus hendrerit. Morbi dignissim pharetra tortor. Etiam malesuada. Mauris lacinia elementum erat. Duis mollis placerat metus. Nunc risus felis, cursus ac, cursus vel, convallis vel, metus. Ut vehicula nibh et nulla. Vivamus id pede. Quisque egestas arcu a ligula. Maecenas vehicula. Quisque sed ligula quis tellus tempus rutrum. Curabitur vel augue sed orci egestas pharetra. Duis pharetra."; - - private OrderedLayout orderedLayout; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - w.setLayout(new GridLayout(2, 2)); - setMainWindow(w); - - Panel p = new Panel(); - p.setCaption("ExpandLayout"); - p.setWidth("500px"); - p.setHeight("500px"); - p.setLayout(new ExpandLayout()); - p.getLayout().setSizeFull(); - - w.getLayout().addComponent(p); - - tf1 = new TextField(); - tf1.setRows(5); - tf1.setSizeFull(); - tf1.setValue(contents); - tf1.setCaption("TextField caption"); - p.getLayout().addComponent(tf1); - - /* - * - * OrderedLayout - */ - - Panel p2 = new Panel(); - p2.setCaption("OrderedLayout"); - p2.setWidth("500px"); - p2.setHeight("500px"); - p2.setLayout(new OrderedLayout()); - p2.getLayout().setSizeFull(); - - w.getLayout().addComponent(p2); - - tf2 = new TextField(); - tf2.setRows(5); - tf2.setSizeFull(); - tf2.setValue(contents); - tf2.setCaption("TextField caption"); - p2.getLayout().addComponent(tf2); - - /* - * - * GridLayout - */ - - Panel p3 = new Panel(); - p3.setCaption("GridLayout"); - p3.setWidth(500); - p3.setHeight(500); - // p3.setLayout(new GridLayout()); - p3.getLayout().setSizeFull(); - p3.getLayout().setMargin(false); - - GridLayout gl = new GridLayout(); - gl.setSizeFull(); - gl.setMargin(false); - p3.getLayout().addComponent(gl); - w.getLayout().addComponent(p3); - - tf3 = new TextField(); - tf3.setRows(5); - tf3.setSizeFull(); - tf3.setValue(contents); - tf3.setCaption("TextField caption"); - // p3.getLayout().addComponent(tf3); - gl.addComponent(tf3); - - // Panel pp = new Panel(); - // pp.setCaption("OrderedLayout"); - // pp.setWidth("500px"); - // pp.setHeight("500px"); - // pp.getLayout().setSizeFull(); - // orderedLayout = new OrderedLayout(); - // pp.getLayout().addComponent(orderedLayout); - // w.getLayout().addComponent(pp); - // createUI(orderedLayout); - } - - @SuppressWarnings("unused") - private void createUI(Layout layout) { - Label l = new Label("Label"); - Button b = new Button("Enable/disable caption and watch button move", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - System.out.println("Enable/disable caption"); - for (AbstractComponent l : new AbstractComponent[] { - tf1, tf2, tf3 }) { - // AbstractComponent l = tf2; - // Layout l = (Layout) event.getButton().getData(); - if (l.getCaption() == null) { - l.setCaption("Expand layout caption"); - } else { - l.setCaption(null); - } - } - } - - }); - b.setData(layout); - Label l2 = new Label("This should always be visible"); - - layout.addComponent(l); - layout.addComponent(b); - layout.addComponent(l2); - - if (layout instanceof ExpandLayout) { - ((ExpandLayout) layout).expand(l); - - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2022.java b/src/com/vaadin/tests/tickets/Ticket2022.java deleted file mode 100644 index 9dfcabc208..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2022.java +++ /dev/null @@ -1,32 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Window; - -public class Ticket2022 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - CustomLayout l; - - // WebApplicationContext wac = ((WebApplicationContext) getContext()); - // File f = new File(wac.getBaseDirectory().getAbsoluteFile() - // + "/VAADIN/themes/" + getTheme() + "/layouts/Ticket2022.html"); - - l = new CustomLayout("Ticket2022"); - // try { - // l = new CustomLayout(new FileInputStream(f)); - w.setLayout(l); - // } catch (FileNotFoundException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } catch (IOException e) { - // // TODO Auto-generated catch block - // e.printStackTrace(); - // } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2023.java b/src/com/vaadin/tests/tickets/Ticket2023.java deleted file mode 100644 index fac09e07ea..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2023.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.AbstractComponent; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2023 extends com.vaadin.Application implements - Button.ClickListener { - - AbstractComponent c = new Button(); - - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - - String[] sizes = { "20", "100", "1", "0", "-1", "", "z" }; - String[] units = { "%", "px", "em", "ex", "in", "cm", "mm", "pt", "pc", - "", "p", "zyx" }; - - GridLayout gl = new GridLayout(units.length, sizes.length); - main.addComponent(gl); - for (int i = 0; i < sizes.length; i++) { - for (int j = 0; j < units.length; j++) { - String s = sizes[i] + units[j]; - gl.addComponent(new Button(s, this)); - } - } - - gl.addComponent(new Button("null", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - c.setWidth(null); - c.setHeight(null); - - } - - })); - - main.addComponent(c); - - } - - public void buttonClick(ClickEvent event) { - c.setWidth(event.getButton().getCaption()); - c.setHeight(event.getButton().getCaption()); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2024.java b/src/com/vaadin/tests/tickets/Ticket2024.java deleted file mode 100644 index 1c2c7b4a33..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2024.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2024 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(2, 2); - layout.setHeight("100%"); - layout.setWidth("700"); - w.getLayout().setSizeFull(); - w.getLayout().setHeight("2000"); - w.getLayout().addComponent(layout); - - layout.addComponent(new Label( - "This should NOT get stuck when scrolling down")); - layout - .addComponent(new TextField( - "This should not get stuck either...")); - - OrderedLayout ol = new OrderedLayout(); - ol.setHeight("1000"); - ol.setWidth("200"); - w.getLayout().addComponent(ol); - ol.addComponent(new Label("Just a label to enable the scrollbar")); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2026.java b/src/com/vaadin/tests/tickets/Ticket2026.java deleted file mode 100644 index 4bbb9057ff..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2026.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2026 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout layout = new GridLayout(2, 2); - layout.setSpacing(true); - - @SuppressWarnings("unused") - int nr = 5; - TextField tf; - tf = new TextField("TextField (tabIndex 1)"); - tf.setTabIndex(1); - tf.focus(); - layout.addComponent(tf); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - layout.addComponent(new TextField("TextField without tab index")); - tf = new TextField("TextField (tabIndex 2)"); - tf.setTabIndex(2); - layout.addComponent(tf); - - w.setLayout(layout); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2029.java b/src/com/vaadin/tests/tickets/Ticket2029.java deleted file mode 100644 index 4c53e2cd9e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2029.java +++ /dev/null @@ -1,140 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Random; - -import com.vaadin.Application; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Component; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2029 extends Application { - - int COMPONENTS; - int DIM1, DIM2; - Random r = new Random(); - - @Override - public void init() { - COMPONENTS = 5; - DIM1 = 504; - DIM2 = 100; - - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - Panel p = createPanel(); - w.getLayout().addComponent(p); - // w.getLayout().addComponent(createGLPanel()); - w.getLayout().addComponent(createPanelV()); - } - - private Panel createPanel() { - Panel p = new Panel(DIM1 + "x" + DIM2 + " OrderedLayout"); - p.setWidth(DIM1 + "px"); - p.setHeight(DIM2 + "px"); - - OrderedLayout layout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - p.setLayout(layout); - p.getLayout().setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextField tf = new TextField(); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - tf.setWidth("100%"); - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_BOTTOM); - p.addComponent(tf); - - } - - return p; - } - - private Panel createGLPanel() { - Panel p = new Panel("" + DIM1 + "x" + DIM2 + " GridLayout"); - p.setWidth("" + DIM1 + "px"); - p.setHeight("" + DIM2 + "px"); - - GridLayout layout = new GridLayout(COMPONENTS, 1); - p.setLayout(layout); - p.getLayout().setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextField tf = new TextField(); - tf.setImmediate(true); - tf.addListener(new ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - Component c = ((Component) event.getProperty()); - c.setCaption("askfdj"); - - } - }); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - tf.setWidth("100%"); - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_VERTICAL_CENTER); - p.addComponent(tf); - - } - - return p; - } - - private Panel createPanelV() { - Panel p = new Panel("" + DIM1 + "x" + DIM2 + " OrderedLayout"); - p.setWidth("" + DIM2 + "px"); - p.setHeight("" + DIM1 + "px"); - - OrderedLayout layout = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - p.setLayout(layout); - p.getLayout().setSizeFull(); - - for (int i = 0; i < COMPONENTS; i++) { - TextField tf = new TextField(); - if (r.nextBoolean()) { - tf.setCaption("Caption"); - } - if (r.nextBoolean()) { - tf.setRequired(true); - } - if (r.nextBoolean()) { - tf.setComponentError(new UserError("Error")); - } - - tf.setRows(2); - tf.setSizeFull(); - - layout.setComponentAlignment(tf, OrderedLayout.ALIGNMENT_LEFT, - OrderedLayout.ALIGNMENT_BOTTOM); - p.addComponent(tf); - - } - - return p; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2032.java b/src/com/vaadin/tests/tickets/Ticket2032.java deleted file mode 100644 index f51984f336..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2032.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2032 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel(el); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("Field caption"); - tf.setValue("Expanded"); - el.addComponent(tf); - el.expand(tf); - tf.setSizeFull(); - - tf = new TextField("Vertical bottom"); - // tf.setComponentError(new UserError("Error")); - tf.setValue("Vertical bottom"); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_BOTTOM); - el.addComponent(tf); - - tf = new TextField("Vertical top"); - tf.setComponentError(new UserError("Error")); - el.addComponent(tf); - tf.setValue("Vertical top"); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("Vertical center"); - el.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - layout.addComponent(p); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2033.java b/src/com/vaadin/tests/tickets/Ticket2033.java deleted file mode 100644 index 744195619e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2033.java +++ /dev/null @@ -1,147 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.ExpandLayout; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2033 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(2, 2); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - layout.addComponent(createExpandLayoutPanel()); - layout.addComponent(createOrderedLayoutPanel()); - layout.addComponent(createGridLayoutPanel()); - } - - private Panel createExpandLayoutPanel() { - ExpandLayout el = new ExpandLayout(ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel("ExpandLayout", el); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - el.addComponent(tf); - el.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - el.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - el.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - el.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } - - private Panel createOrderedLayoutPanel() { - OrderedLayout ol = new OrderedLayout( - ExpandLayout.ORIENTATION_HORIZONTAL); - Panel p = new Panel("OrderedLayout", ol); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - ol.addComponent(tf); - // ol.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - ol.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - ol.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - ol.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } - - private Panel createGridLayoutPanel() { - GridLayout gl = new GridLayout(4, 1); - Panel p = new Panel("GridLayout", gl); - p.setWidth(600); - p.setHeight(500); - p.getLayout().setSizeFull(); - - TextField tf = new TextField("TextField 1"); - tf.setValue("Expanded"); - gl.addComponent(tf); - // ol.expand(tf); - tf.setSizeFull(); - - tf = new TextField("TextField 2 has a longer caption"); - // tf.setComponentError(new UserError("Error")); - tf.setWidth(100); - tf.setValue("Vertical bottom"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_BOTTOM); - gl.addComponent(tf); - - tf = new TextField( - "TextField 3 has a very, very long caption for some weird reason."); - tf.setWidth(100); - tf.setComponentError(new UserError("Error")); - gl.addComponent(tf); - tf.setValue("Vertical top"); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_TOP); - tf = new TextField("TextField 4"); - gl.addComponent(tf); - tf.setValue("Vertical center"); - // tf.setComponentError(new UserError("Error")); - // el.setComponentAlignment(tf, ExpandLayout.ALIGNMENT_LEFT, - // ExpandLayout.ALIGNMENT_VERTICAL_CENTER); - - return p; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2037.java b/src/com/vaadin/tests/tickets/Ticket2037.java deleted file mode 100644 index 084ca14c0f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2037.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2037 extends com.vaadin.Application { - - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - - main - .addComponent(new Label( - "Use debug dialog and trac number of registered paintables. It should not grow on subsequant b clicks.")); - - final Layout lo = new OrderedLayout(); - - Button b = new Button("b"); - - main.addComponent(b); - main.addComponent(lo); - b.addListener(new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - - repopupate(lo); - - } - }); - - } - - int counter = 0; - - protected void repopupate(Layout lo) { - lo.removeAllComponents(); - - for (int i = 0; i < 20; i++) { - lo.addComponent(new Label("tc" + (counter++))); - } - - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2038.java b/src/com/vaadin/tests/tickets/Ticket2038.java deleted file mode 100644 index e566d50520..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2038.java +++ /dev/null @@ -1,46 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Window.Notification; - -public class Ticket2038 extends Application { - - @Override - public void init() { - final Window w = new Window("Testing for #2038"); - setMainWindow(w); - - final TextField tf = new TextField( - "Test-field, enter someting and click outside the field to activate"); - tf.setRequired(true); - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - w.showNotification("TextField is " + (tf.isValid() ? "" : "in") - + "valid, with error: " + tf.getErrorMessage(), - Notification.TYPE_WARNING_MESSAGE); - } - }); - w.addComponent(tf); - - final Button b = new Button( - "Field should use error message. (!) should be shown when invalid.", - false); - w.addComponent(b); - b.setImmediate(true); - b.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - tf - .setRequiredError(b.booleanValue() ? "Field must not be empty" - : null); - } - }); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2040.java b/src/com/vaadin/tests/tickets/Ticket2040.java deleted file mode 100644 index e5300d5eed..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2040.java +++ /dev/null @@ -1,85 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2040 extends com.vaadin.Application { - - TextField f = new TextField(); - - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - - main.getLayout().setSizeFull(); - main.getLayout().setMargin(true); - - setTheme("tests-tickets"); - - Accordion ts; - - ts = new Accordion(); - ts.setSizeFull(); - ts.setWidth("300px"); - - TextField l = new TextField("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "100% h component", null); - - Label testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - // main.addComponent(ts); - - ts = new Accordion(); - ts.setSizeFull(); - ts.setHeight("200px"); - ts.setWidth("300px"); - - l = new TextField("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "200px h component", null); - - testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - main.addComponent(ts); - - ts = new Accordion(); - ts.setSizeFull(); - ts.setHeight("50%"); - ts.setWidth("300px"); - - l = new TextField("DSFS"); - l.setRows(2); - l.setStyleName("red"); - l.setSizeFull(); - ts.addTab(l, "50% h component", null); - - testContent = new Label( - "TabSheet by default uses caption, icon, errors etc. from Components. "); - - testContent.setCaption("Introduction to test"); - - ts.addTab(testContent); - - // main.addComponent(ts); - - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2042.java b/src/com/vaadin/tests/tickets/Ticket2042.java deleted file mode 100644 index 6339222a0b..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2042.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.tickets; - -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.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; -import com.vaadin.ui.Window.Notification; - -public class Ticket2042 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(1, 2); - layout.setHeight("2000px"); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - layout.addComponent(new Label("abc")); - layout.addComponent(new Button("B", new ClickListener() { - - public void buttonClick(ClickEvent event) { - Notification n = new Notification("Test"); - getMainWindow().showNotification(n); - } - - })); - - layout.addComponent(new Label("abc")); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2043.java b/src/com/vaadin/tests/tickets/Ticket2043.java deleted file mode 100644 index aad3cb554a..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2043.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Link; -import com.vaadin.ui.Window; - -public class Ticket2043 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Link l = new Link("Vaadin home (new 200x200 window, no decor, icon)", - new ExternalResource("http://www.vaadin.com"), "_blank", 200, - 200, Link.TARGET_BORDER_NONE); - - layout.addComponent(l); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2048.java b/src/com/vaadin/tests/tickets/Ticket2048.java deleted file mode 100644 index f1bfecdcc0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2048.java +++ /dev/null @@ -1,107 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2048 extends Application { - - private Embedded embedded; - private Panel p; - private SplitPanel splitPanel; - private GridLayout gridLayout; - private OrderedLayout orderedLayout; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - // splitPanel = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - // getMainWindow().setLayout(splitPanel); - - // GridLayout layout = new GridLayout(10, 10); - // w.setLayout(layout); - // gridLayout = new GridLayout(1, 1); - orderedLayout = new OrderedLayout(); - - getMainWindow().setLayout(orderedLayout); - // getMainWindow().setLayout(new GridLayout(1, 1)); - getMainWindow().setSizeFull(); - getMainWindow().getLayout().setSizeFull(); - - createUI(orderedLayout); - // createUI(gridLayout); - - } - - private void createUI(Layout layout) { - // Button sw = new Button("Switch", new ClickListener() { - // - // public void buttonClick(ClickEvent event) { - // Layout l = getMainWindow().getLayout(); - // if (l == orderedLayout) { - // getMainWindow().setLayout(gridLayout); - // } else { - // getMainWindow().setLayout(orderedLayout); - // } - // - // } - // }); - // layout.addComponent(sw); - - Layout ol = new GridLayout(1, 2); - p = new Panel("Panel", ol); - p.setSizeFull(); - Label l = new Label("Spacer"); - l.setHeight("400px"); - p.addComponent(l); - - embedded = new Embedded(null, new ThemeResource( - "icons/64/folder-add.png")); - layout.addComponent(embedded); - Button b = new Button( - "Replace image with new embedded component (flashes)", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - Embedded newEmbedded = new Embedded(null, - new ThemeResource("icons/64/folder-add.png")); - getMainWindow().getLayout().replaceComponent(embedded, - newEmbedded); - embedded = newEmbedded; - - } - - }); - p.addComponent(b); - - b = new Button("Change image source (is fine)", new ClickListener() { - - public void buttonClick(ClickEvent event) { - String img = "folder-add"; - if (((ThemeResource) embedded.getSource()).getResourceId() - .contains("folder-add")) { - img = "folder-delete"; - } - embedded - .setSource(new ThemeResource("icons/64/" + img + ".png")); - - } - - }); - - p.addComponent(b); - layout.addComponent(p); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2051.java b/src/com/vaadin/tests/tickets/Ticket2051.java deleted file mode 100644 index b31acbde11..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2051.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.DateField; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2051 extends Application { - - private static final Object P1 = new Object(); - private static final Object P2 = new Object(); - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Table t = new Table("This is a table"); - t.addContainerProperty(P1, Component.class, null); - t.addContainerProperty(P2, Component.class, null); - t.setColumnHeaders(new String[] { "Col1", "Col2" }); - - Item i = t.addItem("1"); - i.getItemProperty(P1).setValue(new TextField("abc")); - i.getItemProperty(P2).setValue(new Label("label")); - Item i2 = t.addItem("2"); - i2.getItemProperty(P1).setValue(new Button("def")); - i2.getItemProperty(P2).setValue(new DateField()); - - layout.addComponent(t); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2053.java b/src/com/vaadin/tests/tickets/Ticket2053.java deleted file mode 100644 index 167a1440c0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2053.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Window.CloseEvent; - -public class Ticket2053 extends Application { - - int childs = 0; - - @Override - public void init() { - - final Window main = new Window("#2053"); - setMainWindow(main); - Button nothing = new Button("Do nothing"); - main.addComponent(nothing); - nothing - .setDescription("Even though no action is taked, this window is refreshed to " - + "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() { - 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")); - } - }); - 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() { - public void valueChange(ValueChangeEvent event) { - main.addComponent(new Label(name + " send text:" - + tf.toString())); - } - }); - for (int i = 0; i < 3; i++) { - final String caption = "Slow button " + i; - c.addComponent(new Button(caption, - new Button.ClickListener() { - public synchronized void buttonClick( - ClickEvent event) { - try { - this.wait(2000); - } catch (InterruptedException e) { - } - main.addComponent(new Label(caption - + " pressed")); - } - })); - } - - } - }); - main.addComponent(add); - add - .setDescription("This button opens a new browser window. Closing the browser " - + "window should do two things: 1) submit all unsubmitted state to server " - + "(print any changes to textfield to main window) and 2) call window.close()" - + " on the child window (print closed on the main window)"); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2060.java b/src/com/vaadin/tests/tickets/Ticket2060.java deleted file mode 100644 index 09a391e80d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2060.java +++ /dev/null @@ -1,51 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2060 extends Application { - - private Button button1; - private Button button2; - private Button button3; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - OrderedLayout buttonLayout = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - button1 = new Button("Button which is 50px wide"); - button1.setWidth("50px"); - button2 = new Button("Button without width"); - button3 = new Button("Click to repaint buttons", new ClickListener() { - - public void buttonClick(ClickEvent event) { - button1.requestRepaint(); - button2.requestRepaint(); - button3.requestRepaint(); - - } - - }); - - buttonLayout.addComponent(button1); - buttonLayout.addComponent(button2); - buttonLayout.addComponent(button3); - - layout.addComponent(buttonLayout); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2061.java b/src/com/vaadin/tests/tickets/Ticket2061.java deleted file mode 100644 index b6c8f1fb38..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2061.java +++ /dev/null @@ -1,128 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -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.ExpandLayout; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2061 extends Application { - - private Window mainWindow; - - @Override - public void init() { - mainWindow = new Window("Ticket 2061"); - mainWindow.setSizeFull(); - mainWindow.getLayout().setSizeFull(); - setMainWindow(mainWindow); - - MyTable table1 = new MyTable(24, "table1"); - table1.loadTable(1000); - - MyTable table2 = new MyTable(24, "table2"); - table2.loadTable(1000); - - MyTable table3 = new MyTable(24, "table3"); - table3.loadTable(1000); - - MyAccordion accordion = new MyAccordion(new Component[] { table1, - table2 }, "Test"); - - Tabs tab = new Tabs(new Component[] { accordion, table3 }); - - mainWindow.addComponent(tab); - - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private ExpandLayout layout = new ExpandLayout(); - - public MyTable(int columnNumber, String id) { - setDebugId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - - } - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setDebugId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2061b.java b/src/com/vaadin/tests/tickets/Ticket2061b.java deleted file mode 100644 index 8d87a70788..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2061b.java +++ /dev/null @@ -1,198 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -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.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; -import com.vaadin.ui.TabSheet.SelectedTabChangeListener; - -public class Ticket2061b extends Application implements - SelectedTabChangeListener { - - private Window mainWindow; - private Panel p; - - @Override - public void init() { - mainWindow = new Window("Ticket 2061b"); - mainWindow.setSizeFull(); - OrderedLayout mainLayout = (OrderedLayout) mainWindow.getLayout(); - mainLayout.setSizeFull(); - mainLayout.setMargin(false); - setMainWindow(mainWindow); - - SplitPanel sp = new SplitPanel(); - sp.setSizeFull(); - sp.setSplitPosition(20, SplitPanel.UNITS_PIXELS); - - p = new Panel("This is a panel"); - p.setSizeFull(); - Label label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - p.addComponent(label1); - p.setScrollTop(50); - // MyTable table1 = new MyTable(24, "table1"); - // table1.loadTable(1000); - - // MyTable table2 = new MyTable(24, "table2"); - // table2.loadTable(1000); - - // MyTable table3 = new MyTable(24, "table3"); - // table3.loadTable(1000); - - // MyAccordion accordion = new MyAccordion(new Component[] { table1, - // table2 }, "Test"); - - Label a = new Label("abc123"); - TextField tf = new TextField("A large textfield"); - tf.setHeight("2500px"); - tf.setWidth("2500px"); - - TabsAcc tab = new TabsAcc(new Component[] { p, a, tf }); - tab.addListener(this); - - mainLayout.addComponent(sp); - sp.addComponent(new Label("C 1")); - // sp.addComponent(new Label("C 2")); - // sp.setHeight("100px"); - - sp.addComponent(tab); - // mainLayout.addComponent(new Label("Filler")); - // mainLayout.addComponent(tab); - // mainLayout.setExpandRatio(tab, 1.0f); - // sp.addComponent(new Label("Filler")); - // sp.addComponent(tab); - - p = new Panel("This is a panel"); - p.setWidth("2000px"); - p.setHeight("2000px"); - Panel p2 = new Panel("This is another panel"); - p2.setWidth("2500px"); - p2.setHeight("2500px"); - label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - p2.addComponent(label1); - p.addComponent(p2); - - tab.addTab(p, "Panel with panel", null); - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private ExpandLayout layout = new ExpandLayout(); - - public MyTable(int columnNumber, String id) { - setDebugId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - - } - - } - - public class TabsAcc extends Accordion { - - public TabsAcc(Component[] components) { - this.setWidth("100%"); - this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - - } - - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setDebugId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - } - } - - public void selectedTabChange(SelectedTabChangeEvent event) { - p.setScrollTop(10); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2061c.java b/src/com/vaadin/tests/tickets/Ticket2061c.java deleted file mode 100644 index 77381dcbfd..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2061c.java +++ /dev/null @@ -1,149 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.data.Property.ValueChangeListener; -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.ExpandLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.TabSheet.SelectedTabChangeEvent; -import com.vaadin.ui.TabSheet.SelectedTabChangeListener; - -public class Ticket2061c extends Application implements - SelectedTabChangeListener { - - private Window mainWindow; - private Panel p; - - @Override - public void init() { - mainWindow = new Window("Vaadin"); - mainWindow.setSizeFull(); - mainWindow.getLayout().setSizeFull(); - setMainWindow(mainWindow); - - OrderedLayout ol = new OrderedLayout(); - ol.setWidth("200px"); - ol.setHeight("200px"); - - OrderedLayout ol2 = new OrderedLayout(); - ol2.setSizeFull(); - - p = new Panel("This is a panel"); - p.setSizeFull(); - - Label label1 = new Label("This is a table!"); - label1.setHeight("1500px"); - label1.setWidth("1500px"); - p.setScrollTop(50); - - p.addComponent(label1); - ol2.addComponent(p); - ol.addComponent(ol2); - - Label a = new Label("abc123"); - a.setCaption("Label a"); - ol.setCaption("OL"); - Tabs tab = new Tabs(new Component[] { a, ol }); - tab.addListener(this); - mainWindow.addComponent(tab); - - } - - public class MyTable extends CustomComponent implements ValueChangeListener { - - private Table table = new Table(); - private String[] columns; - private ExpandLayout layout = new ExpandLayout(); - - public MyTable(int columnNumber, String id) { - setDebugId(id); - setCompositionRoot(layout); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.addListener(this); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - public void valueChange(ValueChangeEvent event) { - - } - - } - - public class Tabs extends TabSheet { - - public Tabs(Component[] components) { - this.setWidth("100%"); - // this.setHeight("100%"); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - } - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setDebugId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - } - } - - public void selectedTabChange(SelectedTabChangeEvent event) { - p.setScrollTop(10); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2062.java b/src/com/vaadin/tests/tickets/Ticket2062.java deleted file mode 100644 index e5650ae18c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2062.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.SplitPanel; -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 { - private static final Object P1 = new Object(); - - @Override - public void init() { - setMainWindow(new Window("Ticket2062")); - getMainWindow().setSizeFull(); - - SplitPanel p = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - p.setSizeFull(); - getMainWindow().setLayout(p); - - TextField tf1 = new TextField("Tab 1"); - tf1.setValue("Field 1"); - tf1.setSizeFull(); - - Table t = new Table("Table"); - t.addContainerProperty(P1, String.class, ""); - t.setSizeFull(); - - TabSheet tabSheet = new TabSheet(); - tabSheet.setWidth("300px"); - tabSheet.setHeight("300px"); - - tabSheet.addComponent(tf1); - tabSheet.addComponent(t); - - getMainWindow().addComponent(tabSheet); - - } - -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2083.java b/src/com/vaadin/tests/tickets/Ticket2083.java deleted file mode 100644 index e074210fec..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2083.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket2083 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Panel p = new Panel( - "This is a panel with a longer caption than it should have"); - p.setWidth("100px"); - p.getLayout().addComponent(new Label("Contents")); - layout.addComponent(p); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2090.java b/src/com/vaadin/tests/tickets/Ticket2090.java deleted file mode 100644 index 5bc69e0a64..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2090.java +++ /dev/null @@ -1,62 +0,0 @@ -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.TextField; -import com.vaadin.ui.Window; - -public class Ticket2090 extends Application { - - Label label = new Label(); - Button target = new Button(); - Window w = new Window("#2090"); - - @Override - public void init() { - setMainWindow(w); - final TextField width = new TextField("Width"); - width.setImmediate(true); - final TextField height = new TextField("Height"); - height.setImmediate(true); - w.addComponent(width); - w.addComponent(height); - w.addComponent(label); - w.addComponent(target); - height.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - try { - target.setHeight(height.toString()); - height.setComponentError(null); - updateLabel(); - } catch (Exception e) { - height.setComponentError(new UserError(e.getMessage())); - } - } - }); - width.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - try { - target.setWidth(width.toString()); - width.setComponentError(null); - updateLabel(); - } catch (Exception e) { - width.setComponentError(new UserError(e.getMessage())); - } - } - }); - - } - - private void updateLabel() { - label.setValue("width: " + target.getWidth() - + Sizeable.UNIT_SYMBOLS[target.getWidthUnits()] + ", height: " - + target.getHeight() - + Sizeable.UNIT_SYMBOLS[target.getHeightUnits()]); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2095.java b/src/com/vaadin/tests/tickets/Ticket2095.java deleted file mode 100644 index 49353db114..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2095.java +++ /dev/null @@ -1,31 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.Window; - -public class Ticket2095 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - // uncomment to workaround iorderedlayout bug in current trunk - // w.setLayout(new ExpandLayout()); - w.getLayout().setSizeFull(); - - Embedded em = new Embedded(); - em.setType(Embedded.TYPE_BROWSER); - em - .setSource(new ExternalResource( - "../statictestfiles/ticket2095.html")); - em.setDebugId("MYIFRAME"); - - em.setSizeFull(); - - w.addComponent(em); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2098.java b/src/com/vaadin/tests/tickets/Ticket2098.java deleted file mode 100644 index 829fb30070..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2098.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; - -public class Ticket2098 extends Application { - - private static final String info = "First tab hidden, second should initially be selected"; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - w.addComponent(new Label(info)); - createUI(w); - } - - private void createUI(Window w) { - TabSheet ts = new TabSheet(); - Label l1 = new Label("111"); - Label l2 = new Label("222"); - Label l3 = new Label("333"); - Label l4 = new Label("444"); - - ts.addTab(l1, "1", null); - ts.addTab(l2, "2", null); - ts.addTab(l3, "3", null); - ts.addTab(l4, "4", null); - - l1.setVisible(false); - - w.addComponent(ts); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2099.java b/src/com/vaadin/tests/tickets/Ticket2099.java deleted file mode 100644 index 44c264e07e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2099.java +++ /dev/null @@ -1,77 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2099 extends Application { - - private Label l1, l2, l3; - private OrderedLayout ol1, ol2, ol3; - private Window popup; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout layout = new GridLayout(10, 10); - w.setLayout(layout); - createUI(layout); - } - - private void createUI(GridLayout layout) { - Button b = new Button("Show popup", new ClickListener() { - - public void buttonClick(ClickEvent event) { - getMainWindow().addWindow(popup); - // popup.setVisible(true); - } - - }); - popup = createPopup(); - addWindow(popup); - - layout.addComponent(b); - layout.addComponent(new Button("Hide label '222'", new ClickListener() { - - public void buttonClick(ClickEvent event) { - l2.setVisible(!l2.isVisible()); - } - - })); - - } - - private Window createPopup() { - Window w = new Window("Popup"); - TabSheet ts = new TabSheet(); - ol1 = new OrderedLayout(); - ol2 = new OrderedLayout(); - ol3 = new OrderedLayout(); - l1 = new Label("111"); - l2 = new Label("222"); - l3 = new Label("333"); - - ol1.addComponent(l1); - ol2.addComponent(l2); - ol3.addComponent(l3); - - ts.addTab(ol1, "1", null); - ts.addTab(ol2, "2", null); - ts.addTab(ol3, "3", null); - - // l1.setVisible(false); - // ts.setSelectedTab(l3); - - w.addComponent(ts); - - return w; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2101.java b/src/com/vaadin/tests/tickets/Ticket2101.java deleted file mode 100644 index 9a260635cf..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2101.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Window; - -public class Ticket2101 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - Button b = new Button( - "Button with a long text which will not fit on 50 pixels"); - b.setWidth("50px"); - - w.getLayout().addComponent(b); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2103.java b/src/com/vaadin/tests/tickets/Ticket2103.java deleted file mode 100644 index 3e655b6753..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2103.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -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.ExpandLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2103 extends Application { - private Window mainWindow; - - @Override - public void init() { - mainWindow = new Window(getClass().getSimpleName()); - mainWindow.setLayout(new ExpandLayout()); - mainWindow.setSizeFull(); - mainWindow.getLayout().setSizeFull(); - - MyTable table1 = new MyTable(4, "table1"); - table1.loadTable(100); - MyTable table2 = new MyTable(4, "table2"); - table2.loadTable(100); - - MyAccordion a = new MyAccordion(new Component[] { table1, table2 }, - "FDSF"); - mainWindow.addComponent(a); - setMainWindow(mainWindow); - // mainWindow.addComponent(table1); - - } - - public class MyAccordion extends Accordion { - - public MyAccordion(Component[] components, String id) { - this.setWidth("100%"); - this.setHeight("100%"); - setDebugId(id); - for (int i = 0; i < components.length; i++) { - this.addTab(components[i], components[i].getDebugId(), null); - } - } - } - - public class MyTable extends Table { - - private Table table = this; - private String[] columns; - private ExpandLayout layout = new ExpandLayout(); - - public MyTable(int columnNumber, String id) { - setDebugId(id); - setSizeFull(); - columns = initializeColumns(columnNumber); - table.setWidth("100%"); - table.setHeight("100%"); - table.setColumnReorderingAllowed(true); - table.setColumnCollapsingAllowed(true); - table.setSelectable(true); - table.setMultiSelect(false); - table.setNullSelectionAllowed(false); - // table.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - table.setContainerDataSource(createContainer()); - layout.addComponent(table); - } - - public void loadTable(int itemNumber) { - table.removeAllItems(); - for (int j = 0; j < itemNumber; j++) { - Item rowItem = table.addItem(j); - if (rowItem != null) { - for (int i = 0; i < columns.length; i++) { - rowItem.getItemProperty(columns[i]).setValue( - "Value" + j); - } - } - } - } - - private HierarchicalContainer createContainer() { - final HierarchicalContainer c = new HierarchicalContainer(); - for (int i = 0; i < columns.length; i++) { - c.addContainerProperty(columns[i], String.class, null); - } - return c; - } - - private String[] initializeColumns(int number) { - String[] columns = new String[number]; - for (int i = 0; i < number; i++) { - columns[i] = "Column" + i; - } - return columns; - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2104.java b/src/com/vaadin/tests/tickets/Ticket2104.java deleted file mode 100644 index 974e97871f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2104.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.event.ItemClickEvent; -import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Tree; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2104 extends Application { - - 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); - - Tree tree = new Tree(); - Table table = new Table(); - - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - - main.addComponent(info); - - OrderedLayout ol = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - main.addComponent(ol); - Button b = new Button("immediate", - new MethodProperty(tree, "immediate")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("selectable", new MethodProperty(tree, "selectable")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("nullsel", new MethodProperty(tree, - "nullSelectionAllowed")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("multi", new MethodProperty(tree, "multiSelect")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("icon", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (tree.getItemIconPropertyId() == null) { - tree.setItemIconPropertyId("icon"); - } else { - tree.setItemIconPropertyId(null); - } - - } - }); - ol.addComponent(b); - - main.addComponent(tree); - tree.setImmediate(true); - tree.setNullSelectionAllowed(false); - tree.addItem("Root 1"); - tree.addItem("1. Child 1"); - tree.setParent("1. Child 1", "Root 1"); - tree.addItem("1. Child 2"); - tree.setParent("1. Child 2", "Root 1"); - tree.addItem("Root 2"); - tree.addItem("2. Child 1"); - tree.setParent("2. Child 1", "Root 2"); - tree.addItem("2. Child 2"); - tree.setParent("2. Child 2", "Root 2"); - tree.addContainerProperty("icon", ExternalResource.class, - new ExternalResource( - "http://www.itmill.com/res/images/itmill_logo.gif")); - - tree.addListener(new ItemClickListener() { - public void itemClick(ItemClickEvent event) { - getMainWindow().addComponent( - new Label(event.toString() + " // " + event.getItemId() - + "//" + event.getSource())); - - } - }); - - ol = new OrderedLayout(OrderedLayout.ORIENTATION_HORIZONTAL); - main.addComponent(ol); - b = new Button("immediate", new MethodProperty(table, "immediate")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("selectable", new MethodProperty(table, "selectable")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("nullsel", new MethodProperty(table, - "nullSelectionAllowed")); - b.setImmediate(true); - ol.addComponent(b); - b = new Button("multi", new MethodProperty(table, "multiSelect")); - b.setImmediate(true); - ol.addComponent(b); - main.addComponent(table); - table.setWidth("150px"); - table.setImmediate(true); - table.setSelectable(true); - table.setNullSelectionAllowed(false); - for (int i = 0; i < 10; i++) { - table.addItem("Item " + i); - } - table.addListener(new ItemClickListener() { - public void itemClick(ItemClickEvent event) { - getMainWindow().addComponent( - new Label(event.toString() + " // " + event.getItemId() - + "//" + event.getSource())); - - } - }); - table.addContainerProperty("Column", String.class, "value"); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2106.java b/src/com/vaadin/tests/tickets/Ticket2106.java deleted file mode 100644 index 8168e06154..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2106.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Date; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2106 extends Application { - - private static CustomizedSystemMessages msgs = new Application.CustomizedSystemMessages(); - static { - // We will forward the user to www.vaadin.com when the session expires - msgs.setSessionExpiredURL("http://www.vaadin.com"); - msgs.setSessionExpiredMessage(null); - msgs.setSessionExpiredCaption(null); - } - - public static Application.SystemMessages getSystemMessages() { - return msgs; - } - - @Override - public void init() { - setMainWindow(new Window("#2106")); - getMainWindow().addComponent( - new Button("Do nothing", new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - getMainWindow().addComponent( - new Label("Last time did nothing: " - + new Date())); - } - })); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2107.java b/src/com/vaadin/tests/tickets/Ticket2107.java deleted file mode 100644 index adb6784275..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2107.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Validator; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.Button; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Window.Notification; - -public class Ticket2107 extends Application { - - @Override - public void init() { - final Window w = new Window("Testing for #2107"); - setMainWindow(w); - - final TextField tf = new TextField( - "Required field that validated the input"); - tf - .setDescription("Enter someting and click outside the field to activate"); - tf.setRequired(true); - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - w.showNotification("TextField is " + (tf.isValid() ? "" : "in") - + "valid, with error: " + tf.getErrorMessage(), - Notification.TYPE_WARNING_MESSAGE); - } - }); - tf.addValidator(new Validator() { - - public boolean isValid(Object value) { - return value != null && value.toString().length() > 3; - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException( - "Text length must exceed 3 characters"); - } - } - }); - w.addComponent(tf); - - final Button b = new Button( - "Field should use error message. (!) should be shown when empty.", - false); - w.addComponent(b); - b.setImmediate(true); - b.addListener(new Property.ValueChangeListener() { - public void valueChange(ValueChangeEvent event) { - tf - .setRequiredError(b.booleanValue() ? "Field must not be empty" - : null); - } - }); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2117.java b/src/com/vaadin/tests/tickets/Ticket2117.java deleted file mode 100644 index 6a22915f03..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2117.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2117 extends Application { - - @Override - public void init() { - setMainWindow(createWindow()); - } - - @Override - public Window getWindow(String name) { - - // If we already have the requested window, use it - Window w = super.getWindow(name); - if (w == null) { - - // If no window found, create it - w = createExtraWindow(name); - w.open(new ExternalResource(w.getURL())); - } - return w; - } - - private Window createExtraWindow(String name) { - final Window w = new Window("Extra window: " + name); - w.setName(name); - addWindow(w); - w.addComponent(new Label( - "This window has been created on fly for name: " + name)); - w.addComponent(new Label("It has also been redirected to " + w.getURL() - + " to support reloading")); - w.addComponent(new Button("button", new ClickListener() { - public void buttonClick(ClickEvent event) { - w.showNotification("Button clicked"); - w.addComponent(new Label("clicked")); - } - })); - return w; - } - - private Window createWindow() { - final Window w = new Window(); - w - .addComponent(new Label( - "Click this link: " - + getURL().toExternalForm() - + " which opens new windows to this uri. They should end up having a separate Window and URL.", - Label.CONTENT_XHTML)); - return w; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2119.java b/src/com/vaadin/tests/tickets/Ticket2119.java deleted file mode 100644 index 7e782dc2a0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2119.java +++ /dev/null @@ -1,92 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Select; -import com.vaadin.ui.Window; - -/** - * Test case for Ticket 2119. - */ -public class Ticket2119 extends Application { - - private ObjectProperty globalValue; - - @Override - public void init() { - globalValue = new ObjectProperty(null, String.class); - Window main = createWindow(); - setMainWindow(main); - } - - @Override - public Window getWindow(String name) { - if (!isRunning()) { - return null; - } - // If we already have the requested window, use it - Window w = super.getWindow(name); - if (w == null) { - // If no window found, create it - w = createWindow(); - addWindow(w); - w.open(new ExternalResource(w.getURL())); - } - return w; - } - - private Window createWindow() { - Window main = new Window("Test for ticket XXX"); - main.setLayout(testLayout()); - return main; - } - - private Layout testLayout() { - final Layout layout = new OrderedLayout(); - final Label label = new Label( - "Instructions to reproduce:\n" - + " - Open this application in two browser windows\n" - + " - Click the Button in first Window\n" - + " - 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); - layout.addComponent(label); - - final Select select = new Select("Test Select"); - select.setWidth("100px"); - select.setImmediate(true); - select.setNullSelectionAllowed(false); - select.addItem("1"); - select.addItem("2"); - select.addItem("3"); - - final ObjectProperty valueProperty = new ObjectProperty("1", - String.class); - select.setPropertyDataSource(valueProperty); - layout.addComponent(select); - - globalValue.addListener(new Property.ValueChangeListener() { - public void valueChange(Property.ValueChangeEvent event) { - valueProperty.setValue(event.getProperty().getValue()); - } - }); - - final Button changeValueButton = new Button("Change Value to 2"); - changeValueButton.addListener(new Button.ClickListener() { - public void buttonClick(Button.ClickEvent event) { - globalValue.setValue("2"); - } - }); - - layout.addComponent(changeValueButton); - - return layout; - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2125.java b/src/com/vaadin/tests/tickets/Ticket2125.java deleted file mode 100644 index 49610597db..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2125.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.MethodProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Table.CellStyleGenerator; -import com.vaadin.ui.Table.ColumnGenerator; - -public class Ticket2125 extends Application { - - @Override - public void init() { - setMainWindow(new MainWindow("Ticket2125")); - - } - - class MainWindow extends Window { - MainWindow(String caption) { - super(caption); - - addComponent(new Label( - "Inspect w/ Firebug: row 5 should have a MYROW -style on the row, and MYCELL on all cells")); - - Table table = new Table(); - table.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX); - addComponent(table); - for (int i = 0; i < 50; i++) { - table.addItem(new Integer(i)); - } - table.addContainerProperty("String", String.class, "a string"); - table.addContainerProperty("Boolean", Boolean.class, Boolean.TRUE); - table.addGeneratedColumn("Generated", new ColumnGenerator() { - public Component generateCell(Table source, Object itemId, - Object columnId) { - return new Label("Item " + itemId); - } - }); - table.setCellStyleGenerator(new CellStyleGenerator() { - public String getStyle(Object itemId, Object propertyId) { - if (new Integer(4).equals(itemId)) { - if (propertyId == null) { - return "MYROW"; - } else { - return "MYCELL"; - } - } - return null; - } - - }); - Button b = new Button("editmode", new MethodProperty(table, - "editable")); - b.setImmediate(true); - addComponent(b); - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2126.java b/src/com/vaadin/tests/tickets/Ticket2126.java deleted file mode 100644 index 01ef18f2ef..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2126.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -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.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -/** - * - * Toggling container with an empty one may result duplicate header cell in - * client. - * - */ -public class Ticket2126 extends com.vaadin.Application { - - Window main = new Window(); - Table table = new Table(); - - @Override - public void init() { - setMainWindow(main); - - final IndexedContainer container1 = new IndexedContainer(); - container1.addContainerProperty("text", Component.class, null); - final IndexedContainer container2 = new IndexedContainer(); - - // Case #2 Try to comment the following line for another type of strange - // behaviour - container2.addContainerProperty("text", Component.class, null); - - for (int i = 0; i < 100; i++) { - Item item = container1.addItem(i); - item.getItemProperty("text").setValue(new Label("Test " + i)); - } - - table.setContainerDataSource(container1); - - // workaround for case #2 - // table.setWidth("300px"); - // table.setHeight("300px"); - - Button refreshTable = new Button("Switch table container"); - refreshTable.addListener(new Button.ClickListener() { - boolean full = true; - - public void buttonClick(Button.ClickEvent e) { - if (full) { - table.setContainerDataSource(container2); - } else { - table.setContainerDataSource(container1); - } - full = !full; - } - }); - - main.addComponent(table); - main.addComponent(refreshTable); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2151.java b/src/com/vaadin/tests/tickets/Ticket2151.java deleted file mode 100644 index 06d1f15336..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2151.java +++ /dev/null @@ -1,109 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.CheckBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2151 extends Application { - - private Label status; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - Button b = new Button("This is a button"); - CheckBox cb = new CheckBox("This is a checkbox"); - cb.setImmediate(true); - setTheme("tests-tickets"); - layout.setStyleName("mylayout"); - status = new Label("Result:"); - layout.addComponent(status); - layout.setSpacing(true); - layout.setMargin(true); - - layout.addComponent(b); - layout.addComponent(cb); - - layout.addComponent(new Label("a")); - layout.addComponent(new Label("b")); - layout.addComponent(new Label("c")); - - check(Button.class); - check(CheckBox.class); - checkDataBinding(Button.class); - checkDataBinding(CheckBox.class); - - } - - private void check(Class class1) { - boolean ok = false; - Button 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(); - } - } catch (Exception e1) { - e1.printStackTrace(); - return; - } - - if (ok) { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + ": OK"); - } else { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + ": FAILED"); - } - - } - - private void checkDataBinding(Class class1) { - boolean ok = false; - Button b; - try { - b = class1.newInstance(); - b.setCaption("Button of type " + class1.getSimpleName()); - try { - b.setWriteThrough(true); - b.setReadThrough(true); - ObjectProperty prop = new ObjectProperty("ABC 123"); - /* - * This should throw an exception or somehow tell that the - * property was invalid (wrong type). See #2223. - */ - b.setPropertyDataSource(prop); - } catch (Exception e) { - e.printStackTrace(); - } - } catch (Exception e1) { - e1.printStackTrace(); - return; - } - - if (ok) { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + "/DB: OK"); - } else { - status.setValue(status.getValue() + " " - + class1.getClass().getSimpleName() + "/DB: FAILED"); - } - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2157.java b/src/com/vaadin/tests/tickets/Ticket2157.java deleted file mode 100644 index c4f6ff30d3..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2157.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket2157 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - OrderedLayout ol; - Panel p; - ComboBox cb; - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - // cb.setWidth("100%"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - // cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - // - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide"); - // p.setWidth("500px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("500px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide with caption"); - // p.setWidth("500px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("500px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100%"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide with caption"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100%"); - p.addComponent(cb); - layout.addComponent(p); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2178.java b/src/com/vaadin/tests/tickets/Ticket2178.java deleted file mode 100644 index c663b29778..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2178.java +++ /dev/null @@ -1,108 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket2178 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - OrderedLayout ol; - Panel p; - ComboBox cb; - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - // cb.setWidth("100%"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox without width with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - // cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide"); - // p.setWidth("100px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100px wide with caption"); - // p.setWidth("100px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide"); - // p.setWidth("500px"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("500px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 500px wide with caption"); - // p.setWidth("500px"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("500px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide inside 200px panel"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - // cb.setCaption("A combobox"); - cb.setWidth("100%"); - // cb.setWidth("500px"); - p.addComponent(cb); - layout.addComponent(p); - - ol = new OrderedLayout(); - p = new Panel(ol); - p.setCaption("Combobox 100% wide inside 200px panel with caption"); - p.setWidth("200px"); - ol.setWidth("100%"); - cb = new ComboBox(); - cb.setCaption("A combobox"); - cb.setWidth("100%"); - p.addComponent(cb); - layout.addComponent(p); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2179.java b/src/com/vaadin/tests/tickets/Ticket2179.java deleted file mode 100644 index 4612f7464f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2179.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Validator; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2179 extends Application { - - TextField f = new TextField("Test fiel ( must contain 1 & 2 )"); - Window main = new Window("Dual validator test"); - - @Override - public void init() { - - f.setImmediate(true); - f.setRequired(true); - f.addValidator(new ContainsValidator("1")); - f.addValidator(new ContainsValidator("2")); - - setMainWindow(main); - main.addComponent(f); - - f.addListener(new Property.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - main.showNotification("Test field is " - + (f.isValid() ? "valid" : "invalid")); - } - }); - - } - - 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); - } - - public void validate(Object value) throws InvalidValueException { - if (!isValid(value)) { - throw new InvalidValueException("Value does not contain " + c); - } - - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2180.java b/src/com/vaadin/tests/tickets/Ticket2180.java deleted file mode 100644 index 9f5e2a2de1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2180.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; - -public class Ticket2180 extends Application { - - private Window mainWindow; - private TabSheet tabSheet; - - @Override - public void init() { - mainWindow = new Window("Tabsheet should cause scrollbars"); - setMainWindow(mainWindow); - // mainWindow.getLayout().setSizeFull(); - tabSheet = new TabSheet(); - // tabSheet.setWidth("100%"); - Button button = new Button("Blah"); - button.setWidth("100%"); - Label label1 = new Label("Lorem ipsum"); - Label label2 = new Label("Lorem"); - Label label3 = new Label( - "Lorema jsdfhak sjdfh kajsdh fkajhd kfjah dkfjah ksfdjh kajsfh kj 1 2 3 4 5 6 7 8 9 10"); - - label3.setWidth("800px"); - tabSheet.addTab(label1, "Tab 1", null); - tabSheet.addTab(label2, "Tab 2", null); - tabSheet.addTab(label3, "Tab 3", null); - tabSheet.addTab(new Label("a"), "Tab 4", null); - tabSheet.addTab(new Label("a"), "Tab 5", null); - tabSheet.addTab(new Label("a"), "Tab 6", null); - // mainWindow.addComponent(new Label("123")); - mainWindow.addComponent(tabSheet); - mainWindow.addComponent(button); - // mainWindow.addComponent(new Label("abc")); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2181.java b/src/com/vaadin/tests/tickets/Ticket2181.java deleted file mode 100644 index d5afb01e0d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2181.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.Date; -import java.util.Random; -import java.util.Set; - -import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.OptionGroup; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2181 extends Application 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"); - TextField tf1 = new TextField(caption, "Test field - undefined width"); - TextField tf2 = new TextField(caption, "Test field - 150px wide"); - Button setButton = new Button("Set", this); - private Random random = new Random(123); - private OptionGroup options; - - private static ArrayList icons = new ArrayList(); - static { - icons.add("icons/64/ok.png"); - icons.add("icons/64/arrow-down.png"); - icons.add("icons/64/arrow-left.png"); - icons.add("icons/64/arrow-right.png"); - icons.add("icons/64/arrow-up.png"); - } - - @Override - public void init() { - setMainWindow(main); - OrderedLayout ol; - ol = new OrderedLayout(); - ol.addComponent(tf1); - main.addComponent(ol); - - ol = new OrderedLayout(); - ol.setWidth("150px"); - tf2.setWidth("150px"); - ol.addComponent(tf2); - main.addComponent(ol); - - main.addComponent(createSelection()); - main.addComponent(setButton); - } - - private Component createSelection() { - options = new OptionGroup(); - options.addItem("Icon"); - options.addItem("Caption"); - options.addItem("Required"); - options.addItem("Error"); - options.setMultiSelect(true); - options.select("Caption"); - - // ol.addComponent(og); - return options; - } - - public void buttonClick(ClickEvent event) { - if (event.getButton() == setButton) { - set(); - } - } - - private void set() { - Set values = (Set) options.getValue(); - TextField[] tfs = new TextField[] { tf1, tf2 }; - for (TextField tf : tfs) { - // Clear all - tf.setCaption(null); - tf.setComponentError(null); - tf.setRequired(false); - tf.setIcon(null); - - for (String value : values) { - if (value.equals("Caption")) { - tf.setCaption(caption); - } else if (value.equals("Icon")) { - String timestamp = String.valueOf(new Date().getTime()); - tf.setIcon(new ThemeResource(icons.get(random.nextInt(icons - .size())) - + "?" + timestamp)); - } else if (value.equals("Required")) { - tf.setRequired(true); - } else if (value.equals("Error")) { - tf.setComponentError(new UserError("Nooooo...")); - } - } - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2186.java b/src/com/vaadin/tests/tickets/Ticket2186.java deleted file mode 100644 index 55eff60fef..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2186.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2186 extends Application { - - @Override - public void init() { - Window main = new Window("Quick test"); - setMainWindow(main); - - OrderedLayout base = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - main.setLayout(base); - - OrderedLayout content = new OrderedLayout(); - - content.addComponent(new Label("Content.")); - content.setWidth("500px"); - - Table table = new Table(); - - table.setPageLength(10); - - table.setWidth("100%"); - - table.addContainerProperty("Lähettäjä", String.class, ""); - table.addContainerProperty("Viestin tyyppi", String.class, ""); - - for (int i = 0; i < 15; i++) { - - table.addItem(new Object[] { i + " Joku Ihminen", "Testiviesti" }, - - new Object()); - - } - - content.addComponent(table); - - Panel right = new Panel("Panel"); - - right.addComponent(new Label("Some basic text might show up here.")); - - base.addComponent(content); - - base.addComponent(right); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2204.java b/src/com/vaadin/tests/tickets/Ticket2204.java deleted file mode 100644 index d4bcd55c55..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2204.java +++ /dev/null @@ -1,188 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -import com.vaadin.Application; -import com.vaadin.data.Container; -import com.vaadin.data.Item; -import com.vaadin.data.Property; -import com.vaadin.data.util.BeanItem; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.ComponentContainer; -import com.vaadin.ui.Field; -import com.vaadin.ui.FieldFactory; -import com.vaadin.ui.Form; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2204 extends Application { - - private final List textAreas = new ArrayList(); - private TabSheet ts; - private final Map containerToComponent = new HashMap(); - private RichTextArea rta; - private final List> classes = new ArrayList>(); - protected RichTextArea formTextArea; - - @Override - public void init() { - classes.add(OrderedLayout.class); - classes.add(GridLayout.class); - classes.add(Accordion.class); - classes.add(TabSheet.class); - classes.add(Panel.class); - classes.add(SplitPanel.class); - classes.add(Form.class); - - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - ts = new TabSheet(); - layout.addComponent(ts); - - for (Class c : classes) { - ts.addTab(createComponent(c), c.getSimpleName(), null); - } - rta = new RichTextArea(); - rta.setVisible(false); - ts.addTab(rta, "Hidden rta", null); - - Button b = new Button("Show area", new ClickListener() { - - public void buttonClick(ClickEvent event) { - showHide(); - } - }); - - layout.addComponent(b); - - b = new Button("Show tab", new ClickListener() { - - public void buttonClick(ClickEvent event) { - showTab(); - } - }); - - layout.addComponent(b); - - } - - protected void showTab() { - rta.setVisible(!rta.isVisible()); - - } - - protected void showHide() { - Component c = containerToComponent.get(ts.getSelectedTab()); - c.setVisible(!c.isVisible()); - } - - private Component createComponent(Class c) { - RichTextArea textArea = new RichTextArea(); - textArea.setVisible(false); - textArea.setCaption("This is the textArea"); - textArea.setWidth("200px"); - textArea.setHeight("100px"); - textAreas.add(textArea); - Component cc = null; - - try { - cc = (Component) c.newInstance(); - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return null; - } - // if (c == OrderedLayout.class) { - // cc = new OrderedLayout(); - // } else - if (c == Accordion.class) { - // Label l = new Label("Filler"); - // l.setCaption("Filler label"); - // cc.addComponent(l); - } - - if (c == Form.class) { - Form f = (Form) cc; - f.setFieldFactory(new FieldFactory() { - - public Field createField(Class type, Component uiContext) { - return createField(); - } - - public Field createField(Property property, Component uiContext) { - return createField(); - } - - public Field createField(Item item, Object propertyId, - Component uiContext) { - return createField(); - } - - private Field createField() { - formTextArea = new RichTextArea(); - formTextArea.setVisible(false); - return formTextArea; - } - - public Field createField(Container container, Object itemId, - Object propertyId, Component uiContext) { - return createField(); - } - - }); - f.setItemDataSource(new BeanItem(new Object() { - private int a; - - public int getA() { - return a; - } - - public void setA(int a) { - this.a = a; - } - })); - containerToComponent.put(f, formTextArea); - return f; - } - containerToComponent.put(cc, textArea); - if (cc instanceof ComponentContainer) { - ((ComponentContainer) cc).addComponent(textArea); - } - - if (c == SplitPanel.class) { - SplitPanel sp = (SplitPanel) cc; - sp.setWidth("300px"); - sp.setHeight("300px"); - sp.addComponent(new Label("Label")); - textArea.setSizeFull(); - } - if (c == Panel.class) { - Layout layout = ((Panel) cc).getLayout(); - containerToComponent.put(cc, layout); - layout.setVisible(false); - textArea.setVisible(true); - return cc; - } - - return cc; - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2208.java b/src/com/vaadin/tests/tickets/Ticket2208.java deleted file mode 100644 index 0c8639603e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2208.java +++ /dev/null @@ -1,68 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Table.CellStyleGenerator; -import com.vaadin.ui.Table.ColumnGenerator; - -public class Ticket2208 extends Application { - - private Table t; - - @Override - public void init() { - Window mainWindow = new Window(); - setMainWindow(mainWindow); - - t = new Table("A table"); - t.addContainerProperty("col 1 (red)", String.class, ""); - t.addContainerProperty("col 2", String.class, ""); - - t.setHeight("150px"); - t.addGeneratedColumn("col 3 (green)", new ColumnGenerator() { - - public Component generateCell(Table source, Object itemId, - Object columnId) { - Item item = source.getItem(itemId); - String col1 = (String) item.getItemProperty("col 1 (red)") - .getValue(); - String col2 = (String) item.getItemProperty("col 2").getValue(); - return new Label(col1 + "-" + col2); - } - }); - - t.addContainerProperty("col 4", String.class, ""); - t.setCellStyleGenerator(new CellStyleGenerator() { - - public String getStyle(Object itemId, Object propertyId) { - if ("col 1 (red)".equals(propertyId)) { - return "red"; - } - - if ("col 3 (green)".equals(propertyId)) { - return "green"; - } - - return null; - } - }); - - t.addItem(new Object[] { "Col 1-1", "Col 2-1", "Col 4-1" }, - new Object()); - t.addItem(new Object[] { "Col 1-2", "Col 2-2", "Col 4-2" }, - new Object()); - t.addItem(new Object[] { "Col 1-3", "Col 2-3", "Col 4-3" }, - new Object()); - - t.setColumnReorderingAllowed(true); - t.setColumnCollapsingAllowed(true); - setTheme("tests-tickets"); - mainWindow.addComponent(t); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2209.java b/src/com/vaadin/tests/tickets/Ticket2209.java deleted file mode 100644 index 02450e23c1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2209.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2209 extends Application { - - private GridLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new Window()); - - gl = new GridLayout(1, 2); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2209OL.java b/src/com/vaadin/tests/tickets/Ticket2209OL.java deleted file mode 100644 index 620fed1021..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2209OL.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2209OL extends Application { - - private OrderedLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new Window()); - getMainWindow().getLayout().setWidth("250px"); - gl = new OrderedLayout(); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2209OL2.java b/src/com/vaadin/tests/tickets/Ticket2209OL2.java deleted file mode 100644 index 5f250b7976..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2209OL2.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2209OL2 extends Application { - - private OrderedLayout gl; - private ComboBox combo; - private Label labelLong; - - @Override - public void init() { - setMainWindow(new Window()); - getMainWindow().getLayout().setWidth("250px"); - gl = new OrderedLayout(); - gl.setSizeUndefined(); - gl.setStyleName("borders"); - getMainWindow().addComponent(gl); - setTheme("tests-tickets"); - combo = new ComboBox("Combo caption"); - labelLong = new Label( - "This should stay on one line or to wrap to multiple lines? At leas it should display all the text?. " - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?" - + "A long label, longer than the combo box. Why doesn't it affect the width? And why is the gridlayout so high?"); - gl.addComponent(combo); - gl.addComponent(labelLong); - - Button b = new Button("Add label text", new ClickListener() { - - public void buttonClick(ClickEvent event) { - labelLong.setValue(labelLong.getValue() + "-12345"); - } - - }); - getMainWindow().addComponent(b); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2215.java b/src/com/vaadin/tests/tickets/Ticket2215.java deleted file mode 100644 index 51b0236ad0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2215.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket2215 extends Application { - - @Override - public void init() { - setMainWindow(new Window()); - - OrderedLayout ol = new OrderedLayout(); - Panel p = new Panel("Test"); - p.addComponent(new Label("Panel1")); - p.setHeight("500px"); - p.setWidth("500px"); - p.setStyleName(Panel.STYLE_LIGHT); - ol.addComponent(p); - ol.addComponent(new Label("NextComponent")); - - getMainWindow().addComponent(ol); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2221.java b/src/com/vaadin/tests/tickets/Ticket2221.java deleted file mode 100644 index 30d3070043..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2221.java +++ /dev/null @@ -1,90 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2221 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - layout.setSizeFull(); - layout.addComponent(new Invoice()); - } - - public class Invoice extends CustomComponent { - - Layout main = new OrderedLayout(); - - private TextField tf; - - private Panel outerPanel; - - private TextField tf2; - - public Invoice() { - setSizeFull(); - - setCompositionRoot(main); - main.setSizeFull(); - Button b = new Button("Switch textfield/panel", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - Component visible = tf; - - if (tf.isVisible()) { - visible = outerPanel; - } - - outerPanel.setVisible(false); - tf.setVisible(false); - - visible.setVisible(true); - } - - }); - main.addComponent(b); - - tf = new TextField("TextField"); - tf.setHeight("1000px"); - tf.setWidth("1000px"); - - outerPanel = new Panel(); - outerPanel.setCaption("A RichTextArea"); - outerPanel.setVisible(false); - outerPanel.setHeight("1000px"); - outerPanel.setWidth("1000px"); - - outerPanel.getLayout().setSizeFull(); - Panel innerPanel = new Panel("Inner panel"); - innerPanel.setSizeFull(); - outerPanel.addComponent(innerPanel); - - tf2 = new TextField("A 2000x2000 textfield"); - tf2.setWidth("2000px"); - tf2.setHeight("2000px"); - - innerPanel.addComponent(tf2); - main.addComponent(outerPanel); - main.addComponent(tf); - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2222.java b/src/com/vaadin/tests/tickets/Ticket2222.java deleted file mode 100644 index 40980fcef2..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2222.java +++ /dev/null @@ -1,64 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2222 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - OrderedLayout horiz = new OrderedLayout( - OrderedLayout.ORIENTATION_HORIZONTAL); - horiz.setSpacing(true); - horiz.setMargin(true); - horiz.setStyleName("ticket2222"); - - horiz.addComponent(new Label("Horiz spacing: 60px;")); - horiz.addComponent(new Label("Margin-left: 40px")); - horiz.addComponent(new Label("Margin-top: 100px;")); - horiz.addComponent(new Label("Margin-right: 20px;")); - horiz.addComponent(new Label("Margin-bottom: 30px;")); - horiz.addStyleName("borders"); - - OrderedLayout vert = new OrderedLayout( - OrderedLayout.ORIENTATION_VERTICAL); - vert.setSizeUndefined(); - vert.setSpacing(true); - vert.setMargin(false); - vert.setStyleName("ticket2222"); - vert.addComponent(new Label("Vert spacing: 50px;")); - vert.addComponent(new Label("No margins")); - vert.addComponent(new Label("label 3")); - vert.addStyleName("borders"); - - GridLayout gl = new GridLayout(3, 2); - gl.setStyleName("borders"); - gl.setSpacing(true); - gl.setMargin(true); - gl.setStyleName("ticket2222"); - gl.addComponent(new Label("Vert spacing: 50px; horiz 20px;")); - gl.addComponent(new Label("Margin-left: 40px")); - gl.addComponent(new Label("Margin-top: 100px;")); - gl.addComponent(new Label("Margin-right: 20px;")); - gl.addComponent(new Label("Margin-bottom: 30px;")); - gl.addComponent(new Label("label 3")); - gl.addStyleName("borders"); - - layout.addComponent(horiz); - layout.addComponent(new Label(" ")); - layout.addComponent(vert); - layout.addComponent(new Label(" ")); - layout.addComponent(gl); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java b/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java deleted file mode 100644 index a8b4867323..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2227OrderedlayoutInTable.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.Component; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2227OrderedlayoutInTable extends Application { - - @Override - public void init() { - Window w = new Window(); - Table t = new Table(); - t.setWidth("500px"); - t.setHeight("200px"); - t.addContainerProperty("pno", String.class, ""); - t.addContainerProperty("testi", String.class, ""); - t.addContainerProperty("testi2", OrderedLayout.class, null); - t.addContainerProperty("komponentti", Component.class, null); - t.addContainerProperty("nimi", String.class, ""); - t.setVisibleColumns(new Object[] { "pno", "testi", "testi2", "nimi" }); - - t.setSelectable(true); - - Item i = t.addItem(1); - i.getItemProperty("pno").setValue("1"); - i.getItemProperty("testi").setValue("12.12.08"); - OrderedLayout ol = new OrderedLayout(); - ol.setWidth("100%"); - ol.setHeight(null); - ol.addComponent(new Label("monirivi testi")); - ol.addComponent(new Label("monirivi testi2")); - - i.getItemProperty("testi2").setValue(ol); - i.getItemProperty("nimi").setValue("test"); - - w.addComponent(t); - setMainWindow(w); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2231.java b/src/com/vaadin/tests/tickets/Ticket2231.java deleted file mode 100644 index c9f773a4a4..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2231.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2231 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - layout.setSizeUndefined(); - layout.setMargin(false); - layout.setStyleName("borders"); - Label l = new Label("Margin-label"); - - l.setStyleName("ticket2231"); - - layout.addComponent(l); - - for (int i = 0; i < 5; i++) { - l = new Label("This is a label with border"); - l.setStyleName("ticket2231-border"); - if (i == 2) { - l.setWidth("100%"); - l.setValue("100% wide"); - } else if (i == 4) { - l.setWidth("20em"); - l.setValue("20em wide"); - } - // l.addStyleName("ticket2231"); - layout.addComponent(l); - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2232.java b/src/com/vaadin/tests/tickets/Ticket2232.java deleted file mode 100644 index 2b33ee39cf..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2232.java +++ /dev/null @@ -1,74 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.SpacingHandler; - -public class Ticket2232 extends Application { - - @Override - public void init() { - setMainWindow(new Window()); - setTheme("tests-tickets"); - - getMainWindow() - .addComponent( - new Label( - "Defining spacing must be possible also with pure CSS")); - - Layout gl; - gl = new OrderedLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - gl.setStyleName("t2232"); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - gl.setStyleName("t2232"); - fillAndAdd(gl); - - gl = new OrderedLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - ((SpacingHandler) gl).setSpacing(true); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - ((SpacingHandler) gl).setSpacing(true); - fillAndAdd(gl); - - gl = new OrderedLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - fillAndAdd(gl); - - gl = new GridLayout(); - gl.setWidth("100%"); - gl.setHeight("200px"); - fillAndAdd(gl); - - } - - private void fillAndAdd(Layout gl) { - for (int i = 0; i < 4; i++) { - Button b = new Button("B"); - b.setSizeFull(); - gl.addComponent(b); - } - String caption = gl.getClass().getSimpleName(); - caption += " style: " + gl.getStyleName() + ", spacingFromServer:" - + ((SpacingHandler) gl).isSpacingEnabled(); - gl.setCaption(caption); - getMainWindow().addComponent(gl); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2234.java b/src/com/vaadin/tests/tickets/Ticket2234.java deleted file mode 100644 index 25d74e8574..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2234.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Item; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2234 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - ComboBox combo = new ComboBox("Combobox caption"); - combo.addContainerProperty("blah", String.class, ""); - combo.setItemCaptionPropertyId("blah"); - - Item item; - for (int i = 0; i < 100; i++) { - item = combo.addItem(new Object()); - item.getItemProperty("blah").setValue("Item " + i); - } - - layout.addComponent(combo); - - combo = new ComboBox("Combobox caption"); - combo.addContainerProperty("blah", String.class, ""); - combo.setItemCaptionPropertyId("blah"); - - for (int i = 0; i < 5; i++) { - item = combo.addItem(new Object()); - item.getItemProperty("blah").setValue("Item " + i); - } - - layout.addComponent(combo); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2235.java b/src/com/vaadin/tests/tickets/Ticket2235.java deleted file mode 100644 index 98c618453d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2235.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2235 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - layout.setSizeFull(); - - TextField tf = new TextField(); - tf.setCaption("A text field"); - tf.setSizeFull(); - tf.setRows(2); - - layout.addComponent(tf); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2240.java b/src/com/vaadin/tests/tickets/Ticket2240.java deleted file mode 100644 index e28a463eed..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2240.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2240 extends Application { - - public static final String txt = "

There are two main types of windows: application-level windows, and " - + "\"sub windows\".

A sub window is rendered as a \"inline\" popup window" - + " within the (native) browser window to which it was added. You can create" - + " a sub window by creating a new Window and adding it to a application-level window, for instance" - + " your main window.

In contrast, you create a application-level window by" - + " creating a new Window and adding it to the Application. Application-level" - + " windows are not shown by default - you need to open a browser window for" - + " the url representing the window. You can think of the application-level" - + " windows as separate views into your application - and a way to create a" - + " \"native\" browser window.

Depending on your needs, it's also" - + " possible to create a new window instance (with it's own internal state)" - + " for each new (native) browser window, or you can share the same instance" - + " (and state) between several browser windows (the latter is most useful" - + " for read-only views).


This is the end.

"; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - layout.setHeight(null); - layout.setStyleName("borders"); - // layout.setSizeFull(); - final Label l = new Label(txt); - l.setContentMode(Label.CONTENT_XHTML); - // l.setWidth("100%"); - - TextField tf = new TextField("This is a textField"); - tf.setWidth("100%"); - - layout.addComponent(tf); - layout.addComponent(l); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2242.java b/src/com/vaadin/tests/tickets/Ticket2242.java deleted file mode 100644 index 0c1bf21a3f..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2242.java +++ /dev/null @@ -1,116 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -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.data.util.ObjectProperty; -import com.vaadin.ui.Button; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2242 extends Application implements ValueChangeListener { - - private Object tableValue = null; - private Table t; - private String valueDataSource = "-"; - private ObjectProperty prop; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - Button b = new Button("Change container datasource", - new ClickListener() { - - public void buttonClick(ClickEvent event) { - for (int i = 0; i < 5; i++) { - t.setContainerDataSource(createContainer()); - // prop.setValue("ipsum"); - } - } - - }); - - layout.addComponent(b); - - t = new Table("A table"); - prop = new ObjectProperty(valueDataSource); - t.setPropertyDataSource(prop); - t.setSelectable(true); - t.setImmediate(true); - t.setPageLength(5); - t.setContainerDataSource(createContainer()); - tableValue = t.getValue(); - t.addListener(this); - - layout.addComponent(t); - } - - private IndexedContainer createContainer() { - IndexedContainer ic = new IndexedContainer(); - ic.addContainerProperty("a", String.class, null); - - for (String s : new String[] { "Lorem", "ipsum", "dolor", "sit", - "amet", "consectetuer" }) { - Item item = ic.addItem(s); - item.getItemProperty("a").setValue(s); - - } - - return ic; - } - - private static class TestObject { - public TestObject(int a, String b, Long c) { - super(); - this.a = a; - this.b = b; - this.c = c; - } - - private int a; - private String b; - private Long c; - - public int getA() { - return a; - } - - public void setA(int a) { - this.a = a; - } - - public String getB() { - return b; - } - - public void setB(String b) { - this.b = b; - } - - public Long getC() { - return c; - } - - public void setC(Long c) { - this.c = c; - } - } - - public void valueChange(ValueChangeEvent event) { - System.out.println("Value change from " + tableValue + " to " - + t.getValue()); - tableValue = t.getValue(); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2244.java b/src/com/vaadin/tests/tickets/Ticket2244.java deleted file mode 100644 index 4631f63cc4..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2244.java +++ /dev/null @@ -1,127 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.BeanItem; -import com.vaadin.ui.Button; -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.Button.ClickEvent; - -public class Ticket2244 extends Application { - - Form form; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout gl = new GridLayout(3, 3); - gl.setSpacing(true); - gl.addComponent(new Label("Before form")); - gl.newLine(); - - form = new Form(gl); - form.setItemDataSource(new BeanItem(new MyBean())); - - gl.addComponent(new Label("After form")); - - w.addComponent(form); - - w.addComponent(new Button("new item", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - form.setItemDataSource(new BeanItem(new MyBean())); - - } - - })); - w.addComponent(new Button("new bigger item", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - form - .setItemDataSource(new BeanItem( - new MyBiggerBean())); - - } - - })); - w.addComponent(new Button("new grid layout", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - form.setLayout(new GridLayout()); - - } - - })); - w.addComponent(new Button("new form layout", - new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - form.setLayout(new FormLayout()); - - } - - })); - - } - - public class MyBean { - String firstname; - String lastname; - String password; - - 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 getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - } - - public class MyBiggerBean extends MyBean { - String address; - String phone; - - public String getAddress() { - return address; - } - - public void setAddress(String address) { - this.address = address; - } - - public String getPhone() { - return phone; - } - - public void setPhone(String phone) { - this.phone = phone; - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2245.java b/src/com/vaadin/tests/tickets/Ticket2245.java deleted file mode 100644 index 8232b7bc38..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2245.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.Window; - -public class Ticket2245 extends Application { - - @Override - public void init() { - Window main = new Window("The Main Window"); - main.getLayout().setSizeFull(); - setMainWindow(main); - SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_VERTICAL); - main.addComponent(sp); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2267.java b/src/com/vaadin/tests/tickets/Ticket2267.java deleted file mode 100644 index 2ccbce604a..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2267.java +++ /dev/null @@ -1,41 +0,0 @@ -package com.vaadin.tests.tickets; - -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.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2267 extends Application { - - Label l = new Label("0"); - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - GridLayout gl = new GridLayout(4, 2); - - Button button = new Button("1", new ClickListener() { - - public void buttonClick(ClickEvent event) { - Button b = event.getButton(); - l.setValue(l.getValue() + b.getCaption()); - - } - - }); - - gl.addComponent(l, 0, 0, 3, 0); - gl.addComponent(button); - gl.addComponent(new Label("2")); - gl.addComponent(new Label("3")); - gl.addComponent(new Label("4")); - - w.setLayout(gl); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2271.java b/src/com/vaadin/tests/tickets/Ticket2271.java deleted file mode 100644 index 50a5466645..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2271.java +++ /dev/null @@ -1,35 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.ComboBox; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2271 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - - VerticalLayout ol = new VerticalLayout(); - ol.setWidth(null); - - ComboBox cb = new ComboBox("Asiakas"); - cb.setWidth("100%"); - - Button b = new Button("View CSV-tiedostoon"); - - ol.addComponent(cb); - ol.addComponent(b); - - layout.addComponent(ol); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2279.java b/src/com/vaadin/tests/tickets/Ticket2279.java deleted file mode 100644 index 06f2cb9348..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2279.java +++ /dev/null @@ -1,207 +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.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket2279 extends Application { - - private Label label; - - private static Map expected = new HashMap(); - - private static Set longHorizontalAlignments = new HashSet(); - private static Set shortHorizontalAlignments = new HashSet(); - private static Set longVerticalAlignments = new HashSet(); - private static Set shortVerticalAlignments = new HashSet(); - - 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.getLayout(); - - createUI(layout); - } - - private void createUI(Layout layout) { - VerticalLayout vl = new VerticalLayout(); - vl.setWidth("500px"); - vl.setHeight("500px"); - vl.setStyleName("borders"); - label = new Label("Error messages follows:
", - 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("Error messages follows:
", - Label.CONTENT_XHTML); - gl.addComponent(label); - layout.addComponent(gl); - - testAlignments(gl); - - } - - private void testAlignments(AlignmentHandler layout) { - HashSet horizontals = new HashSet(); - 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 + "
"); - System.out.println(error); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2282.java b/src/com/vaadin/tests/tickets/Ticket2282.java deleted file mode 100644 index 1e5924fced..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2282.java +++ /dev/null @@ -1,55 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.FormLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2282 extends Application { - - private FormLayout layout1; - private FormLayout layout2; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - w.getLayout().setSizeUndefined(); - - layout1 = new FormLayout(); - layout1.setSizeUndefined(); - layout1.setStyleName("borders"); - Label label = new Label( - "This should not be wider than this label + reserved error space"); - label.setCaption("A caption"); - layout1.addComponent(label); - w.addComponent(layout1); - - layout2 = new FormLayout(); - layout2.setWidth("500px"); - layout2.setStyleName("borders"); - label = new Label("This should be 500px wide"); - label.setCaption("A caption"); - layout2.addComponent(label); - w.addComponent(layout2); - - Button b = new Button("Swap", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - if (layout1.getWidth() < 0.0) { - layout1.setWidth("500px"); - layout2.setWidth(null); - } else { - layout1.setWidth(null); - layout2.setWidth("500px"); - } - } - - }); - w.addComponent(b); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2283.java b/src/com/vaadin/tests/tickets/Ticket2283.java deleted file mode 100644 index 6504355676..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2283.java +++ /dev/null @@ -1,30 +0,0 @@ -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.Layout.AlignmentHandler; - -public class Ticket2283 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeUndefined(); - - gl.addComponent(new Label( - "Label 1 abc abc abcasdfas dfasd fasdf asdf sadf asdf")); - gl.addComponent(new Label("Label 2 abc abc abc ")); - Label l = new Label("Colspan2, align right"); - gl.addComponent(l, 0, 1, 1, 1); - gl.setComponentAlignment(l, AlignmentHandler.ALIGNMENT_RIGHT, - AlignmentHandler.ALIGNMENT_TOP); - w.setLayout(gl); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2287.java b/src/com/vaadin/tests/tickets/Ticket2287.java deleted file mode 100644 index cd6770e156..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2287.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.net.URL; - -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket2287 extends Ticket2292 { - - @Override - public void init() { - final Window main = new Window(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.setValue("This is a label with as slow image. "); - main.addComponent(l); - - l = new Label(); - l.setContentMode(Label.CONTENT_XHTML); - l.setValue("This is a label with as slow image. "); - main.addComponent(l); - - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2289.java b/src/com/vaadin/tests/tickets/Ticket2289.java deleted file mode 100644 index bd92311f73..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2289.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Accordion; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.CustomComponent; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2289 extends Application { - - TabSheet ts = null; - Accordion acc = null; - - @Override - public void init() { - - Window w = new Window(); - setMainWindow(w); - VerticalLayout ol = new VerticalLayout(); - w.setLayout(ol); - Button b = new Button("close current tab"); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - closeCurrentTab(); - - } - }); - ol.addComponent(b); - - b = new Button("close first tab"); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - closeFirstTab(); - - } - }); - - ol.addComponent(b); - ts = new TabSheet(); - ts.setSizeUndefined(); - ts.setWidth("300px"); - ts.addTab(new MyTab("tab one"), "Caption1", null); - ts.addTab(new MyTab("tab two"), "Caption2", null); - ts.addTab(new MyTab("tab three"), "Caption3", null); - ts.addTab(new MyTab("tab four"), "Caption4", null); - ts.addTab(new MyTab("tab five"), "Caption5", null); - - acc = new Accordion(); - acc.setSizeUndefined(); - acc.addTab(new MyTab("tab one"), "Caption1", null); - acc.addTab(new MyTab("tab two"), "Caption2", null); - acc.addTab(new MyTab("tab three"), "Caption3", null); - acc.addTab(new MyTab("tab four"), "Caption4", null); - - ol.addComponent(acc); - ts = null; - // ol.addComponent(ts); - - } - - private void closeCurrentTab() { - if (ts != null) { - MyTab m = (MyTab) ts.getSelectedTab(); - if (m != null) { - ts.removeComponent(m); - } - } - if (acc != null) { - MyTab m = (MyTab) acc.getSelectedTab(); - if (m != null) { - acc.removeComponent(m); - } - } - } - - private void closeFirstTab() { - if (ts != null) { - ts.removeComponent((Component) ts.getComponentIterator().next()); - } - if (acc != null) { - acc.removeComponent((Component) acc.getComponentIterator().next()); - } - } - -} - -class MyTab extends CustomComponent { - public MyTab(String text) { - setSizeUndefined(); - HorizontalLayout ol = new HorizontalLayout(); - setCompositionRoot(ol); - ol.addComponent(new Label(text)); - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2292.java b/src/com/vaadin/tests/tickets/Ticket2292.java deleted file mode 100644 index 9cd448a5c7..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2292.java +++ /dev/null @@ -1,88 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.awt.Color; -import java.awt.Graphics; -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.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -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; - -public class Ticket2292 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - ExternalResource icon = new ExternalResource("./icon.png"); - main - .addComponent(new Label( - "Note, run with trailing slash in url to have a working icon. Icon is built by servlet with a slow method, so it will show the bug (components not firing requestLayout)")); - Button b = new Button(); - main.addComponent(b); - b.setIcon(icon); - - CheckBox checkBox = new CheckBox(); - main.addComponent(checkBox); - checkBox.setIcon(icon); - - Link l = new Link("l", icon); - main.addComponent(l); - - } - - @Override - public DownloadStream handleURI(URL context, String relativeUri) { - if (!relativeUri.contains("icon.png")) { - return null; - } - - // be slow to show bug - try { - Thread.sleep(2000); - } catch (InterruptedException e1) { - // TODO Auto-generated catch block - e1.printStackTrace(); - } - - BufferedImage image = new BufferedImage(200, 200, - BufferedImage.TYPE_INT_RGB); - Graphics drawable = image.getGraphics(); - drawable.setColor(Color.lightGray); - drawable.fillRect(0, 0, 200, 200); - drawable.setColor(Color.yellow); - drawable.fillOval(25, 25, 150, 150); - drawable.setColor(Color.blue); - drawable.drawRect(0, 0, 199, 199); - - // Use the parameter to create dynamic content. - drawable.setColor(Color.black); - drawable.drawString("Tex", 75, 100); - - try { - // Write the image to a buffer. - ByteArrayOutputStream imagebuffer = new ByteArrayOutputStream(); - ImageIO.write(image, "png", imagebuffer); - - // Return a stream from the buffer. - ByteArrayInputStream istream = new ByteArrayInputStream(imagebuffer - .toByteArray()); - return new DownloadStream(istream, null, null); - } catch (IOException e) { - return null; - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2294.java b/src/com/vaadin/tests/tickets/Ticket2294.java deleted file mode 100644 index f6c8a14420..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2294.java +++ /dev/null @@ -1,62 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Layout.AlignmentHandler; - -public class Ticket2294 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((OrderedLayout) w.getLayout()); - } - - private void createUI(OrderedLayout layout) { - Label label1 = new Label(); - Label label2 = null; - Label label3 = new Label(); - String result1 = ""; - String result2 = ""; - String result3 = ""; - - layout.addComponent(label1); - try { - layout.setComponentAlignment(label1, - AlignmentHandler.ALIGNMENT_LEFT, - AlignmentHandler.ALIGNMENT_BOTTOM); - result1 = "OK"; - } catch (Exception e) { - result1 = "FAILED: " + e.getMessage(); - } - - try { - layout.setComponentAlignment(label2, - AlignmentHandler.ALIGNMENT_LEFT, - AlignmentHandler.ALIGNMENT_BOTTOM); - result2 = "FAILED, no exception"; - } catch (IllegalArgumentException e) { - result2 = "OK"; - } catch (Exception e) { - result2 = "FAILED: " + e.getMessage(); - } - - try { - layout.setComponentAlignment(label3, - AlignmentHandler.ALIGNMENT_LEFT, - AlignmentHandler.ALIGNMENT_BOTTOM); - result3 = "FAILED, no exception"; - } catch (IllegalArgumentException e) { - result3 = "OK"; - } catch (Exception e) { - result3 = "FAILED: " + e.getMessage(); - } - - label1.setValue("Result 1: " + result1 + ", result 2: " + result2 - + ", result 3: " + result3); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2296.java b/src/com/vaadin/tests/tickets/Ticket2296.java deleted file mode 100644 index e4eb3e7a1d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2296.java +++ /dev/null @@ -1,33 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Window; - -public class Ticket2296 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - CustomLayout cl = new CustomLayout("Ticket2296"); - cl.setSizeFull(); - Button b = new Button("100%x100% button"); - b.setSizeFull(); - cl.addComponent(b, "button1"); - - b = new Button("100%x100% button"); - b.setSizeFull(); - cl.addComponent(b, "button2"); - - b = new Button("50%x50% button"); - b.setWidth("50%"); - b.setHeight("50%"); - cl.addComponent(b, "button3"); - - w.setLayout(cl); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2297.java b/src/com/vaadin/tests/tickets/Ticket2297.java deleted file mode 100644 index 48265ded63..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2297.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URL; - -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket2297 extends Ticket2292 { - - @Override - public void init() { - final Window main = new Window(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).")); - - try { - CustomLayout cl = new CustomLayout( - new ByteArrayInputStream( - ("This is an empty CustomLayout with as slow image. ") - .getBytes())); - main.addComponent(cl); - - cl = new CustomLayout( - new ByteArrayInputStream( - ("This is an empty CustomLayout with as slow image. ") - .getBytes())); - main.addComponent(cl); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - } -} \ No newline at end of file diff --git a/src/com/vaadin/tests/tickets/Ticket2303.java b/src/com/vaadin/tests/tickets/Ticket2303.java deleted file mode 100644 index 927358723d..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2303.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -import com.vaadin.Application; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.OrderedLayout; -import com.vaadin.ui.Window; - -public class Ticket2303 extends Application { - - @Override - public void init() { - Window w = new Window("main window"); - - String customlayout = "
"; - CustomLayout cl = null; - try { - cl = new CustomLayout(new ByteArrayInputStream(customlayout - .getBytes())); - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - cl.setWidth("100%"); - w.setLayout(cl); - - // VerticalLayout ol = new VerticalLayout(); - // w.setLayout(ol); - OrderedLayout hugeLayout = new OrderedLayout(); - hugeLayout.setMargin(true); - hugeLayout.setSpacing(true); - for (int i = 0; i < 30; i++) { - hugeLayout.addComponent(new Label("huge " + i)); - } - cl.addComponent(hugeLayout, "test"); - // ol.addComponent(hugeLayout); - setMainWindow(w); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2304.java b/src/com/vaadin/tests/tickets/Ticket2304.java deleted file mode 100644 index 57c7acefc1..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2304.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; - -public class Ticket2304 extends Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - Panel p = new Panel(); - p.setStyleName(Panel.STYLE_LIGHT); - main.addComponent(p); - p.setHeight("100px"); - - 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); - p.addComponent(l); - main.addComponent(new Label( - "This text should be right below the panel, w/o spacing")); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2310.java b/src/com/vaadin/tests/tickets/Ticket2310.java deleted file mode 100644 index 3318456afa..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2310.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2310 extends Application { - - @Override - public void init() { - final Window main = new Window(getClass().getName().substring( - getClass().getName().lastIndexOf(".") + 1)); - setMainWindow(main); - - main - .addComponent(new Label( - "Instructions: change label when panel is " - + "invisible -> invalid change (with disabled " - + "flag) is sent to client. Label is grey when panel is shown.")); - - final Panel p = new Panel(); - p.setStyleName(Panel.STYLE_LIGHT); - main.addComponent(p); - p.setHeight("100px"); - - final Label l = new Label("foobar"); - - p.addComponent(l); - - Button b = new Button("change label"); - - b.addListener(new Button.ClickListener() { - int i = 0; - - public void buttonClick(ClickEvent event) { - - l.setValue("foobar " + i++); - - } - }); - - Button b2 = new Button("toggle panel visibility"); - b2.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - p.setVisible(!p.isVisible()); - } - }); - - main.addComponent(b); - main.addComponent(b2); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2319.java b/src/com/vaadin/tests/tickets/Ticket2319.java deleted file mode 100644 index 9d61a27613..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2319.java +++ /dev/null @@ -1,66 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2319 extends Application { - - @Override - public void init() { - Window mainw = new Window(); - setMainWindow(mainw); - - mainw - .addComponent(new Label( - "This test has somewhat invalid layouts in it to detect analyzy layout function in debug dialog")); - - HorizontalLayout hl = new HorizontalLayout(); - Panel panel = new Panel("p1"); - Panel panel2 = new Panel("p2"); - hl.addComponent(panel); - hl.addComponent(panel2); - - mainw.addComponent(hl); - - hl = new HorizontalLayout(); - panel = new Panel("p1"); - panel.setSizeUndefined(); - panel.setHeight("100%"); - panel2 = new Panel("p2"); - panel2.setSizeUndefined(); - panel2.setHeight("100%"); - - hl.addComponent(panel); - hl.addComponent(panel2); - mainw.addComponent(hl); - - SplitPanel sp = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - - VerticalLayout first = new VerticalLayout(); - first.addComponent(new Label("first")); - VerticalLayout second = new VerticalLayout(); - second.addComponent(new Label("second")); - - sp.setFirstComponent(first); - sp.setSecondComponent(second); - - SplitPanel sp2 = new SplitPanel(); - Label label = new Label("first"); - label.setSizeFull(); - sp2.setFirstComponent(label); - sp2.setSecondComponent(sp); - - sp2.setHeight("200px"); - - mainw.addComponent(sp2); - - mainw.addComponent(new Button("click me to save split panel state")); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2323.java b/src/com/vaadin/tests/tickets/Ticket2323.java deleted file mode 100644 index 4def857112..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2323.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.RichTextArea; -import com.vaadin.ui.Window; - -public class Ticket2323 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - Window subWindow = new Window(""); - subWindow.setSizeUndefined(); - subWindow.getLayout().setSizeUndefined(); - subWindow.center(); - subWindow.addComponent(new RichTextArea()); - w.addWindow(subWindow); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2325.java b/src/com/vaadin/tests/tickets/Ticket2325.java deleted file mode 100644 index 3b46d89a5e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2325.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2325 extends Application { - - @Override - public void init() { - Window main = new Window("Testing...."); - setMainWindow(main); - - final VerticalLayout lo = new VerticalLayout(); - lo.setSizeUndefined(); - lo.setWidth("100%"); - TextField tf = new TextField(); - tf.setValue("The textfield should fill the window." - + "\n - Try to resize window\n - Try to push REdo button"); - tf.setRows(10); - tf.setWidth("100%"); - lo.addComponent(tf); - Window subWin = new Window( - "This window should initially be as wide as the caption", lo); - main.addWindow(subWin); - // subWin.setWidth("500px"); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2329.java b/src/com/vaadin/tests/tickets/Ticket2329.java deleted file mode 100644 index c55ab9cac5..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2329.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Component; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Table.ColumnGenerator; - -public class Ticket2329 extends Application { - private Table table; - private VerticalLayout mainLo; - - @Override - public void init() { - Window mainw = new Window(); - setMainWindow(mainw); - mainLo = (VerticalLayout) mainw.getLayout(); - table = new Table(); - for (int i = 0; i < 10000; i++) { - table.addItem(i); - } - TestColumnGenerator cgen = new TestColumnGenerator(); - table.addGeneratedColumn("col1", cgen); - table.addGeneratedColumn("col2", cgen); - table.addGeneratedColumn("col3", cgen); - table.addGeneratedColumn("col4", cgen); - table.addGeneratedColumn("col5", cgen); - table.addGeneratedColumn("col6", cgen); - table.addGeneratedColumn("col7", cgen); - table.setHeight("500px"); - mainLo.addComponent(table); - } - - class TestColumnGenerator implements ColumnGenerator { - public Component generateCell(Table source, Object rowId, - Object columnId) { - return new Button("1"); - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2337.java b/src/com/vaadin/tests/tickets/Ticket2337.java deleted file mode 100644 index aae4807277..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2337.java +++ /dev/null @@ -1,44 +0,0 @@ -package com.vaadin.tests.tickets; - -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.Button.ClickEvent; - -public class Ticket2337 extends Application { - - GridLayout gl = new GridLayout(3, 1); - - @Override - public void init() { - Window w = new Window(); - setMainWindow(w); - Button b = new Button("add", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - gl.addComponent(new Label("asd"), 0, gl.getCursorY(), 2, gl - .getCursorY()); - - } - - }); - w.addComponent(b); - - b = new Button("empty", new Button.ClickListener() { - - public void buttonClick(ClickEvent event) { - gl.removeAllComponents(); - ; - - } - - }); - w.addComponent(b); - - w.addComponent(gl); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2339.java b/src/com/vaadin/tests/tickets/Ticket2339.java deleted file mode 100644 index 6476807ada..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2339.java +++ /dev/null @@ -1,38 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.io.ByteArrayInputStream; -import java.io.IOException; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.Window; - -public class Ticket2339 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window(getClass().getSimpleName()); - setMainWindow(mainWin); - - try { - CustomLayout cl = new CustomLayout( - new ByteArrayInputStream( - "
" - .getBytes())); - Button button = new Button("b"); - button.setSizeFull(); - - cl.addComponent(button, "b"); - - mainWin.addComponent(cl); - - } catch (IOException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2341.java b/src/com/vaadin/tests/tickets/Ticket2341.java deleted file mode 100644 index b6dd4cc1f0..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2341.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.data.Item; -import com.vaadin.ui.Label; -import com.vaadin.ui.Layout; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2341 extends com.vaadin.Application { - @Override - public void init() { - Window main = new Window(); - setMainWindow(main); - constructTables(main.getLayout()); - } - - private void constructTables(Layout layout) { - - Table t = createTable(); - layout.addComponent(t); - t = createTable(); - Label l = new Label("A high label to enable scrollbars"); - l.setHeight("2000px"); - layout.addComponent(l); - - } - - private Table createTable() { - Table t = new Table(); - t.addContainerProperty("test1", String.class, ""); - t.addContainerProperty("test2", String.class, ""); - t.addContainerProperty("test3", String.class, ""); - t.addContainerProperty("test4", String.class, ""); - t.setWidth("100%"); - t.setHeight("300px"); - for (int i = 0; i < 100; i++) { - Item item = t.addItem(i); - item.getItemProperty("test1").setValue("testing1 " + i); - item.getItemProperty("test2").setValue("testing2 " + i); - item.getItemProperty("test3").setValue("testing3 " + i); - item.getItemProperty("test4").setValue("testing4 " + i); - } - - return t; - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2344.java b/src/com/vaadin/tests/tickets/Ticket2344.java deleted file mode 100644 index cb36fbca9e..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2344.java +++ /dev/null @@ -1,56 +0,0 @@ -package com.vaadin.tests.tickets; - -import java.util.Random; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Panel; -import com.vaadin.ui.Table; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2344 extends Application { - - private Panel p; - - @Override - public void init() { - Window main = new Window("Quick test"); - - setMainWindow(main); - - // setTheme("quicktest"); - - VerticalLayout hl = new VerticalLayout(); - hl.setWidth("400px"); - main.setLayout(hl); - - Table t = new Table(); - t.setWidth("100%"); - - t.addContainerProperty("Prop 1", VerticalLayout.class, ""); - t.addContainerProperty("Prop 2", String.class, ""); - t.addContainerProperty("Prop 3", String.class, ""); - t.addContainerProperty("Prop 4", String.class, ""); - t.addContainerProperty("Prop 5", Button.class, ""); - - t.setPageLength(3); - - for (int i = 0; i < 10; i++) { - - VerticalLayout vl = new VerticalLayout(); - // vl.setWidth(null); - Button b = new Button("String 1 2 3"); - b.setStyleName(Button.STYLE_LINK); - vl.addComponent(b); - t.addItem(new Object[] { vl, "String 2", "String 3", "String 4", - - new Button("String 5") }, new Integer(new Random().nextInt())); - - } - - hl.addComponent(t); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2347.java b/src/com/vaadin/tests/tickets/Ticket2347.java deleted file mode 100644 index 08e1aae34c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2347.java +++ /dev/null @@ -1,49 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.CustomLayout; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2347 extends Application { - - private Button b1; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - setTheme("tests-tickets"); - createUI((VerticalLayout) w.getLayout()); - } - - private void createUI(VerticalLayout layout) { - CustomLayout cl = new CustomLayout("Ticket2347"); - b1 = new Button("200px button"); - b1.addListener(new ClickListener() { - - public void buttonClick(ClickEvent event) { - if (b1.getWidth() == 200.0) { - b1.setWidth("300px"); - } else { - b1.setWidth("200px"); - - } - b1.setCaption(b1.getWidth() + "px button"); - - } - - }); - b1.setWidth("200px"); - Button b2 = new Button("100% button"); - b2.setWidth("100%"); - - cl.addComponent(b1, "button1"); - cl.addComponent(b2, "button2"); - - layout.addComponent(cl); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2364.java b/src/com/vaadin/tests/tickets/Ticket2364.java deleted file mode 100644 index 7f7290dd80..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2364.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Form; -import com.vaadin.ui.Select; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2364 extends Application { - - @Override - public void init() { - - Window main = new Window("The Main Window!!!"); - setMainWindow(main); - Form form = new Form(); - VerticalLayout formLayout = new VerticalLayout(); - form.setLayout(formLayout); - Select formSelect = new Select("hello"); - Select select = new Select("hello"); - form.setEnabled(false); - select.setEnabled(false); - formLayout.addComponent(formSelect); - - VerticalLayout l2 = new VerticalLayout(); - l2.addComponent(new Select("hello")); - l2.setEnabled(false); - - form.setCaption("Form"); - main.addComponent(form); - l2.setCaption("VerticalLayout"); - main.addComponent(l2); - main.addComponent(select); - main.addComponent(new Select("Enabled=true select")); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2365.java b/src/com/vaadin/tests/tickets/Ticket2365.java deleted file mode 100644 index 1fee955e6b..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2365.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.Panel; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; - -public class Ticket2365 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window(getClass().getSimpleName()); - setMainWindow(mainWin); - - VerticalLayout lo = new VerticalLayout(); - lo.setSizeFull(); - mainWin.setLayout(lo); - - final Panel p = createMultilevelPanel(5, (Panel) null); - - Button b = new Button("Toggle parent level size"); - lo.addComponent(b); - b.addListener(new Button.ClickListener() { - public void buttonClick(ClickEvent event) { - if (p.getWidth() > 0) { - p.setSizeUndefined(); - } else { - p.setSizeFull(); - } - } - }); - - lo.addComponent(p); - - lo.setExpandRatio(p, 1); - - } - - private Panel createMultilevelPanel(int i, Panel panel) { - if (panel == null) { - panel = new Panel("Panel level " + i); - panel.setSizeFull(); - panel.getLayout().setSizeFull(); - } - Panel p = new Panel("Panel level " + i--); - p.getLayout().setSizeFull(); - p.setSizeFull(); - panel.addComponent(p); - if (i > 0) { - createMultilevelPanel(i, p); - } - return panel; - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2398.java b/src/com/vaadin/tests/tickets/Ticket2398.java deleted file mode 100644 index dee0417eff..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2398.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.util.IndexedContainer; -import com.vaadin.ui.Label; -import com.vaadin.ui.Table; -import com.vaadin.ui.Window; - -public class Ticket2398 extends Application { - - @Override - public void init() { - - final Window mainWin = new Window(); - setMainWindow(mainWin); - - Table t = new Table(); - - IndexedContainer c = new IndexedContainer(); - - c.addItem("foo"); - - c.addContainerProperty("testcol1", Integer.class, new Integer(7)); - c.addContainerProperty("testcol2", String.class, "str"); - c.addContainerProperty("testcol3", String.class, null); - - c.addItem("bar"); - - t.setContainerDataSource(c); - - t.setRowHeaderMode(Table.ROW_HEADER_MODE_ID); - - mainWin.addComponent(new Label( - "Both rows in table should have same data (default values)")); - - mainWin.addComponent(t); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2404.java b/src/com/vaadin/tests/tickets/Ticket2404.java deleted file mode 100644 index 478d8b7786..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2404.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Window; - -public class Ticket2404 extends Application { - - @Override - public void init() { - - GridLayout gl = new GridLayout(2, 2); - gl.setSizeFull(); - - Button bb = new Button("1st row on 2x2 GridLayout"); - bb.setSizeFull(); - gl.addComponent(bb, 0, 0, 1, 0); - for (int i = 0; i < 2; i++) { - Button b = new Button("" + i); - gl.addComponent(b); - b.setSizeFull(); - } - - setMainWindow(new Window("GridLayout test", gl)); - - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2405.java b/src/com/vaadin/tests/tickets/Ticket2405.java deleted file mode 100644 index 174d6e5d6c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2405.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.ui.Button; -import com.vaadin.ui.Embedded; -import com.vaadin.ui.HorizontalLayout; -import com.vaadin.ui.Label; -import com.vaadin.ui.SplitPanel; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2405 extends Application { - - private Label label; - private SplitPanel split; - - @Override - public void init() { - - final Window root = new Window("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. - // browser.addWindow(root); - setMainWindow(root); - - root.getLayout().setSizeFull(); - root.getLayout().setMargin(false); - - // Top area, containing playback and volume controls, play status, view - // modes and search - HorizontalLayout top = new HorizontalLayout(); - // GridLayout top = new GridLayout(1, 1); - top.setWidth("100%"); - top.setMargin(false); - top.setSpacing(false); - - // Let's attach that one straight away too - root.addComponent(top); - - label = new Label( - "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent porttitor porta lacus. Nulla tellus. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Proin mollis turpis in mauris faucibus posuere. Nullam rutrum, nisi a fermentum tempus, lacus metus rutrum massa, a condimentum mauris justo a tortor. Mauris aliquet, ante quis ultricies posuere, sapien libero laoreet sem, a accumsan diam metus sed elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Curabitur vehicula metus nec turpis dignissim cursus. Suspendisse potenti. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nullam feugiat orci eget risus. Vestibulum at sem. "); - label.setWidth("100%"); - top.addComponent(label); - split = new SplitPanel(SplitPanel.ORIENTATION_HORIZONTAL); - split.setHeight("100%"); - Embedded image = new Embedded("An image", new ExternalResource( - "http://dev.itmill.com/chrome/site/toolkit-logo.png")); - image.setWidth("100%"); - root.addComponent(split); - ((VerticalLayout) root.getLayout()).setExpandRatio(split, 1.0f); - VerticalLayout vl = new VerticalLayout(); - split.addComponent(vl); - - vl.addComponent(new TextField("abc")); - vl.addComponent(image); - vl.setExpandRatio(image, 1.0f); - vl.setComponentAlignment(image, "bottom center"); - vl.setHeight("100%"); - // We'll need one splitpanel to separate the sidebar and track listing - Button bottomButton = new Button("Filler"); - bottomButton.setSizeFull(); - // root.addComponent(bottomButton); - - // The splitpanel is by default 100% x 100%, but we'll need to adjust - // our main window layout to accomodate the height - root.getLayout().setHeight("100%"); - // ((VerticalLayout) root.getLayout()).setExpandRatio(bottomButton, - // 1.0F); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2406.java b/src/com/vaadin/tests/tickets/Ticket2406.java deleted file mode 100644 index b4f8ec77cf..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2406.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; -import com.vaadin.ui.Button.ClickEvent; -import com.vaadin.ui.Button.ClickListener; - -public class Ticket2406 extends Application { - - private Window w; - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - // setTheme("tests-tickets"); - createUI((VerticalLayout) w.getLayout()); - } - - private void createUI(VerticalLayout layout) { - w = new Window("A sub window"); - w.setSizeUndefined(); - getMainWindow().addWindow(w); - - VerticalLayout l = new VerticalLayout(); - l.setSizeFull(); - w.setLayout(l); - - Button b = new Button("Button 1"); - b.setSizeFull(); - b.addListener(new ClickListener() { - - public void buttonClick(ClickEvent event) { - w.setHeight("200px"); - } - - }); - l.addComponent(b); - - for (int i = 0; i < 5; i++) { - b = new Button("Button number " + (i + 2)); - b.setSizeFull(); - l.addComponent(b); - } - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2407.java b/src/com/vaadin/tests/tickets/Ticket2407.java deleted file mode 100644 index e095bb294c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2407.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.ui.Form; -import com.vaadin.ui.TextField; -import com.vaadin.ui.VerticalLayout; -import com.vaadin.ui.Window; - -public class Ticket2407 extends com.vaadin.Application { - - @Override - public void init() { - final Window main = new Window("Ticket2407"); - setMainWindow(main); - - Form form = new Form(new VerticalLayout()); - TextField text = new TextField("This caption shall be visible"); - text.setRequired(true); - form.addField("test", text); - main.addComponent(form); - } -} diff --git a/src/com/vaadin/tests/tickets/Ticket2411.java b/src/com/vaadin/tests/tickets/Ticket2411.java deleted file mode 100644 index b402ced300..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2411.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Button; -import com.vaadin.ui.GridLayout; -import com.vaadin.ui.Window; - -public class Ticket2411 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - // VerticalLayout l = new VerticalLayout(); - GridLayout l = new GridLayout(); - w.setLayout(l); - - l.setHeight("504px"); - - for (int i = 1; i <= 5; i++) { - Button b = new Button("Button " + i - + " should be 100px or 101px high"); - b.setHeight("100%"); - l.addComponent(b); - } - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2415.java b/src/com/vaadin/tests/tickets/Ticket2415.java deleted file mode 100644 index 5c1d0c2a51..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2415.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.data.Property; -import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.ui.TextField; -import com.vaadin.ui.Window; - -public class Ticket2415 extends Application { - - @Override - public void init() { - final Window main = new Window(""); - setMainWindow(main); - - final TextField tf = new TextField("Try to change me"); - main.addComponent(tf); - - tf.setImmediate(true); - tf.addListener(new Property.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - main.showNotification("New value = " + tf); - } - }); - - final TextField tf2 = new TextField("Try to change me"); - main.addComponent(tf2); - - tf2.setImmediate(true); - tf2.addListener(new Property.ValueChangeListener() { - - public void valueChange(ValueChangeEvent event) { - main.showNotification("New value = " + tf2); - } - }); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2420.java b/src/com/vaadin/tests/tickets/Ticket2420.java deleted file mode 100644 index e40d73877c..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2420.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.ProgressIndicator; -import com.vaadin.ui.Window; - -public class Ticket2420 extends Application { - - @Override - public void init() { - final Window main = new Window("Hello window"); - setMainWindow(main); - - main.setTheme("tests-tickets"); - - ProgressIndicator pi = new ProgressIndicator(); - pi.setCaption("Visible"); - pi.setIndeterminate(false); - pi.setValue(new Float(0.5)); - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Visible (indeterminate)"); - pi.setIndeterminate(true); - - main.addComponent(pi); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Visible (indeterminate, with .redborder css)"); - pi.addStyleName("redborder"); - pi.setIndeterminate(true); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - pi.setCaption("Disabled "); - pi.setEnabled(false); - pi.setIndeterminate(true); - - main.addComponent(pi); - - pi = new ProgressIndicator(); - - pi.setCaption("Hidden (via css)"); - - pi.addStyleName("dispnone"); - - main.addComponent(pi); - - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2425.java b/src/com/vaadin/tests/tickets/Ticket2425.java deleted file mode 100644 index 75810137ad..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2425.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.Panel; -import com.vaadin.ui.TabSheet; -import com.vaadin.ui.Window; - -public class Ticket2425 extends Application { - - @Override - public void init() { - Window w = new Window(getClass().getSimpleName()); - setMainWindow(w); - - w.addComponent(new Label("No scrollbars should be visible anywhere")); - TabSheet ts = new TabSheet(); - ts.addTab(new Panel(), "Panel 1", null); - ts.addTab(new Panel(), "Panel 2", null); - - w.addComponent(ts); - } - -} diff --git a/src/com/vaadin/tests/tickets/Ticket2426.java b/src/com/vaadin/tests/tickets/Ticket2426.java deleted file mode 100644 index bbad5ef686..0000000000 --- a/src/com/vaadin/tests/tickets/Ticket2426.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.vaadin.tests.tickets; - -import com.vaadin.Application; -import com.vaadin.ui.Label; -import com.vaadin.ui.Window; - -public class Ticket2426 extends Application { - - @Override - public void init() { - Window w = new Window(); - setMainWindow(w); - - final String content = "