From e18177bac62e8367829dfc5ec3083a09973e621e Mon Sep 17 00:00:00 2001 From: Artur Signell Date: Wed, 29 Aug 2012 11:30:17 +0300 Subject: Renamed com.vaadin.terminal -> com.vaadin.server (#9431) --- .../src/com/vaadin/client/JavaScriptExtension.java | 2 +- client/src/com/vaadin/client/UIDL.java | 2 +- .../client/ui/combobox/ComboBoxConnector.java | 3 +- server/src/com/vaadin/Application.java | 26 +- .../vaadin/UIRequiresMoreInformationException.java | 4 +- server/src/com/vaadin/annotations/EagerInit.java | 4 +- .../com/vaadin/data/util/FilesystemContainer.java | 2 +- server/src/com/vaadin/event/Action.java | 2 +- server/src/com/vaadin/event/ActionManager.java | 8 +- server/src/com/vaadin/event/ShortcutAction.java | 2 +- server/src/com/vaadin/event/ShortcutListener.java | 2 +- .../event/dd/acceptcriteria/AcceptCriterion.java | 4 +- .../com/vaadin/event/dd/acceptcriteria/And.java | 4 +- .../dd/acceptcriteria/ClientSideCriterion.java | 4 +- .../dd/acceptcriteria/ContainsDataFlavor.java | 4 +- .../com/vaadin/event/dd/acceptcriteria/Not.java | 4 +- .../src/com/vaadin/event/dd/acceptcriteria/Or.java | 4 +- .../dd/acceptcriteria/ServerSideCriterion.java | 4 +- .../vaadin/event/dd/acceptcriteria/SourceIs.java | 4 +- .../event/dd/acceptcriteria/TargetDetailIs.java | 4 +- server/src/com/vaadin/navigator/Navigator.java | 6 +- .../com/vaadin/server/AbstractClientConnector.java | 570 ++++++++++++++++++ .../com/vaadin/server/AbstractErrorMessage.java | 188 ++++++ .../src/com/vaadin/server/AbstractExtension.java | 87 +++ .../vaadin/server/AbstractJavaScriptExtension.java | 172 ++++++ .../src/com/vaadin/server/AbstractUIProvider.java | 35 ++ .../src/com/vaadin/server/ApplicationResource.java | 85 +++ server/src/com/vaadin/server/ClassResource.java | 188 ++++++ server/src/com/vaadin/server/CombinedRequest.java | 199 +++++++ .../com/vaadin/server/CompositeErrorMessage.java | 122 ++++ .../src/com/vaadin/server/DefaultUIProvider.java | 51 ++ .../com/vaadin/server/DeploymentConfiguration.java | 188 ++++++ server/src/com/vaadin/server/DownloadStream.java | 345 +++++++++++ server/src/com/vaadin/server/ErrorMessage.java | 136 +++++ server/src/com/vaadin/server/Extension.java | 38 ++ server/src/com/vaadin/server/ExternalResource.java | 128 ++++ server/src/com/vaadin/server/FileResource.java | 184 ++++++ .../vaadin/server/JavaScriptCallbackHelper.java | 122 ++++ server/src/com/vaadin/server/KeyMapper.java | 96 +++ server/src/com/vaadin/server/LegacyPaint.java | 97 +++ server/src/com/vaadin/server/Page.java | 653 +++++++++++++++++++++ server/src/com/vaadin/server/PaintException.java | 64 ++ server/src/com/vaadin/server/PaintTarget.java | 517 ++++++++++++++++ server/src/com/vaadin/server/RequestHandler.java | 48 ++ server/src/com/vaadin/server/Resource.java | 36 ++ server/src/com/vaadin/server/Scrollable.java | 90 +++ server/src/com/vaadin/server/Sizeable.java | 252 ++++++++ server/src/com/vaadin/server/StreamResource.java | 230 ++++++++ server/src/com/vaadin/server/StreamVariable.java | 167 ++++++ server/src/com/vaadin/server/SystemError.java | 92 +++ server/src/com/vaadin/server/Terminal.java | 58 ++ server/src/com/vaadin/server/ThemeResource.java | 106 ++++ server/src/com/vaadin/server/UIProvider.java | 29 + server/src/com/vaadin/server/UserError.java | 80 +++ server/src/com/vaadin/server/Vaadin6Component.java | 66 +++ server/src/com/vaadin/server/VariableOwner.java | 95 +++ server/src/com/vaadin/server/WrappedRequest.java | 290 +++++++++ server/src/com/vaadin/server/WrappedResponse.java | 159 +++++ server/src/com/vaadin/server/package.html | 21 + .../src/com/vaadin/service/ApplicationContext.java | 2 +- .../src/com/vaadin/service/FileTypeResolver.java | 4 +- .../vaadin/terminal/AbstractClientConnector.java | 570 ------------------ .../com/vaadin/terminal/AbstractErrorMessage.java | 188 ------ .../src/com/vaadin/terminal/AbstractExtension.java | 87 --- .../terminal/AbstractJavaScriptExtension.java | 172 ------ .../com/vaadin/terminal/AbstractUIProvider.java | 35 -- .../com/vaadin/terminal/ApplicationResource.java | 85 --- server/src/com/vaadin/terminal/ClassResource.java | 188 ------ .../src/com/vaadin/terminal/CombinedRequest.java | 199 ------- .../com/vaadin/terminal/CompositeErrorMessage.java | 122 ---- .../src/com/vaadin/terminal/DefaultUIProvider.java | 51 -- .../vaadin/terminal/DeploymentConfiguration.java | 188 ------ server/src/com/vaadin/terminal/DownloadStream.java | 345 ----------- server/src/com/vaadin/terminal/ErrorMessage.java | 136 ----- server/src/com/vaadin/terminal/Extension.java | 38 -- .../src/com/vaadin/terminal/ExternalResource.java | 128 ---- server/src/com/vaadin/terminal/FileResource.java | 184 ------ .../vaadin/terminal/JavaScriptCallbackHelper.java | 122 ---- server/src/com/vaadin/terminal/KeyMapper.java | 96 --- server/src/com/vaadin/terminal/LegacyPaint.java | 97 --- server/src/com/vaadin/terminal/Page.java | 653 --------------------- server/src/com/vaadin/terminal/PaintException.java | 64 -- server/src/com/vaadin/terminal/PaintTarget.java | 517 ---------------- server/src/com/vaadin/terminal/RequestHandler.java | 48 -- server/src/com/vaadin/terminal/Resource.java | 36 -- server/src/com/vaadin/terminal/Scrollable.java | 90 --- server/src/com/vaadin/terminal/Sizeable.java | 252 -------- server/src/com/vaadin/terminal/StreamResource.java | 230 -------- server/src/com/vaadin/terminal/StreamVariable.java | 167 ------ server/src/com/vaadin/terminal/SystemError.java | 92 --- server/src/com/vaadin/terminal/Terminal.java | 58 -- server/src/com/vaadin/terminal/ThemeResource.java | 106 ---- server/src/com/vaadin/terminal/UIProvider.java | 29 - server/src/com/vaadin/terminal/UserError.java | 80 --- .../src/com/vaadin/terminal/Vaadin6Component.java | 66 --- server/src/com/vaadin/terminal/VariableOwner.java | 95 --- server/src/com/vaadin/terminal/WrappedRequest.java | 290 --------- .../src/com/vaadin/terminal/WrappedResponse.java | 159 ----- .../gwt/server/AbstractApplicationPortlet.java | 8 +- .../gwt/server/AbstractApplicationServlet.java | 10 +- .../gwt/server/AbstractCommunicationManager.java | 30 +- .../server/AbstractDeploymentConfiguration.java | 2 +- .../gwt/server/AbstractStreamingEvent.java | 2 +- .../gwt/server/AbstractWebApplicationContext.java | 2 +- .../vaadin/terminal/gwt/server/AddonContext.java | 2 +- .../gwt/server/ApplicationResourceHandler.java | 10 +- .../terminal/gwt/server/ApplicationServlet.java | 2 +- .../gwt/server/BootstrapFragmentResponse.java | 2 +- .../terminal/gwt/server/BootstrapHandler.java | 10 +- .../terminal/gwt/server/BootstrapPageResponse.java | 4 +- .../terminal/gwt/server/BootstrapResponse.java | 2 +- .../terminal/gwt/server/ClientConnector.java | 4 +- .../terminal/gwt/server/CommunicationManager.java | 4 +- .../gwt/server/ComponentSizeValidator.java | 2 +- .../terminal/gwt/server/DragAndDropService.java | 6 +- .../gwt/server/HttpServletRequestListener.java | 2 +- .../terminal/gwt/server/JsonPaintTarget.java | 12 +- .../gwt/server/PortletApplicationContext2.java | 2 +- .../gwt/server/PortletCommunicationManager.java | 8 +- .../gwt/server/PortletRequestListener.java | 2 +- .../terminal/gwt/server/ResourceReference.java | 8 +- .../com/vaadin/terminal/gwt/server/RpcTarget.java | 2 +- .../terminal/gwt/server/ServletPortletHelper.java | 4 +- .../terminal/gwt/server/StreamingEndEventImpl.java | 2 +- .../gwt/server/StreamingErrorEventImpl.java | 2 +- .../gwt/server/StreamingProgressEventImpl.java | 2 +- .../gwt/server/StreamingStartEventImpl.java | 2 +- .../gwt/server/UnsupportedBrowserHandler.java | 6 +- .../com/vaadin/terminal/gwt/server/WebBrowser.java | 2 +- .../gwt/server/WrappedHttpServletRequest.java | 6 +- .../gwt/server/WrappedHttpServletResponse.java | 4 +- .../terminal/gwt/server/WrappedPortletRequest.java | 6 +- .../gwt/server/WrappedPortletResponse.java | 4 +- server/src/com/vaadin/terminal/package.html | 21 - server/src/com/vaadin/ui/AbsoluteLayout.java | 2 +- server/src/com/vaadin/ui/AbstractComponent.java | 28 +- server/src/com/vaadin/ui/AbstractEmbedded.java | 2 +- server/src/com/vaadin/ui/AbstractField.java | 6 +- .../com/vaadin/ui/AbstractJavaScriptComponent.java | 2 +- server/src/com/vaadin/ui/AbstractMedia.java | 2 +- .../src/com/vaadin/ui/AbstractOrderedLayout.java | 2 +- server/src/com/vaadin/ui/AbstractSelect.java | 10 +- server/src/com/vaadin/ui/AbstractSplitPanel.java | 2 +- server/src/com/vaadin/ui/AbstractTextField.java | 6 +- server/src/com/vaadin/ui/Audio.java | 2 +- server/src/com/vaadin/ui/ComboBox.java | 4 +- server/src/com/vaadin/ui/Component.java | 10 +- server/src/com/vaadin/ui/ConnectorTracker.java | 2 +- server/src/com/vaadin/ui/CustomLayout.java | 6 +- server/src/com/vaadin/ui/DateField.java | 6 +- server/src/com/vaadin/ui/DragAndDropWrapper.java | 8 +- server/src/com/vaadin/ui/Embedded.java | 8 +- server/src/com/vaadin/ui/Form.java | 14 +- server/src/com/vaadin/ui/GridLayout.java | 8 +- server/src/com/vaadin/ui/Html5File.java | 2 +- server/src/com/vaadin/ui/Image.java | 2 +- server/src/com/vaadin/ui/JavaScript.java | 4 +- server/src/com/vaadin/ui/JavaScriptFunction.java | 2 +- server/src/com/vaadin/ui/Link.java | 8 +- server/src/com/vaadin/ui/ListSelect.java | 4 +- server/src/com/vaadin/ui/LoginForm.java | 10 +- server/src/com/vaadin/ui/MenuBar.java | 8 +- server/src/com/vaadin/ui/NativeSelect.java | 4 +- server/src/com/vaadin/ui/Notification.java | 4 +- server/src/com/vaadin/ui/OptionGroup.java | 4 +- server/src/com/vaadin/ui/Panel.java | 21 +- server/src/com/vaadin/ui/PopupDateField.java | 4 +- server/src/com/vaadin/ui/PopupView.java | 10 +- server/src/com/vaadin/ui/ProgressIndicator.java | 6 +- server/src/com/vaadin/ui/RichTextArea.java | 6 +- server/src/com/vaadin/ui/Select.java | 6 +- server/src/com/vaadin/ui/TabSheet.java | 14 +- server/src/com/vaadin/ui/Table.java | 12 +- server/src/com/vaadin/ui/Tree.java | 10 +- server/src/com/vaadin/ui/TreeTable.java | 6 +- server/src/com/vaadin/ui/TwinColSelect.java | 4 +- server/src/com/vaadin/ui/UI.java | 18 +- server/src/com/vaadin/ui/Upload.java | 14 +- server/src/com/vaadin/ui/Video.java | 2 +- server/src/com/vaadin/ui/Window.java | 8 +- shared/src/com/vaadin/shared/ComponentState.java | 4 +- .../vaadin/data/util/AbstractContainerTest.java | 95 ++- .../util/AbstractHierarchicalContainerTest.java | 6 +- .../util/TestContainerHierarchicalWrapper.java | 5 +- .../data/util/TestHierarchicalContainer.java | 44 +- .../com/vaadin/tests/server/TestKeyMapper.java | 2 +- .../com/vaadin/tests/server/TestMimeTypes.java | 2 +- .../tests/server/TestStreamVariableMapping.java | 4 +- .../server/TransactionListenersConcurrency.java | 2 +- .../absolutelayout/ComponentPosition.java | 4 +- .../abstractfield/RemoveListenersOnDetach.java | 2 +- .../server/component/root/CustomUIClassLoader.java | 6 +- .../server/component/upload/UploadListeners.java | 2 +- .../component/window/AttachDetachWindow.java | 2 +- .../server/navigator/UriFragmentManagerTest.java | 4 +- .../vaadin/launcher/ApplicationRunnerServlet.java | 4 +- tests/testbench/com/vaadin/tests/Components.java | 4 +- tests/testbench/com/vaadin/tests/LayoutDemo.java | 2 +- .../com/vaadin/tests/NativeWindowing.java | 2 +- tests/testbench/com/vaadin/tests/Parameters.java | 8 +- .../PerformanceTestBasicComponentRendering.java | 2 +- .../com/vaadin/tests/RandomLayoutStress.java | 2 +- tests/testbench/com/vaadin/tests/TestBench.java | 6 +- .../com/vaadin/tests/TestCaptionWrapper.java | 8 +- .../vaadin/tests/TestComponentAddAndRecursion.java | 2 +- .../testbench/com/vaadin/tests/TestDateField.java | 6 +- .../tests/TestForBasicApplicationLayout.java | 2 +- .../tests/TestForChildComponentRendering.java | 2 +- .../TestForGridLayoutChildComponentRendering.java | 2 +- .../com/vaadin/tests/TestForNativeWindowing.java | 2 +- .../com/vaadin/tests/TestForStyledUpload.java | 2 +- ...tForTablesInitialColumnWidthLogicRendering.java | 2 +- .../testbench/com/vaadin/tests/TestForUpload.java | 2 +- .../com/vaadin/tests/TestForWindowOpen.java | 2 +- .../com/vaadin/tests/TestSizeableIncomponents.java | 2 +- .../com/vaadin/tests/appengine/GAESyncTest.java | 6 +- .../tests/application/RefreshStatePreserve.java | 4 +- .../application/TerminalErrorNotification.java | 2 +- .../tests/application/ThreadLocalInstances.java | 10 +- .../tests/components/AbstractComponentTest.java | 6 +- .../components/AbstractComponentTestCase.java | 6 +- .../vaadin/tests/components/AbstractTestUI.java | 2 +- .../com/vaadin/tests/components/ErrorMessages.java | 4 +- .../components/UnknownComponentConnectorTest.java | 2 +- .../abstractcomponent/AllComponentTooltipTest.java | 2 +- .../abstractfield/TextFieldConversions.java | 2 +- .../tests/components/button/ButtonsAndIcons.java | 2 +- .../tests/components/button/DisabledButtons.java | 2 +- .../button/ShortCutListenerModification.java | 2 +- .../tests/components/caption/EmptyCaptions.java | 2 +- .../tests/components/caption/IconsInCaption.java | 2 +- .../tests/components/caption/LargeCaptionIcon.java | 2 +- .../components/checkbox/CheckBoxNullValue.java | 2 +- .../tests/components/checkbox/CheckBoxes.java | 4 +- .../tests/components/checkbox/CheckboxIcon.java | 2 +- .../components/combobox/ComboBoxItemIcon.java | 4 +- .../components/combobox/ComboBoxLargeIcons.java | 4 +- .../combobox/ComboBoxUndefinedWidthAndIcon.java | 4 +- .../tests/components/combobox/ComboBoxes2.java | 2 +- .../tests/components/combobox/Comboboxes.java | 2 +- .../tests/components/combobox/PopUpWidth.java | 4 +- .../components/combobox/RemovalOfSelectedIcon.java | 2 +- .../customcomponent/EmbeddedInCustomComponent.java | 2 +- .../components/datefield/DatePopupStyleName.java | 2 +- .../tests/components/embedded/EmbeddedAltText.java | 4 +- .../tests/components/embedded/EmbeddedApplet.java | 2 +- .../EmbeddedClickListenerRelativeCoordinates.java | 2 +- .../tests/components/embedded/EmbeddedFlash.java | 2 +- .../components/embedded/EmbeddedImageRefresh.java | 2 +- .../tests/components/embedded/EmbeddedPdf.java | 2 +- .../tests/components/embedded/EmbeddedTooltip.java | 2 +- .../tests/components/embedded/FlashIsVisible.java | 2 +- .../embeddedbrowser/EmbeddedBrowserIsVisible.java | 2 +- .../tests/components/flash/FlashIsVisible.java | 2 +- .../tests/components/flash/FlashPresentation.java | 2 +- .../formlayout/FormLayoutErrorHover.java | 2 +- .../tests/components/image/ImageAltText.java | 2 +- .../vaadin/tests/components/image/ImageClicks.java | 2 +- .../BasicJavaScriptComponent.java | 4 +- .../tests/components/label/LabelTooltip.java | 4 +- .../tests/components/label/MarginsInLabels.java | 2 +- .../com/vaadin/tests/components/link/LinkIcon.java | 4 +- .../tests/components/link/LinkTargetSize.java | 2 +- .../tests/components/link/LinkToPercentage.java | 6 +- .../loginform/LoginFormWithMultipleWindows.java | 2 +- .../com/vaadin/tests/components/media/Media.java | 2 +- .../tests/components/menubar/MenuBarHtmlItems.java | 4 +- .../menubar/MenuBarRunsOutOfBrowser.java | 2 +- .../tests/components/menubar/MenuBarTest.java | 4 +- .../components/notification/Notifications.java | 2 +- .../notification/NotificationsHtmlAllowed.java | 2 +- .../tests/components/optiongroup/OptionGroups.java | 2 +- .../components/orderedlayout/LayoutResizeTest.java | 2 +- .../orderedlayout/OrderedLayoutCases.java | 2 +- .../components/panel/PanelChangeContents.java | 2 +- .../components/popupview/ReopenPopupView.java | 2 +- .../RichTextAreaWithKeyboardShortcuts.java | 2 +- .../components/select/AbstractSelectTestCase.java | 2 +- .../components/select/SelectIconPlacement.java | 2 +- .../splitpanel/AbstractSplitPanelTest.java | 4 +- .../splitpanel/SplitPanelExtraScrollbars.java | 2 +- .../splitpanel/SplitPanelInModalWindow.java | 2 +- .../splitpanel/SplitPanelReversePosition.java | 2 +- .../splitpanel/SplitPanelWidthOnResize.java | 2 +- .../SplitPanelWithMinimumAndMaximum.java | 2 +- .../tests/components/table/ItemClickEvents.java | 2 +- .../KeyboardNavigationWithChangingContent.java | 2 +- .../table/LabelEmbeddedClickThroughForTable.java | 2 +- .../table/SafariRenderingBugWhiteSpace.java | 2 +- .../table/TableAndBrowserContextMenu.java | 2 +- .../TableClickAndDragOnIconAndComponents.java | 4 +- .../tests/components/table/TableInTabsheet.java | 2 +- .../tests/components/table/TableItemIcon.java | 4 +- .../com/vaadin/tests/components/table/Tables.java | 2 +- .../tests/components/tabsheet/TabSheetIcons.java | 2 +- .../tests/components/tabsheet/TabSheetTest.java | 2 +- .../tests/components/tabsheet/TabsheetTooltip.java | 2 +- .../tests/components/tree/TreeConnectors.java | 2 +- .../components/tree/TreeHorizontalResize.java | 2 +- .../components/tree/TreeNodeCaptionWrapping.java | 2 +- .../tests/components/tree/TreeWithIcons.java | 4 +- .../treetable/ChangeDataSourcePageLengthZero.java | 2 +- .../treetable/DisappearingComponents.java | 2 +- .../treetable/ExpandAnimationsInChameleon.java | 2 +- .../vaadin/tests/components/ui/LazyInitUIs.java | 6 +- .../vaadin/tests/components/ui/TestUITheme.java | 2 +- .../tests/components/ui/TestUIWidgetset.java | 2 +- .../tests/components/ui/TestUIWidgetset2.java | 2 +- .../tests/components/ui/UIInitException.java | 2 +- .../com/vaadin/tests/components/ui/UIInitTest.java | 2 +- .../tests/components/ui/UIsInMultipleTabs.java | 4 +- .../tests/components/ui/UriFragmentTest.java | 6 +- .../tests/components/window/DownloadAndUpdate.java | 2 +- .../components/window/EmbeddedInSubWindow.java | 2 +- .../tests/components/window/ExtraWindowShown.java | 2 +- .../tests/components/window/LazyWindowResize.java | 4 +- .../components/window/RepaintWindowContents.java | 2 +- .../tests/components/window/TooltipInWindow.java | 2 +- .../components/window/WindowResizeListener.java | 4 +- .../containers/BeanItemContainerFilteringTest.java | 2 +- .../containers/IndexedContainerFilteringTest.java | 2 +- tests/testbench/com/vaadin/tests/dd/DDTest1.java | 2 +- tests/testbench/com/vaadin/tests/dd/DDTest2.java | 4 +- tests/testbench/com/vaadin/tests/dd/DDTest6.java | 10 +- .../com/vaadin/tests/dd/DragAndDropFiles.java | 2 +- .../com/vaadin/tests/dd/DragDropPane.java | 2 +- .../com/vaadin/tests/dd/StartHtml5Drag.java | 4 +- .../vaadin/tests/extensions/BasicExtension.java | 4 +- .../tests/extensions/BasicExtensionTest.java | 2 +- .../tests/extensions/HelloWorldExtension.java | 2 +- .../tests/extensions/HelloWorldExtensionTest.java | 2 +- .../tests/extensions/JavascriptManagerTest.java | 2 +- .../extensions/SimpleJavaScriptExtensionTest.java | 4 +- .../vaadin/tests/integration/EmbedSizeTest.java | 4 +- .../vaadin/tests/integration/FlagSeResource.java | 2 +- .../integration/IntegrationTestApplication.java | 4 +- .../integration/JSR286PortletApplication.java | 2 +- .../vaadin/tests/integration/LiferayThemeDemo.java | 8 +- .../tests/integration/SpecialNameResource.java | 2 +- .../vaadin/tests/layouts/CaptionsInLayouts.java | 4 +- .../ComplexGLColumnExpansionWithColSpan.java | 2 +- .../vaadin/tests/layouts/GridLayoutCaptions.java | 2 +- .../vaadin/tests/layouts/OrderedLayoutBasics.java | 4 +- .../layouts/layouttester/GridLayoutTests.java | 8 +- .../layouttester/HorizontalLayoutTests.java | 8 +- .../layouts/layouttester/VerticalLayoutTests.java | 8 +- .../minitutorials/v7a1/AutoGeneratingForm.java | 2 +- .../tests/minitutorials/v7a1/BasicApplication.java | 2 +- .../minitutorials/v7a1/CreatingPreserveState.java | 2 +- .../v7a1/CustomConverterFactoryUI.java | 2 +- .../tests/minitutorials/v7a1/DefineUITheme.java | 2 +- .../v7a1/DifferentFeaturesForDifferentClients.java | 4 +- .../tests/minitutorials/v7a1/DynamicImageUI.java | 8 +- .../tests/minitutorials/v7a1/FindCurrentUI.java | 2 +- .../v7a1/FormUsingExistingLayout.java | 2 +- .../tests/minitutorials/v7a1/FormatTableValue.java | 2 +- .../v7a1/IntegerTextFieldDataSource.java | 2 +- .../v7a1/IntegerTextFieldStandalone.java | 2 +- .../minitutorials/v7a1/MultiTabApplication.java | 4 +- .../minitutorials/v7a1/StringMyTypeConverter.java | 2 +- .../minitutorials/v7a1/UsingBeanValidation.java | 2 +- .../minitutorials/v7a1/UsingUriFragments.java | 6 +- .../v7a1/UsingXyzWhenInitializing.java | 2 +- .../minitutorials/v7a2/ComponentInStateUI.java | 2 +- .../tests/minitutorials/v7a2/MyComponentUI.java | 2 +- .../v7a2/ResourceInStateComponent.java | 2 +- .../minitutorials/v7a2/ResourceInStateUI.java | 4 +- .../minitutorials/v7a2/WidgetcontainerUI.java | 2 +- .../vaadin/tests/minitutorials/v7a3/Analytics.java | 2 +- .../tests/minitutorials/v7a3/AnalyticsUI.java | 2 +- .../tests/minitutorials/v7a3/ComplexTypesUI.java | 2 +- .../tests/minitutorials/v7a3/FlotJavaScriptUI.java | 2 +- .../tests/minitutorials/v7a3/RedButtonUI.java | 2 +- .../tests/requesthandlers/AppResource404.java | 2 +- .../tests/resources/DownloadLargeFileResource.java | 2 +- .../tests/resources/NonExistingFileResource.java | 2 +- .../vaadin/tests/resources/ResourceDownload.java | 4 +- .../tests/serialization/DelegateToWidgetTest.java | 2 +- .../serialization/SerializerNamespaceTest.java | 2 +- .../vaadin/tests/serialization/SerializerTest.java | 2 +- .../com/vaadin/tests/themes/ButtonsTest.java | 4 +- .../com/vaadin/tests/tickets/Ticket1589.java | 10 +- .../com/vaadin/tests/tickets/Ticket1598.java | 2 +- .../com/vaadin/tests/tickets/Ticket1659.java | 2 +- .../com/vaadin/tests/tickets/Ticket1663.java | 2 +- .../com/vaadin/tests/tickets/Ticket1710.java | 4 +- .../com/vaadin/tests/tickets/Ticket1737.java | 6 +- .../com/vaadin/tests/tickets/Ticket1804.java | 2 +- .../com/vaadin/tests/tickets/Ticket1878.java | 6 +- .../com/vaadin/tests/tickets/Ticket1916.java | 2 +- .../com/vaadin/tests/tickets/Ticket1921.java | 6 +- .../com/vaadin/tests/tickets/Ticket1966_3.java | 4 +- .../com/vaadin/tests/tickets/Ticket1969.java | 2 +- .../com/vaadin/tests/tickets/Ticket1983.java | 2 +- .../com/vaadin/tests/tickets/Ticket2007.java | 2 +- .../com/vaadin/tests/tickets/Ticket2029.java | 2 +- .../com/vaadin/tests/tickets/Ticket2043.java | 2 +- .../com/vaadin/tests/tickets/Ticket2048.java | 2 +- .../com/vaadin/tests/tickets/Ticket2053.java | 2 +- .../com/vaadin/tests/tickets/Ticket2061b.java | 2 +- .../com/vaadin/tests/tickets/Ticket2090.java | 2 +- .../com/vaadin/tests/tickets/Ticket2095.java | 2 +- .../com/vaadin/tests/tickets/Ticket2104.java | 2 +- .../com/vaadin/tests/tickets/Ticket2117.java | 2 +- .../com/vaadin/tests/tickets/Ticket2119.java | 2 +- .../com/vaadin/tests/tickets/Ticket2181.java | 4 +- .../com/vaadin/tests/tickets/Ticket2292.java | 10 +- .../com/vaadin/tests/tickets/Ticket2405.java | 2 +- .../com/vaadin/tests/tickets/Ticket34.java | 4 +- .../com/vaadin/tests/tickets/Ticket736.java | 2 +- .../com/vaadin/tests/tickets/Ticket8291.java | 2 +- .../com/vaadin/tests/util/SampleDirectory.java | 2 +- .../tests/vaadincontext/BootstrapModifyUI.java | 2 +- .../widgetset/server/SerializerTestExtension.java | 2 +- 414 files changed, 6781 insertions(+), 6815 deletions(-) create mode 100644 server/src/com/vaadin/server/AbstractClientConnector.java create mode 100644 server/src/com/vaadin/server/AbstractErrorMessage.java create mode 100644 server/src/com/vaadin/server/AbstractExtension.java create mode 100644 server/src/com/vaadin/server/AbstractJavaScriptExtension.java create mode 100644 server/src/com/vaadin/server/AbstractUIProvider.java create mode 100644 server/src/com/vaadin/server/ApplicationResource.java create mode 100644 server/src/com/vaadin/server/ClassResource.java create mode 100644 server/src/com/vaadin/server/CombinedRequest.java create mode 100644 server/src/com/vaadin/server/CompositeErrorMessage.java create mode 100644 server/src/com/vaadin/server/DefaultUIProvider.java create mode 100644 server/src/com/vaadin/server/DeploymentConfiguration.java create mode 100644 server/src/com/vaadin/server/DownloadStream.java create mode 100644 server/src/com/vaadin/server/ErrorMessage.java create mode 100644 server/src/com/vaadin/server/Extension.java create mode 100644 server/src/com/vaadin/server/ExternalResource.java create mode 100644 server/src/com/vaadin/server/FileResource.java create mode 100644 server/src/com/vaadin/server/JavaScriptCallbackHelper.java create mode 100644 server/src/com/vaadin/server/KeyMapper.java create mode 100644 server/src/com/vaadin/server/LegacyPaint.java create mode 100644 server/src/com/vaadin/server/Page.java create mode 100644 server/src/com/vaadin/server/PaintException.java create mode 100644 server/src/com/vaadin/server/PaintTarget.java create mode 100644 server/src/com/vaadin/server/RequestHandler.java create mode 100644 server/src/com/vaadin/server/Resource.java create mode 100644 server/src/com/vaadin/server/Scrollable.java create mode 100644 server/src/com/vaadin/server/Sizeable.java create mode 100644 server/src/com/vaadin/server/StreamResource.java create mode 100644 server/src/com/vaadin/server/StreamVariable.java create mode 100644 server/src/com/vaadin/server/SystemError.java create mode 100644 server/src/com/vaadin/server/Terminal.java create mode 100644 server/src/com/vaadin/server/ThemeResource.java create mode 100644 server/src/com/vaadin/server/UIProvider.java create mode 100644 server/src/com/vaadin/server/UserError.java create mode 100644 server/src/com/vaadin/server/Vaadin6Component.java create mode 100644 server/src/com/vaadin/server/VariableOwner.java create mode 100644 server/src/com/vaadin/server/WrappedRequest.java create mode 100644 server/src/com/vaadin/server/WrappedResponse.java create mode 100644 server/src/com/vaadin/server/package.html delete mode 100644 server/src/com/vaadin/terminal/AbstractClientConnector.java delete mode 100644 server/src/com/vaadin/terminal/AbstractErrorMessage.java delete mode 100644 server/src/com/vaadin/terminal/AbstractExtension.java delete mode 100644 server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java delete mode 100644 server/src/com/vaadin/terminal/AbstractUIProvider.java delete mode 100644 server/src/com/vaadin/terminal/ApplicationResource.java delete mode 100644 server/src/com/vaadin/terminal/ClassResource.java delete mode 100644 server/src/com/vaadin/terminal/CombinedRequest.java delete mode 100644 server/src/com/vaadin/terminal/CompositeErrorMessage.java delete mode 100644 server/src/com/vaadin/terminal/DefaultUIProvider.java delete mode 100644 server/src/com/vaadin/terminal/DeploymentConfiguration.java delete mode 100644 server/src/com/vaadin/terminal/DownloadStream.java delete mode 100644 server/src/com/vaadin/terminal/ErrorMessage.java delete mode 100644 server/src/com/vaadin/terminal/Extension.java delete mode 100644 server/src/com/vaadin/terminal/ExternalResource.java delete mode 100644 server/src/com/vaadin/terminal/FileResource.java delete mode 100644 server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java delete mode 100644 server/src/com/vaadin/terminal/KeyMapper.java delete mode 100644 server/src/com/vaadin/terminal/LegacyPaint.java delete mode 100644 server/src/com/vaadin/terminal/Page.java delete mode 100644 server/src/com/vaadin/terminal/PaintException.java delete mode 100644 server/src/com/vaadin/terminal/PaintTarget.java delete mode 100644 server/src/com/vaadin/terminal/RequestHandler.java delete mode 100644 server/src/com/vaadin/terminal/Resource.java delete mode 100644 server/src/com/vaadin/terminal/Scrollable.java delete mode 100644 server/src/com/vaadin/terminal/Sizeable.java delete mode 100644 server/src/com/vaadin/terminal/StreamResource.java delete mode 100644 server/src/com/vaadin/terminal/StreamVariable.java delete mode 100644 server/src/com/vaadin/terminal/SystemError.java delete mode 100644 server/src/com/vaadin/terminal/Terminal.java delete mode 100644 server/src/com/vaadin/terminal/ThemeResource.java delete mode 100644 server/src/com/vaadin/terminal/UIProvider.java delete mode 100644 server/src/com/vaadin/terminal/UserError.java delete mode 100644 server/src/com/vaadin/terminal/Vaadin6Component.java delete mode 100644 server/src/com/vaadin/terminal/VariableOwner.java delete mode 100644 server/src/com/vaadin/terminal/WrappedRequest.java delete mode 100644 server/src/com/vaadin/terminal/WrappedResponse.java delete mode 100644 server/src/com/vaadin/terminal/package.html diff --git a/client/src/com/vaadin/client/JavaScriptExtension.java b/client/src/com/vaadin/client/JavaScriptExtension.java index 674262e35e..0a3d6b81ba 100644 --- a/client/src/com/vaadin/client/JavaScriptExtension.java +++ b/client/src/com/vaadin/client/JavaScriptExtension.java @@ -18,9 +18,9 @@ package com.vaadin.client; import com.vaadin.client.communication.HasJavaScriptConnectorHelper; import com.vaadin.client.extensions.AbstractExtensionConnector; +import com.vaadin.server.AbstractJavaScriptExtension; import com.vaadin.shared.JavaScriptExtensionState; import com.vaadin.shared.ui.Connect; -import com.vaadin.terminal.AbstractJavaScriptExtension; @Connect(AbstractJavaScriptExtension.class) public final class JavaScriptExtension extends AbstractExtensionConnector diff --git a/client/src/com/vaadin/client/UIDL.java b/client/src/com/vaadin/client/UIDL.java index dff9f91b35..f9cad3dee5 100644 --- a/client/src/com/vaadin/client/UIDL.java +++ b/client/src/com/vaadin/client/UIDL.java @@ -22,7 +22,7 @@ import java.util.Set; import com.google.gwt.core.client.JavaScriptObject; import com.google.gwt.core.client.JsArrayString; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintTarget; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Component; diff --git a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java index a87b761bbd..6c0d8fa725 100644 --- a/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java +++ b/client/src/com/vaadin/client/ui/combobox/ComboBoxConnector.java @@ -36,8 +36,7 @@ public class ComboBoxConnector extends AbstractFieldConnector implements /* * (non-Javadoc) * - * @see - * com.vaadin.client.Paintable#updateFromUIDL(com.vaadin.terminal + * @see com.vaadin.client.Paintable#updateFromUIDL(com.vaadin.terminal * .gwt.client.UIDL, com.vaadin.client.ApplicationConnection) */ @Override diff --git a/server/src/com/vaadin/Application.java b/server/src/com/vaadin/Application.java index bdad94355d..a406617288 100644 --- a/server/src/com/vaadin/Application.java +++ b/server/src/com/vaadin/Application.java @@ -51,19 +51,19 @@ import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.ConverterFactory; import com.vaadin.data.util.converter.DefaultConverterFactory; import com.vaadin.event.EventRouter; +import com.vaadin.server.AbstractErrorMessage; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.CombinedRequest; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.Terminal; +import com.vaadin.server.UIProvider; +import com.vaadin.server.VariableOwner; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; +import com.vaadin.server.WrappedRequest.BrowserDetails; import com.vaadin.service.ApplicationContext; import com.vaadin.shared.ui.ui.UIConstants; -import com.vaadin.terminal.AbstractErrorMessage; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.CombinedRequest; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.Terminal; -import com.vaadin.terminal.UIProvider; -import com.vaadin.terminal.VariableOwner; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; -import com.vaadin.terminal.WrappedResponse; import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; import com.vaadin.terminal.gwt.server.BootstrapFragmentResponse; import com.vaadin.terminal.gwt.server.BootstrapListener; @@ -123,7 +123,7 @@ import com.vaadin.ui.Window; * found out, the window itself is queried for a preferred theme. If the window * does not prefer a specific theme, the application containing the window is * queried. If neither the application prefers a theme, the default theme for - * the {@link com.vaadin.terminal.Terminal terminal} is used. The terminal + * the {@link com.vaadin.server.Terminal terminal} is used. The terminal * always defines a default theme. *

* @@ -1075,7 +1075,7 @@ public class Application implements Terminal.ErrorListener, Serializable { * * @param event * the change event. - * @see com.vaadin.terminal.Terminal.ErrorListener#terminalError(com.vaadin.terminal.Terminal.ErrorEvent) + * @see com.vaadin.server.Terminal.ErrorListener#terminalError(com.vaadin.server.Terminal.ErrorEvent) */ @Override diff --git a/server/src/com/vaadin/UIRequiresMoreInformationException.java b/server/src/com/vaadin/UIRequiresMoreInformationException.java index 493c31acb6..76a31d88ef 100644 --- a/server/src/com/vaadin/UIRequiresMoreInformationException.java +++ b/server/src/com/vaadin/UIRequiresMoreInformationException.java @@ -16,8 +16,8 @@ package com.vaadin; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedRequest.BrowserDetails; /** * Exception that is thrown to indicate that creating or initializing the UI diff --git a/server/src/com/vaadin/annotations/EagerInit.java b/server/src/com/vaadin/annotations/EagerInit.java index 462c6bb5ac..f08d46b551 100644 --- a/server/src/com/vaadin/annotations/EagerInit.java +++ b/server/src/com/vaadin/annotations/EagerInit.java @@ -20,7 +20,7 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** @@ -29,7 +29,7 @@ import com.vaadin.ui.UI; * This will make the UI appear more quickly, as ensuring the availability of * this information typically requires an additional round trip to the client. * - * @see UI#init(com.vaadin.terminal.WrappedRequest) + * @see UI#init(com.vaadin.server.WrappedRequest) * @see WrappedRequest#getBrowserDetails() * * @since 7.0 diff --git a/server/src/com/vaadin/data/util/FilesystemContainer.java b/server/src/com/vaadin/data/util/FilesystemContainer.java index 54ee2d6f0c..4c27169409 100644 --- a/server/src/com/vaadin/data/util/FilesystemContainer.java +++ b/server/src/com/vaadin/data/util/FilesystemContainer.java @@ -33,8 +33,8 @@ import java.util.List; import com.vaadin.data.Container; import com.vaadin.data.Item; import com.vaadin.data.Property; +import com.vaadin.server.Resource; import com.vaadin.service.FileTypeResolver; -import com.vaadin.terminal.Resource; /** * A hierarchical container wrapper for a filesystem. diff --git a/server/src/com/vaadin/event/Action.java b/server/src/com/vaadin/event/Action.java index aca28940a1..b8296418d3 100644 --- a/server/src/com/vaadin/event/Action.java +++ b/server/src/com/vaadin/event/Action.java @@ -18,7 +18,7 @@ package com.vaadin.event; import java.io.Serializable; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; /** * Implements the action framework. This class contains subinterfaces for action diff --git a/server/src/com/vaadin/event/ActionManager.java b/server/src/com/vaadin/event/ActionManager.java index 296d12ba92..85a1bf0f12 100644 --- a/server/src/com/vaadin/event/ActionManager.java +++ b/server/src/com/vaadin/event/ActionManager.java @@ -20,10 +20,10 @@ import java.util.Map; import com.vaadin.event.Action.Container; import com.vaadin.event.Action.Handler; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.VariableOwner; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.VariableOwner; import com.vaadin.ui.Component; /** diff --git a/server/src/com/vaadin/event/ShortcutAction.java b/server/src/com/vaadin/event/ShortcutAction.java index b3f41b474d..b1d14b15fe 100644 --- a/server/src/com/vaadin/event/ShortcutAction.java +++ b/server/src/com/vaadin/event/ShortcutAction.java @@ -20,7 +20,7 @@ import java.io.Serializable; import java.util.regex.Matcher; import java.util.regex.Pattern; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.Panel; import com.vaadin.ui.Window; diff --git a/server/src/com/vaadin/event/ShortcutListener.java b/server/src/com/vaadin/event/ShortcutListener.java index 82a09585b3..d7e0577e84 100644 --- a/server/src/com/vaadin/event/ShortcutListener.java +++ b/server/src/com/vaadin/event/ShortcutListener.java @@ -16,7 +16,7 @@ package com.vaadin.event; import com.vaadin.event.Action.Listener; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; public abstract class ShortcutListener extends ShortcutAction implements Listener { diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java index 7b04efc4b3..850e68b231 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/AcceptCriterion.java @@ -23,8 +23,8 @@ import java.io.Serializable; import com.vaadin.event.Transferable; import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * Criterion that can be used create policy to accept/discard dragged content diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/And.java b/server/src/com/vaadin/event/dd/acceptcriteria/And.java index 3d11ecf7bf..183010a298 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/And.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/And.java @@ -19,8 +19,8 @@ package com.vaadin.event.dd.acceptcriteria; import com.vaadin.event.dd.DragAndDropEvent; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * A compound criterion that accepts the drag if all of its criteria accepts the diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java index be7e2d4033..e862cdfd39 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ClientSideCriterion.java @@ -17,8 +17,8 @@ package com.vaadin.event.dd.acceptcriteria; import java.io.Serializable; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * Parent class for criteria that can be completely validated on client side. diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java b/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java index 55ee17fea9..97094814ef 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ContainsDataFlavor.java @@ -20,8 +20,8 @@ package com.vaadin.event.dd.acceptcriteria; import com.vaadin.event.Transferable; import com.vaadin.event.dd.DragAndDropEvent; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * A Criterion that checks whether {@link Transferable} contains given data diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/Not.java b/server/src/com/vaadin/event/dd/acceptcriteria/Not.java index b3f73699ea..9e1b1571ae 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/Not.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/Not.java @@ -19,8 +19,8 @@ package com.vaadin.event.dd.acceptcriteria; import com.vaadin.event.dd.DragAndDropEvent; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * Criterion that wraps another criterion and inverts its return value. diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/Or.java b/server/src/com/vaadin/event/dd/acceptcriteria/Or.java index 42d1c3293d..7aa7d8cd20 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/Or.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/Or.java @@ -19,8 +19,8 @@ package com.vaadin.event.dd.acceptcriteria; import com.vaadin.event.dd.DragAndDropEvent; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * A compound criterion that accepts the drag if any of its criterion accepts diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java b/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java index b9c2855021..b7457605b8 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/ServerSideCriterion.java @@ -18,8 +18,8 @@ package com.vaadin.event.dd.acceptcriteria; import java.io.Serializable; import com.vaadin.event.Transferable; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * Parent class for criteria which are verified on the server side during a drag diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java index cc1d586076..6258aed423 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/SourceIs.java @@ -23,8 +23,8 @@ import java.util.logging.Logger; import com.vaadin.event.TransferableImpl; import com.vaadin.event.dd.DragAndDropEvent; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; import com.vaadin.ui.Component; /** diff --git a/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java b/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java index 536ba8780e..a6d3e2c5d5 100644 --- a/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java +++ b/server/src/com/vaadin/event/dd/acceptcriteria/TargetDetailIs.java @@ -20,8 +20,8 @@ package com.vaadin.event.dd.acceptcriteria; import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.TargetDetails; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * Criterion for checking if drop target details contains the specific property diff --git a/server/src/com/vaadin/navigator/Navigator.java b/server/src/com/vaadin/navigator/Navigator.java index 13e87c16ad..1fa11184b9 100644 --- a/server/src/com/vaadin/navigator/Navigator.java +++ b/server/src/com/vaadin/navigator/Navigator.java @@ -22,9 +22,9 @@ import java.util.LinkedList; import java.util.List; import com.vaadin.navigator.ViewChangeListener.ViewChangeEvent; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.FragmentChangedEvent; -import com.vaadin.terminal.Page.FragmentChangedListener; +import com.vaadin.server.Page; +import com.vaadin.server.Page.FragmentChangedEvent; +import com.vaadin.server.Page.FragmentChangedListener; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.CssLayout; diff --git a/server/src/com/vaadin/server/AbstractClientConnector.java b/server/src/com/vaadin/server/AbstractClientConnector.java new file mode 100644 index 0000000000..2a0d1e4425 --- /dev/null +++ b/server/src/com/vaadin/server/AbstractClientConnector.java @@ -0,0 +1,570 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server; + +import java.io.Serializable; +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationHandler; +import java.lang.reflect.Method; +import java.lang.reflect.Proxy; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.logging.Logger; + +import com.vaadin.Application; +import com.vaadin.external.json.JSONException; +import com.vaadin.external.json.JSONObject; +import com.vaadin.shared.communication.ClientRpc; +import com.vaadin.shared.communication.ServerRpc; +import com.vaadin.shared.communication.SharedState; +import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; +import com.vaadin.terminal.gwt.server.ClientConnector; +import com.vaadin.terminal.gwt.server.ClientMethodInvocation; +import com.vaadin.terminal.gwt.server.RpcManager; +import com.vaadin.terminal.gwt.server.RpcTarget; +import com.vaadin.terminal.gwt.server.ServerRpcManager; +import com.vaadin.ui.HasComponents; +import com.vaadin.ui.UI; + +/** + * An abstract base class for ClientConnector implementations. This class + * provides all the basic functionality required for connectors. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +public abstract class AbstractClientConnector implements ClientConnector { + /** + * A map from client to server RPC interface class to the RPC call manager + * that handles incoming RPC calls for that interface. + */ + private Map, RpcManager> rpcManagerMap = new HashMap, RpcManager>(); + + /** + * A map from server to client RPC interface class to the RPC proxy that + * sends ourgoing RPC calls for that interface. + */ + private Map, ClientRpc> rpcProxyMap = new HashMap, ClientRpc>(); + + /** + * Shared state object to be communicated from the server to the client when + * modified. + */ + private SharedState sharedState; + + private Class stateType; + + /** + * Pending RPC method invocations to be sent. + */ + private ArrayList pendingInvocations = new ArrayList(); + + private String connectorId; + + private ArrayList extensions = new ArrayList(); + + private ClientConnector parent; + + /* Documentation copied from interface */ + @Deprecated + @Override + public void requestRepaint() { + markAsDirty(); + } + + /* Documentation copied from interface */ + @Override + public void markAsDirty() { + UI uI = getUI(); + if (uI != null) { + uI.getConnectorTracker().markDirty(this); + } + } + + /** + * Registers an RPC interface implementation for this component. + * + * A component can listen to multiple RPC interfaces, and subclasses can + * register additional implementations. + * + * @since 7.0 + * + * @param implementation + * RPC interface implementation + * @param rpcInterfaceType + * RPC interface class for which the implementation should be + * registered + */ + protected void registerRpc(T implementation, Class rpcInterfaceType) { + rpcManagerMap.put(rpcInterfaceType, new ServerRpcManager( + implementation, rpcInterfaceType)); + } + + /** + * Registers an RPC interface implementation for this component. + * + * A component can listen to multiple RPC interfaces, and subclasses can + * register additional implementations. + * + * @since 7.0 + * + * @param implementation + * RPC interface implementation. Also used to deduce the type. + */ + protected void registerRpc(T implementation) { + Class cls = implementation.getClass(); + Class[] interfaces = cls.getInterfaces(); + while (interfaces.length == 0) { + // Search upwards until an interface is found. It must be found as T + // extends ServerRpc + cls = cls.getSuperclass(); + interfaces = cls.getInterfaces(); + } + if (interfaces.length != 1 + || !(ServerRpc.class.isAssignableFrom(interfaces[0]))) { + throw new RuntimeException( + "Use registerRpc(T implementation, Class rpcInterfaceType) if the Rpc implementation implements more than one interface"); + } + @SuppressWarnings("unchecked") + Class type = (Class) interfaces[0]; + registerRpc(implementation, type); + } + + protected SharedState getState() { + if (null == sharedState) { + sharedState = createState(); + } + + UI uI = getUI(); + if (uI != null && !uI.getConnectorTracker().isDirty(this)) { + requestRepaint(); + } + + return sharedState; + } + + @Override + public JSONObject encodeState() throws JSONException { + return AbstractCommunicationManager.encodeState(this, getState()); + } + + /** + * Creates the shared state bean to be used in server to client + * communication. + *

+ * By default a state object of the defined return type of + * {@link #getState()} is created. Subclasses can override this method and + * return a new instance of the correct state class but this should rarely + * be necessary. + *

+ *

+ * No configuration of the values of the state should be performed in + * {@link #createState()}. + * + * @since 7.0 + * + * @return new shared state object + */ + protected SharedState createState() { + try { + return getStateType().newInstance(); + } catch (Exception e) { + throw new RuntimeException( + "Error creating state of type " + getStateType().getName() + + " for " + getClass().getName(), e); + } + } + + @Override + public Class getStateType() { + // Lazy load because finding type can be expensive because of the + // exceptions flying around + if (stateType == null) { + stateType = findStateType(); + } + + return stateType; + } + + private Class findStateType() { + try { + Class class1 = getClass(); + while (class1 != null) { + try { + Method m = class1.getDeclaredMethod("getState", + (Class[]) null); + Class type = m.getReturnType(); + return type.asSubclass(SharedState.class); + } catch (NoSuchMethodException nsme) { + // Try in superclass instead + class1 = class1.getSuperclass(); + } + } + throw new NoSuchMethodException(getClass().getCanonicalName() + + ".getState()"); + } catch (Exception e) { + throw new RuntimeException("Error finding state type for " + + getClass().getName(), e); + } + } + + /** + * Returns an RPC proxy for a given server to client RPC interface for this + * component. + * + * TODO more javadoc, subclasses, ... + * + * @param rpcInterface + * RPC interface type + * + * @since 7.0 + */ + public T getRpcProxy(final Class rpcInterface) { + // create, initialize and return a dynamic proxy for RPC + try { + if (!rpcProxyMap.containsKey(rpcInterface)) { + Class proxyClass = Proxy.getProxyClass( + rpcInterface.getClassLoader(), rpcInterface); + Constructor constructor = proxyClass + .getConstructor(InvocationHandler.class); + T rpcProxy = rpcInterface.cast(constructor + .newInstance(new RpcInvoicationHandler(rpcInterface))); + // cache the proxy + rpcProxyMap.put(rpcInterface, rpcProxy); + } + return (T) rpcProxyMap.get(rpcInterface); + } catch (Exception e) { + // TODO exception handling? + throw new RuntimeException(e); + } + } + + private static final class AllChildrenIterable implements + Iterable, Serializable { + private final ClientConnector connector; + + private AllChildrenIterable(ClientConnector connector) { + this.connector = connector; + } + + @Override + public Iterator iterator() { + CombinedIterator iterator = new CombinedIterator(); + iterator.addIterator(connector.getExtensions().iterator()); + + if (connector instanceof HasComponents) { + HasComponents hasComponents = (HasComponents) connector; + iterator.addIterator(hasComponents.iterator()); + } + + return iterator; + } + } + + private class RpcInvoicationHandler implements InvocationHandler, + Serializable { + + private String rpcInterfaceName; + + public RpcInvoicationHandler(Class rpcInterface) { + rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", "."); + } + + @Override + public Object invoke(Object proxy, Method method, Object[] args) + throws Throwable { + addMethodInvocationToQueue(rpcInterfaceName, method, args); + return null; + } + + } + + /** + * For internal use: adds a method invocation to the pending RPC call queue. + * + * @param interfaceName + * RPC interface name + * @param method + * RPC method + * @param parameters + * RPC all parameters + * + * @since 7.0 + */ + protected void addMethodInvocationToQueue(String interfaceName, + Method method, Object[] parameters) { + // add to queue + pendingInvocations.add(new ClientMethodInvocation(this, interfaceName, + method, parameters)); + // TODO no need to do full repaint if only RPC calls + requestRepaint(); + } + + /** + * @see RpcTarget#getRpcManager(Class) + * + * @param rpcInterface + * RPC interface for which a call was made + * @return RPC Manager handling calls for the interface + * + * @since 7.0 + */ + @Override + public RpcManager getRpcManager(Class rpcInterface) { + return rpcManagerMap.get(rpcInterface); + } + + @Override + public List retrievePendingRpcCalls() { + if (pendingInvocations.isEmpty()) { + return Collections.emptyList(); + } else { + List result = pendingInvocations; + pendingInvocations = new ArrayList(); + return Collections.unmodifiableList(result); + } + } + + @Override + public String getConnectorId() { + if (connectorId == null) { + if (getApplication() == null) { + throw new RuntimeException( + "Component must be attached to an application when getConnectorId() is called for the first time"); + } + connectorId = getApplication().createConnectorId(this); + } + return connectorId; + } + + /** + * Finds the Application to which this connector belongs. If the connector + * has not been attached, null is returned. + * + * @return The connector's application, or null if not attached + */ + protected Application getApplication() { + UI uI = getUI(); + if (uI == null) { + return null; + } else { + return uI.getApplication(); + } + } + + /** + * Finds a UI ancestor of this connector. null is returned if + * no UI ancestor is found (typically because the connector is not + * attached to a proper hierarchy). + * + * @return the UI ancestor of this connector, or null if none + * is found. + */ + @Override + public UI getUI() { + ClientConnector connector = this; + while (connector != null) { + if (connector instanceof UI) { + return (UI) connector; + } + connector = connector.getParent(); + } + return null; + } + + private static Logger getLogger() { + return Logger.getLogger(AbstractClientConnector.class.getName()); + } + + @Override + @Deprecated + public void requestRepaintAll() { + markAsDirtyRecursive(); + } + + @Override + public void markAsDirtyRecursive() { + markAsDirty(); + + for (ClientConnector connector : getAllChildrenIterable(this)) { + connector.markAsDirtyRecursive(); + } + } + + private static final class CombinedIterator implements Iterator, + Serializable { + + private final Collection> iterators = new ArrayList>(); + + public void addIterator(Iterator iterator) { + iterators.add(iterator); + } + + @Override + public boolean hasNext() { + for (Iterator i : iterators) { + if (i.hasNext()) { + return true; + } + } + return false; + } + + @Override + public T next() { + for (Iterator i : iterators) { + if (i.hasNext()) { + return i.next(); + } + } + throw new NoSuchElementException(); + } + + @Override + public void remove() { + throw new UnsupportedOperationException(); + } + } + + /** + * Get an Iterable for iterating over all child connectors, including both + * extensions and child components. + * + * @param connector + * the connector to get children for + * @return an Iterable giving all child connectors. + */ + public static Iterable getAllChildrenIterable( + final ClientConnector connector) { + return new AllChildrenIterable(connector); + } + + @Override + public Collection getExtensions() { + return Collections.unmodifiableCollection(extensions); + } + + /** + * Add an extension to this connector. This method is protected to allow + * extensions to select which targets they can extend. + * + * @param extension + * the extension to add + */ + protected void addExtension(Extension extension) { + ClientConnector previousParent = extension.getParent(); + if (previousParent == this) { + // Nothing to do, already attached + return; + } else if (previousParent != null) { + throw new IllegalStateException( + "Moving an extension from one parent to another is not supported"); + } + + extensions.add(extension); + extension.setParent(this); + markAsDirty(); + } + + @Override + public void removeExtension(Extension extension) { + extension.setParent(null); + extensions.remove(extension); + markAsDirty(); + } + + @Override + public void setParent(ClientConnector parent) { + + // If the parent is not changed, don't do anything + if (parent == this.parent) { + return; + } + + if (parent != null && this.parent != null) { + throw new IllegalStateException(getClass().getName() + + " already has a parent."); + } + + // Send detach event if the component have been connected to a window + if (getApplication() != null) { + detach(); + } + + // Connect to new parent + this.parent = parent; + + // Send attach event if connected to an application + if (getApplication() != null) { + attach(); + } + } + + @Override + public ClientConnector getParent() { + return parent; + } + + @Override + public void attach() { + markAsDirty(); + + getUI().getConnectorTracker().registerConnector(this); + + for (ClientConnector connector : getAllChildrenIterable(this)) { + connector.attach(); + } + + } + + /** + * {@inheritDoc} + * + *

+ * The {@link #getApplication()} and {@link #getUI()} methods might return + * null after this method is called. + *

+ */ + @Override + public void detach() { + for (ClientConnector connector : getAllChildrenIterable(this)) { + connector.detach(); + } + + getUI().getConnectorTracker().unregisterConnector(this); + } + + @Override + public boolean isConnectorEnabled() { + if (getParent() == null) { + // No parent -> the component cannot receive updates from the client + return false; + } else { + return getParent().isConnectorEnabled(); + } + } + + @Override + public void beforeClientResponse(boolean initial) { + // Do nothing by default + } +} diff --git a/server/src/com/vaadin/server/AbstractErrorMessage.java b/server/src/com/vaadin/server/AbstractErrorMessage.java new file mode 100644 index 0000000000..13bddcc6ca --- /dev/null +++ b/server/src/com/vaadin/server/AbstractErrorMessage.java @@ -0,0 +1,188 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.PrintWriter; +import java.io.StringWriter; +import java.util.ArrayList; +import java.util.List; + +import com.vaadin.data.Buffered; +import com.vaadin.data.Validator; +import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; + +/** + * Base class for component error messages. + * + * This class is used on the server side to construct the error messages to send + * to the client. + * + * @since 7.0 + */ +public abstract class AbstractErrorMessage implements ErrorMessage { + + public enum ContentMode { + /** + * Content mode, where the error contains only plain text. + */ + TEXT, + /** + * Content mode, where the error contains preformatted text. + */ + PREFORMATTED, + /** + * Content mode, where the error contains XHTML. + */ + XHTML; + } + + /** + * Content mode. + */ + private ContentMode mode = ContentMode.TEXT; + + /** + * Message in content mode. + */ + private String message; + + /** + * Error level. + */ + private ErrorLevel level = ErrorLevel.ERROR; + + private List causes = new ArrayList(); + + protected AbstractErrorMessage(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + protected void setMessage(String message) { + this.message = message; + } + + /* Documented in interface */ + @Override + public ErrorLevel getErrorLevel() { + return level; + } + + protected void setErrorLevel(ErrorLevel level) { + this.level = level; + } + + protected ContentMode getMode() { + return mode; + } + + protected void setMode(ContentMode mode) { + this.mode = mode; + } + + protected List getCauses() { + return causes; + } + + protected void addCause(ErrorMessage cause) { + causes.add(cause); + } + + @Override + public String getFormattedHtmlMessage() { + String result = null; + switch (getMode()) { + case TEXT: + result = AbstractApplicationServlet.safeEscapeForHtml(getMessage()); + break; + case PREFORMATTED: + result = "
"
+                    + AbstractApplicationServlet
+                            .safeEscapeForHtml(getMessage()) + "
"; + break; + case XHTML: + result = getMessage(); + break; + } + // if no message, combine the messages of all children + if (null == result && null != getCauses() && getCauses().size() > 0) { + StringBuilder sb = new StringBuilder(); + for (ErrorMessage cause : getCauses()) { + String childMessage = cause.getFormattedHtmlMessage(); + if (null != childMessage) { + sb.append("
"); + sb.append(childMessage); + sb.append("
\n"); + } + } + if (sb.length() > 0) { + result = sb.toString(); + } + } + // still no message? use an empty string for backwards compatibility + if (null == result) { + result = ""; + } + return result; + } + + // TODO replace this with a helper method elsewhere? + public static ErrorMessage getErrorMessageForException(Throwable t) { + if (null == t) { + return null; + } else if (t instanceof ErrorMessage) { + // legacy case for custom error messages + return (ErrorMessage) t; + } else if (t instanceof Validator.InvalidValueException) { + UserError error = new UserError( + ((Validator.InvalidValueException) t).getHtmlMessage(), + ContentMode.XHTML, ErrorLevel.ERROR); + for (Validator.InvalidValueException nestedException : ((Validator.InvalidValueException) t) + .getCauses()) { + error.addCause(getErrorMessageForException(nestedException)); + } + return error; + } else if (t instanceof Buffered.SourceException) { + // no message, only the causes to be painted + UserError error = new UserError(null); + // in practice, this was always ERROR in Vaadin 6 unless tweaked in + // custom exceptions implementing ErrorMessage + error.setErrorLevel(ErrorLevel.ERROR); + // causes + for (Throwable nestedException : ((Buffered.SourceException) t) + .getCauses()) { + error.addCause(getErrorMessageForException(nestedException)); + } + return error; + } else { + StringWriter sw = new StringWriter(); + PrintWriter pw = new PrintWriter(sw); + t.printStackTrace(pw); + return new SystemError(sw.toString()); + } + } + + /* Documented in superclass */ + @Override + public String toString() { + return getMessage(); + } + +} diff --git a/server/src/com/vaadin/server/AbstractExtension.java b/server/src/com/vaadin/server/AbstractExtension.java new file mode 100644 index 0000000000..5693d1a29f --- /dev/null +++ b/server/src/com/vaadin/server/AbstractExtension.java @@ -0,0 +1,87 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.terminal.gwt.server.ClientConnector; + +/** + * An extension is an entity that is attached to a Component or another + * Extension and independently communicates between client and server. + *

+ * Extensions can use shared state and RPC in the same way as components. + *

+ * AbstractExtension adds a mechanism for adding the extension to any Connector + * (extend). To let the Extension determine what kind target it can be added to, + * the extend method is declared as protected. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +public abstract class AbstractExtension extends AbstractClientConnector + implements Extension { + private boolean previouslyAttached = false; + + /** + * Gets a type that the parent must be an instance of. Override this if the + * extension only support certain targets, e.g. if only TextFields can be + * extended. + * + * @return a type that the parent must be an instance of + */ + protected Class getSupportedParentType() { + return ClientConnector.class; + } + + /** + * Add this extension to the target connector. This method is protected to + * allow subclasses to require a more specific type of target. + * + * @param target + * the connector to attach this extension to + */ + protected void extend(AbstractClientConnector target) { + target.addExtension(this); + } + + /** + * Remove this extension from its target. After an extension has been + * removed, it can not be attached again. + */ + public void removeFromTarget() { + getParent().removeExtension(this); + } + + @Override + public void setParent(ClientConnector parent) { + if (previouslyAttached && parent != null) { + throw new IllegalStateException( + "An extension can not be set to extend a new target after getting detached from the previous."); + } + + Class supportedParentType = getSupportedParentType(); + if (parent == null || supportedParentType.isInstance(parent)) { + super.setParent(parent); + previouslyAttached = true; + } else { + throw new IllegalArgumentException(getClass().getName() + + " can only be attached to targets of type " + + supportedParentType.getName() + " but attach to " + + parent.getClass().getName() + " was attempted."); + } + } + +} diff --git a/server/src/com/vaadin/server/AbstractJavaScriptExtension.java b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java new file mode 100644 index 0000000000..20e2752801 --- /dev/null +++ b/server/src/com/vaadin/server/AbstractJavaScriptExtension.java @@ -0,0 +1,172 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.shared.JavaScriptExtensionState; +import com.vaadin.ui.JavaScriptFunction; + +/** + * Base class for Extensions with all client-side logic implemented using + * JavaScript. + *

+ * When a new JavaScript extension is initialized in the browser, the framework + * will look for a globally defined JavaScript function that will initialize the + * extension. The name of the initialization function is formed by replacing . + * with _ in the name of the server-side class. If no such function is defined, + * each super class is used in turn until a match is found. The framework will + * thus first attempt with com_example_MyExtension for the + * server-side + * com.example.MyExtension extends AbstractJavaScriptExtension + * class. If MyExtension instead extends com.example.SuperExtension + * , then com_example_SuperExtension will also be attempted if + * com_example_MyExtension has not been defined. + *

+ * + * The initialization function will be called with this pointing to + * a connector wrapper object providing integration to Vaadin with the following + * functions: + *

    + *
  • getConnectorId() - returns a string with the id of the + * connector.
  • + *
  • getParentId([connectorId]) - returns a string with the id of + * the connector's parent. If connectorId is provided, the id of + * the parent of the corresponding connector with the passed id is returned + * instead.
  • + *
  • getElement([connectorId]) - returns the DOM Element that is + * the root of a connector's widget. null is returned if the + * connector can not be found or if the connector doesn't have a widget. If + * connectorId is not provided, the connector id of the current + * connector will be used.
  • + *
  • getState() - returns an object corresponding to the shared + * state defined on the server. The scheme for conversion between Java and + * JavaScript types is described bellow.
  • + *
  • registerRpc([name, ] rpcObject) - registers the + * rpcObject as a RPC handler. rpcObject should be an + * object with field containing functions for all eligible RPC functions. If + * name is provided, the RPC handler will only used for RPC calls + * for the RPC interface with the same fully qualified Java name. If no + * name is provided, the RPC handler will be used for all incoming + * RPC invocations where the RPC method name is defined as a function field in + * the handler. The scheme for conversion between Java types in the RPC + * interface definition and the JavaScript values passed as arguments to the + * handler functions is described bellow.
  • + *
  • getRpcProxy([name]) - returns an RPC proxy object. If + * name is provided, the proxy object will contain functions for + * all methods in the RPC interface with the same fully qualified name, provided + * a RPC handler has been registered by the server-side code. If no + * name is provided, the returned RPC proxy object will contain + * functions for all methods in all RPC interfaces registered for the connector + * on the server. If the same method name is present in multiple registered RPC + * interfaces, the corresponding function in the RPC proxy object will throw an + * exception when called. The scheme for conversion between Java types in the + * RPC interface and the JavaScript values that should be passed to the + * functions is described bellow.
  • + *
  • translateVaadinUri(uri) - Translates a Vaadin URI to a URL + * that can be used in the browser. This is just way of accessing + * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)} + *
  • + *
+ * The connector wrapper also supports these special functions: + *
    + *
  • onStateChange - If the JavaScript code assigns a function to + * the field, that function is called whenever the contents of the shared state + * is changed.
  • + *
  • Any field name corresponding to a call to + * {@link #addFunction(String, JavaScriptFunction)} on the server will + * automatically be present as a function that triggers the registered function + * on the server.
  • + *
  • Any field name referred to using {@link #callFunction(String, Object...)} + * on the server will be called if a function has been assigned to the field.
  • + *
+ *

+ * + * Values in the Shared State and in RPC calls are converted between Java and + * JavaScript using the following conventions: + *

    + *
  • Primitive Java numbers (byte, char, int, long, float, double) and their + * boxed types (Byte, Character, Integer, Long, Float, Double) are represented + * by JavaScript numbers.
  • + *
  • The primitive Java boolean and the boxed Boolean are represented by + * JavaScript booleans.
  • + *
  • Java Strings are represented by JavaScript strings.
  • + *
  • List, Set and all arrays in Java are represented by JavaScript arrays.
  • + *
  • Map in Java is represented by JavaScript object with fields + * corresponding to the map keys.
  • + *
  • Any other Java Map is represented by a JavaScript array containing two + * arrays, the first contains the keys and the second contains the values in the + * same order.
  • + *
  • A Java Bean is represented by a JavaScript object with fields + * corresponding to the bean's properties.
  • + *
  • A Java Connector is represented by a JavaScript string containing the + * connector's id.
  • + *
  • A pluggable serialization mechanism is provided for types not described + * here. Please refer to the documentation for specific types for serialization + * information.
  • + *
+ * + * @author Vaadin Ltd + * @since 7.0.0 + */ +public abstract class AbstractJavaScriptExtension extends AbstractExtension { + private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper( + this); + + @Override + protected void registerRpc(T implementation, Class rpcInterfaceType) { + super.registerRpc(implementation, rpcInterfaceType); + callbackHelper.registerRpc(rpcInterfaceType); + } + + /** + * Register a {@link JavaScriptFunction} that can be called from the + * JavaScript using the provided name. A JavaScript function with the + * provided name will be added to the connector wrapper object (initially + * available as this). Calling that JavaScript function will + * cause the call method in the registered {@link JavaScriptFunction} to be + * invoked with the same arguments. + * + * @param functionName + * the name that should be used for client-side callback + * @param function + * the {@link JavaScriptFunction} object that will be invoked + * when the JavaScript function is called + */ + protected void addFunction(String functionName, JavaScriptFunction function) { + callbackHelper.registerCallback(functionName, function); + } + + /** + * Invoke a named function that the connector JavaScript has added to the + * JavaScript connector wrapper object. The arguments should only contain + * data types that can be represented in JavaScript including primitives, + * their boxed types, arrays, String, List, Set, Map, Connector and + * JavaBeans. + * + * @param name + * the name of the function + * @param arguments + * function arguments + */ + protected void callFunction(String name, Object... arguments) { + callbackHelper.invokeCallback(name, arguments); + } + + @Override + protected JavaScriptExtensionState getState() { + return (JavaScriptExtensionState) super.getState(); + } +} diff --git a/server/src/com/vaadin/server/AbstractUIProvider.java b/server/src/com/vaadin/server/AbstractUIProvider.java new file mode 100644 index 0000000000..ba8e266eb2 --- /dev/null +++ b/server/src/com/vaadin/server/AbstractUIProvider.java @@ -0,0 +1,35 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.Application; +import com.vaadin.ui.UI; + +public abstract class AbstractUIProvider implements UIProvider { + + @Override + public UI instantiateUI(Application application, + Class type, WrappedRequest request) { + try { + return type.newInstance(); + } catch (InstantiationException e) { + throw new RuntimeException("Could not instantiate root class", e); + } catch (IllegalAccessException e) { + throw new RuntimeException("Could not access root class", e); + } + } +} diff --git a/server/src/com/vaadin/server/ApplicationResource.java b/server/src/com/vaadin/server/ApplicationResource.java new file mode 100644 index 0000000000..b18886ed55 --- /dev/null +++ b/server/src/com/vaadin/server/ApplicationResource.java @@ -0,0 +1,85 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +import com.vaadin.Application; + +/** + * This interface must be implemented by classes wishing to provide Application + * resources. + *

+ * ApplicationResource are a set of named resources (pictures, + * sounds, etc) associated with some specific application. Having named + * application resources provides a convenient method for having inter-theme + * common resources for an application. + *

+ * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface ApplicationResource extends Resource, Serializable { + + /** + * Default cache time. + */ + public static final long DEFAULT_CACHETIME = 1000 * 60 * 60 * 24; + + /** + * Gets resource as stream. + */ + public DownloadStream getStream(); + + /** + * Gets the application of the resource. + */ + public Application getApplication(); + + /** + * Gets the virtual filename for this resource. + * + * @return the file name associated to this resource. + */ + public String getFilename(); + + /** + * Gets the length of cache expiration time. + * + *

+ * This gives the adapter the possibility cache streams sent to the client. + * The caching may be made in adapter or at the client if the client + * supports caching. Default is DEFAULT_CACHETIME. + *

+ * + * @return Cache time in milliseconds + */ + public long getCacheTime(); + + /** + * Gets the size of the download buffer used for this resource. + * + *

+ * If the buffer size is 0, the buffer size is decided by the terminal + * adapter. The default value is 0. + *

+ * + * @return int the size of the buffer in bytes. + */ + public int getBufferSize(); + +} diff --git a/server/src/com/vaadin/server/ClassResource.java b/server/src/com/vaadin/server/ClassResource.java new file mode 100644 index 0000000000..4b4837faa3 --- /dev/null +++ b/server/src/com/vaadin/server/ClassResource.java @@ -0,0 +1,188 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +import com.vaadin.Application; +import com.vaadin.service.FileTypeResolver; + +/** + * ClassResource is a named resource accessed with the class + * loader. + * + * This can be used to access resources such as icons, files, etc. + * + * @see java.lang.Class#getResource(java.lang.String) + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class ClassResource implements ApplicationResource, Serializable { + + /** + * Default buffer size for this stream resource. + */ + private int bufferSize = 0; + + /** + * Default cache time for this stream resource. + */ + private long cacheTime = DEFAULT_CACHETIME; + + /** + * Associated class used for indetifying the source of the resource. + */ + private final Class associatedClass; + + /** + * Name of the resource is relative to the associated class. + */ + private final String resourceName; + + /** + * Application used for serving the class. + */ + private final Application application; + + /** + * Creates a new application resource instance. The resource id is relative + * to the location of the application class. + * + * @param resourceName + * the Unique identifier of the resource within the application. + * @param application + * the application this resource will be added to. + */ + public ClassResource(String resourceName, Application application) { + this(application.getClass(), resourceName, application); + } + + /** + * Creates a new application resource instance. + * + * @param associatedClass + * the class of the which the resource is associated. + * @param resourceName + * the Unique identifier of the resource within the application. + * @param application + * the application this resource will be added to. + */ + public ClassResource(Class associatedClass, String resourceName, + Application application) { + this.associatedClass = associatedClass; + this.resourceName = resourceName; + this.application = application; + if (resourceName == null || associatedClass == null) { + throw new NullPointerException(); + } + application.addResource(this); + } + + /** + * Gets the MIME type of this resource. + * + * @see com.vaadin.server.Resource#getMIMEType() + */ + @Override + public String getMIMEType() { + return FileTypeResolver.getMIMEType(resourceName); + } + + /** + * Gets the application of this resource. + * + * @see com.vaadin.server.ApplicationResource#getApplication() + */ + @Override + public Application getApplication() { + return application; + } + + /** + * Gets the virtual filename for this resource. + * + * @return the file name associated to this resource. + * @see com.vaadin.server.ApplicationResource#getFilename() + */ + @Override + public String getFilename() { + int index = 0; + int next = 0; + while ((next = resourceName.indexOf('/', index)) > 0 + && next + 1 < resourceName.length()) { + index = next + 1; + } + return resourceName.substring(index); + } + + /** + * Gets resource as stream. + * + * @see com.vaadin.server.ApplicationResource#getStream() + */ + @Override + public DownloadStream getStream() { + final DownloadStream ds = new DownloadStream( + associatedClass.getResourceAsStream(resourceName), + getMIMEType(), getFilename()); + ds.setBufferSize(getBufferSize()); + ds.setCacheTime(cacheTime); + return ds; + } + + /* documented in superclass */ + @Override + public int getBufferSize() { + return bufferSize; + } + + /** + * Sets the size of the download buffer used for this resource. + * + * @param bufferSize + * the size of the buffer in bytes. + */ + public void setBufferSize(int bufferSize) { + this.bufferSize = bufferSize; + } + + /* documented in superclass */ + @Override + public long getCacheTime() { + return cacheTime; + } + + /** + * Sets the length of cache expiration time. + * + *

+ * This gives the adapter the possibility cache streams sent to the client. + * The caching may be made in adapter or at the client if the client + * supports caching. Zero or negavive value disbales the caching of this + * stream. + *

+ * + * @param cacheTime + * the cache time in milliseconds. + * + */ + public void setCacheTime(long cacheTime) { + this.cacheTime = cacheTime; + } +} diff --git a/server/src/com/vaadin/server/CombinedRequest.java b/server/src/com/vaadin/server/CombinedRequest.java new file mode 100644 index 0000000000..a7a4040c35 --- /dev/null +++ b/server/src/com/vaadin/server/CombinedRequest.java @@ -0,0 +1,199 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.InputStream; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; + +import com.vaadin.Application; +import com.vaadin.external.json.JSONArray; +import com.vaadin.external.json.JSONException; +import com.vaadin.external.json.JSONObject; +import com.vaadin.terminal.gwt.server.WebApplicationContext; +import com.vaadin.terminal.gwt.server.WebBrowser; + +/** + * A {@link WrappedRequest} with path and parameters from one request and + * {@link WrappedRequest.BrowserDetails} extracted from another request. + * + * This class is intended to be used for a two request initialization where the + * first request fetches the actual application page and the second request + * contains information extracted from the browser using javascript. + * + */ +public class CombinedRequest implements WrappedRequest { + + private final WrappedRequest secondRequest; + private Map parameterMap; + + /** + * Creates a new combined request based on the second request and some + * details from the first request. + * + * @param secondRequest + * the second request which will be used as the foundation of the + * combined request + * @throws JSONException + * if the initialParams parameter can not be decoded + */ + public CombinedRequest(WrappedRequest secondRequest) throws JSONException { + this.secondRequest = secondRequest; + + HashMap map = new HashMap(); + JSONObject initialParams = new JSONObject( + secondRequest.getParameter("initialParams")); + for (Iterator keys = initialParams.keys(); keys.hasNext();) { + String name = (String) keys.next(); + JSONArray jsonValues = initialParams.getJSONArray(name); + String[] values = new String[jsonValues.length()]; + for (int i = 0; i < values.length; i++) { + values[i] = jsonValues.getString(i); + } + map.put(name, values); + } + + parameterMap = Collections.unmodifiableMap(map); + + } + + @Override + public String getParameter(String parameter) { + String[] strings = getParameterMap().get(parameter); + if (strings == null || strings.length == 0) { + return null; + } else { + return strings[0]; + } + } + + @Override + public Map getParameterMap() { + return parameterMap; + } + + @Override + public int getContentLength() { + return secondRequest.getContentLength(); + } + + @Override + public InputStream getInputStream() throws IOException { + return secondRequest.getInputStream(); + } + + @Override + public Object getAttribute(String name) { + return secondRequest.getAttribute(name); + } + + @Override + public void setAttribute(String name, Object value) { + secondRequest.setAttribute(name, value); + } + + @Override + public String getRequestPathInfo() { + return secondRequest.getParameter("initialPath"); + } + + @Override + public int getSessionMaxInactiveInterval() { + return secondRequest.getSessionMaxInactiveInterval(); + } + + @Override + public Object getSessionAttribute(String name) { + return secondRequest.getSessionAttribute(name); + } + + @Override + public void setSessionAttribute(String name, Object attribute) { + secondRequest.setSessionAttribute(name, attribute); + } + + @Override + public String getContentType() { + return secondRequest.getContentType(); + } + + @Override + public BrowserDetails getBrowserDetails() { + return new BrowserDetails() { + @Override + public String getUriFragment() { + String fragment = secondRequest.getParameter("fr"); + if (fragment == null) { + return ""; + } else { + return fragment; + } + } + + @Override + public String getWindowName() { + return secondRequest.getParameter("wn"); + } + + @Override + public WebBrowser getWebBrowser() { + WebApplicationContext context = (WebApplicationContext) Application + .getCurrent().getContext(); + return context.getBrowser(); + } + }; + } + + /** + * Gets the original second request. This can be used e.g. if a request + * parameter from the second request is required. + * + * @return the original second wrapped request + */ + public WrappedRequest getSecondRequest() { + return secondRequest; + } + + @Override + public Locale getLocale() { + return secondRequest.getLocale(); + } + + @Override + public String getRemoteAddr() { + return secondRequest.getRemoteAddr(); + } + + @Override + public boolean isSecure() { + return secondRequest.isSecure(); + } + + @Override + public String getHeader(String name) { + return secondRequest.getHeader(name); + } + + @Override + public DeploymentConfiguration getDeploymentConfiguration() { + return secondRequest.getDeploymentConfiguration(); + } +} diff --git a/server/src/com/vaadin/server/CompositeErrorMessage.java b/server/src/com/vaadin/server/CompositeErrorMessage.java new file mode 100644 index 0000000000..f51ba559eb --- /dev/null +++ b/server/src/com/vaadin/server/CompositeErrorMessage.java @@ -0,0 +1,122 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.util.Collection; +import java.util.Iterator; + +/** + * Class for combining multiple error messages together. + * + * @author Vaadin Ltd + * @since 3.0 + */ +@SuppressWarnings("serial") +public class CompositeErrorMessage extends AbstractErrorMessage { + + /** + * Constructor for CompositeErrorMessage. + * + * @param errorMessages + * the Array of error messages that are listed togeter. Nulls are + * ignored, but at least one message is required. + */ + public CompositeErrorMessage(ErrorMessage[] errorMessages) { + super(null); + setErrorLevel(ErrorLevel.INFORMATION); + + for (int i = 0; i < errorMessages.length; i++) { + addErrorMessage(errorMessages[i]); + } + + if (getCauses().size() == 0) { + throw new IllegalArgumentException( + "Composite error message must have at least one error"); + } + + } + + /** + * Constructor for CompositeErrorMessage. + * + * @param errorMessages + * the Collection of error messages that are listed together. At + * least one message is required. + */ + public CompositeErrorMessage( + Collection errorMessages) { + super(null); + setErrorLevel(ErrorLevel.INFORMATION); + + for (final Iterator i = errorMessages + .iterator(); i.hasNext();) { + addErrorMessage(i.next()); + } + + if (getCauses().size() == 0) { + throw new IllegalArgumentException( + "Composite error message must have at least one error"); + } + } + + /** + * Adds a error message into this composite message. Updates the level + * field. + * + * @param error + * the error message to be added. Duplicate errors are ignored. + */ + private void addErrorMessage(ErrorMessage error) { + if (error != null && !getCauses().contains(error)) { + addCause(error); + if (error.getErrorLevel().intValue() > getErrorLevel().intValue()) { + setErrorLevel(error.getErrorLevel()); + } + } + } + + /** + * Gets Error Iterator. + * + * @return the error iterator. + */ + public Iterator iterator() { + return getCauses().iterator(); + } + + /** + * Returns a comma separated list of the error messages. + * + * @return String, comma separated list of error messages. + */ + @Override + public String toString() { + String retval = "["; + int pos = 0; + for (final Iterator i = getCauses().iterator(); i + .hasNext();) { + if (pos > 0) { + retval += ","; + } + pos++; + retval += i.next().toString(); + } + retval += "]"; + + return retval; + } +} diff --git a/server/src/com/vaadin/server/DefaultUIProvider.java b/server/src/com/vaadin/server/DefaultUIProvider.java new file mode 100644 index 0000000000..913402c89f --- /dev/null +++ b/server/src/com/vaadin/server/DefaultUIProvider.java @@ -0,0 +1,51 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.Application; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.ui.UI; + +public class DefaultUIProvider extends AbstractUIProvider { + + @Override + public Class getUIClass(Application application, + WrappedRequest request) throws UIRequiresMoreInformationException { + Object uiClassNameObj = application + .getProperty(Application.UI_PARAMETER); + + if (uiClassNameObj instanceof String) { + String uiClassName = uiClassNameObj.toString(); + + ClassLoader classLoader = request.getDeploymentConfiguration() + .getClassLoader(); + if (classLoader == null) { + classLoader = getClass().getClassLoader(); + } + try { + Class uiClass = Class.forName(uiClassName, true, + classLoader).asSubclass(UI.class); + + return uiClass; + } catch (ClassNotFoundException e) { + throw new RuntimeException("Could not find UI class", e); + } + } + + return null; + } +} diff --git a/server/src/com/vaadin/server/DeploymentConfiguration.java b/server/src/com/vaadin/server/DeploymentConfiguration.java new file mode 100644 index 0000000000..d365c4ce18 --- /dev/null +++ b/server/src/com/vaadin/server/DeploymentConfiguration.java @@ -0,0 +1,188 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.util.Iterator; +import java.util.Properties; + +import javax.portlet.PortletContext; +import javax.servlet.ServletContext; + +import com.vaadin.service.ApplicationContext; +import com.vaadin.terminal.gwt.server.AddonContext; +import com.vaadin.terminal.gwt.server.AddonContextListener; + +/** + * Provide deployment specific settings that are required outside terminal + * specific code. + * + * @author Vaadin Ltd. + * + * @since 7.0 + */ +public interface DeploymentConfiguration extends Serializable { + + /** + * Gets the base URL of the location of Vaadin's static files. + * + * @param request + * the request for which the location should be determined + * + * @return a string with the base URL for static files + */ + public String getStaticFileLocation(WrappedRequest request); + + /** + * Gets the widgetset that is configured for this deployment, e.g. from a + * parameter in web.xml. + * + * @param request + * the request for which a widgetset is required + * @return the name of the widgetset + */ + public String getConfiguredWidgetset(WrappedRequest request); + + /** + * Gets the theme that is configured for this deployment, e.g. from a portal + * parameter or just some sensible default value. + * + * @param request + * the request for which a theme is required + * @return the name of the theme + */ + public String getConfiguredTheme(WrappedRequest request); + + /** + * Checks whether the Vaadin application will be rendered on its own in the + * browser or whether it will be included into some other context. A + * standalone application may do things that might interfere with other + * parts of a page, e.g. changing the page title and requesting focus upon + * loading. + * + * @param request + * the request for which the application is loaded + * @return a boolean indicating whether the application should be standalone + */ + public boolean isStandalone(WrappedRequest request); + + /** + * Gets a configured property. The properties are typically read from e.g. + * web.xml or from system properties of the JVM. + * + * @param propertyName + * The simple of the property, in some contexts, lookup might be + * performed using variations of the provided name. + * @param defaultValue + * the default value that should be used if no value has been + * defined + * @return the property value, or the passed default value if no property + * value is found + */ + public String getApplicationOrSystemProperty(String propertyName, + String defaultValue); + + /** + * Get the class loader to use for loading classes loaded by name, e.g. + * custom UI classes. null indicates that the default class + * loader should be used. + * + * @return the class loader to use, or null + */ + public ClassLoader getClassLoader(); + + /** + * Returns the MIME type of the specified file, or null if the MIME type is + * not known. The MIME type is determined by the configuration of the + * container, and may be specified in a deployment descriptor. Common MIME + * types are "text/html" and "image/gif". + * + * @param resourceName + * a String specifying the name of a file + * @return a String specifying the file's MIME type + * + * @see ServletContext#getMimeType(String) + * @see PortletContext#getMimeType(String) + */ + public String getMimeType(String resourceName); + + /** + * Gets the properties configured for the deployment, e.g. as init + * parameters to the servlet or portlet. + * + * @return properties for the application. + */ + public Properties getInitParameters(); + + public Iterator getAddonContextListeners(); + + public AddonContext getAddonContext(); + + public void setAddonContext(AddonContext vaadinContext); + + /** + * Returns whether Vaadin is in production mode. + * + * @since 7.0.0 + * + * @return true if in production mode, false otherwise. + */ + public boolean isProductionMode(); + + /** + * Returns whether cross-site request forgery protection is enabled. + * + * @since 7.0.0 + * + * @return true if XSRF protection is enabled, false otherwise. + */ + public boolean isXsrfProtectionEnabled(); + + /** + * Returns the time resources can be cached in the browsers, in seconds. + * + * @since 7.0.0 + * + * @return The resource cache time. + */ + public int getResourceCacheTime(); + + /** + * Returns the number of seconds between heartbeat requests of a UI, or a + * non-positive number if heartbeat is disabled. + * + * @since 7.0.0 + * + * @return The time between heartbeats. + */ + public int getHeartbeatInterval(); + + /** + * Returns whether UIs that have no other activity than heartbeat requests + * should be closed after they have been idle the maximum inactivity time + * enforced by the session. + * + * @see ApplicationContext#getMaxInactiveInterval() + * + * @since 7.0.0 + * + * @return True if UIs receiving only heartbeat requests are eventually + * closed; false if heartbeat requests extend UI lifetime + * indefinitely. + */ + public boolean isIdleUICleanupEnabled(); +} diff --git a/server/src/com/vaadin/server/DownloadStream.java b/server/src/com/vaadin/server/DownloadStream.java new file mode 100644 index 0000000000..5d3b083f1e --- /dev/null +++ b/server/src/com/vaadin/server/DownloadStream.java @@ -0,0 +1,345 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.io.Serializable; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import javax.servlet.http.HttpServletResponse; + +import com.vaadin.terminal.gwt.server.Constants; + +/** + * Downloadable stream. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class DownloadStream implements Serializable { + + /** + * Maximum cache time. + */ + public static final long MAX_CACHETIME = Long.MAX_VALUE; + + /** + * Default cache time. + */ + public static final long DEFAULT_CACHETIME = 1000 * 60 * 60 * 24; + + private InputStream stream; + + private String contentType; + + private String fileName; + + private Map params; + + private long cacheTime = DEFAULT_CACHETIME; + + private int bufferSize = 0; + + /** + * Creates a new instance of DownloadStream. + */ + public DownloadStream(InputStream stream, String contentType, + String fileName) { + setStream(stream); + setContentType(contentType); + setFileName(fileName); + } + + /** + * Gets downloadable stream. + * + * @return output stream. + */ + public InputStream getStream() { + return stream; + } + + /** + * Sets the stream. + * + * @param stream + * The stream to set + */ + public void setStream(InputStream stream) { + this.stream = stream; + } + + /** + * Gets stream content type. + * + * @return type of the stream content. + */ + public String getContentType() { + return contentType; + } + + /** + * Sets stream content type. + * + * @param contentType + * the contentType to set + */ + public void setContentType(String contentType) { + this.contentType = contentType; + } + + /** + * Returns the file name. + * + * @return the name of the file. + */ + public String getFileName() { + return fileName; + } + + /** + * Sets the file name. + * + * @param fileName + * the file name to set. + */ + public void setFileName(String fileName) { + this.fileName = fileName; + } + + /** + * Sets a paramater for download stream. Parameters are optional information + * about the downloadable stream and their meaning depends on the used + * adapter. For example in WebAdapter they are interpreted as HTTP response + * headers. + * + * If the parameters by this name exists, the old value is replaced. + * + * @param name + * the Name of the parameter to set. + * @param value + * the Value of the parameter to set. + */ + public void setParameter(String name, String value) { + if (params == null) { + params = new HashMap(); + } + params.put(name, value); + } + + /** + * Gets a paramater for download stream. Parameters are optional information + * about the downloadable stream and their meaning depends on the used + * adapter. For example in WebAdapter they are interpreted as HTTP response + * headers. + * + * @param name + * the Name of the parameter to set. + * @return Value of the parameter or null if the parameter does not exist. + */ + public String getParameter(String name) { + if (params != null) { + return params.get(name); + } + return null; + } + + /** + * Gets the names of the parameters. + * + * @return Iterator of names or null if no parameters are set. + */ + public Iterator getParameterNames() { + if (params != null) { + return params.keySet().iterator(); + } + return null; + } + + /** + * Gets length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Default is + * DEFAULT_CACHETIME. + * + * @return Cache time in milliseconds + */ + public long getCacheTime() { + return cacheTime; + } + + /** + * Sets length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Zero or negavive + * value disbales the caching of this stream. + * + * @param cacheTime + * the cache time in milliseconds. + */ + public void setCacheTime(long cacheTime) { + this.cacheTime = cacheTime; + } + + /** + * Gets the size of the download buffer. + * + * @return int The size of the buffer in bytes. + */ + public int getBufferSize() { + return bufferSize; + } + + /** + * Sets the size of the download buffer. + * + * @param bufferSize + * the size of the buffer in bytes. + * + * @since 7.0 + */ + public void setBufferSize(int bufferSize) { + this.bufferSize = bufferSize; + } + + /** + * Writes this download stream to a wrapped response. This takes care of + * setting response headers according to what is defined in this download + * stream ({@link #getContentType()}, {@link #getCacheTime()}, + * {@link #getFileName()}) and transferring the data from the stream ( + * {@link #getStream()}) to the response. Defined parameters ( + * {@link #getParameterNames()}) are also included as headers in the + * response. If there's is a parameter named Location, a + * redirect (302 Moved temporarily) is sent instead of the contents of this + * stream. + * + * @param response + * the wrapped response to write this download stream to + * @throws IOException + * passed through from the wrapped response + * + * @since 7.0 + */ + public void writeTo(WrappedResponse response) throws IOException { + if (getParameter("Location") != null) { + response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); + response.setHeader("Location", getParameter("Location")); + return; + } + + // Download from given stream + final InputStream data = getStream(); + if (data != null) { + + OutputStream out = null; + try { + // Sets content type + response.setContentType(getContentType()); + + // Sets cache headers + response.setCacheTime(getCacheTime()); + + // Copy download stream parameters directly + // to HTTP headers. + final Iterator i = getParameterNames(); + if (i != null) { + while (i.hasNext()) { + final String param = i.next(); + response.setHeader(param, getParameter(param)); + } + } + + // suggest local filename from DownloadStream if + // Content-Disposition + // not explicitly set + String contentDispositionValue = getParameter("Content-Disposition"); + if (contentDispositionValue == null) { + contentDispositionValue = "filename=\"" + getFileName() + + "\""; + response.setHeader("Content-Disposition", + contentDispositionValue); + } + + int bufferSize = getBufferSize(); + if (bufferSize <= 0 || bufferSize > Constants.MAX_BUFFER_SIZE) { + bufferSize = Constants.DEFAULT_BUFFER_SIZE; + } + final byte[] buffer = new byte[bufferSize]; + int bytesRead = 0; + + out = response.getOutputStream(); + + long totalWritten = 0; + while ((bytesRead = data.read(buffer)) > 0) { + out.write(buffer, 0, bytesRead); + + totalWritten += bytesRead; + if (totalWritten >= buffer.length) { + // Avoid chunked encoding for small resources + out.flush(); + } + } + } finally { + tryToCloseStream(out); + tryToCloseStream(data); + } + } + } + + /** + * Helper method that tries to close an output stream and ignores any + * exceptions. + * + * @param out + * the output stream to close, null is also + * supported + */ + static void tryToCloseStream(OutputStream out) { + try { + // try to close output stream (e.g. file handle) + if (out != null) { + out.close(); + } + } catch (IOException e1) { + // NOP + } + } + + /** + * Helper method that tries to close an input stream and ignores any + * exceptions. + * + * @param in + * the input stream to close, null is also supported + */ + static void tryToCloseStream(InputStream in) { + try { + // try to close output stream (e.g. file handle) + if (in != null) { + in.close(); + } + } catch (IOException e1) { + // NOP + } + } + +} diff --git a/server/src/com/vaadin/server/ErrorMessage.java b/server/src/com/vaadin/server/ErrorMessage.java new file mode 100644 index 0000000000..fcc481e826 --- /dev/null +++ b/server/src/com/vaadin/server/ErrorMessage.java @@ -0,0 +1,136 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + * Interface for rendering error messages to terminal. All the visible errors + * shown to user must implement this interface. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface ErrorMessage extends Serializable { + + public enum ErrorLevel { + /** + * Error code for informational messages. + */ + INFORMATION("info", 0), + /** + * Error code for warning messages. + */ + WARNING("warning", 1), + /** + * Error code for regular error messages. + */ + ERROR("error", 2), + /** + * Error code for critical error messages. + */ + CRITICAL("critical", 3), + /** + * Error code for system errors and bugs. + */ + SYSTEMERROR("system", 4); + + String text; + int errorLevel; + + private ErrorLevel(String text, int errorLevel) { + this.text = text; + this.errorLevel = errorLevel; + } + + /** + * Textual representation for server-client communication of level + * + * @return String for error severity + */ + public String getText() { + return text; + } + + /** + * Integer representation of error severity for comparison + * + * @return integer for error severity + */ + public int intValue() { + return errorLevel; + } + + @Override + public String toString() { + return text; + } + + } + + /** + * @deprecated from 7.0, use {@link ErrorLevel#SYSTEMERROR} instead     + */ + @Deprecated + public static final ErrorLevel SYSTEMERROR = ErrorLevel.SYSTEMERROR; + + /** + * @deprecated from 7.0, use {@link ErrorLevel#CRITICAL} instead     + */ + @Deprecated + public static final ErrorLevel CRITICAL = ErrorLevel.CRITICAL; + + /** + * @deprecated from 7.0, use {@link ErrorLevel#ERROR} instead     + */ + + @Deprecated + public static final ErrorLevel ERROR = ErrorLevel.ERROR; + + /** + * @deprecated from 7.0, use {@link ErrorLevel#WARNING} instead     + */ + @Deprecated + public static final ErrorLevel WARNING = ErrorLevel.WARNING; + + /** + * @deprecated from 7.0, use {@link ErrorLevel#INFORMATION} instead     + */ + @Deprecated + public static final ErrorLevel INFORMATION = ErrorLevel.INFORMATION; + + /** + * Gets the errors level. + * + * @return the level of error as an integer. + */ + public ErrorLevel getErrorLevel(); + + /** + * Returns the HTML formatted message to show in as the error message on the + * client. + * + * This method should perform any necessary escaping to avoid XSS attacks. + * + * TODO this API may still change to use a separate data transfer object + * + * @return HTML formatted string for the error message + * @since 7.0 + */ + public String getFormattedHtmlMessage(); + +} diff --git a/server/src/com/vaadin/server/Extension.java b/server/src/com/vaadin/server/Extension.java new file mode 100644 index 0000000000..cf0dad5d1a --- /dev/null +++ b/server/src/com/vaadin/server/Extension.java @@ -0,0 +1,38 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.terminal.gwt.server.ClientConnector; + +/** + * An extension is an entity that is attached to a Component or another + * Extension and independently communicates between client and server. + *

+ * An extension can only be attached once. It is not supported to move an + * extension from one target to another. + *

+ * Extensions can use shared state and RPC in the same way as components. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +public interface Extension extends ClientConnector { + /* + * Currently just an empty marker interface to distinguish between + * extensions and other connectors, e.g. components + */ +} diff --git a/server/src/com/vaadin/server/ExternalResource.java b/server/src/com/vaadin/server/ExternalResource.java new file mode 100644 index 0000000000..925b0589f3 --- /dev/null +++ b/server/src/com/vaadin/server/ExternalResource.java @@ -0,0 +1,128 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.net.URL; + +import com.vaadin.service.FileTypeResolver; + +/** + * ExternalResource implements source for resources fetched from + * location specified by URL:s. The resources are fetched directly by the client + * terminal and are not fetched trough the terminal adapter. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class ExternalResource implements Resource, Serializable { + + /** + * Url of the download. + */ + private String sourceURL = null; + + /** + * MIME Type for the resource + */ + private String mimeType = null; + + /** + * Creates a new download component for downloading directly from given URL. + * + * @param sourceURL + * the source URL. + */ + public ExternalResource(URL sourceURL) { + if (sourceURL == null) { + throw new RuntimeException("Source must be non-null"); + } + + this.sourceURL = sourceURL.toString(); + } + + /** + * Creates a new download component for downloading directly from given URL. + * + * @param sourceURL + * the source URL. + * @param mimeType + * the MIME Type + */ + public ExternalResource(URL sourceURL, String mimeType) { + this(sourceURL); + this.mimeType = mimeType; + } + + /** + * Creates a new download component for downloading directly from given URL. + * + * @param sourceURL + * the source URL. + */ + public ExternalResource(String sourceURL) { + if (sourceURL == null) { + throw new RuntimeException("Source must be non-null"); + } + + this.sourceURL = sourceURL.toString(); + } + + /** + * Creates a new download component for downloading directly from given URL. + * + * @param sourceURL + * the source URL. + * @param mimeType + * the MIME Type + */ + public ExternalResource(String sourceURL, String mimeType) { + this(sourceURL); + this.mimeType = mimeType; + } + + /** + * Gets the URL of the external resource. + * + * @return the URL of the external resource. + */ + public String getURL() { + return sourceURL; + } + + /** + * Gets the MIME type of the resource. + * + * @see com.vaadin.server.Resource#getMIMEType() + */ + @Override + public String getMIMEType() { + if (mimeType == null) { + mimeType = FileTypeResolver.getMIMEType(getURL().toString()); + } + return mimeType; + } + + /** + * Sets the MIME type of the resource. + */ + public void setMIMEType(String mimeType) { + this.mimeType = mimeType; + } + +} diff --git a/server/src/com/vaadin/server/FileResource.java b/server/src/com/vaadin/server/FileResource.java new file mode 100644 index 0000000000..7b3f338b4f --- /dev/null +++ b/server/src/com/vaadin/server/FileResource.java @@ -0,0 +1,184 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import com.vaadin.Application; +import com.vaadin.server.Terminal.ErrorEvent; +import com.vaadin.service.FileTypeResolver; + +/** + * FileResources are files or directories on local filesystem. The + * files and directories are served through URI:s to the client terminal and + * thus must be registered to an URI context before they can be used. The + * resource is automatically registered to the application when it is created. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class FileResource implements ApplicationResource { + + /** + * Default buffer size for this stream resource. + */ + private int bufferSize = 0; + + /** + * File where the downloaded content is fetched from. + */ + private File sourceFile; + + /** + * Application. + */ + private final Application application; + + /** + * Default cache time for this stream resource. + */ + private long cacheTime = DownloadStream.DEFAULT_CACHETIME; + + /** + * Creates a new file resource for providing given file for client + * terminals. + */ + public FileResource(File sourceFile, Application application) { + this.application = application; + setSourceFile(sourceFile); + application.addResource(this); + } + + /** + * Gets the resource as stream. + * + * @see com.vaadin.server.ApplicationResource#getStream() + */ + @Override + public DownloadStream getStream() { + try { + final DownloadStream ds = new DownloadStream(new FileInputStream( + sourceFile), getMIMEType(), getFilename()); + ds.setParameter("Content-Length", + String.valueOf(sourceFile.length())); + + ds.setCacheTime(cacheTime); + return ds; + } catch (final FileNotFoundException e) { + // Log the exception using the application error handler + getApplication().getErrorHandler().terminalError(new ErrorEvent() { + + @Override + public Throwable getThrowable() { + return e; + } + + }); + + return null; + } + } + + /** + * Gets the source file. + * + * @return the source File. + */ + public File getSourceFile() { + return sourceFile; + } + + /** + * Sets the source file. + * + * @param sourceFile + * the source file to set. + */ + public void setSourceFile(File sourceFile) { + this.sourceFile = sourceFile; + } + + /** + * @see com.vaadin.server.ApplicationResource#getApplication() + */ + @Override + public Application getApplication() { + return application; + } + + /** + * @see com.vaadin.server.ApplicationResource#getFilename() + */ + @Override + public String getFilename() { + return sourceFile.getName(); + } + + /** + * @see com.vaadin.server.Resource#getMIMEType() + */ + @Override + public String getMIMEType() { + return FileTypeResolver.getMIMEType(sourceFile); + } + + /** + * Gets the length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Default is + * DownloadStream.DEFAULT_CACHETIME. + * + * @return Cache time in milliseconds. + */ + @Override + public long getCacheTime() { + return cacheTime; + } + + /** + * Sets the length of cache expiration time. This gives the adapter the + * possibility cache streams sent to the client. The caching may be made in + * adapter or at the client if the client supports caching. Zero or negavive + * value disbales the caching of this stream. + * + * @param cacheTime + * the cache time in milliseconds. + */ + public void setCacheTime(long cacheTime) { + this.cacheTime = cacheTime; + } + + /* documented in superclass */ + @Override + public int getBufferSize() { + return bufferSize; + } + + /** + * Sets the size of the download buffer used for this resource. + * + * @param bufferSize + * the size of the buffer in bytes. + */ + public void setBufferSize(int bufferSize) { + this.bufferSize = bufferSize; + } + +} diff --git a/server/src/com/vaadin/server/JavaScriptCallbackHelper.java b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java new file mode 100644 index 0000000000..19b19ce824 --- /dev/null +++ b/server/src/com/vaadin/server/JavaScriptCallbackHelper.java @@ -0,0 +1,122 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import com.vaadin.external.json.JSONArray; +import com.vaadin.external.json.JSONException; +import com.vaadin.shared.JavaScriptConnectorState; +import com.vaadin.tools.ReflectTools; +import com.vaadin.ui.AbstractJavaScriptComponent; +import com.vaadin.ui.JavaScript.JavaScriptCallbackRpc; +import com.vaadin.ui.JavaScriptFunction; + +/** + * Internal helper class used to implement functionality common to + * {@link AbstractJavaScriptComponent} and {@link AbstractJavaScriptExtension}. + * Corresponding support in client-side code is in + * {@link com.vaadin.client.JavaScriptConnectorHelper}. + *

+ * You should most likely no use this class directly. + * + * @author Vaadin Ltd + * @since 7.0.0 + */ +public class JavaScriptCallbackHelper implements Serializable { + + private static final Method CALL_METHOD = ReflectTools.findMethod( + JavaScriptCallbackRpc.class, "call", String.class, JSONArray.class); + private AbstractClientConnector connector; + + private Map callbacks = new HashMap(); + private JavaScriptCallbackRpc javascriptCallbackRpc; + + public JavaScriptCallbackHelper(AbstractClientConnector connector) { + this.connector = connector; + } + + public void registerCallback(String functionName, + JavaScriptFunction javaScriptCallback) { + callbacks.put(functionName, javaScriptCallback); + JavaScriptConnectorState state = getConnectorState(); + state.getCallbackNames().add(functionName); + ensureRpc(); + } + + private JavaScriptConnectorState getConnectorState() { + JavaScriptConnectorState state = (JavaScriptConnectorState) connector + .getState(); + return state; + } + + private void ensureRpc() { + if (javascriptCallbackRpc == null) { + javascriptCallbackRpc = new JavaScriptCallbackRpc() { + @Override + public void call(String name, JSONArray arguments) { + JavaScriptFunction callback = callbacks.get(name); + try { + callback.call(arguments); + } catch (JSONException e) { + throw new IllegalArgumentException(e); + } + } + }; + connector.registerRpc(javascriptCallbackRpc); + } + } + + public void invokeCallback(String name, Object... arguments) { + if (callbacks.containsKey(name)) { + throw new IllegalStateException( + "Can't call callback " + + name + + " on the client because a callback with the same name is registered on the server."); + } + JSONArray args = new JSONArray(Arrays.asList(arguments)); + connector.addMethodInvocationToQueue( + JavaScriptCallbackRpc.class.getName(), CALL_METHOD, + new Object[] { name, args }); + } + + public void registerRpc(Class rpcInterfaceType) { + if (rpcInterfaceType == JavaScriptCallbackRpc.class) { + // Ignore + return; + } + Map> rpcInterfaces = getConnectorState() + .getRpcInterfaces(); + String interfaceName = rpcInterfaceType.getName(); + if (!rpcInterfaces.containsKey(interfaceName)) { + Set methodNames = new HashSet(); + + for (Method method : rpcInterfaceType.getMethods()) { + methodNames.add(method.getName()); + } + + rpcInterfaces.put(interfaceName, methodNames); + } + } + +} diff --git a/server/src/com/vaadin/server/KeyMapper.java b/server/src/com/vaadin/server/KeyMapper.java new file mode 100644 index 0000000000..86714cfc66 --- /dev/null +++ b/server/src/com/vaadin/server/KeyMapper.java @@ -0,0 +1,96 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.util.HashMap; + +/** + * KeyMapper is the simple two-way map for generating textual keys + * for objects and retrieving the objects later with the key. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +public class KeyMapper implements Serializable { + + private int lastKey = 0; + + private final HashMap objectKeyMap = new HashMap(); + + private final HashMap keyObjectMap = new HashMap(); + + /** + * Gets key for an object. + * + * @param o + * the object. + */ + public String key(V o) { + + if (o == null) { + return "null"; + } + + // If the object is already mapped, use existing key + String key = objectKeyMap.get(o); + if (key != null) { + return key; + } + + // If the object is not yet mapped, map it + key = String.valueOf(++lastKey); + objectKeyMap.put(o, key); + keyObjectMap.put(key, o); + + return key; + } + + /** + * Retrieves object with the key. + * + * @param key + * the name with the desired value. + * @return the object with the key. + */ + public V get(String key) { + return keyObjectMap.get(key); + } + + /** + * Removes object from the mapper. + * + * @param removeobj + * the object to be removed. + */ + public void remove(V removeobj) { + final String key = objectKeyMap.get(removeobj); + + if (key != null) { + objectKeyMap.remove(removeobj); + keyObjectMap.remove(key); + } + } + + /** + * Removes all objects from the mapper. + */ + public void removeAll() { + objectKeyMap.clear(); + keyObjectMap.clear(); + } +} diff --git a/server/src/com/vaadin/server/LegacyPaint.java b/server/src/com/vaadin/server/LegacyPaint.java new file mode 100644 index 0000000000..a5e16bb24b --- /dev/null +++ b/server/src/com/vaadin/server/LegacyPaint.java @@ -0,0 +1,97 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server; + +import java.io.Serializable; + +import com.vaadin.server.PaintTarget.PaintStatus; +import com.vaadin.ui.Component; +import com.vaadin.ui.HasComponents; + +public class LegacyPaint implements Serializable { + /** + * + *

+ * Paints the Paintable into a UIDL stream. This method creates the UIDL + * sequence describing it and outputs it to the given UIDL stream. + *

+ * + *

+ * It is called when the contents of the component should be painted in + * response to the component first being shown or having been altered so + * that its visual representation is changed. + *

+ * + *

+ * Do not override this to paint your component. Override + * {@link #paintContent(PaintTarget)} instead. + *

+ * + * + * @param target + * the target UIDL stream where the component should paint itself + * to. + * @throws PaintException + * if the paint operation failed. + */ + public static void paint(Component component, PaintTarget target) + throws PaintException { + // Only paint content of visible components. + if (!isVisibleInContext(component)) { + return; + } + + final String tag = target.getTag(component); + final PaintStatus status = target.startPaintable(component, tag); + if (PaintStatus.CACHED == status) { + // nothing to do but flag as cached and close the paintable tag + target.addAttribute("cached", true); + } else { + // Paint the contents of the component + if (component instanceof Vaadin6Component) { + ((Vaadin6Component) component).paintContent(target); + } + + } + target.endPaintable(component); + + } + + /** + * Checks if the component is visible and its parent is visible, + * recursively. + *

+ * This is only a helper until paint is moved away from this class. + * + * @return + */ + protected static boolean isVisibleInContext(Component c) { + HasComponents p = c.getParent(); + while (p != null) { + if (!p.isVisible()) { + return false; + } + p = p.getParent(); + } + if (c.getParent() != null && !c.getParent().isComponentVisible(c)) { + return false; + } + + // All parents visible, return this state + return c.isVisible(); + } + +} diff --git a/server/src/com/vaadin/server/Page.java b/server/src/com/vaadin/server/Page.java new file mode 100644 index 0000000000..4cb9a1291e --- /dev/null +++ b/server/src/com/vaadin/server/Page.java @@ -0,0 +1,653 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.lang.reflect.Method; +import java.util.EventObject; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; + +import com.vaadin.event.EventRouter; +import com.vaadin.server.WrappedRequest.BrowserDetails; +import com.vaadin.shared.ui.BorderStyle; +import com.vaadin.shared.ui.ui.PageClientRpc; +import com.vaadin.shared.ui.ui.UIConstants; +import com.vaadin.terminal.gwt.server.WebApplicationContext; +import com.vaadin.terminal.gwt.server.WebBrowser; +import com.vaadin.tools.ReflectTools; +import com.vaadin.ui.JavaScript; +import com.vaadin.ui.Notification; +import com.vaadin.ui.UI; + +public class Page implements Serializable { + + /** + * Listener that gets notified when the size of the browser window + * containing the uI has changed. + * + * @see UI#addListener(BrowserWindowResizeListener) + */ + public interface BrowserWindowResizeListener extends Serializable { + /** + * Invoked when the browser window containing a UI has been resized. + * + * @param event + * a browser window resize event + */ + public void browserWindowResized(BrowserWindowResizeEvent event); + } + + /** + * Event that is fired when a browser window containing a uI is resized. + */ + public class BrowserWindowResizeEvent extends EventObject { + + private final int width; + private final int height; + + /** + * Creates a new event + * + * @param source + * the uI for which the browser window has been resized + * @param width + * the new width of the browser window + * @param height + * the new height of the browser window + */ + public BrowserWindowResizeEvent(Page source, int width, int height) { + super(source); + this.width = width; + this.height = height; + } + + @Override + public Page getSource() { + return (Page) super.getSource(); + } + + /** + * Gets the new browser window height + * + * @return an integer with the new pixel height of the browser window + */ + public int getHeight() { + return height; + } + + /** + * Gets the new browser window width + * + * @return an integer with the new pixel width of the browser window + */ + public int getWidth() { + return width; + } + } + + /** + * Private class for storing properties related to opening resources. + */ + private class OpenResource implements Serializable { + + /** + * The resource to open + */ + private final Resource resource; + + /** + * The name of the target window + */ + private final String name; + + /** + * The width of the target window + */ + private final int width; + + /** + * The height of the target window + */ + private final int height; + + /** + * The border style of the target window + */ + private final BorderStyle border; + + /** + * Creates a new open resource. + * + * @param resource + * The resource to open + * @param name + * The name of the target window + * @param width + * The width of the target window + * @param height + * The height of the target window + * @param border + * The border style of the target window + */ + private OpenResource(Resource resource, String name, int width, + int height, BorderStyle border) { + this.resource = resource; + this.name = name; + this.width = width; + this.height = height; + this.border = border; + } + + /** + * Paints the open request. Should be painted inside the window. + * + * @param target + * the paint target + * @throws PaintException + * if the paint operation fails + */ + private void paintContent(PaintTarget target) throws PaintException { + target.startTag("open"); + target.addAttribute("src", resource); + if (name != null && name.length() > 0) { + target.addAttribute("name", name); + } + if (width >= 0) { + target.addAttribute("width", width); + } + if (height >= 0) { + target.addAttribute("height", height); + } + switch (border) { + case MINIMAL: + target.addAttribute("border", "minimal"); + break; + case NONE: + target.addAttribute("border", "none"); + break; + } + + target.endTag("open"); + } + } + + private static final Method BROWSWER_RESIZE_METHOD = ReflectTools + .findMethod(BrowserWindowResizeListener.class, + "browserWindowResized", BrowserWindowResizeEvent.class); + + /** + * A border style used for opening resources in a window without a border. + */ + @Deprecated + public static final BorderStyle BORDER_NONE = BorderStyle.NONE; + + /** + * A border style used for opening resources in a window with a minimal + * border. + */ + public static final BorderStyle BORDER_MINIMAL = BorderStyle.MINIMAL; + + /** + * A border style that indicates that the default border style should be + * used when opening resources. + */ + public static final BorderStyle BORDER_DEFAULT = BorderStyle.DEFAULT; + + /** + * Listener that listens changes in URI fragment. + */ + public interface FragmentChangedListener extends Serializable { + public void fragmentChanged(FragmentChangedEvent event); + } + + private static final Method FRAGMENT_CHANGED_METHOD = ReflectTools + .findMethod(Page.FragmentChangedListener.class, "fragmentChanged", + FragmentChangedEvent.class); + + /** + * Resources to be opened automatically on next repaint. The list is + * automatically cleared when it has been sent to the client. + */ + private final LinkedList openList = new LinkedList(); + + /** + * A list of notifications that are waiting to be sent to the client. + * Cleared (set to null) when the notifications have been sent. + */ + private List notifications; + + /** + * Event fired when uri fragment changes. + */ + public class FragmentChangedEvent extends EventObject { + + /** + * The new uri fragment + */ + private final String fragment; + + /** + * Creates a new instance of UriFragmentReader change event. + * + * @param source + * the Source of the event. + */ + public FragmentChangedEvent(Page source, String fragment) { + super(source); + this.fragment = fragment; + } + + /** + * Gets the uI in which the fragment has changed. + * + * @return the uI in which the fragment has changed + */ + public Page getPage() { + return (Page) getSource(); + } + + /** + * Get the new fragment + * + * @return the new fragment + */ + public String getFragment() { + return fragment; + } + } + + private EventRouter eventRouter; + + /** + * The current URI fragment. + */ + private String fragment; + + private final UI uI; + + private int browserWindowWidth = -1; + private int browserWindowHeight = -1; + + private JavaScript javaScript; + + public Page(UI uI) { + this.uI = uI; + } + + private void addListener(Class eventType, Object target, Method method) { + if (eventRouter == null) { + eventRouter = new EventRouter(); + } + eventRouter.addListener(eventType, target, method); + } + + private void removeListener(Class eventType, Object target, Method method) { + if (eventRouter != null) { + eventRouter.removeListener(eventType, target, method); + } + } + + public void addListener(Page.FragmentChangedListener listener) { + addListener(FragmentChangedEvent.class, listener, + FRAGMENT_CHANGED_METHOD); + } + + public void removeListener(Page.FragmentChangedListener listener) { + removeListener(FragmentChangedEvent.class, listener, + FRAGMENT_CHANGED_METHOD); + } + + /** + * Sets URI fragment. Optionally fires a {@link FragmentChangedEvent} + * + * @param newFragment + * id of the new fragment + * @param fireEvent + * true to fire event + * @see FragmentChangedEvent + * @see Page.FragmentChangedListener + */ + public void setFragment(String newFragment, boolean fireEvents) { + if (newFragment == null) { + throw new NullPointerException("The fragment may not be null"); + } + if (!newFragment.equals(fragment)) { + fragment = newFragment; + if (fireEvents) { + fireEvent(new FragmentChangedEvent(this, newFragment)); + } + uI.markAsDirty(); + } + } + + private void fireEvent(EventObject event) { + if (eventRouter != null) { + eventRouter.fireEvent(event); + } + } + + /** + * Sets URI fragment. This method fires a {@link FragmentChangedEvent} + * + * @param newFragment + * id of the new fragment + * @see FragmentChangedEvent + * @see Page.FragmentChangedListener + */ + public void setFragment(String newFragment) { + setFragment(newFragment, true); + } + + /** + * Gets currently set URI fragment. + *

+ * To listen changes in fragment, hook a + * {@link Page.FragmentChangedListener}. + * + * @return the current fragment in browser uri or null if not known + */ + public String getFragment() { + return fragment; + } + + public void init(WrappedRequest request) { + BrowserDetails browserDetails = request.getBrowserDetails(); + if (browserDetails != null) { + fragment = browserDetails.getUriFragment(); + } + } + + public WebBrowser getWebBrowser() { + return ((WebApplicationContext) uI.getApplication().getContext()) + .getBrowser(); + } + + public void setBrowserWindowSize(int width, int height) { + boolean fireEvent = false; + + if (width != browserWindowWidth) { + browserWindowWidth = width; + fireEvent = true; + } + + if (height != browserWindowHeight) { + browserWindowHeight = height; + fireEvent = true; + } + + if (fireEvent) { + fireEvent(new BrowserWindowResizeEvent(this, browserWindowWidth, + browserWindowHeight)); + } + + } + + /** + * Adds a new {@link BrowserWindowResizeListener} to this uI. The listener + * will be notified whenever the browser window within which this uI + * resides is resized. + * + * @param resizeListener + * the listener to add + * + * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) + * @see #setResizeLazy(boolean) + */ + public void addListener(BrowserWindowResizeListener resizeListener) { + addListener(BrowserWindowResizeEvent.class, resizeListener, + BROWSWER_RESIZE_METHOD); + } + + /** + * Removes a {@link BrowserWindowResizeListener} from this uI. The + * listener will no longer be notified when the browser window is resized. + * + * @param resizeListener + * the listener to remove + */ + public void removeListener(BrowserWindowResizeListener resizeListener) { + removeListener(BrowserWindowResizeEvent.class, resizeListener, + BROWSWER_RESIZE_METHOD); + } + + /** + * Gets the last known height of the browser window in which this uI + * resides. + * + * @return the browser window height in pixels + */ + public int getBrowserWindowHeight() { + return browserWindowHeight; + } + + /** + * Gets the last known width of the browser window in which this uI + * resides. + * + * @return the browser window width in pixels + */ + public int getBrowserWindowWidth() { + return browserWindowWidth; + } + + public JavaScript getJavaScript() { + if (javaScript == null) { + // Create and attach on first use + javaScript = new JavaScript(); + javaScript.extend(uI); + } + + return javaScript; + } + + public void paintContent(PaintTarget target) throws PaintException { + if (!openList.isEmpty()) { + for (final Iterator i = openList.iterator(); i + .hasNext();) { + (i.next()).paintContent(target); + } + openList.clear(); + } + + // Paint notifications + if (notifications != null) { + target.startTag("notifications"); + for (final Iterator it = notifications.iterator(); it + .hasNext();) { + final Notification n = it.next(); + target.startTag("notification"); + if (n.getCaption() != null) { + target.addAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION, + n.getCaption()); + } + if (n.getDescription() != null) { + target.addAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, + n.getDescription()); + } + if (n.getIcon() != null) { + target.addAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_ICON, + n.getIcon()); + } + if (!n.isHtmlContentAllowed()) { + target.addAttribute( + UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, + true); + } + target.addAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, n + .getPosition().ordinal()); + target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY, + n.getDelayMsec()); + if (n.getStyleName() != null) { + target.addAttribute( + UIConstants.ATTRIBUTE_NOTIFICATION_STYLE, + n.getStyleName()); + } + target.endTag("notification"); + } + target.endTag("notifications"); + notifications = null; + } + + if (fragment != null) { + target.addAttribute(UIConstants.FRAGMENT_VARIABLE, fragment); + } + + } + + /** + * Opens the given resource in this uI. The contents of this UI is + * replaced by the {@code Resource}. + * + * @param resource + * the resource to show in this uI + */ + public void open(Resource resource) { + openList.add(new OpenResource(resource, null, -1, -1, BORDER_DEFAULT)); + uI.markAsDirty(); + } + + /** + * Opens the given resource in a window with the given name. + *

+ * The supplied {@code windowName} is used as the target name in a + * window.open call in the client. This means that special values such as + * "_blank", "_self", "_top", "_parent" have special meaning. An empty or + * null window name is also a special case. + *

+ *

+ * "", null and "_self" as {@code windowName} all causes the resource to be + * opened in the current window, replacing any old contents. For + * downloadable content you should avoid "_self" as "_self" causes the + * client to skip rendering of any other changes as it considers them + * irrelevant (the page will be replaced by the resource). This can speed up + * the opening of a resource, but it might also put the client side into an + * inconsistent state if the window content is not completely replaced e.g., + * if the resource is downloaded instead of displayed in the browser. + *

+ *

+ * "_blank" as {@code windowName} causes the resource to always be opened in + * a new window or tab (depends on the browser and browser settings). + *

+ *

+ * "_top" and "_parent" as {@code windowName} works as specified by the HTML + * standard. + *

+ *

+ * Any other {@code windowName} will open the resource in a window with that + * name, either by opening a new window/tab in the browser or by replacing + * the contents of an existing window with that name. + *

+ * + * @param resource + * the resource. + * @param windowName + * the name of the window. + */ + public void open(Resource resource, String windowName) { + openList.add(new OpenResource(resource, windowName, -1, -1, + BORDER_DEFAULT)); + uI.markAsDirty(); + } + + /** + * Opens the given resource in a window with the given size, border and + * name. For more information on the meaning of {@code windowName}, see + * {@link #open(Resource, String)}. + * + * @param resource + * the resource. + * @param windowName + * the name of the window. + * @param width + * the width of the window in pixels + * @param height + * the height of the window in pixels + * @param border + * the border style of the window. + */ + public void open(Resource resource, String windowName, int width, + int height, BorderStyle border) { + openList.add(new OpenResource(resource, windowName, width, height, + border)); + uI.markAsDirty(); + } + + /** + * Internal helper method to actually add a notification. + * + * @param notification + * the notification to add + */ + private void addNotification(Notification notification) { + if (notifications == null) { + notifications = new LinkedList(); + } + notifications.add(notification); + uI.markAsDirty(); + } + + /** + * Shows a notification message. + * + * @see Notification + * + * @param notification + * The notification message to show + * + * @deprecated Use Notification.show(Page) instead. + */ + @Deprecated + public void showNotification(Notification notification) { + addNotification(notification); + } + + /** + * Gets the Page to which the current uI belongs. This is automatically + * defined when processing requests to the server. In other cases, (e.g. + * from background threads), the current uI is not automatically defined. + * + * @see UI#getCurrent() + * + * @return the current page instance if available, otherwise + * null + */ + public static Page getCurrent() { + UI currentUI = UI.getCurrent(); + if (currentUI == null) { + return null; + } + return currentUI.getPage(); + } + + /** + * Sets the page title. The page title is displayed by the browser e.g. as + * the title of the browser window or as the title of the tab. + * + * @param title + * the new page title to set + */ + public void setTitle(String title) { + uI.getRpcProxy(PageClientRpc.class).setTitle(title); + } + +} diff --git a/server/src/com/vaadin/server/PaintException.java b/server/src/com/vaadin/server/PaintException.java new file mode 100644 index 0000000000..5d6f7b1d58 --- /dev/null +++ b/server/src/com/vaadin/server/PaintException.java @@ -0,0 +1,64 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.Serializable; + +/** + * PaintExcepection is thrown if painting of a component fails. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class PaintException extends IOException implements Serializable { + + /** + * Constructs an instance of PaintExeception with the specified + * detail message. + * + * @param msg + * the detail message. + */ + public PaintException(String msg) { + super(msg); + } + + /** + * Constructs an instance of PaintExeception with the specified + * detail message and cause. + * + * @param msg + * the detail message. + * @param cause + * the cause + */ + public PaintException(String msg, Throwable cause) { + super(msg, cause); + } + + /** + * Constructs an instance of PaintExeception from IOException. + * + * @param exception + * the original exception. + */ + public PaintException(IOException exception) { + super(exception.getMessage()); + } +} diff --git a/server/src/com/vaadin/server/PaintTarget.java b/server/src/com/vaadin/server/PaintTarget.java new file mode 100644 index 0000000000..e50fac1cb4 --- /dev/null +++ b/server/src/com/vaadin/server/PaintTarget.java @@ -0,0 +1,517 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.util.Map; + +import com.vaadin.server.StreamVariable.StreamingStartEvent; +import com.vaadin.terminal.gwt.server.ClientConnector; +import com.vaadin.ui.Component; + +/** + * This interface defines the methods for painting XML to the UIDL stream. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface PaintTarget extends Serializable { + + /** + * Prints single XMLsection. + * + * Prints full XML section. The section data is escaped from XML tags and + * surrounded by XML start and end-tags. + * + * @param sectionTagName + * the name of the tag. + * @param sectionData + * the scetion data. + * @throws PaintException + * if the paint operation failed. + */ + public void addSection(String sectionTagName, String sectionData) + throws PaintException; + + /** + * Result of starting to paint a Component ( + * {@link PaintTarget#startPaintable(Component, String)}). + * + * @since 7.0 + */ + public enum PaintStatus { + /** + * Painting started, addVariable() and addAttribute() etc. methods may + * be called. + */ + PAINTING, + /** + * A previously unpainted or painted {@link Component} has been queued + * be created/update later in a separate change in the same set of + * changes. + */ + CACHED + } + + /** + * Prints element start tag of a paintable section. Starts a paintable + * section using the given tag. The PaintTarget may implement a caching + * scheme, that checks the paintable has actually changed or can a cached + * version be used instead. This method should call the startTag method. + *

+ * If the {@link Component} is found in cache and this function returns true + * it may omit the content and close the tag, in which case cached content + * should be used. + *

+ *

+ * This method may also add only a reference to the paintable and queue the + * paintable to be painted separately. + *

+ *

+ * Each paintable being painted should be closed by a matching + * {@link #endPaintable(Component)} regardless of the {@link PaintStatus} + * returned. + *

+ * + * @param paintable + * the paintable to start. + * @param tag + * the name of the start tag. + * @return {@link PaintStatus} - ready to paint or already cached on the + * client (also used for sub paintables that are painted later + * separately) + * @throws PaintException + * if the paint operation failed. + * @see #startTag(String) + * @since 7.0 (previously using startTag(Paintable, String)) + */ + public PaintStatus startPaintable(Component paintable, String tag) + throws PaintException; + + /** + * Prints paintable element end tag. + * + * Calls to {@link #startPaintable(Component, String)}should be matched by + * {@link #endPaintable(Component)}. If the parent tag is closed before + * every child tag is closed a PaintException is raised. + * + * @param paintable + * the paintable to close. + * @throws PaintException + * if the paint operation failed. + * @since 7.0 (previously using engTag(String)) + */ + public void endPaintable(Component paintable) throws PaintException; + + /** + * Prints element start tag. + * + *
+     * Todo:
+     * Checking of input values
+     * 
+ * + * @param tagName + * the name of the start tag. + * @throws PaintException + * if the paint operation failed. + */ + public void startTag(String tagName) throws PaintException; + + /** + * Prints element end tag. + * + * If the parent tag is closed before every child tag is closed an + * PaintException is raised. + * + * @param tagName + * the name of the end tag. + * @throws PaintException + * if the paint operation failed. + */ + public void endTag(String tagName) throws PaintException; + + /** + * Adds a boolean attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Attribute name. + * @param value + * the Attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, boolean value) throws PaintException; + + /** + * Adds a integer attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Attribute name. + * @param value + * the Attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, int value) throws PaintException; + + /** + * Adds a resource attribute to component. Atributes must be added before + * any content is written. + * + * @param name + * the Attribute name + * @param value + * the Attribute value + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, Resource value) throws PaintException; + + /** + * Adds details about {@link StreamVariable} to the UIDL stream. Eg. in web + * terminals Receivers are typically rendered for the client side as URLs, + * where the client side implementation can do an http post request. + *

+ * The urls in UIDL message may use Vaadin specific protocol. Before + * actually using the urls on the client side, they should be passed via + * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}. + *

+ * Note that in current terminal implementation StreamVariables are cleaned + * from the terminal only when: + *

    + *
  • a StreamVariable with same name replaces an old one + *
  • the variable owner is no more attached + *
  • the developer signals this by calling + * {@link StreamingStartEvent#disposeStreamVariable()} + *
+ * Most commonly a component developer can just ignore this issue, but with + * strict memory requirements and lots of StreamVariables implementations + * that reserve a lot of memory this may be a critical issue. + * + * @param owner + * the ReceiverOwner that can track the progress of streaming to + * the given StreamVariable + * @param name + * an identifying name for the StreamVariable + * @param value + * the StreamVariable to paint + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, + StreamVariable value) throws PaintException; + + /** + * Adds a long attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Attribute name. + * @param value + * the Attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, long value) throws PaintException; + + /** + * Adds a float attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Attribute name. + * @param value + * the Attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, float value) throws PaintException; + + /** + * Adds a double attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Attribute name. + * @param value + * the Attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, double value) throws PaintException; + + /** + * Adds a string attribute to component. Atributes must be added before any + * content is written. + * + * @param name + * the Boolean attribute name. + * @param value + * the Boolean attribute value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addAttribute(String name, String value) throws PaintException; + + /** + * TODO + * + * @param name + * @param value + * @throws PaintException + */ + public void addAttribute(String name, Map value) + throws PaintException; + + /** + * Adds a Component type attribute. On client side the value will be a + * terminal specific reference to corresponding component on client side + * implementation. + * + * @param name + * the name of the attribute + * @param value + * the Component to be referenced on client side + * @throws PaintException + */ + public void addAttribute(String name, Component value) + throws PaintException; + + /** + * Adds a string type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, String value) + throws PaintException; + + /** + * Adds a int type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, int value) + throws PaintException; + + /** + * Adds a long type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, long value) + throws PaintException; + + /** + * Adds a float type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, float value) + throws PaintException; + + /** + * Adds a double type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, double value) + throws PaintException; + + /** + * Adds a boolean type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, boolean value) + throws PaintException; + + /** + * Adds a string array type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * @param value + * the Variable initial value. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addVariable(VariableOwner owner, String name, String[] value) + throws PaintException; + + /** + * Adds a Component type variable. On client side the variable value will be + * a terminal specific reference to corresponding component on client side + * implementation. When updated from client side, terminal will map the + * client side component reference back to a corresponding server side + * reference. + * + * @param owner + * the Listener for variable changes + * @param name + * the name of the variable + * @param value + * the initial value of the variable + * + * @throws PaintException + * if the paint oparation fails + */ + public void addVariable(VariableOwner owner, String name, Component value) + throws PaintException; + + /** + * Adds a upload stream type variable. + * + * @param owner + * the Listener for variable changes. + * @param name + * the Variable name. + * + * @throws PaintException + * if the paint operation failed. + */ + public void addUploadStreamVariable(VariableOwner owner, String name) + throws PaintException; + + /** + * Prints single XML section. + *

+ * Prints full XML section. The section data must be XML and it is + * surrounded by XML start and end-tags. + *

+ * + * @param sectionTagName + * the tag name. + * @param sectionData + * the section data to be printed. + * @param namespace + * the namespace. + * @throws PaintException + * if the paint operation failed. + */ + public void addXMLSection(String sectionTagName, String sectionData, + String namespace) throws PaintException; + + /** + * Adds UIDL directly. The UIDL must be valid in accordance with the + * UIDL.dtd + * + * @param uidl + * the UIDL to be added. + * @throws PaintException + * if the paint operation failed. + */ + public void addUIDL(java.lang.String uidl) throws PaintException; + + /** + * Adds text node. All the contents of the text are XML-escaped. + * + * @param text + * the Text to add + * @throws PaintException + * if the paint operation failed. + */ + void addText(String text) throws PaintException; + + /** + * Adds CDATA node to target UIDL-tree. + * + * @param text + * the Character data to add + * @throws PaintException + * if the paint operation failed. + * @since 3.1 + */ + void addCharacterData(String text) throws PaintException; + + public void addAttribute(String string, Object[] keys); + + /** + * @return the "tag" string used in communication to present given + * {@link ClientConnector} type. Terminal may define how to present + * the connector. + */ + public String getTag(ClientConnector paintable); + + /** + * @return true if a full repaint has been requested. E.g. refresh in a + * browser window or such. + */ + public boolean isFullRepaint(); + +} diff --git a/server/src/com/vaadin/server/RequestHandler.java b/server/src/com/vaadin/server/RequestHandler.java new file mode 100644 index 0000000000..fcc506cc54 --- /dev/null +++ b/server/src/com/vaadin/server/RequestHandler.java @@ -0,0 +1,48 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.Serializable; + +import com.vaadin.Application; + +/** + * Handler for producing a response to non-UIDL requests. Handlers can be added + * to applications using {@link Application#addRequestHandler(RequestHandler)} + */ +public interface RequestHandler extends Serializable { + + /** + * Handles a non-UIDL request. If a response is written, this method should + * return false to indicate that no more request handlers + * should be invoked for the request. + * + * @param application + * The application to which the request belongs + * @param request + * The request to handle + * @param response + * The response object to which a response can be written. + * @return true if a response has been written and no further request + * handlers should be called, otherwise false + * @throws IOException + */ + boolean handleRequest(Application application, WrappedRequest request, + WrappedResponse response) throws IOException; + +} diff --git a/server/src/com/vaadin/server/Resource.java b/server/src/com/vaadin/server/Resource.java new file mode 100644 index 0000000000..fa1e040929 --- /dev/null +++ b/server/src/com/vaadin/server/Resource.java @@ -0,0 +1,36 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + * Resource provided to the client terminal. Support for actually + * displaying the resource type is left to the terminal. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface Resource extends Serializable { + + /** + * Gets the MIME type of the resource. + * + * @return the MIME type of the resource. + */ + public String getMIMEType(); +} diff --git a/server/src/com/vaadin/server/Scrollable.java b/server/src/com/vaadin/server/Scrollable.java new file mode 100644 index 0000000000..ca89d598c5 --- /dev/null +++ b/server/src/com/vaadin/server/Scrollable.java @@ -0,0 +1,90 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + *

+ * This interface is implemented by all visual objects that can be scrolled + * programmatically from the server-side. The unit of scrolling is pixel. + *

+ * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface Scrollable extends Serializable { + + /** + * Gets scroll left offset. + * + *

+ * Scrolling offset is the number of pixels this scrollable has been + * scrolled right. + *

+ * + * @return Horizontal scrolling position in pixels. + */ + public int getScrollLeft(); + + /** + * Sets scroll left offset. + * + *

+ * Scrolling offset is the number of pixels this scrollable has been + * scrolled right. + *

+ * + * @param scrollLeft + * the xOffset. + */ + public void setScrollLeft(int scrollLeft); + + /** + * Gets scroll top offset. + * + *

+ * Scrolling offset is the number of pixels this scrollable has been + * scrolled down. + *

+ * + * @return Vertical scrolling position in pixels. + */ + public int getScrollTop(); + + /** + * Sets scroll top offset. + * + *

+ * Scrolling offset is the number of pixels this scrollable has been + * scrolled down. + *

+ * + *

+ * The scrolling position is limited by the current height of the content + * area. If the position is below the height, it is scrolled to the bottom. + * However, if the same response also adds height to the content area, + * scrolling to bottom only scrolls to the bottom of the previous content + * area. + *

+ * + * @param scrollTop + * the yOffset. + */ + public void setScrollTop(int scrollTop); + +} diff --git a/server/src/com/vaadin/server/Sizeable.java b/server/src/com/vaadin/server/Sizeable.java new file mode 100644 index 0000000000..36562a059d --- /dev/null +++ b/server/src/com/vaadin/server/Sizeable.java @@ -0,0 +1,252 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + * Interface to be implemented by components wishing to display some object that + * may be dynamically resized during runtime. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +public interface Sizeable extends Serializable { + + /** + * @deprecated from 7.0, use {@link Unit#PIXELS} instead     + */ + @Deprecated + public static final Unit UNITS_PIXELS = Unit.PIXELS; + + /** + * @deprecated from 7.0, use {@link Unit#POINTS} instead     + */ + @Deprecated + public static final Unit UNITS_POINTS = Unit.POINTS; + + /** + * @deprecated from 7.0, use {@link Unit#PICAS} instead     + */ + @Deprecated + public static final Unit UNITS_PICAS = Unit.PICAS; + + /** + * @deprecated from 7.0, use {@link Unit#EM} instead     + */ + @Deprecated + public static final Unit UNITS_EM = Unit.EM; + + /** + * @deprecated from 7.0, use {@link Unit#EX} instead     + */ + @Deprecated + public static final Unit UNITS_EX = Unit.EX; + + /** + * @deprecated from 7.0, use {@link Unit#MM} instead     + */ + @Deprecated + public static final Unit UNITS_MM = Unit.MM; + + /** + * @deprecated from 7.0, use {@link Unit#CM} instead     + */ + @Deprecated + public static final Unit UNITS_CM = Unit.CM; + + /** + * @deprecated from 7.0, use {@link Unit#INCH} instead     + */ + @Deprecated + public static final Unit UNITS_INCH = Unit.INCH; + + /** + * @deprecated from 7.0, use {@link Unit#PERCENTAGE} instead     + */ + @Deprecated + public static final Unit UNITS_PERCENTAGE = Unit.PERCENTAGE; + + public static final float SIZE_UNDEFINED = -1; + + public enum Unit { + /** + * Unit code representing pixels. + */ + PIXELS("px"), + /** + * Unit code representing points (1/72nd of an inch). + */ + POINTS("pt"), + /** + * Unit code representing picas (12 points). + */ + PICAS("pc"), + /** + * Unit code representing the font-size of the relevant font. + */ + EM("em"), + /** + * Unit code representing the x-height of the relevant font. + */ + EX("ex"), + /** + * Unit code representing millimeters. + */ + MM("mm"), + /** + * Unit code representing centimeters. + */ + CM("cm"), + /** + * Unit code representing inches. + */ + INCH("in"), + /** + * Unit code representing in percentage of the containing element + * defined by terminal. + */ + PERCENTAGE("%"); + + private String symbol; + + private Unit(String symbol) { + this.symbol = symbol; + } + + public String getSymbol() { + return symbol; + } + + @Override + public String toString() { + return symbol; + } + + public static Unit getUnitFromSymbol(String symbol) { + if (symbol == null) { + return Unit.PIXELS; // Defaults to pixels + } + for (Unit unit : Unit.values()) { + if (symbol.equals(unit.getSymbol())) { + return unit; + } + } + return Unit.PIXELS; // Defaults to pixels + } + } + + /** + * Gets the width of the object. Negative number implies unspecified size + * (terminal is free to set the size). + * + * @return width of the object in units specified by widthUnits property. + */ + public float getWidth(); + + /** + * Gets the height of the object. Negative number implies unspecified size + * (terminal is free to set the size). + * + * @return height of the object in units specified by heightUnits property. + */ + public float getHeight(); + + /** + * Gets the width property units. + * + * @return units used in width property. + */ + public Unit getWidthUnits(); + + /** + * Gets the height property units. + * + * @return units used in height property. + */ + public Unit getHeightUnits(); + + /** + * Sets the height of the component using String presentation. + * + * String presentation is similar to what is used in Cascading Style Sheets. + * Size can be length or percentage of available size. + * + * The empty string ("") or null will unset the height and set the units to + * pixels. + * + * See CSS + * specification for more details. + * + * @param height + * in CSS style string representation + */ + public void setHeight(String height); + + /** + * Sets the width of the object. Negative number implies unspecified size + * (terminal is free to set the size). + * + * @param width + * the width of the object. + * @param unit + * the unit used for the width. + */ + public void setWidth(float width, Unit unit); + + /** + * Sets the height of the object. Negative number implies unspecified size + * (terminal is free to set the size). + * + * @param height + * the height of the object. + * @param unit + * the unit used for the width. + */ + public void setHeight(float height, Unit unit); + + /** + * Sets the width of the component using String presentation. + * + * String presentation is similar to what is used in Cascading Style Sheets. + * Size can be length or percentage of available size. + * + * The empty string ("") or null will unset the width and set the units to + * pixels. + * + * See CSS + * specification for more details. + * + * @param width + * in CSS style string representation, null or empty string to + * reset + */ + public void setWidth(String width); + + /** + * Sets the size to 100% x 100%. + */ + public void setSizeFull(); + + /** + * Clears any size settings. + */ + public void setSizeUndefined(); + +} diff --git a/server/src/com/vaadin/server/StreamResource.java b/server/src/com/vaadin/server/StreamResource.java new file mode 100644 index 0000000000..443831129f --- /dev/null +++ b/server/src/com/vaadin/server/StreamResource.java @@ -0,0 +1,230 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.InputStream; +import java.io.Serializable; + +import com.vaadin.Application; +import com.vaadin.service.FileTypeResolver; + +/** + * StreamResource is a resource provided to the client directly by + * the application. The strean resource is fetched from URI that is most often + * in the context of the application or window. The resource is automatically + * registered to window in creation. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class StreamResource implements ApplicationResource { + + /** + * Source stream the downloaded content is fetched from. + */ + private StreamSource streamSource = null; + + /** + * Explicit mime-type. + */ + private String MIMEType = null; + + /** + * Filename. + */ + private String filename; + + /** + * Application. + */ + private final Application application; + + /** + * Default buffer size for this stream resource. + */ + private int bufferSize = 0; + + /** + * Default cache time for this stream resource. + */ + private long cacheTime = DEFAULT_CACHETIME; + + /** + * Creates a new stream resource for downloading from stream. + * + * @param streamSource + * the source Stream. + * @param filename + * the name of the file. + * @param application + * the Application object. + */ + public StreamResource(StreamSource streamSource, String filename, + Application application) { + + this.application = application; + setFilename(filename); + setStreamSource(streamSource); + + // Register to application + application.addResource(this); + + } + + /** + * @see com.vaadin.server.Resource#getMIMEType() + */ + @Override + public String getMIMEType() { + if (MIMEType != null) { + return MIMEType; + } + return FileTypeResolver.getMIMEType(filename); + } + + /** + * Sets the mime type of the resource. + * + * @param MIMEType + * the MIME type to be set. + */ + public void setMIMEType(String MIMEType) { + this.MIMEType = MIMEType; + } + + /** + * Returns the source for this StreamResource. StreamSource is + * queried when the resource is about to be streamed to the client. + * + * @return Source of the StreamResource. + */ + public StreamSource getStreamSource() { + return streamSource; + } + + /** + * Sets the source for this StreamResource. + * StreamSource is queried when the resource is about to be + * streamed to the client. + * + * @param streamSource + * the source to set. + */ + public void setStreamSource(StreamSource streamSource) { + this.streamSource = streamSource; + } + + /** + * Gets the filename. + * + * @return the filename. + */ + @Override + public String getFilename() { + return filename; + } + + /** + * Sets the filename. + * + * @param filename + * the filename to set. + */ + public void setFilename(String filename) { + this.filename = filename; + } + + /** + * @see com.vaadin.server.ApplicationResource#getApplication() + */ + @Override + public Application getApplication() { + return application; + } + + /** + * @see com.vaadin.server.ApplicationResource#getStream() + */ + @Override + public DownloadStream getStream() { + final StreamSource ss = getStreamSource(); + if (ss == null) { + return null; + } + final DownloadStream ds = new DownloadStream(ss.getStream(), + getMIMEType(), getFilename()); + ds.setBufferSize(getBufferSize()); + ds.setCacheTime(cacheTime); + return ds; + } + + /** + * Interface implemented by the source of a StreamResource. + * + * @author Vaadin Ltd. + * @since 3.0 + */ + public interface StreamSource extends Serializable { + + /** + * Returns new input stream that is used for reading the resource. + */ + public InputStream getStream(); + } + + /* documented in superclass */ + @Override + public int getBufferSize() { + return bufferSize; + } + + /** + * Sets the size of the download buffer used for this resource. + * + * @param bufferSize + * the size of the buffer in bytes. + */ + public void setBufferSize(int bufferSize) { + this.bufferSize = bufferSize; + } + + /* documented in superclass */ + @Override + public long getCacheTime() { + return cacheTime; + } + + /** + * Sets the length of cache expiration time. + * + *

+ * This gives the adapter the possibility cache streams sent to the client. + * The caching may be made in adapter or at the client if the client + * supports caching. Zero or negavive value disbales the caching of this + * stream. + *

+ * + * @param cacheTime + * the cache time in milliseconds. + * + */ + public void setCacheTime(long cacheTime) { + this.cacheTime = cacheTime; + } + +} diff --git a/server/src/com/vaadin/server/StreamVariable.java b/server/src/com/vaadin/server/StreamVariable.java new file mode 100644 index 0000000000..f289e7612a --- /dev/null +++ b/server/src/com/vaadin/server/StreamVariable.java @@ -0,0 +1,167 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server; + +import java.io.OutputStream; +import java.io.Serializable; + +import com.vaadin.Application; +import com.vaadin.server.StreamVariable.StreamingEndEvent; +import com.vaadin.server.StreamVariable.StreamingErrorEvent; +import com.vaadin.server.StreamVariable.StreamingStartEvent; + +/** + * StreamVariable is a special kind of variable whose value is streamed to an + * {@link OutputStream} provided by the {@link #getOutputStream()} method. E.g. + * in web terminals {@link StreamVariable} can be used to send large files from + * browsers to the server without consuming large amounts of memory. + *

+ * Note, writing to the {@link OutputStream} is not synchronized by the terminal + * (to avoid stalls in other operations when eg. streaming to a slow network + * service or file system). If UI is changed as a side effect of writing to the + * output stream, developer must handle synchronization manually. + *

+ * + * @author Vaadin Ltd. + * @since 6.5 + * @see PaintTarget#addVariable(VariableOwner, String, StreamVariable) + */ +public interface StreamVariable extends Serializable { + + /** + * Invoked by the terminal when a new upload arrives, after + * {@link #streamingStarted(StreamingStartEvent)} method has been called. + * The terminal implementation will write the streamed variable to the + * returned output stream. + * + * @return Stream to which the uploaded file should be written. + */ + public OutputStream getOutputStream(); + + /** + * Whether the {@link #onProgress(long, long)} method should be called + * during the upload. + *

+ * {@link #onProgress(long, long)} is called in a synchronized block when + * the content is being received. This is potentially bit slow, so we are + * calling that method only if requested. The value is requested after the + * {@link #uploadStarted(StreamingStartEvent)} event, but not after reading + * each buffer. + * + * @return true if this {@link StreamVariable} wants to by notified during + * the upload of the progress of streaming. + * @see #onProgress(StreamingProgressEvent) + */ + public boolean listenProgress(); + + /** + * This method is called by the terminal if {@link #listenProgress()} + * returns true when the streaming starts. + */ + public void onProgress(StreamingProgressEvent event); + + public void streamingStarted(StreamingStartEvent event); + + public void streamingFinished(StreamingEndEvent event); + + public void streamingFailed(StreamingErrorEvent event); + + /* + * Not synchronized to avoid stalls (caused by UIDL requests) while + * streaming the content. Implementations also most commonly atomic even + * without the restriction. + */ + /** + * If this method returns true while the content is being streamed the + * Terminal to stop receiving current upload. + *

+ * Note, the usage of this method is not synchronized over the Application + * instance by the terminal like other methods. The implementation should + * only return a boolean field and especially not modify UI or implement a + * synchronization by itself. + * + * @return true if the streaming should be interrupted as soon as possible. + */ + public boolean isInterrupted(); + + public interface StreamingEvent extends Serializable { + + /** + * @return the file name of the streamed file if known + */ + public String getFileName(); + + /** + * @return the mime type of the streamed file if known + */ + public String getMimeType(); + + /** + * @return the length of the stream (in bytes) if known, else -1 + */ + public long getContentLength(); + + /** + * @return then number of bytes streamed to StreamVariable + */ + public long getBytesReceived(); + } + + /** + * Event passed to {@link #uploadStarted(StreamingStartEvent)} method before + * the streaming of the content to {@link StreamVariable} starts. + */ + public interface StreamingStartEvent extends StreamingEvent { + /** + * The owner of the StreamVariable can call this method to inform the + * terminal implementation that this StreamVariable will not be used to + * accept more post. + */ + public void disposeStreamVariable(); + } + + /** + * Event passed to {@link #onProgress(StreamingProgressEvent)} method during + * the streaming progresses. + */ + public interface StreamingProgressEvent extends StreamingEvent { + } + + /** + * Event passed to {@link #uploadFinished(StreamingEndEvent)} method the + * contents have been streamed to StreamVariable successfully. + */ + public interface StreamingEndEvent extends StreamingEvent { + } + + /** + * Event passed to {@link #uploadFailed(StreamingErrorEvent)} method when + * the streaming ended before the end of the input. The streaming may fail + * due an interruption by {@link } or due an other unknown exception in + * communication. In the latter case the exception is also passed to + * {@link Application#terminalError(com.vaadin.server.Terminal.ErrorEvent)} + * . + */ + public interface StreamingErrorEvent extends StreamingEvent { + + /** + * @return the exception that caused the receiving not to finish cleanly + */ + public Exception getException(); + + } + +} diff --git a/server/src/com/vaadin/server/SystemError.java b/server/src/com/vaadin/server/SystemError.java new file mode 100644 index 0000000000..453be4f632 --- /dev/null +++ b/server/src/com/vaadin/server/SystemError.java @@ -0,0 +1,92 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; + +/** + * SystemError is an error message for a problem caused by error in + * system, not the user application code. The system error can contain technical + * information such as stack trace and exception. + * + * SystemError does not support HTML in error messages or stack traces. If HTML + * messages are required, use {@link UserError} or a custom implementation of + * {@link ErrorMessage}. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class SystemError extends AbstractErrorMessage { + + /** + * Constructor for SystemError with error message specified. + * + * @param message + * the Textual error description. + */ + public SystemError(String message) { + super(message); + setErrorLevel(ErrorLevel.SYSTEMERROR); + setMode(ContentMode.XHTML); + setMessage(getHtmlMessage()); + } + + /** + * Constructor for SystemError with causing exception and error message. + * + * @param message + * the Textual error description. + * @param cause + * the throwable causing the system error. + */ + public SystemError(String message, Throwable cause) { + this(message); + addCause(AbstractErrorMessage.getErrorMessageForException(cause)); + } + + /** + * Constructor for SystemError with cause. + * + * @param cause + * the throwable causing the system error. + */ + public SystemError(Throwable cause) { + this(null, cause); + } + + /** + * Returns the message of the error in HTML. + * + * Note that this API may change in future versions. + */ + protected String getHtmlMessage() { + // TODO wrapping div with namespace? See the old code: + // target.addXMLSection("div", message, + // "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); + + StringBuilder sb = new StringBuilder(); + if (getMessage() != null) { + sb.append("

"); + sb.append(AbstractApplicationServlet + .safeEscapeForHtml(getMessage())); + sb.append("

"); + } + return sb.toString(); + } + +} diff --git a/server/src/com/vaadin/server/Terminal.java b/server/src/com/vaadin/server/Terminal.java new file mode 100644 index 0000000000..265668aa42 --- /dev/null +++ b/server/src/com/vaadin/server/Terminal.java @@ -0,0 +1,58 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; + +/** + * An interface that provides information about the user's terminal. + * Implementors typically provide additional information using methods not in + * this interface.

+ * + * @author Vaadin Ltd. + * @since 3.0 + * @deprecated Currently only a container for ErrorEvent and ErrorListener + */ +@Deprecated +public interface Terminal extends Serializable { + + /** + * An error event implementation for Terminal. + */ + public interface ErrorEvent extends Serializable { + + /** + * Gets the contained throwable, the cause of the error. + */ + public Throwable getThrowable(); + + } + + /** + * Interface for listening to Terminal errors. + */ + public interface ErrorListener extends Serializable { + + /** + * Invoked when a terminal error occurs. + * + * @param event + * the fired event. + */ + public void terminalError(Terminal.ErrorEvent event); + } +} diff --git a/server/src/com/vaadin/server/ThemeResource.java b/server/src/com/vaadin/server/ThemeResource.java new file mode 100644 index 0000000000..7ae0bab828 --- /dev/null +++ b/server/src/com/vaadin/server/ThemeResource.java @@ -0,0 +1,106 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.service.FileTypeResolver; + +/** + * ThemeResource is a named theme dependant resource provided and + * managed by a theme. The actual resource contents are dynamically resolved to + * comply with the used theme by the terminal adapter. This is commonly used to + * provide static images, flash, java-applets, etc for the terminals. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class ThemeResource implements Resource { + + /** + * Id of the terminal managed resource. + */ + private String resourceID = null; + + /** + * Creates a resource. + * + * @param resourceId + * the Id of the resource. + */ + public ThemeResource(String resourceId) { + if (resourceId == null) { + throw new NullPointerException("Resource ID must not be null"); + } + if (resourceId.length() == 0) { + throw new IllegalArgumentException("Resource ID can not be empty"); + } + if (resourceId.charAt(0) == '/') { + throw new IllegalArgumentException( + "Resource ID must be relative (can not begin with /)"); + } + + resourceID = resourceId; + } + + /** + * Tests if the given object equals this Resource. + * + * @param obj + * the object to be tested for equality. + * @return true if the given object equals this Icon, + * false if not. + * @see java.lang.Object#equals(Object) + */ + @Override + public boolean equals(Object obj) { + return obj instanceof ThemeResource + && resourceID.equals(((ThemeResource) obj).resourceID); + } + + /** + * @see java.lang.Object#hashCode() + */ + @Override + public int hashCode() { + return resourceID.hashCode(); + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return resourceID.toString(); + } + + /** + * Gets the resource id. + * + * @return the resource id. + */ + public String getResourceId() { + return resourceID; + } + + /** + * @see com.vaadin.server.Resource#getMIMEType() + */ + @Override + public String getMIMEType() { + return FileTypeResolver.getMIMEType(getResourceId()); + } +} diff --git a/server/src/com/vaadin/server/UIProvider.java b/server/src/com/vaadin/server/UIProvider.java new file mode 100644 index 0000000000..e06b80c62f --- /dev/null +++ b/server/src/com/vaadin/server/UIProvider.java @@ -0,0 +1,29 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import com.vaadin.Application; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.ui.UI; + +public interface UIProvider { + public Class getUIClass(Application application, + WrappedRequest request) throws UIRequiresMoreInformationException; + + public UI instantiateUI(Application application, + Class type, WrappedRequest request); +} diff --git a/server/src/com/vaadin/server/UserError.java b/server/src/com/vaadin/server/UserError.java new file mode 100644 index 0000000000..756f2e70e0 --- /dev/null +++ b/server/src/com/vaadin/server/UserError.java @@ -0,0 +1,80 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +/** + * UserError is a controlled error occurred in application. User + * errors are occur in normal usage of the application and guide the user. + * + * @author Vaadin Ltd. + * @since 3.0 + */ +@SuppressWarnings("serial") +public class UserError extends AbstractErrorMessage { + + /** + * @deprecated from 7.0, use {@link ContentMode#TEXT} instead     + */ + @Deprecated + public static final ContentMode CONTENT_TEXT = ContentMode.TEXT; + + /** + * @deprecated from 7.0, use {@link ContentMode#PREFORMATTED} instead     + */ + @Deprecated + public static final ContentMode CONTENT_PREFORMATTED = ContentMode.PREFORMATTED; + + /** + * @deprecated from 7.0, use {@link ContentMode#XHTML} instead     + */ + @Deprecated + public static final ContentMode CONTENT_XHTML = ContentMode.XHTML; + + /** + * Creates a textual error message of level ERROR. + * + * @param textErrorMessage + * the text of the error message. + */ + public UserError(String textErrorMessage) { + super(textErrorMessage); + } + + /** + * Creates an error message with level and content mode. + * + * @param message + * the error message. + * @param contentMode + * the content Mode. + * @param errorLevel + * the level of error. + */ + public UserError(String message, ContentMode contentMode, + ErrorLevel errorLevel) { + super(message); + if (contentMode == null) { + contentMode = ContentMode.TEXT; + } + if (errorLevel == null) { + errorLevel = ErrorLevel.ERROR; + } + setMode(contentMode); + setErrorLevel(errorLevel); + } + +} diff --git a/server/src/com/vaadin/server/Vaadin6Component.java b/server/src/com/vaadin/server/Vaadin6Component.java new file mode 100644 index 0000000000..00889df14a --- /dev/null +++ b/server/src/com/vaadin/server/Vaadin6Component.java @@ -0,0 +1,66 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ +package com.vaadin.server; + +import java.util.EventListener; + +import com.vaadin.ui.Component; + +/** + * Interface provided to ease porting of Vaadin 6 components to Vaadin 7. By + * implementing this interface your Component will be able to use + * {@link #paintContent(PaintTarget)} and + * {@link #changeVariables(Object, java.util.Map)} just like in Vaadin 6. + * + * @author Vaadin Ltd + * @since 7.0.0 + * + */ +public interface Vaadin6Component extends VariableOwner, Component, + EventListener { + + /** + *

+ * Paints the Paintable into a UIDL stream. This method creates the UIDL + * sequence describing it and outputs it to the given UIDL stream. + *

+ * + *

+ * It is called when the contents of the component should be painted in + * response to the component first being shown or having been altered so + * that its visual representation is changed. + *

+ * + * @param target + * the target UIDL stream where the component should paint itself + * to. + * @throws PaintException + * if the paint operation failed. + */ + public void paintContent(PaintTarget target) throws PaintException; + + /** + * (non-Javadoc) {@inheritDoc} + *

+ * For a Vaadin6Component, markAsDirty will also cause + * {@link #paintContent(PaintTarget)} to be called before sending changes to + * the client. + * + * @see com.vaadin.terminal.gwt.server.ClientConnector#markAsDirty() + */ + @Override + public void markAsDirty(); +} diff --git a/server/src/com/vaadin/server/VariableOwner.java b/server/src/com/vaadin/server/VariableOwner.java new file mode 100644 index 0000000000..4c6c86669c --- /dev/null +++ b/server/src/com/vaadin/server/VariableOwner.java @@ -0,0 +1,95 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.Serializable; +import java.util.Map; + +/** + *

+ * Listener interface for UI variable changes. The user communicates with the + * application using the so-called variables. When the user makes a + * change using the UI the terminal trasmits the changed variables to the + * application, and the components owning those variables may then process those + * changes. + *

+ * + * @author Vaadin Ltd. + * @since 3.0 + * @deprecated in 7.0. Only provided to ease porting of Vaadin 6 components. Do + * not implement this directly, implement {@link Vaadin6Component}. + */ +@Deprecated +public interface VariableOwner extends Serializable { + + /** + * Called when one or more variables handled by the implementing class are + * changed. + * + * @param source + * the Source of the variable change. This is the origin of the + * event. For example in Web Adapter this is the request. + * @param variables + * the Mapping from variable names to new variable values. + */ + public void changeVariables(Object source, Map variables); + + /** + *

+ * Tests if the variable owner is enabled or not. The terminal should not + * send any variable changes to disabled variable owners. + *

+ * + * @return true if the variable owner is enabled, + * false if not + */ + public boolean isEnabled(); + + /** + *

+ * Tests if the variable owner is in immediate mode or not. Being in + * immediate mode means that all variable changes are required to be sent + * back from the terminal immediately when they occur. + *

+ * + *

+ * Note: VariableOwner does not include a set- + * method for the immediateness property. This is because not all + * VariableOwners wish to offer the functionality. Such VariableOwners are + * never in the immediate mode, thus they always return false + * in {@link #isImmediate()}. + *

+ * + * @return true if the component is in immediate mode, + * false if not. + */ + public boolean isImmediate(); + + /** + * VariableOwner error event. + */ + public interface ErrorEvent extends Terminal.ErrorEvent { + + /** + * Gets the source VariableOwner. + * + * @return the variable owner. + */ + public VariableOwner getVariableOwner(); + + } +} diff --git a/server/src/com/vaadin/server/WrappedRequest.java b/server/src/com/vaadin/server/WrappedRequest.java new file mode 100644 index 0000000000..d012d572ea --- /dev/null +++ b/server/src/com/vaadin/server/WrappedRequest.java @@ -0,0 +1,290 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.util.Locale; +import java.util.Map; + +import javax.portlet.PortletRequest; +import javax.servlet.ServletRequest; +import javax.servlet.http.HttpServletRequest; + +import com.vaadin.Application; +import com.vaadin.UIRequiresMoreInformationException; +import com.vaadin.annotations.EagerInit; +import com.vaadin.terminal.gwt.server.WebBrowser; +import com.vaadin.ui.UI; + +/** + * A generic request to the server, wrapping a more specific request type, e.g. + * HttpServletReqest or PortletRequest. + * + * @since 7.0 + */ +public interface WrappedRequest extends Serializable { + + /** + * Detailed information extracted from the browser. + * + * @see WrappedRequest#getBrowserDetails() + */ + public interface BrowserDetails extends Serializable { + /** + * Gets the URI hash fragment for the request. This is typically used to + * encode navigation within an application. + * + * @return the URI hash fragment + */ + public String getUriFragment(); + + /** + * Gets the value of window.name from the browser. This can be used to + * keep track of the specific window between browser reloads. + * + * @return the string value of window.name in the browser + */ + public String getWindowName(); + + /** + * Gets a reference to the {@link WebBrowser} object containing + * additional information, e.g. screen size and the time zone offset. + * + * @return the web browser object + */ + public WebBrowser getWebBrowser(); + } + + /** + * Gets the named request parameter This is typically a HTTP GET or POST + * parameter, though other request types might have other ways of + * representing parameters. + * + * @see javax.servlet.ServletRequest#getParameter(String) + * @see javax.portlet.PortletRequest#getParameter(String) + * + * @param parameter + * the name of the parameter + * @return The paramter value, or null if no parameter with the + * given name is present + */ + public String getParameter(String parameter); + + /** + * Gets all the parameters of the request. + * + * @see #getParameter(String) + * + * @see javax.servlet.ServletRequest#getParameterMap() + * @see javax.portlet.PortletRequest#getParameter(String) + * + * @return A mapping of parameter names to arrays of parameter values + */ + public Map getParameterMap(); + + /** + * Returns the length of the request content that can be read from the input + * stream returned by {@link #getInputStream()}. + * + * @see javax.servlet.ServletRequest#getContentLength() + * @see javax.portlet.ClientDataRequest#getContentLength() + * + * @return content length in bytes + */ + public int getContentLength(); + + /** + * Returns an input stream from which the request content can be read. The + * request content length can be obtained with {@link #getContentLength()} + * without reading the full stream contents. + * + * @see javax.servlet.ServletRequest#getInputStream() + * @see javax.portlet.ClientDataRequest#getPortletInputStream() + * + * @return the input stream from which the contents of the request can be + * read + * @throws IOException + * if the input stream can not be opened + */ + public InputStream getInputStream() throws IOException; + + /** + * Gets a request attribute. + * + * @param name + * the name of the attribute + * @return the value of the attribute, or null if there is no + * attribute with the given name + * + * @see javax.servlet.ServletRequest#getAttribute(String) + * @see javax.portlet.PortletRequest#getAttribute(String) + */ + public Object getAttribute(String name); + + /** + * Defines a request attribute. + * + * @param name + * the name of the attribute + * @param value + * the attribute value + * + * @see javax.servlet.ServletRequest#setAttribute(String, Object) + * @see javax.portlet.PortletRequest#setAttribute(String, Object) + */ + public void setAttribute(String name, Object value); + + /** + * Gets the path of the requested resource relative to the application. The + * path be null if no path information is available. Does + * always start with / if the path isn't null. + * + * @return a string with the path relative to the application. + * + * @see javax.servlet.http.HttpServletRequest#getPathInfo() + */ + public String getRequestPathInfo(); + + /** + * Returns the maximum time interval, in seconds, that the session + * associated with this request will be kept open between client accesses. + * + * @return an integer specifying the number of seconds the session + * associated with this request remains open between client requests + * + * @see javax.servlet.http.HttpSession#getMaxInactiveInterval() + * @see javax.portlet.PortletSession#getMaxInactiveInterval() + */ + public int getSessionMaxInactiveInterval(); + + /** + * Gets an attribute from the session associated with this request. + * + * @param name + * the name of the attribute + * @return the attribute value, or null if the attribute is not + * defined in the session + * + * @see javax.servlet.http.HttpSession#getAttribute(String) + * @see javax.portlet.PortletSession#getAttribute(String) + */ + public Object getSessionAttribute(String name); + + /** + * Saves an attribute value in the session associated with this request. + * + * @param name + * the name of the attribute + * @param attribute + * the attribute value + * + * @see javax.servlet.http.HttpSession#setAttribute(String, Object) + * @see javax.portlet.PortletSession#setAttribute(String, Object) + */ + public void setSessionAttribute(String name, Object attribute); + + /** + * Returns the MIME type of the body of the request, or null if the type is + * not known. + * + * @return a string containing the name of the MIME type of the request, or + * null if the type is not known + * + * @see javax.servlet.ServletRequest#getContentType() + * @see javax.portlet.ResourceRequest#getContentType() + * + */ + public String getContentType(); + + /** + * Gets detailed information about the browser from which the request + * originated. This consists of information that is not available from + * normal HTTP requests, but requires additional information to be extracted + * for instance using javascript in the browser. + * + * This information is only guaranteed to be available in some special + * cases, for instance when + * {@link Application#getUIForRequest(WrappedRequest)} is called again after + * throwing {@link UIRequiresMoreInformationException} or in + * {@link UI#init(WrappedRequest)} for a UI class not annotated with + * {@link EagerInit} + * + * @return the browser details, or null if details are not + * available + * + * @see BrowserDetails + */ + public BrowserDetails getBrowserDetails(); + + /** + * Gets locale information from the query, e.g. using the Accept-Language + * header. + * + * @return the preferred Locale + * + * @see ServletRequest#getLocale() + * @see PortletRequest#getLocale() + */ + public Locale getLocale(); + + /** + * Returns the IP address from which the request came. This might also be + * the address of a proxy between the server and the original requester. + * + * @return a string containing the IP address, or null if the + * address is not available + * + * @see ServletRequest#getRemoteAddr() + */ + public String getRemoteAddr(); + + /** + * Checks whether the request was made using a secure channel, e.g. using + * https. + * + * @return a boolean indicating if the request is secure + * + * @see ServletRequest#isSecure() + * @see PortletRequest#isSecure() + */ + public boolean isSecure(); + + /** + * Gets the value of a request header, e.g. a http header for a + * {@link HttpServletRequest}. + * + * @param headerName + * the name of the header + * @return the header value, or null if the header is not + * present in the request + * + * @see HttpServletRequest#getHeader(String) + */ + public String getHeader(String headerName); + + /** + * Gets the deployment configuration for the context of this request. + * + * @return the deployment configuration + * + * @see DeploymentConfiguration + */ + public DeploymentConfiguration getDeploymentConfiguration(); + +} diff --git a/server/src/com/vaadin/server/WrappedResponse.java b/server/src/com/vaadin/server/WrappedResponse.java new file mode 100644 index 0000000000..c8d9342418 --- /dev/null +++ b/server/src/com/vaadin/server/WrappedResponse.java @@ -0,0 +1,159 @@ +/* + * Copyright 2011 Vaadin Ltd. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not + * use this file except in compliance with the License. You may obtain a copy of + * the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the + * License for the specific language governing permissions and limitations under + * the License. + */ + +package com.vaadin.server; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.PrintWriter; +import java.io.Serializable; + +import javax.portlet.MimeResponse; +import javax.portlet.PortletResponse; +import javax.portlet.ResourceResponse; +import javax.servlet.ServletResponse; +import javax.servlet.http.HttpServletResponse; + +/** + * A generic response from the server, wrapping a more specific response type, + * e.g. HttpServletResponse or PortletResponse. + * + * @since 7.0 + */ +public interface WrappedResponse extends Serializable { + + /** + * Sets the (http) status code for the response. If you want to include an + * error message along the status code, use {@link #sendError(int, String)} + * instead. + * + * @param statusCode + * the status code to set + * @see HttpServletResponse#setStatus(int) + * + * @see ResourceResponse#HTTP_STATUS_CODE + */ + public void setStatus(int statusCode); + + /** + * Sets the content type of this response. If the content type including a + * charset is set before {@link #getWriter()} is invoked, the returned + * PrintWriter will automatically use the defined charset. + * + * @param contentType + * a string specifying the MIME type of the content + * + * @see ServletResponse#setContentType(String) + * @see MimeResponse#setContentType(String) + */ + public void setContentType(String contentType); + + /** + * Sets the value of a generic response header. If the header had already + * been set, the new value overwrites the previous one. + * + * @param name + * the name of the header + * @param value + * the header value. + * + * @see HttpServletResponse#setHeader(String, String) + * @see PortletResponse#setProperty(String, String) + */ + public void setHeader(String name, String value); + + /** + * Properly formats a timestamp as a date header. If the header had already + * been set, the new value overwrites the previous one. + * + * @param name + * the name of the header + * @param timestamp + * the number of milliseconds since epoch + * + * @see HttpServletResponse#setDateHeader(String, long) + */ + public void setDateHeader(String name, long timestamp); + + /** + * Returns a OutputStream for writing binary data in the + * response. + *

+ * Either this method or getWriter() may be called to write the response, + * not both. + * + * @return a OutputStream for writing binary data + * @throws IOException + * if an input or output exception occurred + * + * @see #getWriter() + * @see ServletResponse#getOutputStream() + * @see MimeResponse#getPortletOutputStream() + */ + public OutputStream getOutputStream() throws IOException; + + /** + * Returns a PrintWriter object that can send character text to + * the client. The PrintWriter uses the character encoding defined using + * setContentType. + *

+ * Either this method or getOutputStream() may be called to write the + * response, not both. + * + * @return a PrintWriter for writing character text + * @throws IOException + * if an input or output exception occurred + * + * @see #getOutputStream() + * @see ServletResponse#getWriter() + * @see MimeResponse#getWriter() + */ + public PrintWriter getWriter() throws IOException; + + /** + * Sets cache time in milliseconds, -1 means no cache at all. All required + * headers related to caching in the response are set based on the time. + * + * @param milliseconds + * Cache time in milliseconds + */ + public void setCacheTime(long milliseconds); + + /** + * Sends an error response to the client using the specified status code and + * clears the buffer. In some configurations, this can cause a predefined + * error page to be displayed. + * + * @param errorCode + * the HTTP status code + * @param message + * a message to accompany the error + * @throws IOException + * if an input or output exception occurs + * + * @see HttpServletResponse#sendError(int, String) + */ + public void sendError(int errorCode, String message) throws IOException; + + /** + * Gets the deployment configuration for the context of this response. + * + * @return the deployment configuration + * + * @see DeploymentConfiguration + */ + public DeploymentConfiguration getDeploymentConfiguration(); +} diff --git a/server/src/com/vaadin/server/package.html b/server/src/com/vaadin/server/package.html new file mode 100644 index 0000000000..83514a0de5 --- /dev/null +++ b/server/src/com/vaadin/server/package.html @@ -0,0 +1,21 @@ + + + + + + + + + + +

Provides classes and interfaces that wrap the terminal-side functionalities +for the server-side application. (FIXME: This could be a little more descriptive and wordy.)

+ +

Package Specification

+ + + + + + + diff --git a/server/src/com/vaadin/service/ApplicationContext.java b/server/src/com/vaadin/service/ApplicationContext.java index 55495dcd5c..aaf5d1b386 100644 --- a/server/src/com/vaadin/service/ApplicationContext.java +++ b/server/src/com/vaadin/service/ApplicationContext.java @@ -22,7 +22,7 @@ import java.net.URL; import java.util.Collection; import com.vaadin.Application; -import com.vaadin.terminal.ApplicationResource; +import com.vaadin.server.ApplicationResource; import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; /** diff --git a/server/src/com/vaadin/service/FileTypeResolver.java b/server/src/com/vaadin/service/FileTypeResolver.java index 2b289d6752..4b1c8697eb 100644 --- a/server/src/com/vaadin/service/FileTypeResolver.java +++ b/server/src/com/vaadin/service/FileTypeResolver.java @@ -23,8 +23,8 @@ import java.util.Hashtable; import java.util.Map; import java.util.StringTokenizer; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; /** * Utility class that can figure out mime-types and icons related to files. diff --git a/server/src/com/vaadin/terminal/AbstractClientConnector.java b/server/src/com/vaadin/terminal/AbstractClientConnector.java deleted file mode 100644 index 157bd17e41..0000000000 --- a/server/src/com/vaadin/terminal/AbstractClientConnector.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal; - -import java.io.Serializable; -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationHandler; -import java.lang.reflect.Method; -import java.lang.reflect.Proxy; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; -import java.util.logging.Logger; - -import com.vaadin.Application; -import com.vaadin.external.json.JSONException; -import com.vaadin.external.json.JSONObject; -import com.vaadin.shared.communication.ClientRpc; -import com.vaadin.shared.communication.ServerRpc; -import com.vaadin.shared.communication.SharedState; -import com.vaadin.terminal.gwt.server.AbstractCommunicationManager; -import com.vaadin.terminal.gwt.server.ClientConnector; -import com.vaadin.terminal.gwt.server.ClientMethodInvocation; -import com.vaadin.terminal.gwt.server.RpcManager; -import com.vaadin.terminal.gwt.server.RpcTarget; -import com.vaadin.terminal.gwt.server.ServerRpcManager; -import com.vaadin.ui.HasComponents; -import com.vaadin.ui.UI; - -/** - * An abstract base class for ClientConnector implementations. This class - * provides all the basic functionality required for connectors. - * - * @author Vaadin Ltd - * @since 7.0.0 - */ -public abstract class AbstractClientConnector implements ClientConnector { - /** - * A map from client to server RPC interface class to the RPC call manager - * that handles incoming RPC calls for that interface. - */ - private Map, RpcManager> rpcManagerMap = new HashMap, RpcManager>(); - - /** - * A map from server to client RPC interface class to the RPC proxy that - * sends ourgoing RPC calls for that interface. - */ - private Map, ClientRpc> rpcProxyMap = new HashMap, ClientRpc>(); - - /** - * Shared state object to be communicated from the server to the client when - * modified. - */ - private SharedState sharedState; - - private Class stateType; - - /** - * Pending RPC method invocations to be sent. - */ - private ArrayList pendingInvocations = new ArrayList(); - - private String connectorId; - - private ArrayList extensions = new ArrayList(); - - private ClientConnector parent; - - /* Documentation copied from interface */ - @Deprecated - @Override - public void requestRepaint() { - markAsDirty(); - } - - /* Documentation copied from interface */ - @Override - public void markAsDirty() { - UI uI = getUI(); - if (uI != null) { - uI.getConnectorTracker().markDirty(this); - } - } - - /** - * Registers an RPC interface implementation for this component. - * - * A component can listen to multiple RPC interfaces, and subclasses can - * register additional implementations. - * - * @since 7.0 - * - * @param implementation - * RPC interface implementation - * @param rpcInterfaceType - * RPC interface class for which the implementation should be - * registered - */ - protected void registerRpc(T implementation, Class rpcInterfaceType) { - rpcManagerMap.put(rpcInterfaceType, new ServerRpcManager( - implementation, rpcInterfaceType)); - } - - /** - * Registers an RPC interface implementation for this component. - * - * A component can listen to multiple RPC interfaces, and subclasses can - * register additional implementations. - * - * @since 7.0 - * - * @param implementation - * RPC interface implementation. Also used to deduce the type. - */ - protected void registerRpc(T implementation) { - Class cls = implementation.getClass(); - Class[] interfaces = cls.getInterfaces(); - while (interfaces.length == 0) { - // Search upwards until an interface is found. It must be found as T - // extends ServerRpc - cls = cls.getSuperclass(); - interfaces = cls.getInterfaces(); - } - if (interfaces.length != 1 - || !(ServerRpc.class.isAssignableFrom(interfaces[0]))) { - throw new RuntimeException( - "Use registerRpc(T implementation, Class rpcInterfaceType) if the Rpc implementation implements more than one interface"); - } - @SuppressWarnings("unchecked") - Class type = (Class) interfaces[0]; - registerRpc(implementation, type); - } - - protected SharedState getState() { - if (null == sharedState) { - sharedState = createState(); - } - - UI uI = getUI(); - if (uI != null && !uI.getConnectorTracker().isDirty(this)) { - requestRepaint(); - } - - return sharedState; - } - - @Override - public JSONObject encodeState() throws JSONException { - return AbstractCommunicationManager.encodeState(this, getState()); - } - - /** - * Creates the shared state bean to be used in server to client - * communication. - *

- * By default a state object of the defined return type of - * {@link #getState()} is created. Subclasses can override this method and - * return a new instance of the correct state class but this should rarely - * be necessary. - *

- *

- * No configuration of the values of the state should be performed in - * {@link #createState()}. - * - * @since 7.0 - * - * @return new shared state object - */ - protected SharedState createState() { - try { - return getStateType().newInstance(); - } catch (Exception e) { - throw new RuntimeException( - "Error creating state of type " + getStateType().getName() - + " for " + getClass().getName(), e); - } - } - - @Override - public Class getStateType() { - // Lazy load because finding type can be expensive because of the - // exceptions flying around - if (stateType == null) { - stateType = findStateType(); - } - - return stateType; - } - - private Class findStateType() { - try { - Class class1 = getClass(); - while (class1 != null) { - try { - Method m = class1.getDeclaredMethod("getState", - (Class[]) null); - Class type = m.getReturnType(); - return type.asSubclass(SharedState.class); - } catch (NoSuchMethodException nsme) { - // Try in superclass instead - class1 = class1.getSuperclass(); - } - } - throw new NoSuchMethodException(getClass().getCanonicalName() - + ".getState()"); - } catch (Exception e) { - throw new RuntimeException("Error finding state type for " - + getClass().getName(), e); - } - } - - /** - * Returns an RPC proxy for a given server to client RPC interface for this - * component. - * - * TODO more javadoc, subclasses, ... - * - * @param rpcInterface - * RPC interface type - * - * @since 7.0 - */ - public T getRpcProxy(final Class rpcInterface) { - // create, initialize and return a dynamic proxy for RPC - try { - if (!rpcProxyMap.containsKey(rpcInterface)) { - Class proxyClass = Proxy.getProxyClass( - rpcInterface.getClassLoader(), rpcInterface); - Constructor constructor = proxyClass - .getConstructor(InvocationHandler.class); - T rpcProxy = rpcInterface.cast(constructor - .newInstance(new RpcInvoicationHandler(rpcInterface))); - // cache the proxy - rpcProxyMap.put(rpcInterface, rpcProxy); - } - return (T) rpcProxyMap.get(rpcInterface); - } catch (Exception e) { - // TODO exception handling? - throw new RuntimeException(e); - } - } - - private static final class AllChildrenIterable implements - Iterable, Serializable { - private final ClientConnector connector; - - private AllChildrenIterable(ClientConnector connector) { - this.connector = connector; - } - - @Override - public Iterator iterator() { - CombinedIterator iterator = new CombinedIterator(); - iterator.addIterator(connector.getExtensions().iterator()); - - if (connector instanceof HasComponents) { - HasComponents hasComponents = (HasComponents) connector; - iterator.addIterator(hasComponents.iterator()); - } - - return iterator; - } - } - - private class RpcInvoicationHandler implements InvocationHandler, - Serializable { - - private String rpcInterfaceName; - - public RpcInvoicationHandler(Class rpcInterface) { - rpcInterfaceName = rpcInterface.getName().replaceAll("\\$", "."); - } - - @Override - public Object invoke(Object proxy, Method method, Object[] args) - throws Throwable { - addMethodInvocationToQueue(rpcInterfaceName, method, args); - return null; - } - - } - - /** - * For internal use: adds a method invocation to the pending RPC call queue. - * - * @param interfaceName - * RPC interface name - * @param method - * RPC method - * @param parameters - * RPC all parameters - * - * @since 7.0 - */ - protected void addMethodInvocationToQueue(String interfaceName, - Method method, Object[] parameters) { - // add to queue - pendingInvocations.add(new ClientMethodInvocation(this, interfaceName, - method, parameters)); - // TODO no need to do full repaint if only RPC calls - requestRepaint(); - } - - /** - * @see RpcTarget#getRpcManager(Class) - * - * @param rpcInterface - * RPC interface for which a call was made - * @return RPC Manager handling calls for the interface - * - * @since 7.0 - */ - @Override - public RpcManager getRpcManager(Class rpcInterface) { - return rpcManagerMap.get(rpcInterface); - } - - @Override - public List retrievePendingRpcCalls() { - if (pendingInvocations.isEmpty()) { - return Collections.emptyList(); - } else { - List result = pendingInvocations; - pendingInvocations = new ArrayList(); - return Collections.unmodifiableList(result); - } - } - - @Override - public String getConnectorId() { - if (connectorId == null) { - if (getApplication() == null) { - throw new RuntimeException( - "Component must be attached to an application when getConnectorId() is called for the first time"); - } - connectorId = getApplication().createConnectorId(this); - } - return connectorId; - } - - /** - * Finds the Application to which this connector belongs. If the connector - * has not been attached, null is returned. - * - * @return The connector's application, or null if not attached - */ - protected Application getApplication() { - UI uI = getUI(); - if (uI == null) { - return null; - } else { - return uI.getApplication(); - } - } - - /** - * Finds a UI ancestor of this connector. null is returned if - * no UI ancestor is found (typically because the connector is not - * attached to a proper hierarchy). - * - * @return the UI ancestor of this connector, or null if none - * is found. - */ - @Override - public UI getUI() { - ClientConnector connector = this; - while (connector != null) { - if (connector instanceof UI) { - return (UI) connector; - } - connector = connector.getParent(); - } - return null; - } - - private static Logger getLogger() { - return Logger.getLogger(AbstractClientConnector.class.getName()); - } - - @Override - @Deprecated - public void requestRepaintAll() { - markAsDirtyRecursive(); - } - - @Override - public void markAsDirtyRecursive() { - markAsDirty(); - - for (ClientConnector connector : getAllChildrenIterable(this)) { - connector.markAsDirtyRecursive(); - } - } - - private static final class CombinedIterator implements Iterator, - Serializable { - - private final Collection> iterators = new ArrayList>(); - - public void addIterator(Iterator iterator) { - iterators.add(iterator); - } - - @Override - public boolean hasNext() { - for (Iterator i : iterators) { - if (i.hasNext()) { - return true; - } - } - return false; - } - - @Override - public T next() { - for (Iterator i : iterators) { - if (i.hasNext()) { - return i.next(); - } - } - throw new NoSuchElementException(); - } - - @Override - public void remove() { - throw new UnsupportedOperationException(); - } - } - - /** - * Get an Iterable for iterating over all child connectors, including both - * extensions and child components. - * - * @param connector - * the connector to get children for - * @return an Iterable giving all child connectors. - */ - public static Iterable getAllChildrenIterable( - final ClientConnector connector) { - return new AllChildrenIterable(connector); - } - - @Override - public Collection getExtensions() { - return Collections.unmodifiableCollection(extensions); - } - - /** - * Add an extension to this connector. This method is protected to allow - * extensions to select which targets they can extend. - * - * @param extension - * the extension to add - */ - protected void addExtension(Extension extension) { - ClientConnector previousParent = extension.getParent(); - if (previousParent == this) { - // Nothing to do, already attached - return; - } else if (previousParent != null) { - throw new IllegalStateException( - "Moving an extension from one parent to another is not supported"); - } - - extensions.add(extension); - extension.setParent(this); - markAsDirty(); - } - - @Override - public void removeExtension(Extension extension) { - extension.setParent(null); - extensions.remove(extension); - markAsDirty(); - } - - @Override - public void setParent(ClientConnector parent) { - - // If the parent is not changed, don't do anything - if (parent == this.parent) { - return; - } - - if (parent != null && this.parent != null) { - throw new IllegalStateException(getClass().getName() - + " already has a parent."); - } - - // Send detach event if the component have been connected to a window - if (getApplication() != null) { - detach(); - } - - // Connect to new parent - this.parent = parent; - - // Send attach event if connected to an application - if (getApplication() != null) { - attach(); - } - } - - @Override - public ClientConnector getParent() { - return parent; - } - - @Override - public void attach() { - markAsDirty(); - - getUI().getConnectorTracker().registerConnector(this); - - for (ClientConnector connector : getAllChildrenIterable(this)) { - connector.attach(); - } - - } - - /** - * {@inheritDoc} - * - *

- * The {@link #getApplication()} and {@link #getUI()} methods might return - * null after this method is called. - *

- */ - @Override - public void detach() { - for (ClientConnector connector : getAllChildrenIterable(this)) { - connector.detach(); - } - - getUI().getConnectorTracker().unregisterConnector(this); - } - - @Override - public boolean isConnectorEnabled() { - if (getParent() == null) { - // No parent -> the component cannot receive updates from the client - return false; - } else { - return getParent().isConnectorEnabled(); - } - } - - @Override - public void beforeClientResponse(boolean initial) { - // Do nothing by default - } -} diff --git a/server/src/com/vaadin/terminal/AbstractErrorMessage.java b/server/src/com/vaadin/terminal/AbstractErrorMessage.java deleted file mode 100644 index 808791158a..0000000000 --- a/server/src/com/vaadin/terminal/AbstractErrorMessage.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.PrintWriter; -import java.io.StringWriter; -import java.util.ArrayList; -import java.util.List; - -import com.vaadin.data.Buffered; -import com.vaadin.data.Validator; -import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; - -/** - * Base class for component error messages. - * - * This class is used on the server side to construct the error messages to send - * to the client. - * - * @since 7.0 - */ -public abstract class AbstractErrorMessage implements ErrorMessage { - - public enum ContentMode { - /** - * Content mode, where the error contains only plain text. - */ - TEXT, - /** - * Content mode, where the error contains preformatted text. - */ - PREFORMATTED, - /** - * Content mode, where the error contains XHTML. - */ - XHTML; - } - - /** - * Content mode. - */ - private ContentMode mode = ContentMode.TEXT; - - /** - * Message in content mode. - */ - private String message; - - /** - * Error level. - */ - private ErrorLevel level = ErrorLevel.ERROR; - - private List causes = new ArrayList(); - - protected AbstractErrorMessage(String message) { - this.message = message; - } - - public String getMessage() { - return message; - } - - protected void setMessage(String message) { - this.message = message; - } - - /* Documented in interface */ - @Override - public ErrorLevel getErrorLevel() { - return level; - } - - protected void setErrorLevel(ErrorLevel level) { - this.level = level; - } - - protected ContentMode getMode() { - return mode; - } - - protected void setMode(ContentMode mode) { - this.mode = mode; - } - - protected List getCauses() { - return causes; - } - - protected void addCause(ErrorMessage cause) { - causes.add(cause); - } - - @Override - public String getFormattedHtmlMessage() { - String result = null; - switch (getMode()) { - case TEXT: - result = AbstractApplicationServlet.safeEscapeForHtml(getMessage()); - break; - case PREFORMATTED: - result = "
"
-                    + AbstractApplicationServlet
-                            .safeEscapeForHtml(getMessage()) + "
"; - break; - case XHTML: - result = getMessage(); - break; - } - // if no message, combine the messages of all children - if (null == result && null != getCauses() && getCauses().size() > 0) { - StringBuilder sb = new StringBuilder(); - for (ErrorMessage cause : getCauses()) { - String childMessage = cause.getFormattedHtmlMessage(); - if (null != childMessage) { - sb.append("
"); - sb.append(childMessage); - sb.append("
\n"); - } - } - if (sb.length() > 0) { - result = sb.toString(); - } - } - // still no message? use an empty string for backwards compatibility - if (null == result) { - result = ""; - } - return result; - } - - // TODO replace this with a helper method elsewhere? - public static ErrorMessage getErrorMessageForException(Throwable t) { - if (null == t) { - return null; - } else if (t instanceof ErrorMessage) { - // legacy case for custom error messages - return (ErrorMessage) t; - } else if (t instanceof Validator.InvalidValueException) { - UserError error = new UserError( - ((Validator.InvalidValueException) t).getHtmlMessage(), - ContentMode.XHTML, ErrorLevel.ERROR); - for (Validator.InvalidValueException nestedException : ((Validator.InvalidValueException) t) - .getCauses()) { - error.addCause(getErrorMessageForException(nestedException)); - } - return error; - } else if (t instanceof Buffered.SourceException) { - // no message, only the causes to be painted - UserError error = new UserError(null); - // in practice, this was always ERROR in Vaadin 6 unless tweaked in - // custom exceptions implementing ErrorMessage - error.setErrorLevel(ErrorLevel.ERROR); - // causes - for (Throwable nestedException : ((Buffered.SourceException) t) - .getCauses()) { - error.addCause(getErrorMessageForException(nestedException)); - } - return error; - } else { - StringWriter sw = new StringWriter(); - PrintWriter pw = new PrintWriter(sw); - t.printStackTrace(pw); - return new SystemError(sw.toString()); - } - } - - /* Documented in superclass */ - @Override - public String toString() { - return getMessage(); - } - -} diff --git a/server/src/com/vaadin/terminal/AbstractExtension.java b/server/src/com/vaadin/terminal/AbstractExtension.java deleted file mode 100644 index 8ac0ce01e3..0000000000 --- a/server/src/com/vaadin/terminal/AbstractExtension.java +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.terminal.gwt.server.ClientConnector; - -/** - * An extension is an entity that is attached to a Component or another - * Extension and independently communicates between client and server. - *

- * Extensions can use shared state and RPC in the same way as components. - *

- * AbstractExtension adds a mechanism for adding the extension to any Connector - * (extend). To let the Extension determine what kind target it can be added to, - * the extend method is declared as protected. - * - * @author Vaadin Ltd - * @since 7.0.0 - */ -public abstract class AbstractExtension extends AbstractClientConnector - implements Extension { - private boolean previouslyAttached = false; - - /** - * Gets a type that the parent must be an instance of. Override this if the - * extension only support certain targets, e.g. if only TextFields can be - * extended. - * - * @return a type that the parent must be an instance of - */ - protected Class getSupportedParentType() { - return ClientConnector.class; - } - - /** - * Add this extension to the target connector. This method is protected to - * allow subclasses to require a more specific type of target. - * - * @param target - * the connector to attach this extension to - */ - protected void extend(AbstractClientConnector target) { - target.addExtension(this); - } - - /** - * Remove this extension from its target. After an extension has been - * removed, it can not be attached again. - */ - public void removeFromTarget() { - getParent().removeExtension(this); - } - - @Override - public void setParent(ClientConnector parent) { - if (previouslyAttached && parent != null) { - throw new IllegalStateException( - "An extension can not be set to extend a new target after getting detached from the previous."); - } - - Class supportedParentType = getSupportedParentType(); - if (parent == null || supportedParentType.isInstance(parent)) { - super.setParent(parent); - previouslyAttached = true; - } else { - throw new IllegalArgumentException(getClass().getName() - + " can only be attached to targets of type " - + supportedParentType.getName() + " but attach to " - + parent.getClass().getName() + " was attempted."); - } - } - -} diff --git a/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java b/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java deleted file mode 100644 index c8700d12ab..0000000000 --- a/server/src/com/vaadin/terminal/AbstractJavaScriptExtension.java +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.shared.JavaScriptExtensionState; -import com.vaadin.ui.JavaScriptFunction; - -/** - * Base class for Extensions with all client-side logic implemented using - * JavaScript. - *

- * When a new JavaScript extension is initialized in the browser, the framework - * will look for a globally defined JavaScript function that will initialize the - * extension. The name of the initialization function is formed by replacing . - * with _ in the name of the server-side class. If no such function is defined, - * each super class is used in turn until a match is found. The framework will - * thus first attempt with com_example_MyExtension for the - * server-side - * com.example.MyExtension extends AbstractJavaScriptExtension - * class. If MyExtension instead extends com.example.SuperExtension - * , then com_example_SuperExtension will also be attempted if - * com_example_MyExtension has not been defined. - *

- * - * The initialization function will be called with this pointing to - * a connector wrapper object providing integration to Vaadin with the following - * functions: - *

    - *
  • getConnectorId() - returns a string with the id of the - * connector.
  • - *
  • getParentId([connectorId]) - returns a string with the id of - * the connector's parent. If connectorId is provided, the id of - * the parent of the corresponding connector with the passed id is returned - * instead.
  • - *
  • getElement([connectorId]) - returns the DOM Element that is - * the root of a connector's widget. null is returned if the - * connector can not be found or if the connector doesn't have a widget. If - * connectorId is not provided, the connector id of the current - * connector will be used.
  • - *
  • getState() - returns an object corresponding to the shared - * state defined on the server. The scheme for conversion between Java and - * JavaScript types is described bellow.
  • - *
  • registerRpc([name, ] rpcObject) - registers the - * rpcObject as a RPC handler. rpcObject should be an - * object with field containing functions for all eligible RPC functions. If - * name is provided, the RPC handler will only used for RPC calls - * for the RPC interface with the same fully qualified Java name. If no - * name is provided, the RPC handler will be used for all incoming - * RPC invocations where the RPC method name is defined as a function field in - * the handler. The scheme for conversion between Java types in the RPC - * interface definition and the JavaScript values passed as arguments to the - * handler functions is described bellow.
  • - *
  • getRpcProxy([name]) - returns an RPC proxy object. If - * name is provided, the proxy object will contain functions for - * all methods in the RPC interface with the same fully qualified name, provided - * a RPC handler has been registered by the server-side code. If no - * name is provided, the returned RPC proxy object will contain - * functions for all methods in all RPC interfaces registered for the connector - * on the server. If the same method name is present in multiple registered RPC - * interfaces, the corresponding function in the RPC proxy object will throw an - * exception when called. The scheme for conversion between Java types in the - * RPC interface and the JavaScript values that should be passed to the - * functions is described bellow.
  • - *
  • translateVaadinUri(uri) - Translates a Vaadin URI to a URL - * that can be used in the browser. This is just way of accessing - * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)} - *
  • - *
- * The connector wrapper also supports these special functions: - *
    - *
  • onStateChange - If the JavaScript code assigns a function to - * the field, that function is called whenever the contents of the shared state - * is changed.
  • - *
  • Any field name corresponding to a call to - * {@link #addFunction(String, JavaScriptFunction)} on the server will - * automatically be present as a function that triggers the registered function - * on the server.
  • - *
  • Any field name referred to using {@link #callFunction(String, Object...)} - * on the server will be called if a function has been assigned to the field.
  • - *
- *

- * - * Values in the Shared State and in RPC calls are converted between Java and - * JavaScript using the following conventions: - *

    - *
  • Primitive Java numbers (byte, char, int, long, float, double) and their - * boxed types (Byte, Character, Integer, Long, Float, Double) are represented - * by JavaScript numbers.
  • - *
  • The primitive Java boolean and the boxed Boolean are represented by - * JavaScript booleans.
  • - *
  • Java Strings are represented by JavaScript strings.
  • - *
  • List, Set and all arrays in Java are represented by JavaScript arrays.
  • - *
  • Map in Java is represented by JavaScript object with fields - * corresponding to the map keys.
  • - *
  • Any other Java Map is represented by a JavaScript array containing two - * arrays, the first contains the keys and the second contains the values in the - * same order.
  • - *
  • A Java Bean is represented by a JavaScript object with fields - * corresponding to the bean's properties.
  • - *
  • A Java Connector is represented by a JavaScript string containing the - * connector's id.
  • - *
  • A pluggable serialization mechanism is provided for types not described - * here. Please refer to the documentation for specific types for serialization - * information.
  • - *
- * - * @author Vaadin Ltd - * @since 7.0.0 - */ -public abstract class AbstractJavaScriptExtension extends AbstractExtension { - private JavaScriptCallbackHelper callbackHelper = new JavaScriptCallbackHelper( - this); - - @Override - protected void registerRpc(T implementation, Class rpcInterfaceType) { - super.registerRpc(implementation, rpcInterfaceType); - callbackHelper.registerRpc(rpcInterfaceType); - } - - /** - * Register a {@link JavaScriptFunction} that can be called from the - * JavaScript using the provided name. A JavaScript function with the - * provided name will be added to the connector wrapper object (initially - * available as this). Calling that JavaScript function will - * cause the call method in the registered {@link JavaScriptFunction} to be - * invoked with the same arguments. - * - * @param functionName - * the name that should be used for client-side callback - * @param function - * the {@link JavaScriptFunction} object that will be invoked - * when the JavaScript function is called - */ - protected void addFunction(String functionName, JavaScriptFunction function) { - callbackHelper.registerCallback(functionName, function); - } - - /** - * Invoke a named function that the connector JavaScript has added to the - * JavaScript connector wrapper object. The arguments should only contain - * data types that can be represented in JavaScript including primitives, - * their boxed types, arrays, String, List, Set, Map, Connector and - * JavaBeans. - * - * @param name - * the name of the function - * @param arguments - * function arguments - */ - protected void callFunction(String name, Object... arguments) { - callbackHelper.invokeCallback(name, arguments); - } - - @Override - protected JavaScriptExtensionState getState() { - return (JavaScriptExtensionState) super.getState(); - } -} diff --git a/server/src/com/vaadin/terminal/AbstractUIProvider.java b/server/src/com/vaadin/terminal/AbstractUIProvider.java deleted file mode 100644 index 5bb4d35b30..0000000000 --- a/server/src/com/vaadin/terminal/AbstractUIProvider.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.Application; -import com.vaadin.ui.UI; - -public abstract class AbstractUIProvider implements UIProvider { - - @Override - public UI instantiateUI(Application application, - Class type, WrappedRequest request) { - try { - return type.newInstance(); - } catch (InstantiationException e) { - throw new RuntimeException("Could not instantiate root class", e); - } catch (IllegalAccessException e) { - throw new RuntimeException("Could not access root class", e); - } - } -} diff --git a/server/src/com/vaadin/terminal/ApplicationResource.java b/server/src/com/vaadin/terminal/ApplicationResource.java deleted file mode 100644 index 1d1444b774..0000000000 --- a/server/src/com/vaadin/terminal/ApplicationResource.java +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -import com.vaadin.Application; - -/** - * This interface must be implemented by classes wishing to provide Application - * resources. - *

- * ApplicationResource are a set of named resources (pictures, - * sounds, etc) associated with some specific application. Having named - * application resources provides a convenient method for having inter-theme - * common resources for an application. - *

- * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface ApplicationResource extends Resource, Serializable { - - /** - * Default cache time. - */ - public static final long DEFAULT_CACHETIME = 1000 * 60 * 60 * 24; - - /** - * Gets resource as stream. - */ - public DownloadStream getStream(); - - /** - * Gets the application of the resource. - */ - public Application getApplication(); - - /** - * Gets the virtual filename for this resource. - * - * @return the file name associated to this resource. - */ - public String getFilename(); - - /** - * Gets the length of cache expiration time. - * - *

- * This gives the adapter the possibility cache streams sent to the client. - * The caching may be made in adapter or at the client if the client - * supports caching. Default is DEFAULT_CACHETIME. - *

- * - * @return Cache time in milliseconds - */ - public long getCacheTime(); - - /** - * Gets the size of the download buffer used for this resource. - * - *

- * If the buffer size is 0, the buffer size is decided by the terminal - * adapter. The default value is 0. - *

- * - * @return int the size of the buffer in bytes. - */ - public int getBufferSize(); - -} diff --git a/server/src/com/vaadin/terminal/ClassResource.java b/server/src/com/vaadin/terminal/ClassResource.java deleted file mode 100644 index e4921f2413..0000000000 --- a/server/src/com/vaadin/terminal/ClassResource.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -import com.vaadin.Application; -import com.vaadin.service.FileTypeResolver; - -/** - * ClassResource is a named resource accessed with the class - * loader. - * - * This can be used to access resources such as icons, files, etc. - * - * @see java.lang.Class#getResource(java.lang.String) - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class ClassResource implements ApplicationResource, Serializable { - - /** - * Default buffer size for this stream resource. - */ - private int bufferSize = 0; - - /** - * Default cache time for this stream resource. - */ - private long cacheTime = DEFAULT_CACHETIME; - - /** - * Associated class used for indetifying the source of the resource. - */ - private final Class associatedClass; - - /** - * Name of the resource is relative to the associated class. - */ - private final String resourceName; - - /** - * Application used for serving the class. - */ - private final Application application; - - /** - * Creates a new application resource instance. The resource id is relative - * to the location of the application class. - * - * @param resourceName - * the Unique identifier of the resource within the application. - * @param application - * the application this resource will be added to. - */ - public ClassResource(String resourceName, Application application) { - this(application.getClass(), resourceName, application); - } - - /** - * Creates a new application resource instance. - * - * @param associatedClass - * the class of the which the resource is associated. - * @param resourceName - * the Unique identifier of the resource within the application. - * @param application - * the application this resource will be added to. - */ - public ClassResource(Class associatedClass, String resourceName, - Application application) { - this.associatedClass = associatedClass; - this.resourceName = resourceName; - this.application = application; - if (resourceName == null || associatedClass == null) { - throw new NullPointerException(); - } - application.addResource(this); - } - - /** - * Gets the MIME type of this resource. - * - * @see com.vaadin.terminal.Resource#getMIMEType() - */ - @Override - public String getMIMEType() { - return FileTypeResolver.getMIMEType(resourceName); - } - - /** - * Gets the application of this resource. - * - * @see com.vaadin.terminal.ApplicationResource#getApplication() - */ - @Override - public Application getApplication() { - return application; - } - - /** - * Gets the virtual filename for this resource. - * - * @return the file name associated to this resource. - * @see com.vaadin.terminal.ApplicationResource#getFilename() - */ - @Override - public String getFilename() { - int index = 0; - int next = 0; - while ((next = resourceName.indexOf('/', index)) > 0 - && next + 1 < resourceName.length()) { - index = next + 1; - } - return resourceName.substring(index); - } - - /** - * Gets resource as stream. - * - * @see com.vaadin.terminal.ApplicationResource#getStream() - */ - @Override - public DownloadStream getStream() { - final DownloadStream ds = new DownloadStream( - associatedClass.getResourceAsStream(resourceName), - getMIMEType(), getFilename()); - ds.setBufferSize(getBufferSize()); - ds.setCacheTime(cacheTime); - return ds; - } - - /* documented in superclass */ - @Override - public int getBufferSize() { - return bufferSize; - } - - /** - * Sets the size of the download buffer used for this resource. - * - * @param bufferSize - * the size of the buffer in bytes. - */ - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - - /* documented in superclass */ - @Override - public long getCacheTime() { - return cacheTime; - } - - /** - * Sets the length of cache expiration time. - * - *

- * This gives the adapter the possibility cache streams sent to the client. - * The caching may be made in adapter or at the client if the client - * supports caching. Zero or negavive value disbales the caching of this - * stream. - *

- * - * @param cacheTime - * the cache time in milliseconds. - * - */ - public void setCacheTime(long cacheTime) { - this.cacheTime = cacheTime; - } -} diff --git a/server/src/com/vaadin/terminal/CombinedRequest.java b/server/src/com/vaadin/terminal/CombinedRequest.java deleted file mode 100644 index 3d6c3c2149..0000000000 --- a/server/src/com/vaadin/terminal/CombinedRequest.java +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.InputStream; -import java.util.Collections; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Locale; -import java.util.Map; - -import com.vaadin.Application; -import com.vaadin.external.json.JSONArray; -import com.vaadin.external.json.JSONException; -import com.vaadin.external.json.JSONObject; -import com.vaadin.terminal.gwt.server.WebApplicationContext; -import com.vaadin.terminal.gwt.server.WebBrowser; - -/** - * A {@link WrappedRequest} with path and parameters from one request and - * {@link WrappedRequest.BrowserDetails} extracted from another request. - * - * This class is intended to be used for a two request initialization where the - * first request fetches the actual application page and the second request - * contains information extracted from the browser using javascript. - * - */ -public class CombinedRequest implements WrappedRequest { - - private final WrappedRequest secondRequest; - private Map parameterMap; - - /** - * Creates a new combined request based on the second request and some - * details from the first request. - * - * @param secondRequest - * the second request which will be used as the foundation of the - * combined request - * @throws JSONException - * if the initialParams parameter can not be decoded - */ - public CombinedRequest(WrappedRequest secondRequest) throws JSONException { - this.secondRequest = secondRequest; - - HashMap map = new HashMap(); - JSONObject initialParams = new JSONObject( - secondRequest.getParameter("initialParams")); - for (Iterator keys = initialParams.keys(); keys.hasNext();) { - String name = (String) keys.next(); - JSONArray jsonValues = initialParams.getJSONArray(name); - String[] values = new String[jsonValues.length()]; - for (int i = 0; i < values.length; i++) { - values[i] = jsonValues.getString(i); - } - map.put(name, values); - } - - parameterMap = Collections.unmodifiableMap(map); - - } - - @Override - public String getParameter(String parameter) { - String[] strings = getParameterMap().get(parameter); - if (strings == null || strings.length == 0) { - return null; - } else { - return strings[0]; - } - } - - @Override - public Map getParameterMap() { - return parameterMap; - } - - @Override - public int getContentLength() { - return secondRequest.getContentLength(); - } - - @Override - public InputStream getInputStream() throws IOException { - return secondRequest.getInputStream(); - } - - @Override - public Object getAttribute(String name) { - return secondRequest.getAttribute(name); - } - - @Override - public void setAttribute(String name, Object value) { - secondRequest.setAttribute(name, value); - } - - @Override - public String getRequestPathInfo() { - return secondRequest.getParameter("initialPath"); - } - - @Override - public int getSessionMaxInactiveInterval() { - return secondRequest.getSessionMaxInactiveInterval(); - } - - @Override - public Object getSessionAttribute(String name) { - return secondRequest.getSessionAttribute(name); - } - - @Override - public void setSessionAttribute(String name, Object attribute) { - secondRequest.setSessionAttribute(name, attribute); - } - - @Override - public String getContentType() { - return secondRequest.getContentType(); - } - - @Override - public BrowserDetails getBrowserDetails() { - return new BrowserDetails() { - @Override - public String getUriFragment() { - String fragment = secondRequest.getParameter("fr"); - if (fragment == null) { - return ""; - } else { - return fragment; - } - } - - @Override - public String getWindowName() { - return secondRequest.getParameter("wn"); - } - - @Override - public WebBrowser getWebBrowser() { - WebApplicationContext context = (WebApplicationContext) Application - .getCurrent().getContext(); - return context.getBrowser(); - } - }; - } - - /** - * Gets the original second request. This can be used e.g. if a request - * parameter from the second request is required. - * - * @return the original second wrapped request - */ - public WrappedRequest getSecondRequest() { - return secondRequest; - } - - @Override - public Locale getLocale() { - return secondRequest.getLocale(); - } - - @Override - public String getRemoteAddr() { - return secondRequest.getRemoteAddr(); - } - - @Override - public boolean isSecure() { - return secondRequest.isSecure(); - } - - @Override - public String getHeader(String name) { - return secondRequest.getHeader(name); - } - - @Override - public DeploymentConfiguration getDeploymentConfiguration() { - return secondRequest.getDeploymentConfiguration(); - } -} diff --git a/server/src/com/vaadin/terminal/CompositeErrorMessage.java b/server/src/com/vaadin/terminal/CompositeErrorMessage.java deleted file mode 100644 index e86102ae3b..0000000000 --- a/server/src/com/vaadin/terminal/CompositeErrorMessage.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.util.Collection; -import java.util.Iterator; - -/** - * Class for combining multiple error messages together. - * - * @author Vaadin Ltd - * @since 3.0 - */ -@SuppressWarnings("serial") -public class CompositeErrorMessage extends AbstractErrorMessage { - - /** - * Constructor for CompositeErrorMessage. - * - * @param errorMessages - * the Array of error messages that are listed togeter. Nulls are - * ignored, but at least one message is required. - */ - public CompositeErrorMessage(ErrorMessage[] errorMessages) { - super(null); - setErrorLevel(ErrorLevel.INFORMATION); - - for (int i = 0; i < errorMessages.length; i++) { - addErrorMessage(errorMessages[i]); - } - - if (getCauses().size() == 0) { - throw new IllegalArgumentException( - "Composite error message must have at least one error"); - } - - } - - /** - * Constructor for CompositeErrorMessage. - * - * @param errorMessages - * the Collection of error messages that are listed together. At - * least one message is required. - */ - public CompositeErrorMessage( - Collection errorMessages) { - super(null); - setErrorLevel(ErrorLevel.INFORMATION); - - for (final Iterator i = errorMessages - .iterator(); i.hasNext();) { - addErrorMessage(i.next()); - } - - if (getCauses().size() == 0) { - throw new IllegalArgumentException( - "Composite error message must have at least one error"); - } - } - - /** - * Adds a error message into this composite message. Updates the level - * field. - * - * @param error - * the error message to be added. Duplicate errors are ignored. - */ - private void addErrorMessage(ErrorMessage error) { - if (error != null && !getCauses().contains(error)) { - addCause(error); - if (error.getErrorLevel().intValue() > getErrorLevel().intValue()) { - setErrorLevel(error.getErrorLevel()); - } - } - } - - /** - * Gets Error Iterator. - * - * @return the error iterator. - */ - public Iterator iterator() { - return getCauses().iterator(); - } - - /** - * Returns a comma separated list of the error messages. - * - * @return String, comma separated list of error messages. - */ - @Override - public String toString() { - String retval = "["; - int pos = 0; - for (final Iterator i = getCauses().iterator(); i - .hasNext();) { - if (pos > 0) { - retval += ","; - } - pos++; - retval += i.next().toString(); - } - retval += "]"; - - return retval; - } -} diff --git a/server/src/com/vaadin/terminal/DefaultUIProvider.java b/server/src/com/vaadin/terminal/DefaultUIProvider.java deleted file mode 100644 index 8713c45b31..0000000000 --- a/server/src/com/vaadin/terminal/DefaultUIProvider.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.Application; -import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.ui.UI; - -public class DefaultUIProvider extends AbstractUIProvider { - - @Override - public Class getUIClass(Application application, - WrappedRequest request) throws UIRequiresMoreInformationException { - Object uiClassNameObj = application - .getProperty(Application.UI_PARAMETER); - - if (uiClassNameObj instanceof String) { - String uiClassName = uiClassNameObj.toString(); - - ClassLoader classLoader = request.getDeploymentConfiguration() - .getClassLoader(); - if (classLoader == null) { - classLoader = getClass().getClassLoader(); - } - try { - Class uiClass = Class.forName(uiClassName, true, - classLoader).asSubclass(UI.class); - - return uiClass; - } catch (ClassNotFoundException e) { - throw new RuntimeException("Could not find UI class", e); - } - } - - return null; - } -} diff --git a/server/src/com/vaadin/terminal/DeploymentConfiguration.java b/server/src/com/vaadin/terminal/DeploymentConfiguration.java deleted file mode 100644 index 0cfbdb7544..0000000000 --- a/server/src/com/vaadin/terminal/DeploymentConfiguration.java +++ /dev/null @@ -1,188 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.util.Iterator; -import java.util.Properties; - -import javax.portlet.PortletContext; -import javax.servlet.ServletContext; - -import com.vaadin.service.ApplicationContext; -import com.vaadin.terminal.gwt.server.AddonContext; -import com.vaadin.terminal.gwt.server.AddonContextListener; - -/** - * Provide deployment specific settings that are required outside terminal - * specific code. - * - * @author Vaadin Ltd. - * - * @since 7.0 - */ -public interface DeploymentConfiguration extends Serializable { - - /** - * Gets the base URL of the location of Vaadin's static files. - * - * @param request - * the request for which the location should be determined - * - * @return a string with the base URL for static files - */ - public String getStaticFileLocation(WrappedRequest request); - - /** - * Gets the widgetset that is configured for this deployment, e.g. from a - * parameter in web.xml. - * - * @param request - * the request for which a widgetset is required - * @return the name of the widgetset - */ - public String getConfiguredWidgetset(WrappedRequest request); - - /** - * Gets the theme that is configured for this deployment, e.g. from a portal - * parameter or just some sensible default value. - * - * @param request - * the request for which a theme is required - * @return the name of the theme - */ - public String getConfiguredTheme(WrappedRequest request); - - /** - * Checks whether the Vaadin application will be rendered on its own in the - * browser or whether it will be included into some other context. A - * standalone application may do things that might interfere with other - * parts of a page, e.g. changing the page title and requesting focus upon - * loading. - * - * @param request - * the request for which the application is loaded - * @return a boolean indicating whether the application should be standalone - */ - public boolean isStandalone(WrappedRequest request); - - /** - * Gets a configured property. The properties are typically read from e.g. - * web.xml or from system properties of the JVM. - * - * @param propertyName - * The simple of the property, in some contexts, lookup might be - * performed using variations of the provided name. - * @param defaultValue - * the default value that should be used if no value has been - * defined - * @return the property value, or the passed default value if no property - * value is found - */ - public String getApplicationOrSystemProperty(String propertyName, - String defaultValue); - - /** - * Get the class loader to use for loading classes loaded by name, e.g. - * custom UI classes. null indicates that the default class - * loader should be used. - * - * @return the class loader to use, or null - */ - public ClassLoader getClassLoader(); - - /** - * Returns the MIME type of the specified file, or null if the MIME type is - * not known. The MIME type is determined by the configuration of the - * container, and may be specified in a deployment descriptor. Common MIME - * types are "text/html" and "image/gif". - * - * @param resourceName - * a String specifying the name of a file - * @return a String specifying the file's MIME type - * - * @see ServletContext#getMimeType(String) - * @see PortletContext#getMimeType(String) - */ - public String getMimeType(String resourceName); - - /** - * Gets the properties configured for the deployment, e.g. as init - * parameters to the servlet or portlet. - * - * @return properties for the application. - */ - public Properties getInitParameters(); - - public Iterator getAddonContextListeners(); - - public AddonContext getAddonContext(); - - public void setAddonContext(AddonContext vaadinContext); - - /** - * Returns whether Vaadin is in production mode. - * - * @since 7.0.0 - * - * @return true if in production mode, false otherwise. - */ - public boolean isProductionMode(); - - /** - * Returns whether cross-site request forgery protection is enabled. - * - * @since 7.0.0 - * - * @return true if XSRF protection is enabled, false otherwise. - */ - public boolean isXsrfProtectionEnabled(); - - /** - * Returns the time resources can be cached in the browsers, in seconds. - * - * @since 7.0.0 - * - * @return The resource cache time. - */ - public int getResourceCacheTime(); - - /** - * Returns the number of seconds between heartbeat requests of a UI, or a - * non-positive number if heartbeat is disabled. - * - * @since 7.0.0 - * - * @return The time between heartbeats. - */ - public int getHeartbeatInterval(); - - /** - * Returns whether UIs that have no other activity than heartbeat requests - * should be closed after they have been idle the maximum inactivity time - * enforced by the session. - * - * @see ApplicationContext#getMaxInactiveInterval() - * - * @since 7.0.0 - * - * @return True if UIs receiving only heartbeat requests are eventually - * closed; false if heartbeat requests extend UI lifetime - * indefinitely. - */ - public boolean isIdleUICleanupEnabled(); -} diff --git a/server/src/com/vaadin/terminal/DownloadStream.java b/server/src/com/vaadin/terminal/DownloadStream.java deleted file mode 100644 index 30810d5da4..0000000000 --- a/server/src/com/vaadin/terminal/DownloadStream.java +++ /dev/null @@ -1,345 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; -import java.io.Serializable; -import java.util.HashMap; -import java.util.Iterator; -import java.util.Map; - -import javax.servlet.http.HttpServletResponse; - -import com.vaadin.terminal.gwt.server.Constants; - -/** - * Downloadable stream. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class DownloadStream implements Serializable { - - /** - * Maximum cache time. - */ - public static final long MAX_CACHETIME = Long.MAX_VALUE; - - /** - * Default cache time. - */ - public static final long DEFAULT_CACHETIME = 1000 * 60 * 60 * 24; - - private InputStream stream; - - private String contentType; - - private String fileName; - - private Map params; - - private long cacheTime = DEFAULT_CACHETIME; - - private int bufferSize = 0; - - /** - * Creates a new instance of DownloadStream. - */ - public DownloadStream(InputStream stream, String contentType, - String fileName) { - setStream(stream); - setContentType(contentType); - setFileName(fileName); - } - - /** - * Gets downloadable stream. - * - * @return output stream. - */ - public InputStream getStream() { - return stream; - } - - /** - * Sets the stream. - * - * @param stream - * The stream to set - */ - public void setStream(InputStream stream) { - this.stream = stream; - } - - /** - * Gets stream content type. - * - * @return type of the stream content. - */ - public String getContentType() { - return contentType; - } - - /** - * Sets stream content type. - * - * @param contentType - * the contentType to set - */ - public void setContentType(String contentType) { - this.contentType = contentType; - } - - /** - * Returns the file name. - * - * @return the name of the file. - */ - public String getFileName() { - return fileName; - } - - /** - * Sets the file name. - * - * @param fileName - * the file name to set. - */ - public void setFileName(String fileName) { - this.fileName = fileName; - } - - /** - * Sets a paramater for download stream. Parameters are optional information - * about the downloadable stream and their meaning depends on the used - * adapter. For example in WebAdapter they are interpreted as HTTP response - * headers. - * - * If the parameters by this name exists, the old value is replaced. - * - * @param name - * the Name of the parameter to set. - * @param value - * the Value of the parameter to set. - */ - public void setParameter(String name, String value) { - if (params == null) { - params = new HashMap(); - } - params.put(name, value); - } - - /** - * Gets a paramater for download stream. Parameters are optional information - * about the downloadable stream and their meaning depends on the used - * adapter. For example in WebAdapter they are interpreted as HTTP response - * headers. - * - * @param name - * the Name of the parameter to set. - * @return Value of the parameter or null if the parameter does not exist. - */ - public String getParameter(String name) { - if (params != null) { - return params.get(name); - } - return null; - } - - /** - * Gets the names of the parameters. - * - * @return Iterator of names or null if no parameters are set. - */ - public Iterator getParameterNames() { - if (params != null) { - return params.keySet().iterator(); - } - return null; - } - - /** - * Gets length of cache expiration time. This gives the adapter the - * possibility cache streams sent to the client. The caching may be made in - * adapter or at the client if the client supports caching. Default is - * DEFAULT_CACHETIME. - * - * @return Cache time in milliseconds - */ - public long getCacheTime() { - return cacheTime; - } - - /** - * Sets length of cache expiration time. This gives the adapter the - * possibility cache streams sent to the client. The caching may be made in - * adapter or at the client if the client supports caching. Zero or negavive - * value disbales the caching of this stream. - * - * @param cacheTime - * the cache time in milliseconds. - */ - public void setCacheTime(long cacheTime) { - this.cacheTime = cacheTime; - } - - /** - * Gets the size of the download buffer. - * - * @return int The size of the buffer in bytes. - */ - public int getBufferSize() { - return bufferSize; - } - - /** - * Sets the size of the download buffer. - * - * @param bufferSize - * the size of the buffer in bytes. - * - * @since 7.0 - */ - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - - /** - * Writes this download stream to a wrapped response. This takes care of - * setting response headers according to what is defined in this download - * stream ({@link #getContentType()}, {@link #getCacheTime()}, - * {@link #getFileName()}) and transferring the data from the stream ( - * {@link #getStream()}) to the response. Defined parameters ( - * {@link #getParameterNames()}) are also included as headers in the - * response. If there's is a parameter named Location, a - * redirect (302 Moved temporarily) is sent instead of the contents of this - * stream. - * - * @param response - * the wrapped response to write this download stream to - * @throws IOException - * passed through from the wrapped response - * - * @since 7.0 - */ - public void writeTo(WrappedResponse response) throws IOException { - if (getParameter("Location") != null) { - response.setStatus(HttpServletResponse.SC_MOVED_TEMPORARILY); - response.setHeader("Location", getParameter("Location")); - return; - } - - // Download from given stream - final InputStream data = getStream(); - if (data != null) { - - OutputStream out = null; - try { - // Sets content type - response.setContentType(getContentType()); - - // Sets cache headers - response.setCacheTime(getCacheTime()); - - // Copy download stream parameters directly - // to HTTP headers. - final Iterator i = getParameterNames(); - if (i != null) { - while (i.hasNext()) { - final String param = i.next(); - response.setHeader(param, getParameter(param)); - } - } - - // suggest local filename from DownloadStream if - // Content-Disposition - // not explicitly set - String contentDispositionValue = getParameter("Content-Disposition"); - if (contentDispositionValue == null) { - contentDispositionValue = "filename=\"" + getFileName() - + "\""; - response.setHeader("Content-Disposition", - contentDispositionValue); - } - - int bufferSize = getBufferSize(); - if (bufferSize <= 0 || bufferSize > Constants.MAX_BUFFER_SIZE) { - bufferSize = Constants.DEFAULT_BUFFER_SIZE; - } - final byte[] buffer = new byte[bufferSize]; - int bytesRead = 0; - - out = response.getOutputStream(); - - long totalWritten = 0; - while ((bytesRead = data.read(buffer)) > 0) { - out.write(buffer, 0, bytesRead); - - totalWritten += bytesRead; - if (totalWritten >= buffer.length) { - // Avoid chunked encoding for small resources - out.flush(); - } - } - } finally { - tryToCloseStream(out); - tryToCloseStream(data); - } - } - } - - /** - * Helper method that tries to close an output stream and ignores any - * exceptions. - * - * @param out - * the output stream to close, null is also - * supported - */ - static void tryToCloseStream(OutputStream out) { - try { - // try to close output stream (e.g. file handle) - if (out != null) { - out.close(); - } - } catch (IOException e1) { - // NOP - } - } - - /** - * Helper method that tries to close an input stream and ignores any - * exceptions. - * - * @param in - * the input stream to close, null is also supported - */ - static void tryToCloseStream(InputStream in) { - try { - // try to close output stream (e.g. file handle) - if (in != null) { - in.close(); - } - } catch (IOException e1) { - // NOP - } - } - -} diff --git a/server/src/com/vaadin/terminal/ErrorMessage.java b/server/src/com/vaadin/terminal/ErrorMessage.java deleted file mode 100644 index 15273efb6f..0000000000 --- a/server/src/com/vaadin/terminal/ErrorMessage.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -/** - * Interface for rendering error messages to terminal. All the visible errors - * shown to user must implement this interface. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface ErrorMessage extends Serializable { - - public enum ErrorLevel { - /** - * Error code for informational messages. - */ - INFORMATION("info", 0), - /** - * Error code for warning messages. - */ - WARNING("warning", 1), - /** - * Error code for regular error messages. - */ - ERROR("error", 2), - /** - * Error code for critical error messages. - */ - CRITICAL("critical", 3), - /** - * Error code for system errors and bugs. - */ - SYSTEMERROR("system", 4); - - String text; - int errorLevel; - - private ErrorLevel(String text, int errorLevel) { - this.text = text; - this.errorLevel = errorLevel; - } - - /** - * Textual representation for server-client communication of level - * - * @return String for error severity - */ - public String getText() { - return text; - } - - /** - * Integer representation of error severity for comparison - * - * @return integer for error severity - */ - public int intValue() { - return errorLevel; - } - - @Override - public String toString() { - return text; - } - - } - - /** - * @deprecated from 7.0, use {@link ErrorLevel#SYSTEMERROR} instead     - */ - @Deprecated - public static final ErrorLevel SYSTEMERROR = ErrorLevel.SYSTEMERROR; - - /** - * @deprecated from 7.0, use {@link ErrorLevel#CRITICAL} instead     - */ - @Deprecated - public static final ErrorLevel CRITICAL = ErrorLevel.CRITICAL; - - /** - * @deprecated from 7.0, use {@link ErrorLevel#ERROR} instead     - */ - - @Deprecated - public static final ErrorLevel ERROR = ErrorLevel.ERROR; - - /** - * @deprecated from 7.0, use {@link ErrorLevel#WARNING} instead     - */ - @Deprecated - public static final ErrorLevel WARNING = ErrorLevel.WARNING; - - /** - * @deprecated from 7.0, use {@link ErrorLevel#INFORMATION} instead     - */ - @Deprecated - public static final ErrorLevel INFORMATION = ErrorLevel.INFORMATION; - - /** - * Gets the errors level. - * - * @return the level of error as an integer. - */ - public ErrorLevel getErrorLevel(); - - /** - * Returns the HTML formatted message to show in as the error message on the - * client. - * - * This method should perform any necessary escaping to avoid XSS attacks. - * - * TODO this API may still change to use a separate data transfer object - * - * @return HTML formatted string for the error message - * @since 7.0 - */ - public String getFormattedHtmlMessage(); - -} diff --git a/server/src/com/vaadin/terminal/Extension.java b/server/src/com/vaadin/terminal/Extension.java deleted file mode 100644 index 87901c3c13..0000000000 --- a/server/src/com/vaadin/terminal/Extension.java +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.terminal.gwt.server.ClientConnector; - -/** - * An extension is an entity that is attached to a Component or another - * Extension and independently communicates between client and server. - *

- * An extension can only be attached once. It is not supported to move an - * extension from one target to another. - *

- * Extensions can use shared state and RPC in the same way as components. - * - * @author Vaadin Ltd - * @since 7.0.0 - */ -public interface Extension extends ClientConnector { - /* - * Currently just an empty marker interface to distinguish between - * extensions and other connectors, e.g. components - */ -} diff --git a/server/src/com/vaadin/terminal/ExternalResource.java b/server/src/com/vaadin/terminal/ExternalResource.java deleted file mode 100644 index d970c0934b..0000000000 --- a/server/src/com/vaadin/terminal/ExternalResource.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.net.URL; - -import com.vaadin.service.FileTypeResolver; - -/** - * ExternalResource implements source for resources fetched from - * location specified by URL:s. The resources are fetched directly by the client - * terminal and are not fetched trough the terminal adapter. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class ExternalResource implements Resource, Serializable { - - /** - * Url of the download. - */ - private String sourceURL = null; - - /** - * MIME Type for the resource - */ - private String mimeType = null; - - /** - * Creates a new download component for downloading directly from given URL. - * - * @param sourceURL - * the source URL. - */ - public ExternalResource(URL sourceURL) { - if (sourceURL == null) { - throw new RuntimeException("Source must be non-null"); - } - - this.sourceURL = sourceURL.toString(); - } - - /** - * Creates a new download component for downloading directly from given URL. - * - * @param sourceURL - * the source URL. - * @param mimeType - * the MIME Type - */ - public ExternalResource(URL sourceURL, String mimeType) { - this(sourceURL); - this.mimeType = mimeType; - } - - /** - * Creates a new download component for downloading directly from given URL. - * - * @param sourceURL - * the source URL. - */ - public ExternalResource(String sourceURL) { - if (sourceURL == null) { - throw new RuntimeException("Source must be non-null"); - } - - this.sourceURL = sourceURL.toString(); - } - - /** - * Creates a new download component for downloading directly from given URL. - * - * @param sourceURL - * the source URL. - * @param mimeType - * the MIME Type - */ - public ExternalResource(String sourceURL, String mimeType) { - this(sourceURL); - this.mimeType = mimeType; - } - - /** - * Gets the URL of the external resource. - * - * @return the URL of the external resource. - */ - public String getURL() { - return sourceURL; - } - - /** - * Gets the MIME type of the resource. - * - * @see com.vaadin.terminal.Resource#getMIMEType() - */ - @Override - public String getMIMEType() { - if (mimeType == null) { - mimeType = FileTypeResolver.getMIMEType(getURL().toString()); - } - return mimeType; - } - - /** - * Sets the MIME type of the resource. - */ - public void setMIMEType(String mimeType) { - this.mimeType = mimeType; - } - -} diff --git a/server/src/com/vaadin/terminal/FileResource.java b/server/src/com/vaadin/terminal/FileResource.java deleted file mode 100644 index ab8bc95ce3..0000000000 --- a/server/src/com/vaadin/terminal/FileResource.java +++ /dev/null @@ -1,184 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; - -import com.vaadin.Application; -import com.vaadin.service.FileTypeResolver; -import com.vaadin.terminal.Terminal.ErrorEvent; - -/** - * FileResources are files or directories on local filesystem. The - * files and directories are served through URI:s to the client terminal and - * thus must be registered to an URI context before they can be used. The - * resource is automatically registered to the application when it is created. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class FileResource implements ApplicationResource { - - /** - * Default buffer size for this stream resource. - */ - private int bufferSize = 0; - - /** - * File where the downloaded content is fetched from. - */ - private File sourceFile; - - /** - * Application. - */ - private final Application application; - - /** - * Default cache time for this stream resource. - */ - private long cacheTime = DownloadStream.DEFAULT_CACHETIME; - - /** - * Creates a new file resource for providing given file for client - * terminals. - */ - public FileResource(File sourceFile, Application application) { - this.application = application; - setSourceFile(sourceFile); - application.addResource(this); - } - - /** - * Gets the resource as stream. - * - * @see com.vaadin.terminal.ApplicationResource#getStream() - */ - @Override - public DownloadStream getStream() { - try { - final DownloadStream ds = new DownloadStream(new FileInputStream( - sourceFile), getMIMEType(), getFilename()); - ds.setParameter("Content-Length", - String.valueOf(sourceFile.length())); - - ds.setCacheTime(cacheTime); - return ds; - } catch (final FileNotFoundException e) { - // Log the exception using the application error handler - getApplication().getErrorHandler().terminalError(new ErrorEvent() { - - @Override - public Throwable getThrowable() { - return e; - } - - }); - - return null; - } - } - - /** - * Gets the source file. - * - * @return the source File. - */ - public File getSourceFile() { - return sourceFile; - } - - /** - * Sets the source file. - * - * @param sourceFile - * the source file to set. - */ - public void setSourceFile(File sourceFile) { - this.sourceFile = sourceFile; - } - - /** - * @see com.vaadin.terminal.ApplicationResource#getApplication() - */ - @Override - public Application getApplication() { - return application; - } - - /** - * @see com.vaadin.terminal.ApplicationResource#getFilename() - */ - @Override - public String getFilename() { - return sourceFile.getName(); - } - - /** - * @see com.vaadin.terminal.Resource#getMIMEType() - */ - @Override - public String getMIMEType() { - return FileTypeResolver.getMIMEType(sourceFile); - } - - /** - * Gets the length of cache expiration time. This gives the adapter the - * possibility cache streams sent to the client. The caching may be made in - * adapter or at the client if the client supports caching. Default is - * DownloadStream.DEFAULT_CACHETIME. - * - * @return Cache time in milliseconds. - */ - @Override - public long getCacheTime() { - return cacheTime; - } - - /** - * Sets the length of cache expiration time. This gives the adapter the - * possibility cache streams sent to the client. The caching may be made in - * adapter or at the client if the client supports caching. Zero or negavive - * value disbales the caching of this stream. - * - * @param cacheTime - * the cache time in milliseconds. - */ - public void setCacheTime(long cacheTime) { - this.cacheTime = cacheTime; - } - - /* documented in superclass */ - @Override - public int getBufferSize() { - return bufferSize; - } - - /** - * Sets the size of the download buffer used for this resource. - * - * @param bufferSize - * the size of the buffer in bytes. - */ - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - -} diff --git a/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java b/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java deleted file mode 100644 index 17fa2cbd32..0000000000 --- a/server/src/com/vaadin/terminal/JavaScriptCallbackHelper.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - -import com.vaadin.external.json.JSONArray; -import com.vaadin.external.json.JSONException; -import com.vaadin.shared.JavaScriptConnectorState; -import com.vaadin.tools.ReflectTools; -import com.vaadin.ui.AbstractJavaScriptComponent; -import com.vaadin.ui.JavaScript.JavaScriptCallbackRpc; -import com.vaadin.ui.JavaScriptFunction; - -/** - * Internal helper class used to implement functionality common to - * {@link AbstractJavaScriptComponent} and {@link AbstractJavaScriptExtension}. - * Corresponding support in client-side code is in - * {@link com.vaadin.client.JavaScriptConnectorHelper}. - *

- * You should most likely no use this class directly. - * - * @author Vaadin Ltd - * @since 7.0.0 - */ -public class JavaScriptCallbackHelper implements Serializable { - - private static final Method CALL_METHOD = ReflectTools.findMethod( - JavaScriptCallbackRpc.class, "call", String.class, JSONArray.class); - private AbstractClientConnector connector; - - private Map callbacks = new HashMap(); - private JavaScriptCallbackRpc javascriptCallbackRpc; - - public JavaScriptCallbackHelper(AbstractClientConnector connector) { - this.connector = connector; - } - - public void registerCallback(String functionName, - JavaScriptFunction javaScriptCallback) { - callbacks.put(functionName, javaScriptCallback); - JavaScriptConnectorState state = getConnectorState(); - state.getCallbackNames().add(functionName); - ensureRpc(); - } - - private JavaScriptConnectorState getConnectorState() { - JavaScriptConnectorState state = (JavaScriptConnectorState) connector - .getState(); - return state; - } - - private void ensureRpc() { - if (javascriptCallbackRpc == null) { - javascriptCallbackRpc = new JavaScriptCallbackRpc() { - @Override - public void call(String name, JSONArray arguments) { - JavaScriptFunction callback = callbacks.get(name); - try { - callback.call(arguments); - } catch (JSONException e) { - throw new IllegalArgumentException(e); - } - } - }; - connector.registerRpc(javascriptCallbackRpc); - } - } - - public void invokeCallback(String name, Object... arguments) { - if (callbacks.containsKey(name)) { - throw new IllegalStateException( - "Can't call callback " - + name - + " on the client because a callback with the same name is registered on the server."); - } - JSONArray args = new JSONArray(Arrays.asList(arguments)); - connector.addMethodInvocationToQueue( - JavaScriptCallbackRpc.class.getName(), CALL_METHOD, - new Object[] { name, args }); - } - - public void registerRpc(Class rpcInterfaceType) { - if (rpcInterfaceType == JavaScriptCallbackRpc.class) { - // Ignore - return; - } - Map> rpcInterfaces = getConnectorState() - .getRpcInterfaces(); - String interfaceName = rpcInterfaceType.getName(); - if (!rpcInterfaces.containsKey(interfaceName)) { - Set methodNames = new HashSet(); - - for (Method method : rpcInterfaceType.getMethods()) { - methodNames.add(method.getName()); - } - - rpcInterfaces.put(interfaceName, methodNames); - } - } - -} diff --git a/server/src/com/vaadin/terminal/KeyMapper.java b/server/src/com/vaadin/terminal/KeyMapper.java deleted file mode 100644 index cf54af545f..0000000000 --- a/server/src/com/vaadin/terminal/KeyMapper.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.util.HashMap; - -/** - * KeyMapper is the simple two-way map for generating textual keys - * for objects and retrieving the objects later with the key. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -public class KeyMapper implements Serializable { - - private int lastKey = 0; - - private final HashMap objectKeyMap = new HashMap(); - - private final HashMap keyObjectMap = new HashMap(); - - /** - * Gets key for an object. - * - * @param o - * the object. - */ - public String key(V o) { - - if (o == null) { - return "null"; - } - - // If the object is already mapped, use existing key - String key = objectKeyMap.get(o); - if (key != null) { - return key; - } - - // If the object is not yet mapped, map it - key = String.valueOf(++lastKey); - objectKeyMap.put(o, key); - keyObjectMap.put(key, o); - - return key; - } - - /** - * Retrieves object with the key. - * - * @param key - * the name with the desired value. - * @return the object with the key. - */ - public V get(String key) { - return keyObjectMap.get(key); - } - - /** - * Removes object from the mapper. - * - * @param removeobj - * the object to be removed. - */ - public void remove(V removeobj) { - final String key = objectKeyMap.get(removeobj); - - if (key != null) { - objectKeyMap.remove(removeobj); - keyObjectMap.remove(key); - } - } - - /** - * Removes all objects from the mapper. - */ - public void removeAll() { - objectKeyMap.clear(); - keyObjectMap.clear(); - } -} diff --git a/server/src/com/vaadin/terminal/LegacyPaint.java b/server/src/com/vaadin/terminal/LegacyPaint.java deleted file mode 100644 index 3db0f52079..0000000000 --- a/server/src/com/vaadin/terminal/LegacyPaint.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal; - -import java.io.Serializable; - -import com.vaadin.terminal.PaintTarget.PaintStatus; -import com.vaadin.ui.Component; -import com.vaadin.ui.HasComponents; - -public class LegacyPaint implements Serializable { - /** - * - *

- * Paints the Paintable into a UIDL stream. This method creates the UIDL - * sequence describing it and outputs it to the given UIDL stream. - *

- * - *

- * It is called when the contents of the component should be painted in - * response to the component first being shown or having been altered so - * that its visual representation is changed. - *

- * - *

- * Do not override this to paint your component. Override - * {@link #paintContent(PaintTarget)} instead. - *

- * - * - * @param target - * the target UIDL stream where the component should paint itself - * to. - * @throws PaintException - * if the paint operation failed. - */ - public static void paint(Component component, PaintTarget target) - throws PaintException { - // Only paint content of visible components. - if (!isVisibleInContext(component)) { - return; - } - - final String tag = target.getTag(component); - final PaintStatus status = target.startPaintable(component, tag); - if (PaintStatus.CACHED == status) { - // nothing to do but flag as cached and close the paintable tag - target.addAttribute("cached", true); - } else { - // Paint the contents of the component - if (component instanceof Vaadin6Component) { - ((Vaadin6Component) component).paintContent(target); - } - - } - target.endPaintable(component); - - } - - /** - * Checks if the component is visible and its parent is visible, - * recursively. - *

- * This is only a helper until paint is moved away from this class. - * - * @return - */ - protected static boolean isVisibleInContext(Component c) { - HasComponents p = c.getParent(); - while (p != null) { - if (!p.isVisible()) { - return false; - } - p = p.getParent(); - } - if (c.getParent() != null && !c.getParent().isComponentVisible(c)) { - return false; - } - - // All parents visible, return this state - return c.isVisible(); - } - -} diff --git a/server/src/com/vaadin/terminal/Page.java b/server/src/com/vaadin/terminal/Page.java deleted file mode 100644 index 66ef7da296..0000000000 --- a/server/src/com/vaadin/terminal/Page.java +++ /dev/null @@ -1,653 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.lang.reflect.Method; -import java.util.EventObject; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; - -import com.vaadin.event.EventRouter; -import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.shared.ui.ui.PageClientRpc; -import com.vaadin.shared.ui.ui.UIConstants; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; -import com.vaadin.terminal.gwt.server.WebApplicationContext; -import com.vaadin.terminal.gwt.server.WebBrowser; -import com.vaadin.tools.ReflectTools; -import com.vaadin.ui.JavaScript; -import com.vaadin.ui.Notification; -import com.vaadin.ui.UI; - -public class Page implements Serializable { - - /** - * Listener that gets notified when the size of the browser window - * containing the uI has changed. - * - * @see UI#addListener(BrowserWindowResizeListener) - */ - public interface BrowserWindowResizeListener extends Serializable { - /** - * Invoked when the browser window containing a UI has been resized. - * - * @param event - * a browser window resize event - */ - public void browserWindowResized(BrowserWindowResizeEvent event); - } - - /** - * Event that is fired when a browser window containing a uI is resized. - */ - public class BrowserWindowResizeEvent extends EventObject { - - private final int width; - private final int height; - - /** - * Creates a new event - * - * @param source - * the uI for which the browser window has been resized - * @param width - * the new width of the browser window - * @param height - * the new height of the browser window - */ - public BrowserWindowResizeEvent(Page source, int width, int height) { - super(source); - this.width = width; - this.height = height; - } - - @Override - public Page getSource() { - return (Page) super.getSource(); - } - - /** - * Gets the new browser window height - * - * @return an integer with the new pixel height of the browser window - */ - public int getHeight() { - return height; - } - - /** - * Gets the new browser window width - * - * @return an integer with the new pixel width of the browser window - */ - public int getWidth() { - return width; - } - } - - /** - * Private class for storing properties related to opening resources. - */ - private class OpenResource implements Serializable { - - /** - * The resource to open - */ - private final Resource resource; - - /** - * The name of the target window - */ - private final String name; - - /** - * The width of the target window - */ - private final int width; - - /** - * The height of the target window - */ - private final int height; - - /** - * The border style of the target window - */ - private final BorderStyle border; - - /** - * Creates a new open resource. - * - * @param resource - * The resource to open - * @param name - * The name of the target window - * @param width - * The width of the target window - * @param height - * The height of the target window - * @param border - * The border style of the target window - */ - private OpenResource(Resource resource, String name, int width, - int height, BorderStyle border) { - this.resource = resource; - this.name = name; - this.width = width; - this.height = height; - this.border = border; - } - - /** - * Paints the open request. Should be painted inside the window. - * - * @param target - * the paint target - * @throws PaintException - * if the paint operation fails - */ - private void paintContent(PaintTarget target) throws PaintException { - target.startTag("open"); - target.addAttribute("src", resource); - if (name != null && name.length() > 0) { - target.addAttribute("name", name); - } - if (width >= 0) { - target.addAttribute("width", width); - } - if (height >= 0) { - target.addAttribute("height", height); - } - switch (border) { - case MINIMAL: - target.addAttribute("border", "minimal"); - break; - case NONE: - target.addAttribute("border", "none"); - break; - } - - target.endTag("open"); - } - } - - private static final Method BROWSWER_RESIZE_METHOD = ReflectTools - .findMethod(BrowserWindowResizeListener.class, - "browserWindowResized", BrowserWindowResizeEvent.class); - - /** - * A border style used for opening resources in a window without a border. - */ - @Deprecated - public static final BorderStyle BORDER_NONE = BorderStyle.NONE; - - /** - * A border style used for opening resources in a window with a minimal - * border. - */ - public static final BorderStyle BORDER_MINIMAL = BorderStyle.MINIMAL; - - /** - * A border style that indicates that the default border style should be - * used when opening resources. - */ - public static final BorderStyle BORDER_DEFAULT = BorderStyle.DEFAULT; - - /** - * Listener that listens changes in URI fragment. - */ - public interface FragmentChangedListener extends Serializable { - public void fragmentChanged(FragmentChangedEvent event); - } - - private static final Method FRAGMENT_CHANGED_METHOD = ReflectTools - .findMethod(Page.FragmentChangedListener.class, "fragmentChanged", - FragmentChangedEvent.class); - - /** - * Resources to be opened automatically on next repaint. The list is - * automatically cleared when it has been sent to the client. - */ - private final LinkedList openList = new LinkedList(); - - /** - * A list of notifications that are waiting to be sent to the client. - * Cleared (set to null) when the notifications have been sent. - */ - private List notifications; - - /** - * Event fired when uri fragment changes. - */ - public class FragmentChangedEvent extends EventObject { - - /** - * The new uri fragment - */ - private final String fragment; - - /** - * Creates a new instance of UriFragmentReader change event. - * - * @param source - * the Source of the event. - */ - public FragmentChangedEvent(Page source, String fragment) { - super(source); - this.fragment = fragment; - } - - /** - * Gets the uI in which the fragment has changed. - * - * @return the uI in which the fragment has changed - */ - public Page getPage() { - return (Page) getSource(); - } - - /** - * Get the new fragment - * - * @return the new fragment - */ - public String getFragment() { - return fragment; - } - } - - private EventRouter eventRouter; - - /** - * The current URI fragment. - */ - private String fragment; - - private final UI uI; - - private int browserWindowWidth = -1; - private int browserWindowHeight = -1; - - private JavaScript javaScript; - - public Page(UI uI) { - this.uI = uI; - } - - private void addListener(Class eventType, Object target, Method method) { - if (eventRouter == null) { - eventRouter = new EventRouter(); - } - eventRouter.addListener(eventType, target, method); - } - - private void removeListener(Class eventType, Object target, Method method) { - if (eventRouter != null) { - eventRouter.removeListener(eventType, target, method); - } - } - - public void addListener(Page.FragmentChangedListener listener) { - addListener(FragmentChangedEvent.class, listener, - FRAGMENT_CHANGED_METHOD); - } - - public void removeListener(Page.FragmentChangedListener listener) { - removeListener(FragmentChangedEvent.class, listener, - FRAGMENT_CHANGED_METHOD); - } - - /** - * Sets URI fragment. Optionally fires a {@link FragmentChangedEvent} - * - * @param newFragment - * id of the new fragment - * @param fireEvent - * true to fire event - * @see FragmentChangedEvent - * @see Page.FragmentChangedListener - */ - public void setFragment(String newFragment, boolean fireEvents) { - if (newFragment == null) { - throw new NullPointerException("The fragment may not be null"); - } - if (!newFragment.equals(fragment)) { - fragment = newFragment; - if (fireEvents) { - fireEvent(new FragmentChangedEvent(this, newFragment)); - } - uI.markAsDirty(); - } - } - - private void fireEvent(EventObject event) { - if (eventRouter != null) { - eventRouter.fireEvent(event); - } - } - - /** - * Sets URI fragment. This method fires a {@link FragmentChangedEvent} - * - * @param newFragment - * id of the new fragment - * @see FragmentChangedEvent - * @see Page.FragmentChangedListener - */ - public void setFragment(String newFragment) { - setFragment(newFragment, true); - } - - /** - * Gets currently set URI fragment. - *

- * To listen changes in fragment, hook a - * {@link Page.FragmentChangedListener}. - * - * @return the current fragment in browser uri or null if not known - */ - public String getFragment() { - return fragment; - } - - public void init(WrappedRequest request) { - BrowserDetails browserDetails = request.getBrowserDetails(); - if (browserDetails != null) { - fragment = browserDetails.getUriFragment(); - } - } - - public WebBrowser getWebBrowser() { - return ((WebApplicationContext) uI.getApplication().getContext()) - .getBrowser(); - } - - public void setBrowserWindowSize(int width, int height) { - boolean fireEvent = false; - - if (width != browserWindowWidth) { - browserWindowWidth = width; - fireEvent = true; - } - - if (height != browserWindowHeight) { - browserWindowHeight = height; - fireEvent = true; - } - - if (fireEvent) { - fireEvent(new BrowserWindowResizeEvent(this, browserWindowWidth, - browserWindowHeight)); - } - - } - - /** - * Adds a new {@link BrowserWindowResizeListener} to this uI. The listener - * will be notified whenever the browser window within which this uI - * resides is resized. - * - * @param resizeListener - * the listener to add - * - * @see BrowserWindowResizeListener#browserWindowResized(BrowserWindowResizeEvent) - * @see #setResizeLazy(boolean) - */ - public void addListener(BrowserWindowResizeListener resizeListener) { - addListener(BrowserWindowResizeEvent.class, resizeListener, - BROWSWER_RESIZE_METHOD); - } - - /** - * Removes a {@link BrowserWindowResizeListener} from this uI. The - * listener will no longer be notified when the browser window is resized. - * - * @param resizeListener - * the listener to remove - */ - public void removeListener(BrowserWindowResizeListener resizeListener) { - removeListener(BrowserWindowResizeEvent.class, resizeListener, - BROWSWER_RESIZE_METHOD); - } - - /** - * Gets the last known height of the browser window in which this uI - * resides. - * - * @return the browser window height in pixels - */ - public int getBrowserWindowHeight() { - return browserWindowHeight; - } - - /** - * Gets the last known width of the browser window in which this uI - * resides. - * - * @return the browser window width in pixels - */ - public int getBrowserWindowWidth() { - return browserWindowWidth; - } - - public JavaScript getJavaScript() { - if (javaScript == null) { - // Create and attach on first use - javaScript = new JavaScript(); - javaScript.extend(uI); - } - - return javaScript; - } - - public void paintContent(PaintTarget target) throws PaintException { - if (!openList.isEmpty()) { - for (final Iterator i = openList.iterator(); i - .hasNext();) { - (i.next()).paintContent(target); - } - openList.clear(); - } - - // Paint notifications - if (notifications != null) { - target.startTag("notifications"); - for (final Iterator it = notifications.iterator(); it - .hasNext();) { - final Notification n = it.next(); - target.startTag("notification"); - if (n.getCaption() != null) { - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_CAPTION, - n.getCaption()); - } - if (n.getDescription() != null) { - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_MESSAGE, - n.getDescription()); - } - if (n.getIcon() != null) { - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_ICON, - n.getIcon()); - } - if (!n.isHtmlContentAllowed()) { - target.addAttribute( - UIConstants.NOTIFICATION_HTML_CONTENT_NOT_ALLOWED, - true); - } - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_POSITION, n - .getPosition().ordinal()); - target.addAttribute(UIConstants.ATTRIBUTE_NOTIFICATION_DELAY, - n.getDelayMsec()); - if (n.getStyleName() != null) { - target.addAttribute( - UIConstants.ATTRIBUTE_NOTIFICATION_STYLE, - n.getStyleName()); - } - target.endTag("notification"); - } - target.endTag("notifications"); - notifications = null; - } - - if (fragment != null) { - target.addAttribute(UIConstants.FRAGMENT_VARIABLE, fragment); - } - - } - - /** - * Opens the given resource in this uI. The contents of this UI is - * replaced by the {@code Resource}. - * - * @param resource - * the resource to show in this uI - */ - public void open(Resource resource) { - openList.add(new OpenResource(resource, null, -1, -1, BORDER_DEFAULT)); - uI.markAsDirty(); - } - - /** - * Opens the given resource in a window with the given name. - *

- * The supplied {@code windowName} is used as the target name in a - * window.open call in the client. This means that special values such as - * "_blank", "_self", "_top", "_parent" have special meaning. An empty or - * null window name is also a special case. - *

- *

- * "", null and "_self" as {@code windowName} all causes the resource to be - * opened in the current window, replacing any old contents. For - * downloadable content you should avoid "_self" as "_self" causes the - * client to skip rendering of any other changes as it considers them - * irrelevant (the page will be replaced by the resource). This can speed up - * the opening of a resource, but it might also put the client side into an - * inconsistent state if the window content is not completely replaced e.g., - * if the resource is downloaded instead of displayed in the browser. - *

- *

- * "_blank" as {@code windowName} causes the resource to always be opened in - * a new window or tab (depends on the browser and browser settings). - *

- *

- * "_top" and "_parent" as {@code windowName} works as specified by the HTML - * standard. - *

- *

- * Any other {@code windowName} will open the resource in a window with that - * name, either by opening a new window/tab in the browser or by replacing - * the contents of an existing window with that name. - *

- * - * @param resource - * the resource. - * @param windowName - * the name of the window. - */ - public void open(Resource resource, String windowName) { - openList.add(new OpenResource(resource, windowName, -1, -1, - BORDER_DEFAULT)); - uI.markAsDirty(); - } - - /** - * Opens the given resource in a window with the given size, border and - * name. For more information on the meaning of {@code windowName}, see - * {@link #open(Resource, String)}. - * - * @param resource - * the resource. - * @param windowName - * the name of the window. - * @param width - * the width of the window in pixels - * @param height - * the height of the window in pixels - * @param border - * the border style of the window. - */ - public void open(Resource resource, String windowName, int width, - int height, BorderStyle border) { - openList.add(new OpenResource(resource, windowName, width, height, - border)); - uI.markAsDirty(); - } - - /** - * Internal helper method to actually add a notification. - * - * @param notification - * the notification to add - */ - private void addNotification(Notification notification) { - if (notifications == null) { - notifications = new LinkedList(); - } - notifications.add(notification); - uI.markAsDirty(); - } - - /** - * Shows a notification message. - * - * @see Notification - * - * @param notification - * The notification message to show - * - * @deprecated Use Notification.show(Page) instead. - */ - @Deprecated - public void showNotification(Notification notification) { - addNotification(notification); - } - - /** - * Gets the Page to which the current uI belongs. This is automatically - * defined when processing requests to the server. In other cases, (e.g. - * from background threads), the current uI is not automatically defined. - * - * @see UI#getCurrent() - * - * @return the current page instance if available, otherwise - * null - */ - public static Page getCurrent() { - UI currentUI = UI.getCurrent(); - if (currentUI == null) { - return null; - } - return currentUI.getPage(); - } - - /** - * Sets the page title. The page title is displayed by the browser e.g. as - * the title of the browser window or as the title of the tab. - * - * @param title - * the new page title to set - */ - public void setTitle(String title) { - uI.getRpcProxy(PageClientRpc.class).setTitle(title); - } - -} diff --git a/server/src/com/vaadin/terminal/PaintException.java b/server/src/com/vaadin/terminal/PaintException.java deleted file mode 100644 index dd5752653a..0000000000 --- a/server/src/com/vaadin/terminal/PaintException.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.Serializable; - -/** - * PaintExcepection is thrown if painting of a component fails. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class PaintException extends IOException implements Serializable { - - /** - * Constructs an instance of PaintExeception with the specified - * detail message. - * - * @param msg - * the detail message. - */ - public PaintException(String msg) { - super(msg); - } - - /** - * Constructs an instance of PaintExeception with the specified - * detail message and cause. - * - * @param msg - * the detail message. - * @param cause - * the cause - */ - public PaintException(String msg, Throwable cause) { - super(msg, cause); - } - - /** - * Constructs an instance of PaintExeception from IOException. - * - * @param exception - * the original exception. - */ - public PaintException(IOException exception) { - super(exception.getMessage()); - } -} diff --git a/server/src/com/vaadin/terminal/PaintTarget.java b/server/src/com/vaadin/terminal/PaintTarget.java deleted file mode 100644 index fd349310f6..0000000000 --- a/server/src/com/vaadin/terminal/PaintTarget.java +++ /dev/null @@ -1,517 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.util.Map; - -import com.vaadin.terminal.StreamVariable.StreamingStartEvent; -import com.vaadin.terminal.gwt.server.ClientConnector; -import com.vaadin.ui.Component; - -/** - * This interface defines the methods for painting XML to the UIDL stream. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface PaintTarget extends Serializable { - - /** - * Prints single XMLsection. - * - * Prints full XML section. The section data is escaped from XML tags and - * surrounded by XML start and end-tags. - * - * @param sectionTagName - * the name of the tag. - * @param sectionData - * the scetion data. - * @throws PaintException - * if the paint operation failed. - */ - public void addSection(String sectionTagName, String sectionData) - throws PaintException; - - /** - * Result of starting to paint a Component ( - * {@link PaintTarget#startPaintable(Component, String)}). - * - * @since 7.0 - */ - public enum PaintStatus { - /** - * Painting started, addVariable() and addAttribute() etc. methods may - * be called. - */ - PAINTING, - /** - * A previously unpainted or painted {@link Component} has been queued - * be created/update later in a separate change in the same set of - * changes. - */ - CACHED - } - - /** - * Prints element start tag of a paintable section. Starts a paintable - * section using the given tag. The PaintTarget may implement a caching - * scheme, that checks the paintable has actually changed or can a cached - * version be used instead. This method should call the startTag method. - *

- * If the {@link Component} is found in cache and this function returns true - * it may omit the content and close the tag, in which case cached content - * should be used. - *

- *

- * This method may also add only a reference to the paintable and queue the - * paintable to be painted separately. - *

- *

- * Each paintable being painted should be closed by a matching - * {@link #endPaintable(Component)} regardless of the {@link PaintStatus} - * returned. - *

- * - * @param paintable - * the paintable to start. - * @param tag - * the name of the start tag. - * @return {@link PaintStatus} - ready to paint or already cached on the - * client (also used for sub paintables that are painted later - * separately) - * @throws PaintException - * if the paint operation failed. - * @see #startTag(String) - * @since 7.0 (previously using startTag(Paintable, String)) - */ - public PaintStatus startPaintable(Component paintable, String tag) - throws PaintException; - - /** - * Prints paintable element end tag. - * - * Calls to {@link #startPaintable(Component, String)}should be matched by - * {@link #endPaintable(Component)}. If the parent tag is closed before - * every child tag is closed a PaintException is raised. - * - * @param paintable - * the paintable to close. - * @throws PaintException - * if the paint operation failed. - * @since 7.0 (previously using engTag(String)) - */ - public void endPaintable(Component paintable) throws PaintException; - - /** - * Prints element start tag. - * - *
-     * Todo:
-     * Checking of input values
-     * 
- * - * @param tagName - * the name of the start tag. - * @throws PaintException - * if the paint operation failed. - */ - public void startTag(String tagName) throws PaintException; - - /** - * Prints element end tag. - * - * If the parent tag is closed before every child tag is closed an - * PaintException is raised. - * - * @param tagName - * the name of the end tag. - * @throws PaintException - * if the paint operation failed. - */ - public void endTag(String tagName) throws PaintException; - - /** - * Adds a boolean attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Attribute name. - * @param value - * the Attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, boolean value) throws PaintException; - - /** - * Adds a integer attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Attribute name. - * @param value - * the Attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, int value) throws PaintException; - - /** - * Adds a resource attribute to component. Atributes must be added before - * any content is written. - * - * @param name - * the Attribute name - * @param value - * the Attribute value - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, Resource value) throws PaintException; - - /** - * Adds details about {@link StreamVariable} to the UIDL stream. Eg. in web - * terminals Receivers are typically rendered for the client side as URLs, - * where the client side implementation can do an http post request. - *

- * The urls in UIDL message may use Vaadin specific protocol. Before - * actually using the urls on the client side, they should be passed via - * {@link com.vaadin.client.ApplicationConnection#translateVaadinUri(String)}. - *

- * Note that in current terminal implementation StreamVariables are cleaned - * from the terminal only when: - *

    - *
  • a StreamVariable with same name replaces an old one - *
  • the variable owner is no more attached - *
  • the developer signals this by calling - * {@link StreamingStartEvent#disposeStreamVariable()} - *
- * Most commonly a component developer can just ignore this issue, but with - * strict memory requirements and lots of StreamVariables implementations - * that reserve a lot of memory this may be a critical issue. - * - * @param owner - * the ReceiverOwner that can track the progress of streaming to - * the given StreamVariable - * @param name - * an identifying name for the StreamVariable - * @param value - * the StreamVariable to paint - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, - StreamVariable value) throws PaintException; - - /** - * Adds a long attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Attribute name. - * @param value - * the Attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, long value) throws PaintException; - - /** - * Adds a float attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Attribute name. - * @param value - * the Attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, float value) throws PaintException; - - /** - * Adds a double attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Attribute name. - * @param value - * the Attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, double value) throws PaintException; - - /** - * Adds a string attribute to component. Atributes must be added before any - * content is written. - * - * @param name - * the Boolean attribute name. - * @param value - * the Boolean attribute value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addAttribute(String name, String value) throws PaintException; - - /** - * TODO - * - * @param name - * @param value - * @throws PaintException - */ - public void addAttribute(String name, Map value) - throws PaintException; - - /** - * Adds a Component type attribute. On client side the value will be a - * terminal specific reference to corresponding component on client side - * implementation. - * - * @param name - * the name of the attribute - * @param value - * the Component to be referenced on client side - * @throws PaintException - */ - public void addAttribute(String name, Component value) - throws PaintException; - - /** - * Adds a string type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, String value) - throws PaintException; - - /** - * Adds a int type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, int value) - throws PaintException; - - /** - * Adds a long type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, long value) - throws PaintException; - - /** - * Adds a float type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, float value) - throws PaintException; - - /** - * Adds a double type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, double value) - throws PaintException; - - /** - * Adds a boolean type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, boolean value) - throws PaintException; - - /** - * Adds a string array type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * @param value - * the Variable initial value. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addVariable(VariableOwner owner, String name, String[] value) - throws PaintException; - - /** - * Adds a Component type variable. On client side the variable value will be - * a terminal specific reference to corresponding component on client side - * implementation. When updated from client side, terminal will map the - * client side component reference back to a corresponding server side - * reference. - * - * @param owner - * the Listener for variable changes - * @param name - * the name of the variable - * @param value - * the initial value of the variable - * - * @throws PaintException - * if the paint oparation fails - */ - public void addVariable(VariableOwner owner, String name, Component value) - throws PaintException; - - /** - * Adds a upload stream type variable. - * - * @param owner - * the Listener for variable changes. - * @param name - * the Variable name. - * - * @throws PaintException - * if the paint operation failed. - */ - public void addUploadStreamVariable(VariableOwner owner, String name) - throws PaintException; - - /** - * Prints single XML section. - *

- * Prints full XML section. The section data must be XML and it is - * surrounded by XML start and end-tags. - *

- * - * @param sectionTagName - * the tag name. - * @param sectionData - * the section data to be printed. - * @param namespace - * the namespace. - * @throws PaintException - * if the paint operation failed. - */ - public void addXMLSection(String sectionTagName, String sectionData, - String namespace) throws PaintException; - - /** - * Adds UIDL directly. The UIDL must be valid in accordance with the - * UIDL.dtd - * - * @param uidl - * the UIDL to be added. - * @throws PaintException - * if the paint operation failed. - */ - public void addUIDL(java.lang.String uidl) throws PaintException; - - /** - * Adds text node. All the contents of the text are XML-escaped. - * - * @param text - * the Text to add - * @throws PaintException - * if the paint operation failed. - */ - void addText(String text) throws PaintException; - - /** - * Adds CDATA node to target UIDL-tree. - * - * @param text - * the Character data to add - * @throws PaintException - * if the paint operation failed. - * @since 3.1 - */ - void addCharacterData(String text) throws PaintException; - - public void addAttribute(String string, Object[] keys); - - /** - * @return the "tag" string used in communication to present given - * {@link ClientConnector} type. Terminal may define how to present - * the connector. - */ - public String getTag(ClientConnector paintable); - - /** - * @return true if a full repaint has been requested. E.g. refresh in a - * browser window or such. - */ - public boolean isFullRepaint(); - -} diff --git a/server/src/com/vaadin/terminal/RequestHandler.java b/server/src/com/vaadin/terminal/RequestHandler.java deleted file mode 100644 index 2ea02487b1..0000000000 --- a/server/src/com/vaadin/terminal/RequestHandler.java +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.Serializable; - -import com.vaadin.Application; - -/** - * Handler for producing a response to non-UIDL requests. Handlers can be added - * to applications using {@link Application#addRequestHandler(RequestHandler)} - */ -public interface RequestHandler extends Serializable { - - /** - * Handles a non-UIDL request. If a response is written, this method should - * return false to indicate that no more request handlers - * should be invoked for the request. - * - * @param application - * The application to which the request belongs - * @param request - * The request to handle - * @param response - * The response object to which a response can be written. - * @return true if a response has been written and no further request - * handlers should be called, otherwise false - * @throws IOException - */ - boolean handleRequest(Application application, WrappedRequest request, - WrappedResponse response) throws IOException; - -} diff --git a/server/src/com/vaadin/terminal/Resource.java b/server/src/com/vaadin/terminal/Resource.java deleted file mode 100644 index 27adb16869..0000000000 --- a/server/src/com/vaadin/terminal/Resource.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -/** - * Resource provided to the client terminal. Support for actually - * displaying the resource type is left to the terminal. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface Resource extends Serializable { - - /** - * Gets the MIME type of the resource. - * - * @return the MIME type of the resource. - */ - public String getMIMEType(); -} diff --git a/server/src/com/vaadin/terminal/Scrollable.java b/server/src/com/vaadin/terminal/Scrollable.java deleted file mode 100644 index 641b20ab34..0000000000 --- a/server/src/com/vaadin/terminal/Scrollable.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -/** - *

- * This interface is implemented by all visual objects that can be scrolled - * programmatically from the server-side. The unit of scrolling is pixel. - *

- * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface Scrollable extends Serializable { - - /** - * Gets scroll left offset. - * - *

- * Scrolling offset is the number of pixels this scrollable has been - * scrolled right. - *

- * - * @return Horizontal scrolling position in pixels. - */ - public int getScrollLeft(); - - /** - * Sets scroll left offset. - * - *

- * Scrolling offset is the number of pixels this scrollable has been - * scrolled right. - *

- * - * @param scrollLeft - * the xOffset. - */ - public void setScrollLeft(int scrollLeft); - - /** - * Gets scroll top offset. - * - *

- * Scrolling offset is the number of pixels this scrollable has been - * scrolled down. - *

- * - * @return Vertical scrolling position in pixels. - */ - public int getScrollTop(); - - /** - * Sets scroll top offset. - * - *

- * Scrolling offset is the number of pixels this scrollable has been - * scrolled down. - *

- * - *

- * The scrolling position is limited by the current height of the content - * area. If the position is below the height, it is scrolled to the bottom. - * However, if the same response also adds height to the content area, - * scrolling to bottom only scrolls to the bottom of the previous content - * area. - *

- * - * @param scrollTop - * the yOffset. - */ - public void setScrollTop(int scrollTop); - -} diff --git a/server/src/com/vaadin/terminal/Sizeable.java b/server/src/com/vaadin/terminal/Sizeable.java deleted file mode 100644 index d8d0b0e043..0000000000 --- a/server/src/com/vaadin/terminal/Sizeable.java +++ /dev/null @@ -1,252 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -/** - * Interface to be implemented by components wishing to display some object that - * may be dynamically resized during runtime. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -public interface Sizeable extends Serializable { - - /** - * @deprecated from 7.0, use {@link Unit#PIXELS} instead     - */ - @Deprecated - public static final Unit UNITS_PIXELS = Unit.PIXELS; - - /** - * @deprecated from 7.0, use {@link Unit#POINTS} instead     - */ - @Deprecated - public static final Unit UNITS_POINTS = Unit.POINTS; - - /** - * @deprecated from 7.0, use {@link Unit#PICAS} instead     - */ - @Deprecated - public static final Unit UNITS_PICAS = Unit.PICAS; - - /** - * @deprecated from 7.0, use {@link Unit#EM} instead     - */ - @Deprecated - public static final Unit UNITS_EM = Unit.EM; - - /** - * @deprecated from 7.0, use {@link Unit#EX} instead     - */ - @Deprecated - public static final Unit UNITS_EX = Unit.EX; - - /** - * @deprecated from 7.0, use {@link Unit#MM} instead     - */ - @Deprecated - public static final Unit UNITS_MM = Unit.MM; - - /** - * @deprecated from 7.0, use {@link Unit#CM} instead     - */ - @Deprecated - public static final Unit UNITS_CM = Unit.CM; - - /** - * @deprecated from 7.0, use {@link Unit#INCH} instead     - */ - @Deprecated - public static final Unit UNITS_INCH = Unit.INCH; - - /** - * @deprecated from 7.0, use {@link Unit#PERCENTAGE} instead     - */ - @Deprecated - public static final Unit UNITS_PERCENTAGE = Unit.PERCENTAGE; - - public static final float SIZE_UNDEFINED = -1; - - public enum Unit { - /** - * Unit code representing pixels. - */ - PIXELS("px"), - /** - * Unit code representing points (1/72nd of an inch). - */ - POINTS("pt"), - /** - * Unit code representing picas (12 points). - */ - PICAS("pc"), - /** - * Unit code representing the font-size of the relevant font. - */ - EM("em"), - /** - * Unit code representing the x-height of the relevant font. - */ - EX("ex"), - /** - * Unit code representing millimeters. - */ - MM("mm"), - /** - * Unit code representing centimeters. - */ - CM("cm"), - /** - * Unit code representing inches. - */ - INCH("in"), - /** - * Unit code representing in percentage of the containing element - * defined by terminal. - */ - PERCENTAGE("%"); - - private String symbol; - - private Unit(String symbol) { - this.symbol = symbol; - } - - public String getSymbol() { - return symbol; - } - - @Override - public String toString() { - return symbol; - } - - public static Unit getUnitFromSymbol(String symbol) { - if (symbol == null) { - return Unit.PIXELS; // Defaults to pixels - } - for (Unit unit : Unit.values()) { - if (symbol.equals(unit.getSymbol())) { - return unit; - } - } - return Unit.PIXELS; // Defaults to pixels - } - } - - /** - * Gets the width of the object. Negative number implies unspecified size - * (terminal is free to set the size). - * - * @return width of the object in units specified by widthUnits property. - */ - public float getWidth(); - - /** - * Gets the height of the object. Negative number implies unspecified size - * (terminal is free to set the size). - * - * @return height of the object in units specified by heightUnits property. - */ - public float getHeight(); - - /** - * Gets the width property units. - * - * @return units used in width property. - */ - public Unit getWidthUnits(); - - /** - * Gets the height property units. - * - * @return units used in height property. - */ - public Unit getHeightUnits(); - - /** - * Sets the height of the component using String presentation. - * - * String presentation is similar to what is used in Cascading Style Sheets. - * Size can be length or percentage of available size. - * - * The empty string ("") or null will unset the height and set the units to - * pixels. - * - * See CSS - * specification for more details. - * - * @param height - * in CSS style string representation - */ - public void setHeight(String height); - - /** - * Sets the width of the object. Negative number implies unspecified size - * (terminal is free to set the size). - * - * @param width - * the width of the object. - * @param unit - * the unit used for the width. - */ - public void setWidth(float width, Unit unit); - - /** - * Sets the height of the object. Negative number implies unspecified size - * (terminal is free to set the size). - * - * @param height - * the height of the object. - * @param unit - * the unit used for the width. - */ - public void setHeight(float height, Unit unit); - - /** - * Sets the width of the component using String presentation. - * - * String presentation is similar to what is used in Cascading Style Sheets. - * Size can be length or percentage of available size. - * - * The empty string ("") or null will unset the width and set the units to - * pixels. - * - * See CSS - * specification for more details. - * - * @param width - * in CSS style string representation, null or empty string to - * reset - */ - public void setWidth(String width); - - /** - * Sets the size to 100% x 100%. - */ - public void setSizeFull(); - - /** - * Clears any size settings. - */ - public void setSizeUndefined(); - -} diff --git a/server/src/com/vaadin/terminal/StreamResource.java b/server/src/com/vaadin/terminal/StreamResource.java deleted file mode 100644 index bbb58c71e2..0000000000 --- a/server/src/com/vaadin/terminal/StreamResource.java +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.InputStream; -import java.io.Serializable; - -import com.vaadin.Application; -import com.vaadin.service.FileTypeResolver; - -/** - * StreamResource is a resource provided to the client directly by - * the application. The strean resource is fetched from URI that is most often - * in the context of the application or window. The resource is automatically - * registered to window in creation. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class StreamResource implements ApplicationResource { - - /** - * Source stream the downloaded content is fetched from. - */ - private StreamSource streamSource = null; - - /** - * Explicit mime-type. - */ - private String MIMEType = null; - - /** - * Filename. - */ - private String filename; - - /** - * Application. - */ - private final Application application; - - /** - * Default buffer size for this stream resource. - */ - private int bufferSize = 0; - - /** - * Default cache time for this stream resource. - */ - private long cacheTime = DEFAULT_CACHETIME; - - /** - * Creates a new stream resource for downloading from stream. - * - * @param streamSource - * the source Stream. - * @param filename - * the name of the file. - * @param application - * the Application object. - */ - public StreamResource(StreamSource streamSource, String filename, - Application application) { - - this.application = application; - setFilename(filename); - setStreamSource(streamSource); - - // Register to application - application.addResource(this); - - } - - /** - * @see com.vaadin.terminal.Resource#getMIMEType() - */ - @Override - public String getMIMEType() { - if (MIMEType != null) { - return MIMEType; - } - return FileTypeResolver.getMIMEType(filename); - } - - /** - * Sets the mime type of the resource. - * - * @param MIMEType - * the MIME type to be set. - */ - public void setMIMEType(String MIMEType) { - this.MIMEType = MIMEType; - } - - /** - * Returns the source for this StreamResource. StreamSource is - * queried when the resource is about to be streamed to the client. - * - * @return Source of the StreamResource. - */ - public StreamSource getStreamSource() { - return streamSource; - } - - /** - * Sets the source for this StreamResource. - * StreamSource is queried when the resource is about to be - * streamed to the client. - * - * @param streamSource - * the source to set. - */ - public void setStreamSource(StreamSource streamSource) { - this.streamSource = streamSource; - } - - /** - * Gets the filename. - * - * @return the filename. - */ - @Override - public String getFilename() { - return filename; - } - - /** - * Sets the filename. - * - * @param filename - * the filename to set. - */ - public void setFilename(String filename) { - this.filename = filename; - } - - /** - * @see com.vaadin.terminal.ApplicationResource#getApplication() - */ - @Override - public Application getApplication() { - return application; - } - - /** - * @see com.vaadin.terminal.ApplicationResource#getStream() - */ - @Override - public DownloadStream getStream() { - final StreamSource ss = getStreamSource(); - if (ss == null) { - return null; - } - final DownloadStream ds = new DownloadStream(ss.getStream(), - getMIMEType(), getFilename()); - ds.setBufferSize(getBufferSize()); - ds.setCacheTime(cacheTime); - return ds; - } - - /** - * Interface implemented by the source of a StreamResource. - * - * @author Vaadin Ltd. - * @since 3.0 - */ - public interface StreamSource extends Serializable { - - /** - * Returns new input stream that is used for reading the resource. - */ - public InputStream getStream(); - } - - /* documented in superclass */ - @Override - public int getBufferSize() { - return bufferSize; - } - - /** - * Sets the size of the download buffer used for this resource. - * - * @param bufferSize - * the size of the buffer in bytes. - */ - public void setBufferSize(int bufferSize) { - this.bufferSize = bufferSize; - } - - /* documented in superclass */ - @Override - public long getCacheTime() { - return cacheTime; - } - - /** - * Sets the length of cache expiration time. - * - *

- * This gives the adapter the possibility cache streams sent to the client. - * The caching may be made in adapter or at the client if the client - * supports caching. Zero or negavive value disbales the caching of this - * stream. - *

- * - * @param cacheTime - * the cache time in milliseconds. - * - */ - public void setCacheTime(long cacheTime) { - this.cacheTime = cacheTime; - } - -} diff --git a/server/src/com/vaadin/terminal/StreamVariable.java b/server/src/com/vaadin/terminal/StreamVariable.java deleted file mode 100644 index 53f398f09c..0000000000 --- a/server/src/com/vaadin/terminal/StreamVariable.java +++ /dev/null @@ -1,167 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal; - -import java.io.OutputStream; -import java.io.Serializable; - -import com.vaadin.Application; -import com.vaadin.terminal.StreamVariable.StreamingEndEvent; -import com.vaadin.terminal.StreamVariable.StreamingErrorEvent; -import com.vaadin.terminal.StreamVariable.StreamingStartEvent; - -/** - * StreamVariable is a special kind of variable whose value is streamed to an - * {@link OutputStream} provided by the {@link #getOutputStream()} method. E.g. - * in web terminals {@link StreamVariable} can be used to send large files from - * browsers to the server without consuming large amounts of memory. - *

- * Note, writing to the {@link OutputStream} is not synchronized by the terminal - * (to avoid stalls in other operations when eg. streaming to a slow network - * service or file system). If UI is changed as a side effect of writing to the - * output stream, developer must handle synchronization manually. - *

- * - * @author Vaadin Ltd. - * @since 6.5 - * @see PaintTarget#addVariable(VariableOwner, String, StreamVariable) - */ -public interface StreamVariable extends Serializable { - - /** - * Invoked by the terminal when a new upload arrives, after - * {@link #streamingStarted(StreamingStartEvent)} method has been called. - * The terminal implementation will write the streamed variable to the - * returned output stream. - * - * @return Stream to which the uploaded file should be written. - */ - public OutputStream getOutputStream(); - - /** - * Whether the {@link #onProgress(long, long)} method should be called - * during the upload. - *

- * {@link #onProgress(long, long)} is called in a synchronized block when - * the content is being received. This is potentially bit slow, so we are - * calling that method only if requested. The value is requested after the - * {@link #uploadStarted(StreamingStartEvent)} event, but not after reading - * each buffer. - * - * @return true if this {@link StreamVariable} wants to by notified during - * the upload of the progress of streaming. - * @see #onProgress(StreamingProgressEvent) - */ - public boolean listenProgress(); - - /** - * This method is called by the terminal if {@link #listenProgress()} - * returns true when the streaming starts. - */ - public void onProgress(StreamingProgressEvent event); - - public void streamingStarted(StreamingStartEvent event); - - public void streamingFinished(StreamingEndEvent event); - - public void streamingFailed(StreamingErrorEvent event); - - /* - * Not synchronized to avoid stalls (caused by UIDL requests) while - * streaming the content. Implementations also most commonly atomic even - * without the restriction. - */ - /** - * If this method returns true while the content is being streamed the - * Terminal to stop receiving current upload. - *

- * Note, the usage of this method is not synchronized over the Application - * instance by the terminal like other methods. The implementation should - * only return a boolean field and especially not modify UI or implement a - * synchronization by itself. - * - * @return true if the streaming should be interrupted as soon as possible. - */ - public boolean isInterrupted(); - - public interface StreamingEvent extends Serializable { - - /** - * @return the file name of the streamed file if known - */ - public String getFileName(); - - /** - * @return the mime type of the streamed file if known - */ - public String getMimeType(); - - /** - * @return the length of the stream (in bytes) if known, else -1 - */ - public long getContentLength(); - - /** - * @return then number of bytes streamed to StreamVariable - */ - public long getBytesReceived(); - } - - /** - * Event passed to {@link #uploadStarted(StreamingStartEvent)} method before - * the streaming of the content to {@link StreamVariable} starts. - */ - public interface StreamingStartEvent extends StreamingEvent { - /** - * The owner of the StreamVariable can call this method to inform the - * terminal implementation that this StreamVariable will not be used to - * accept more post. - */ - public void disposeStreamVariable(); - } - - /** - * Event passed to {@link #onProgress(StreamingProgressEvent)} method during - * the streaming progresses. - */ - public interface StreamingProgressEvent extends StreamingEvent { - } - - /** - * Event passed to {@link #uploadFinished(StreamingEndEvent)} method the - * contents have been streamed to StreamVariable successfully. - */ - public interface StreamingEndEvent extends StreamingEvent { - } - - /** - * Event passed to {@link #uploadFailed(StreamingErrorEvent)} method when - * the streaming ended before the end of the input. The streaming may fail - * due an interruption by {@link } or due an other unknown exception in - * communication. In the latter case the exception is also passed to - * {@link Application#terminalError(com.vaadin.terminal.Terminal.ErrorEvent)} - * . - */ - public interface StreamingErrorEvent extends StreamingEvent { - - /** - * @return the exception that caused the receiving not to finish cleanly - */ - public Exception getException(); - - } - -} diff --git a/server/src/com/vaadin/terminal/SystemError.java b/server/src/com/vaadin/terminal/SystemError.java deleted file mode 100644 index c4cb7eef0c..0000000000 --- a/server/src/com/vaadin/terminal/SystemError.java +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; - -/** - * SystemError is an error message for a problem caused by error in - * system, not the user application code. The system error can contain technical - * information such as stack trace and exception. - * - * SystemError does not support HTML in error messages or stack traces. If HTML - * messages are required, use {@link UserError} or a custom implementation of - * {@link ErrorMessage}. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class SystemError extends AbstractErrorMessage { - - /** - * Constructor for SystemError with error message specified. - * - * @param message - * the Textual error description. - */ - public SystemError(String message) { - super(message); - setErrorLevel(ErrorLevel.SYSTEMERROR); - setMode(ContentMode.XHTML); - setMessage(getHtmlMessage()); - } - - /** - * Constructor for SystemError with causing exception and error message. - * - * @param message - * the Textual error description. - * @param cause - * the throwable causing the system error. - */ - public SystemError(String message, Throwable cause) { - this(message); - addCause(AbstractErrorMessage.getErrorMessageForException(cause)); - } - - /** - * Constructor for SystemError with cause. - * - * @param cause - * the throwable causing the system error. - */ - public SystemError(Throwable cause) { - this(null, cause); - } - - /** - * Returns the message of the error in HTML. - * - * Note that this API may change in future versions. - */ - protected String getHtmlMessage() { - // TODO wrapping div with namespace? See the old code: - // target.addXMLSection("div", message, - // "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"); - - StringBuilder sb = new StringBuilder(); - if (getMessage() != null) { - sb.append("

"); - sb.append(AbstractApplicationServlet - .safeEscapeForHtml(getMessage())); - sb.append("

"); - } - return sb.toString(); - } - -} diff --git a/server/src/com/vaadin/terminal/Terminal.java b/server/src/com/vaadin/terminal/Terminal.java deleted file mode 100644 index a02bcb50bb..0000000000 --- a/server/src/com/vaadin/terminal/Terminal.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; - -/** - * An interface that provides information about the user's terminal. - * Implementors typically provide additional information using methods not in - * this interface.

- * - * @author Vaadin Ltd. - * @since 3.0 - * @deprecated Currently only a container for ErrorEvent and ErrorListener - */ -@Deprecated -public interface Terminal extends Serializable { - - /** - * An error event implementation for Terminal. - */ - public interface ErrorEvent extends Serializable { - - /** - * Gets the contained throwable, the cause of the error. - */ - public Throwable getThrowable(); - - } - - /** - * Interface for listening to Terminal errors. - */ - public interface ErrorListener extends Serializable { - - /** - * Invoked when a terminal error occurs. - * - * @param event - * the fired event. - */ - public void terminalError(Terminal.ErrorEvent event); - } -} diff --git a/server/src/com/vaadin/terminal/ThemeResource.java b/server/src/com/vaadin/terminal/ThemeResource.java deleted file mode 100644 index 61fe157ee6..0000000000 --- a/server/src/com/vaadin/terminal/ThemeResource.java +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.service.FileTypeResolver; - -/** - * ThemeResource is a named theme dependant resource provided and - * managed by a theme. The actual resource contents are dynamically resolved to - * comply with the used theme by the terminal adapter. This is commonly used to - * provide static images, flash, java-applets, etc for the terminals. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class ThemeResource implements Resource { - - /** - * Id of the terminal managed resource. - */ - private String resourceID = null; - - /** - * Creates a resource. - * - * @param resourceId - * the Id of the resource. - */ - public ThemeResource(String resourceId) { - if (resourceId == null) { - throw new NullPointerException("Resource ID must not be null"); - } - if (resourceId.length() == 0) { - throw new IllegalArgumentException("Resource ID can not be empty"); - } - if (resourceId.charAt(0) == '/') { - throw new IllegalArgumentException( - "Resource ID must be relative (can not begin with /)"); - } - - resourceID = resourceId; - } - - /** - * Tests if the given object equals this Resource. - * - * @param obj - * the object to be tested for equality. - * @return true if the given object equals this Icon, - * false if not. - * @see java.lang.Object#equals(Object) - */ - @Override - public boolean equals(Object obj) { - return obj instanceof ThemeResource - && resourceID.equals(((ThemeResource) obj).resourceID); - } - - /** - * @see java.lang.Object#hashCode() - */ - @Override - public int hashCode() { - return resourceID.hashCode(); - } - - /** - * @see java.lang.Object#toString() - */ - @Override - public String toString() { - return resourceID.toString(); - } - - /** - * Gets the resource id. - * - * @return the resource id. - */ - public String getResourceId() { - return resourceID; - } - - /** - * @see com.vaadin.terminal.Resource#getMIMEType() - */ - @Override - public String getMIMEType() { - return FileTypeResolver.getMIMEType(getResourceId()); - } -} diff --git a/server/src/com/vaadin/terminal/UIProvider.java b/server/src/com/vaadin/terminal/UIProvider.java deleted file mode 100644 index 27b63fbcac..0000000000 --- a/server/src/com/vaadin/terminal/UIProvider.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import com.vaadin.Application; -import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.ui.UI; - -public interface UIProvider { - public Class getUIClass(Application application, - WrappedRequest request) throws UIRequiresMoreInformationException; - - public UI instantiateUI(Application application, - Class type, WrappedRequest request); -} diff --git a/server/src/com/vaadin/terminal/UserError.java b/server/src/com/vaadin/terminal/UserError.java deleted file mode 100644 index 18680f912f..0000000000 --- a/server/src/com/vaadin/terminal/UserError.java +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -/** - * UserError is a controlled error occurred in application. User - * errors are occur in normal usage of the application and guide the user. - * - * @author Vaadin Ltd. - * @since 3.0 - */ -@SuppressWarnings("serial") -public class UserError extends AbstractErrorMessage { - - /** - * @deprecated from 7.0, use {@link ContentMode#TEXT} instead     - */ - @Deprecated - public static final ContentMode CONTENT_TEXT = ContentMode.TEXT; - - /** - * @deprecated from 7.0, use {@link ContentMode#PREFORMATTED} instead     - */ - @Deprecated - public static final ContentMode CONTENT_PREFORMATTED = ContentMode.PREFORMATTED; - - /** - * @deprecated from 7.0, use {@link ContentMode#XHTML} instead     - */ - @Deprecated - public static final ContentMode CONTENT_XHTML = ContentMode.XHTML; - - /** - * Creates a textual error message of level ERROR. - * - * @param textErrorMessage - * the text of the error message. - */ - public UserError(String textErrorMessage) { - super(textErrorMessage); - } - - /** - * Creates an error message with level and content mode. - * - * @param message - * the error message. - * @param contentMode - * the content Mode. - * @param errorLevel - * the level of error. - */ - public UserError(String message, ContentMode contentMode, - ErrorLevel errorLevel) { - super(message); - if (contentMode == null) { - contentMode = ContentMode.TEXT; - } - if (errorLevel == null) { - errorLevel = ErrorLevel.ERROR; - } - setMode(contentMode); - setErrorLevel(errorLevel); - } - -} diff --git a/server/src/com/vaadin/terminal/Vaadin6Component.java b/server/src/com/vaadin/terminal/Vaadin6Component.java deleted file mode 100644 index eb169c90f9..0000000000 --- a/server/src/com/vaadin/terminal/Vaadin6Component.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ -package com.vaadin.terminal; - -import java.util.EventListener; - -import com.vaadin.ui.Component; - -/** - * Interface provided to ease porting of Vaadin 6 components to Vaadin 7. By - * implementing this interface your Component will be able to use - * {@link #paintContent(PaintTarget)} and - * {@link #changeVariables(Object, java.util.Map)} just like in Vaadin 6. - * - * @author Vaadin Ltd - * @since 7.0.0 - * - */ -public interface Vaadin6Component extends VariableOwner, Component, - EventListener { - - /** - *

- * Paints the Paintable into a UIDL stream. This method creates the UIDL - * sequence describing it and outputs it to the given UIDL stream. - *

- * - *

- * It is called when the contents of the component should be painted in - * response to the component first being shown or having been altered so - * that its visual representation is changed. - *

- * - * @param target - * the target UIDL stream where the component should paint itself - * to. - * @throws PaintException - * if the paint operation failed. - */ - public void paintContent(PaintTarget target) throws PaintException; - - /** - * (non-Javadoc) {@inheritDoc} - *

- * For a Vaadin6Component, markAsDirty will also cause - * {@link #paintContent(PaintTarget)} to be called before sending changes to - * the client. - * - * @see com.vaadin.terminal.gwt.server.ClientConnector#markAsDirty() - */ - @Override - public void markAsDirty(); -} diff --git a/server/src/com/vaadin/terminal/VariableOwner.java b/server/src/com/vaadin/terminal/VariableOwner.java deleted file mode 100644 index faa0298311..0000000000 --- a/server/src/com/vaadin/terminal/VariableOwner.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.Serializable; -import java.util.Map; - -/** - *

- * Listener interface for UI variable changes. The user communicates with the - * application using the so-called variables. When the user makes a - * change using the UI the terminal trasmits the changed variables to the - * application, and the components owning those variables may then process those - * changes. - *

- * - * @author Vaadin Ltd. - * @since 3.0 - * @deprecated in 7.0. Only provided to ease porting of Vaadin 6 components. Do - * not implement this directly, implement {@link Vaadin6Component}. - */ -@Deprecated -public interface VariableOwner extends Serializable { - - /** - * Called when one or more variables handled by the implementing class are - * changed. - * - * @param source - * the Source of the variable change. This is the origin of the - * event. For example in Web Adapter this is the request. - * @param variables - * the Mapping from variable names to new variable values. - */ - public void changeVariables(Object source, Map variables); - - /** - *

- * Tests if the variable owner is enabled or not. The terminal should not - * send any variable changes to disabled variable owners. - *

- * - * @return true if the variable owner is enabled, - * false if not - */ - public boolean isEnabled(); - - /** - *

- * Tests if the variable owner is in immediate mode or not. Being in - * immediate mode means that all variable changes are required to be sent - * back from the terminal immediately when they occur. - *

- * - *

- * Note: VariableOwner does not include a set- - * method for the immediateness property. This is because not all - * VariableOwners wish to offer the functionality. Such VariableOwners are - * never in the immediate mode, thus they always return false - * in {@link #isImmediate()}. - *

- * - * @return true if the component is in immediate mode, - * false if not. - */ - public boolean isImmediate(); - - /** - * VariableOwner error event. - */ - public interface ErrorEvent extends Terminal.ErrorEvent { - - /** - * Gets the source VariableOwner. - * - * @return the variable owner. - */ - public VariableOwner getVariableOwner(); - - } -} diff --git a/server/src/com/vaadin/terminal/WrappedRequest.java b/server/src/com/vaadin/terminal/WrappedRequest.java deleted file mode 100644 index 343a60848e..0000000000 --- a/server/src/com/vaadin/terminal/WrappedRequest.java +++ /dev/null @@ -1,290 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.InputStream; -import java.io.Serializable; -import java.util.Locale; -import java.util.Map; - -import javax.portlet.PortletRequest; -import javax.servlet.ServletRequest; -import javax.servlet.http.HttpServletRequest; - -import com.vaadin.Application; -import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.annotations.EagerInit; -import com.vaadin.terminal.gwt.server.WebBrowser; -import com.vaadin.ui.UI; - -/** - * A generic request to the server, wrapping a more specific request type, e.g. - * HttpServletReqest or PortletRequest. - * - * @since 7.0 - */ -public interface WrappedRequest extends Serializable { - - /** - * Detailed information extracted from the browser. - * - * @see WrappedRequest#getBrowserDetails() - */ - public interface BrowserDetails extends Serializable { - /** - * Gets the URI hash fragment for the request. This is typically used to - * encode navigation within an application. - * - * @return the URI hash fragment - */ - public String getUriFragment(); - - /** - * Gets the value of window.name from the browser. This can be used to - * keep track of the specific window between browser reloads. - * - * @return the string value of window.name in the browser - */ - public String getWindowName(); - - /** - * Gets a reference to the {@link WebBrowser} object containing - * additional information, e.g. screen size and the time zone offset. - * - * @return the web browser object - */ - public WebBrowser getWebBrowser(); - } - - /** - * Gets the named request parameter This is typically a HTTP GET or POST - * parameter, though other request types might have other ways of - * representing parameters. - * - * @see javax.servlet.ServletRequest#getParameter(String) - * @see javax.portlet.PortletRequest#getParameter(String) - * - * @param parameter - * the name of the parameter - * @return The paramter value, or null if no parameter with the - * given name is present - */ - public String getParameter(String parameter); - - /** - * Gets all the parameters of the request. - * - * @see #getParameter(String) - * - * @see javax.servlet.ServletRequest#getParameterMap() - * @see javax.portlet.PortletRequest#getParameter(String) - * - * @return A mapping of parameter names to arrays of parameter values - */ - public Map getParameterMap(); - - /** - * Returns the length of the request content that can be read from the input - * stream returned by {@link #getInputStream()}. - * - * @see javax.servlet.ServletRequest#getContentLength() - * @see javax.portlet.ClientDataRequest#getContentLength() - * - * @return content length in bytes - */ - public int getContentLength(); - - /** - * Returns an input stream from which the request content can be read. The - * request content length can be obtained with {@link #getContentLength()} - * without reading the full stream contents. - * - * @see javax.servlet.ServletRequest#getInputStream() - * @see javax.portlet.ClientDataRequest#getPortletInputStream() - * - * @return the input stream from which the contents of the request can be - * read - * @throws IOException - * if the input stream can not be opened - */ - public InputStream getInputStream() throws IOException; - - /** - * Gets a request attribute. - * - * @param name - * the name of the attribute - * @return the value of the attribute, or null if there is no - * attribute with the given name - * - * @see javax.servlet.ServletRequest#getAttribute(String) - * @see javax.portlet.PortletRequest#getAttribute(String) - */ - public Object getAttribute(String name); - - /** - * Defines a request attribute. - * - * @param name - * the name of the attribute - * @param value - * the attribute value - * - * @see javax.servlet.ServletRequest#setAttribute(String, Object) - * @see javax.portlet.PortletRequest#setAttribute(String, Object) - */ - public void setAttribute(String name, Object value); - - /** - * Gets the path of the requested resource relative to the application. The - * path be null if no path information is available. Does - * always start with / if the path isn't null. - * - * @return a string with the path relative to the application. - * - * @see javax.servlet.http.HttpServletRequest#getPathInfo() - */ - public String getRequestPathInfo(); - - /** - * Returns the maximum time interval, in seconds, that the session - * associated with this request will be kept open between client accesses. - * - * @return an integer specifying the number of seconds the session - * associated with this request remains open between client requests - * - * @see javax.servlet.http.HttpSession#getMaxInactiveInterval() - * @see javax.portlet.PortletSession#getMaxInactiveInterval() - */ - public int getSessionMaxInactiveInterval(); - - /** - * Gets an attribute from the session associated with this request. - * - * @param name - * the name of the attribute - * @return the attribute value, or null if the attribute is not - * defined in the session - * - * @see javax.servlet.http.HttpSession#getAttribute(String) - * @see javax.portlet.PortletSession#getAttribute(String) - */ - public Object getSessionAttribute(String name); - - /** - * Saves an attribute value in the session associated with this request. - * - * @param name - * the name of the attribute - * @param attribute - * the attribute value - * - * @see javax.servlet.http.HttpSession#setAttribute(String, Object) - * @see javax.portlet.PortletSession#setAttribute(String, Object) - */ - public void setSessionAttribute(String name, Object attribute); - - /** - * Returns the MIME type of the body of the request, or null if the type is - * not known. - * - * @return a string containing the name of the MIME type of the request, or - * null if the type is not known - * - * @see javax.servlet.ServletRequest#getContentType() - * @see javax.portlet.ResourceRequest#getContentType() - * - */ - public String getContentType(); - - /** - * Gets detailed information about the browser from which the request - * originated. This consists of information that is not available from - * normal HTTP requests, but requires additional information to be extracted - * for instance using javascript in the browser. - * - * This information is only guaranteed to be available in some special - * cases, for instance when - * {@link Application#getUIForRequest(WrappedRequest)} is called again after - * throwing {@link UIRequiresMoreInformationException} or in - * {@link UI#init(WrappedRequest)} for a UI class not annotated with - * {@link EagerInit} - * - * @return the browser details, or null if details are not - * available - * - * @see BrowserDetails - */ - public BrowserDetails getBrowserDetails(); - - /** - * Gets locale information from the query, e.g. using the Accept-Language - * header. - * - * @return the preferred Locale - * - * @see ServletRequest#getLocale() - * @see PortletRequest#getLocale() - */ - public Locale getLocale(); - - /** - * Returns the IP address from which the request came. This might also be - * the address of a proxy between the server and the original requester. - * - * @return a string containing the IP address, or null if the - * address is not available - * - * @see ServletRequest#getRemoteAddr() - */ - public String getRemoteAddr(); - - /** - * Checks whether the request was made using a secure channel, e.g. using - * https. - * - * @return a boolean indicating if the request is secure - * - * @see ServletRequest#isSecure() - * @see PortletRequest#isSecure() - */ - public boolean isSecure(); - - /** - * Gets the value of a request header, e.g. a http header for a - * {@link HttpServletRequest}. - * - * @param headerName - * the name of the header - * @return the header value, or null if the header is not - * present in the request - * - * @see HttpServletRequest#getHeader(String) - */ - public String getHeader(String headerName); - - /** - * Gets the deployment configuration for the context of this request. - * - * @return the deployment configuration - * - * @see DeploymentConfiguration - */ - public DeploymentConfiguration getDeploymentConfiguration(); - -} diff --git a/server/src/com/vaadin/terminal/WrappedResponse.java b/server/src/com/vaadin/terminal/WrappedResponse.java deleted file mode 100644 index 02daaa1bdd..0000000000 --- a/server/src/com/vaadin/terminal/WrappedResponse.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright 2011 Vaadin Ltd. - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.vaadin.terminal; - -import java.io.IOException; -import java.io.OutputStream; -import java.io.PrintWriter; -import java.io.Serializable; - -import javax.portlet.MimeResponse; -import javax.portlet.PortletResponse; -import javax.portlet.ResourceResponse; -import javax.servlet.ServletResponse; -import javax.servlet.http.HttpServletResponse; - -/** - * A generic response from the server, wrapping a more specific response type, - * e.g. HttpServletResponse or PortletResponse. - * - * @since 7.0 - */ -public interface WrappedResponse extends Serializable { - - /** - * Sets the (http) status code for the response. If you want to include an - * error message along the status code, use {@link #sendError(int, String)} - * instead. - * - * @param statusCode - * the status code to set - * @see HttpServletResponse#setStatus(int) - * - * @see ResourceResponse#HTTP_STATUS_CODE - */ - public void setStatus(int statusCode); - - /** - * Sets the content type of this response. If the content type including a - * charset is set before {@link #getWriter()} is invoked, the returned - * PrintWriter will automatically use the defined charset. - * - * @param contentType - * a string specifying the MIME type of the content - * - * @see ServletResponse#setContentType(String) - * @see MimeResponse#setContentType(String) - */ - public void setContentType(String contentType); - - /** - * Sets the value of a generic response header. If the header had already - * been set, the new value overwrites the previous one. - * - * @param name - * the name of the header - * @param value - * the header value. - * - * @see HttpServletResponse#setHeader(String, String) - * @see PortletResponse#setProperty(String, String) - */ - public void setHeader(String name, String value); - - /** - * Properly formats a timestamp as a date header. If the header had already - * been set, the new value overwrites the previous one. - * - * @param name - * the name of the header - * @param timestamp - * the number of milliseconds since epoch - * - * @see HttpServletResponse#setDateHeader(String, long) - */ - public void setDateHeader(String name, long timestamp); - - /** - * Returns a OutputStream for writing binary data in the - * response. - *

- * Either this method or getWriter() may be called to write the response, - * not both. - * - * @return a OutputStream for writing binary data - * @throws IOException - * if an input or output exception occurred - * - * @see #getWriter() - * @see ServletResponse#getOutputStream() - * @see MimeResponse#getPortletOutputStream() - */ - public OutputStream getOutputStream() throws IOException; - - /** - * Returns a PrintWriter object that can send character text to - * the client. The PrintWriter uses the character encoding defined using - * setContentType. - *

- * Either this method or getOutputStream() may be called to write the - * response, not both. - * - * @return a PrintWriter for writing character text - * @throws IOException - * if an input or output exception occurred - * - * @see #getOutputStream() - * @see ServletResponse#getWriter() - * @see MimeResponse#getWriter() - */ - public PrintWriter getWriter() throws IOException; - - /** - * Sets cache time in milliseconds, -1 means no cache at all. All required - * headers related to caching in the response are set based on the time. - * - * @param milliseconds - * Cache time in milliseconds - */ - public void setCacheTime(long milliseconds); - - /** - * Sends an error response to the client using the specified status code and - * clears the buffer. In some configurations, this can cause a predefined - * error page to be displayed. - * - * @param errorCode - * the HTTP status code - * @param message - * a message to accompany the error - * @throws IOException - * if an input or output exception occurs - * - * @see HttpServletResponse#sendError(int, String) - */ - public void sendError(int errorCode, String message) throws IOException; - - /** - * Gets the deployment configuration for the context of this response. - * - * @return the deployment configuration - * - * @see DeploymentConfiguration - */ - public DeploymentConfiguration getDeploymentConfiguration(); -} diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java index 345f462239..47b9e97648 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationPortlet.java @@ -57,10 +57,10 @@ import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.Application.SystemMessages; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.Terminal; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.Terminal; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback; import com.vaadin.ui.UI; diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java index 13fd869166..c92dfddd3b 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractApplicationServlet.java @@ -49,12 +49,12 @@ import javax.servlet.http.HttpSession; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.Application.SystemMessages; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.Terminal; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.Terminal; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; import com.vaadin.terminal.gwt.server.AbstractCommunicationManager.Callback; import com.vaadin.ui.UI; diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java index 47923a1374..d4c1cfb157 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractCommunicationManager.java @@ -66,6 +66,21 @@ import com.vaadin.annotations.StyleSheet; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; +import com.vaadin.server.AbstractClientConnector; +import com.vaadin.server.CombinedRequest; +import com.vaadin.server.LegacyPaint; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.StreamVariable; +import com.vaadin.server.Vaadin6Component; +import com.vaadin.server.VariableOwner; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; +import com.vaadin.server.StreamVariable.StreamingEndEvent; +import com.vaadin.server.StreamVariable.StreamingErrorEvent; +import com.vaadin.server.Terminal.ErrorEvent; +import com.vaadin.server.Terminal.ErrorListener; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.Connector; import com.vaadin.shared.JavaScriptConnectorState; @@ -75,21 +90,6 @@ import com.vaadin.shared.communication.MethodInvocation; import com.vaadin.shared.communication.SharedState; import com.vaadin.shared.communication.UidlValue; import com.vaadin.shared.ui.ui.UIConstants; -import com.vaadin.terminal.AbstractClientConnector; -import com.vaadin.terminal.CombinedRequest; -import com.vaadin.terminal.LegacyPaint; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.StreamVariable; -import com.vaadin.terminal.StreamVariable.StreamingEndEvent; -import com.vaadin.terminal.StreamVariable.StreamingErrorEvent; -import com.vaadin.terminal.Terminal.ErrorEvent; -import com.vaadin.terminal.Terminal.ErrorListener; -import com.vaadin.terminal.Vaadin6Component; -import com.vaadin.terminal.VariableOwner; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; import com.vaadin.terminal.gwt.server.BootstrapHandler.BootstrapContext; import com.vaadin.terminal.gwt.server.ComponentSizeValidator.InvalidLayout; import com.vaadin.terminal.gwt.server.RpcManager.RpcInvocationException; diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java index 4052f5a400..ab85214d25 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractDeploymentConfiguration.java @@ -22,7 +22,7 @@ import java.util.Properties; import java.util.ServiceLoader; import java.util.logging.Logger; -import com.vaadin.terminal.DeploymentConfiguration; +import com.vaadin.server.DeploymentConfiguration; public abstract class AbstractDeploymentConfiguration implements DeploymentConfiguration { diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java b/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java index ec2aa84947..4ee309576b 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractStreamingEvent.java @@ -15,7 +15,7 @@ */ package com.vaadin.terminal.gwt.server; -import com.vaadin.terminal.StreamVariable.StreamingEvent; +import com.vaadin.server.StreamVariable.StreamingEvent; /** * Abstract base class for StreamingEvent implementations. diff --git a/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java b/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java index d857eeef4a..29a2bcf72f 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java +++ b/server/src/com/vaadin/terminal/gwt/server/AbstractWebApplicationContext.java @@ -34,9 +34,9 @@ import javax.servlet.http.HttpSessionBindingEvent; import javax.servlet.http.HttpSessionBindingListener; import com.vaadin.Application; +import com.vaadin.server.ApplicationResource; import com.vaadin.service.ApplicationContext; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.ApplicationResource; /** * Base class for web application contexts (including portlet contexts) that diff --git a/server/src/com/vaadin/terminal/gwt/server/AddonContext.java b/server/src/com/vaadin/terminal/gwt/server/AddonContext.java index 2af22c560b..03f1d95a56 100644 --- a/server/src/com/vaadin/terminal/gwt/server/AddonContext.java +++ b/server/src/com/vaadin/terminal/gwt/server/AddonContext.java @@ -24,7 +24,7 @@ import java.util.ServiceLoader; import com.vaadin.Application; import com.vaadin.event.EventRouter; -import com.vaadin.terminal.DeploymentConfiguration; +import com.vaadin.server.DeploymentConfiguration; import com.vaadin.tools.ReflectTools; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java b/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java index d5c0d604c3..397c8e7369 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java +++ b/server/src/com/vaadin/terminal/gwt/server/ApplicationResourceHandler.java @@ -23,11 +23,11 @@ import java.util.regex.Pattern; import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; public class ApplicationResourceHandler implements RequestHandler { private static final Pattern APP_RESOURCE_PATTERN = Pattern diff --git a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java index 857c7c738c..6765958369 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java +++ b/server/src/com/vaadin/terminal/gwt/server/ApplicationServlet.java @@ -20,7 +20,7 @@ import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import com.vaadin.Application; -import com.vaadin.terminal.DefaultUIProvider; +import com.vaadin.server.DefaultUIProvider; import com.vaadin.terminal.gwt.server.ServletPortletHelper.ApplicationClassException; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java index 6f69086523..ff26a1270a 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapFragmentResponse.java @@ -21,7 +21,7 @@ import java.util.List; import org.jsoup.nodes.Node; import com.vaadin.Application; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; /** * A representation of a bootstrap fragment being generated. The bootstrap diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java index 02005e8d22..94328b47bf 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapHandler.java @@ -40,14 +40,14 @@ import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.PaintException; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.Version; import com.vaadin.shared.ui.ui.UIConstants; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; import com.vaadin.ui.UI; public abstract class BootstrapHandler implements RequestHandler { diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java index 847578ef97..1d244a69be 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapPageResponse.java @@ -21,8 +21,8 @@ import java.util.Map; import org.jsoup.nodes.Document; import com.vaadin.Application; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; /** * A representation of a bootstrap page being generated. The bootstrap page diff --git a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java index a422cba345..bc2fdb0dd2 100644 --- a/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/BootstrapResponse.java @@ -20,7 +20,7 @@ import java.util.EventObject; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java index c2fbbe37d4..152acf9d2b 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java +++ b/server/src/com/vaadin/terminal/gwt/server/ClientConnector.java @@ -20,10 +20,10 @@ import java.util.List; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; +import com.vaadin.server.AbstractClientConnector; +import com.vaadin.server.Extension; import com.vaadin.shared.Connector; import com.vaadin.shared.communication.SharedState; -import com.vaadin.terminal.AbstractClientConnector; -import com.vaadin.terminal.Extension; import com.vaadin.ui.Component; import com.vaadin.ui.ComponentContainer; import com.vaadin.ui.UI; diff --git a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java index 7551e849a1..93a2ede4ce 100644 --- a/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/CommunicationManager.java @@ -23,8 +23,8 @@ import javax.servlet.ServletContext; import com.vaadin.Application; import com.vaadin.external.json.JSONException; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.PaintException; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java b/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java index 2349be1974..b8a116b1ad 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java +++ b/server/src/com/vaadin/terminal/gwt/server/ComponentSizeValidator.java @@ -28,7 +28,7 @@ import java.util.Vector; import java.util.logging.Level; import java.util.logging.Logger; -import com.vaadin.terminal.Sizeable.Unit; +import com.vaadin.server.Sizeable.Unit; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.AbstractSplitPanel; import com.vaadin.ui.Component; diff --git a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java index 0106f466fc..ff5cedd656 100644 --- a/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java +++ b/server/src/com/vaadin/terminal/gwt/server/DragAndDropService.java @@ -33,12 +33,12 @@ import com.vaadin.event.dd.TargetDetailsImpl; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; +import com.vaadin.server.Extension; +import com.vaadin.server.PaintException; +import com.vaadin.server.VariableOwner; import com.vaadin.shared.ApplicationConstants; import com.vaadin.shared.communication.SharedState; import com.vaadin.shared.ui.dd.DragEventType; -import com.vaadin.terminal.Extension; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.VariableOwner; import com.vaadin.ui.Component; import com.vaadin.ui.UI; diff --git a/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java b/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java index 22467a0c1a..3b5eb9b42f 100644 --- a/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java +++ b/server/src/com/vaadin/terminal/gwt/server/HttpServletRequestListener.java @@ -23,8 +23,8 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; +import com.vaadin.server.Terminal; import com.vaadin.service.ApplicationContext.TransactionListener; -import com.vaadin.terminal.Terminal; /** * {@link Application} that implements this interface gets notified of request diff --git a/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java b/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java index cfc3cc7e7e..e7efd28a9c 100644 --- a/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java +++ b/server/src/com/vaadin/terminal/gwt/server/JsonPaintTarget.java @@ -27,11 +27,11 @@ import java.util.Stack; import java.util.Vector; import java.util.logging.Logger; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.StreamVariable; -import com.vaadin.terminal.VariableOwner; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.StreamVariable; +import com.vaadin.server.VariableOwner; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.CustomLayout; @@ -589,7 +589,7 @@ public class JsonPaintTarget implements PaintTarget { * @throws PaintException * if the paint operation failed. * - * @see com.vaadin.terminal.PaintTarget#addXMLSection(String, String, + * @see com.vaadin.server.PaintTarget#addXMLSection(String, String, * String) */ diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java index 3e0f8d6b99..b10e661fb3 100644 --- a/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java +++ b/server/src/com/vaadin/terminal/gwt/server/PortletApplicationContext2.java @@ -45,7 +45,7 @@ import javax.servlet.http.HttpSessionBindingListener; import javax.xml.namespace.QName; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.UI; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java index e127425786..a2aa446ac7 100644 --- a/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java +++ b/server/src/com/vaadin/terminal/gwt/server/PortletCommunicationManager.java @@ -29,11 +29,11 @@ import javax.portlet.ResourceURL; import com.vaadin.Application; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.PaintException; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; import com.vaadin.ui.UI; /** diff --git a/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java b/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java index f7b6421e11..5647606a75 100644 --- a/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java +++ b/server/src/com/vaadin/terminal/gwt/server/PortletRequestListener.java @@ -22,8 +22,8 @@ import javax.portlet.PortletResponse; import javax.servlet.Filter; import com.vaadin.Application; +import com.vaadin.server.Terminal; import com.vaadin.service.ApplicationContext.TransactionListener; -import com.vaadin.terminal.Terminal; /** * An {@link Application} that implements this interface gets notified of diff --git a/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java b/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java index a1d5731f7d..98aa61a885 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java +++ b/server/src/com/vaadin/terminal/gwt/server/ResourceReference.java @@ -16,11 +16,11 @@ package com.vaadin.terminal.gwt.server; import com.vaadin.Application; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.communication.URLReference; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; public class ResourceReference extends URLReference { diff --git a/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java b/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java index 1a3cf28fcc..0bdb141b6f 100644 --- a/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java +++ b/server/src/com/vaadin/terminal/gwt/server/RpcTarget.java @@ -18,7 +18,7 @@ package com.vaadin.terminal.gwt.server; import java.io.Serializable; -import com.vaadin.terminal.VariableOwner; +import com.vaadin.server.VariableOwner; /** * Marker interface for server side classes that can receive RPC calls. diff --git a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java index 1d35785a57..cb95eada22 100644 --- a/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java +++ b/server/src/com/vaadin/terminal/gwt/server/ServletPortletHelper.java @@ -3,9 +3,9 @@ package com.vaadin.terminal.gwt.server; import java.io.Serializable; import com.vaadin.Application; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.ui.UI; /* diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java index 6bc9f8fbd9..a484705ca5 100644 --- a/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java +++ b/server/src/com/vaadin/terminal/gwt/server/StreamingEndEventImpl.java @@ -15,7 +15,7 @@ */ package com.vaadin.terminal.gwt.server; -import com.vaadin.terminal.StreamVariable.StreamingEndEvent; +import com.vaadin.server.StreamVariable.StreamingEndEvent; @SuppressWarnings("serial") final class StreamingEndEventImpl extends AbstractStreamingEvent implements diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java index cf9339d676..8e794b5fbf 100644 --- a/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java +++ b/server/src/com/vaadin/terminal/gwt/server/StreamingErrorEventImpl.java @@ -15,7 +15,7 @@ */ package com.vaadin.terminal.gwt.server; -import com.vaadin.terminal.StreamVariable.StreamingErrorEvent; +import com.vaadin.server.StreamVariable.StreamingErrorEvent; @SuppressWarnings("serial") final class StreamingErrorEventImpl extends AbstractStreamingEvent implements diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java index bcb114db60..14d0ed4f3a 100644 --- a/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java +++ b/server/src/com/vaadin/terminal/gwt/server/StreamingProgressEventImpl.java @@ -15,7 +15,7 @@ */ package com.vaadin.terminal.gwt.server; -import com.vaadin.terminal.StreamVariable.StreamingProgressEvent; +import com.vaadin.server.StreamVariable.StreamingProgressEvent; @SuppressWarnings("serial") final class StreamingProgressEventImpl extends AbstractStreamingEvent implements diff --git a/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java b/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java index 07ff6cf7b1..51c286549d 100644 --- a/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java +++ b/server/src/com/vaadin/terminal/gwt/server/StreamingStartEventImpl.java @@ -15,7 +15,7 @@ */ package com.vaadin.terminal.gwt.server; -import com.vaadin.terminal.StreamVariable.StreamingStartEvent; +import com.vaadin.server.StreamVariable.StreamingStartEvent; @SuppressWarnings("serial") final class StreamingStartEventImpl extends AbstractStreamingEvent implements diff --git a/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java b/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java index 22e46cb722..b30133191d 100644 --- a/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java +++ b/server/src/com/vaadin/terminal/gwt/server/UnsupportedBrowserHandler.java @@ -19,9 +19,9 @@ import java.io.IOException; import java.io.Writer; import com.vaadin.Application; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; /** * A {@link RequestHandler} that presents an informative page if the browser in diff --git a/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java b/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java index 37bc81cfcf..25193b5cbe 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java +++ b/server/src/com/vaadin/terminal/gwt/server/WebBrowser.java @@ -19,8 +19,8 @@ package com.vaadin.terminal.gwt.server; import java.util.Date; import java.util.Locale; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.VBrowserDetails; -import com.vaadin.terminal.WrappedRequest; /** * Class that provides information about the web browser the user is using. diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java index a64be4c163..6b69a125a2 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java +++ b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletRequest.java @@ -20,9 +20,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequestWrapper; import com.vaadin.Application; -import com.vaadin.terminal.CombinedRequest; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.CombinedRequest; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedRequest; /** * Wrapper for {@link HttpServletRequest}. diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java index 237bb643ee..c2e8ed1416 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/WrappedHttpServletResponse.java @@ -19,8 +19,8 @@ package com.vaadin.terminal.gwt.server; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponseWrapper; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedResponse; /** * Wrapper for {@link HttpServletResponse}. diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java index 9ac2e5a608..80d6f9571e 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java +++ b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletRequest.java @@ -26,10 +26,10 @@ import javax.portlet.PortletRequest; import javax.portlet.ResourceRequest; import com.vaadin.Application; +import com.vaadin.server.CombinedRequest; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.CombinedRequest; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedRequest; /** * Wrapper for {@link PortletRequest} and its subclasses. diff --git a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java index 39ccacd331..584c304eaa 100644 --- a/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java +++ b/server/src/com/vaadin/terminal/gwt/server/WrappedPortletResponse.java @@ -29,8 +29,8 @@ import javax.portlet.MimeResponse; import javax.portlet.PortletResponse; import javax.portlet.ResourceResponse; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedResponse; /** * Wrapper for {@link PortletResponse} and its subclasses. diff --git a/server/src/com/vaadin/terminal/package.html b/server/src/com/vaadin/terminal/package.html deleted file mode 100644 index 83514a0de5..0000000000 --- a/server/src/com/vaadin/terminal/package.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - -

Provides classes and interfaces that wrap the terminal-side functionalities -for the server-side application. (FIXME: This could be a little more descriptive and wordy.)

- -

Package Specification

- - - - - - - diff --git a/server/src/com/vaadin/ui/AbsoluteLayout.java b/server/src/com/vaadin/ui/AbsoluteLayout.java index 56bbd19852..412a3390e4 100644 --- a/server/src/com/vaadin/ui/AbsoluteLayout.java +++ b/server/src/com/vaadin/ui/AbsoluteLayout.java @@ -24,12 +24,12 @@ import java.util.Map; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.event.LayoutEvents.LayoutClickNotifier; +import com.vaadin.server.Sizeable; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutServerRpc; import com.vaadin.shared.ui.absolutelayout.AbsoluteLayoutState; -import com.vaadin.terminal.Sizeable; /** * AbsoluteLayout is a layout implementation that mimics html absolute diff --git a/server/src/com/vaadin/ui/AbstractComponent.java b/server/src/com/vaadin/ui/AbstractComponent.java index 33ba80656d..d651755a2a 100644 --- a/server/src/com/vaadin/ui/AbstractComponent.java +++ b/server/src/com/vaadin/ui/AbstractComponent.java @@ -32,11 +32,11 @@ import com.vaadin.event.ActionManager; import com.vaadin.event.EventRouter; import com.vaadin.event.MethodEventSource; import com.vaadin.event.ShortcutListener; +import com.vaadin.server.AbstractClientConnector; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.Resource; +import com.vaadin.server.Terminal; import com.vaadin.shared.ComponentState; -import com.vaadin.terminal.AbstractClientConnector; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Terminal; import com.vaadin.terminal.gwt.server.ClientConnector; import com.vaadin.terminal.gwt.server.ComponentSizeValidator; import com.vaadin.terminal.gwt.server.ResourceReference; @@ -1072,7 +1072,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#getHeight() + * @see com.vaadin.Sizeable#getHeight() */ @Override public float getHeight() { @@ -1082,7 +1082,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#getHeightUnits() + * @see com.vaadin.server.Sizeable#getHeightUnits() */ @Override public Unit getHeightUnits() { @@ -1092,7 +1092,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#getWidth() + * @see com.vaadin.server.Sizeable#getWidth() */ @Override public float getWidth() { @@ -1102,7 +1102,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#getWidthUnits() + * @see com.vaadin.server.Sizeable#getWidthUnits() */ @Override public Unit getWidthUnits() { @@ -1112,7 +1112,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setHeight(float, Unit) + * @see com.vaadin.server.Sizeable#setHeight(float, Unit) */ @Override public void setHeight(float height, Unit unit) { @@ -1128,7 +1128,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setSizeFull() + * @see com.vaadin.server.Sizeable#setSizeFull() */ @Override public void setSizeFull() { @@ -1139,7 +1139,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setSizeUndefined() + * @see com.vaadin.server.Sizeable#setSizeUndefined() */ @Override public void setSizeUndefined() { @@ -1150,7 +1150,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setWidth(float, Unit) + * @see com.vaadin.server.Sizeable#setWidth(float, Unit) */ @Override public void setWidth(float width, Unit unit) { @@ -1166,7 +1166,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setWidth(java.lang.String) + * @see com.vaadin.server.Sizeable#setWidth(java.lang.String) */ @Override public void setWidth(String width) { @@ -1181,7 +1181,7 @@ public abstract class AbstractComponent extends AbstractClientConnector /* * (non-Javadoc) * - * @see com.vaadin.terminal.Sizeable#setHeight(java.lang.String) + * @see com.vaadin.server.Sizeable#setHeight(java.lang.String) */ @Override public void setHeight(String height) { diff --git a/server/src/com/vaadin/ui/AbstractEmbedded.java b/server/src/com/vaadin/ui/AbstractEmbedded.java index 9396af5c44..de44c89656 100644 --- a/server/src/com/vaadin/ui/AbstractEmbedded.java +++ b/server/src/com/vaadin/ui/AbstractEmbedded.java @@ -4,8 +4,8 @@ package com.vaadin.ui; +import com.vaadin.server.Resource; import com.vaadin.shared.ui.AbstractEmbeddedState; -import com.vaadin.terminal.Resource; import com.vaadin.terminal.gwt.server.ResourceReference; /** diff --git a/server/src/com/vaadin/ui/AbstractField.java b/server/src/com/vaadin/ui/AbstractField.java index 5123d08da9..eaedfa5809 100644 --- a/server/src/com/vaadin/ui/AbstractField.java +++ b/server/src/com/vaadin/ui/AbstractField.java @@ -37,10 +37,10 @@ import com.vaadin.data.util.converter.ConverterUtil; import com.vaadin.event.Action; import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutListener; +import com.vaadin.server.AbstractErrorMessage; +import com.vaadin.server.CompositeErrorMessage; +import com.vaadin.server.ErrorMessage; import com.vaadin.shared.AbstractFieldState; -import com.vaadin.terminal.AbstractErrorMessage; -import com.vaadin.terminal.CompositeErrorMessage; -import com.vaadin.terminal.ErrorMessage; /** *

diff --git a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java index bd5735144e..3b80ac1f68 100644 --- a/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java +++ b/server/src/com/vaadin/ui/AbstractJavaScriptComponent.java @@ -15,8 +15,8 @@ */ package com.vaadin.ui; +import com.vaadin.server.JavaScriptCallbackHelper; import com.vaadin.shared.ui.JavaScriptComponentState; -import com.vaadin.terminal.JavaScriptCallbackHelper; /** * Base class for Components with all client-side logic implemented using diff --git a/server/src/com/vaadin/ui/AbstractMedia.java b/server/src/com/vaadin/ui/AbstractMedia.java index 77c12ac045..f26fe714b9 100644 --- a/server/src/com/vaadin/ui/AbstractMedia.java +++ b/server/src/com/vaadin/ui/AbstractMedia.java @@ -19,10 +19,10 @@ package com.vaadin.ui; import java.util.ArrayList; import java.util.List; +import com.vaadin.server.Resource; import com.vaadin.shared.communication.URLReference; import com.vaadin.shared.ui.AbstractMediaState; import com.vaadin.shared.ui.MediaControl; -import com.vaadin.terminal.Resource; import com.vaadin.terminal.gwt.server.ResourceReference; /** diff --git a/server/src/com/vaadin/ui/AbstractOrderedLayout.java b/server/src/com/vaadin/ui/AbstractOrderedLayout.java index 596bbb7ee2..53572097e0 100644 --- a/server/src/com/vaadin/ui/AbstractOrderedLayout.java +++ b/server/src/com/vaadin/ui/AbstractOrderedLayout.java @@ -22,6 +22,7 @@ import java.util.LinkedList; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.event.LayoutEvents.LayoutClickNotifier; +import com.vaadin.server.Sizeable; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; @@ -29,7 +30,6 @@ import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutServerRpc; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState; import com.vaadin.shared.ui.orderedlayout.AbstractOrderedLayoutState.ChildComponentData; -import com.vaadin.terminal.Sizeable; @SuppressWarnings("serial") public abstract class AbstractOrderedLayout extends AbstractLayout implements diff --git a/server/src/com/vaadin/ui/AbstractSelect.java b/server/src/com/vaadin/ui/AbstractSelect.java index 21ff7ba948..05169552d7 100644 --- a/server/src/com/vaadin/ui/AbstractSelect.java +++ b/server/src/com/vaadin/ui/AbstractSelect.java @@ -39,12 +39,12 @@ import com.vaadin.event.dd.TargetDetailsImpl; import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion; import com.vaadin.event.dd.acceptcriteria.ContainsDataFlavor; import com.vaadin.event.dd.acceptcriteria.TargetDetailIs; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.dd.VerticalDropLocation; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; import com.vaadin.ui.AbstractSelect.ItemCaptionMode; /** diff --git a/server/src/com/vaadin/ui/AbstractSplitPanel.java b/server/src/com/vaadin/ui/AbstractSplitPanel.java index 8b7499115c..f9fea66276 100644 --- a/server/src/com/vaadin/ui/AbstractSplitPanel.java +++ b/server/src/com/vaadin/ui/AbstractSplitPanel.java @@ -22,12 +22,12 @@ import java.util.Iterator; import com.vaadin.event.ComponentEventListener; import com.vaadin.event.MouseEvents.ClickEvent; +import com.vaadin.server.Sizeable; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelRpc; import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState; import com.vaadin.shared.ui.splitpanel.AbstractSplitPanelState.SplitterState; -import com.vaadin.terminal.Sizeable; import com.vaadin.tools.ReflectTools; /** diff --git a/server/src/com/vaadin/ui/AbstractTextField.java b/server/src/com/vaadin/ui/AbstractTextField.java index 1bd61023a4..94a32dac96 100644 --- a/server/src/com/vaadin/ui/AbstractTextField.java +++ b/server/src/com/vaadin/ui/AbstractTextField.java @@ -27,11 +27,11 @@ import com.vaadin.event.FieldEvents.FocusNotifier; import com.vaadin.event.FieldEvents.TextChangeEvent; import com.vaadin.event.FieldEvents.TextChangeListener; import com.vaadin.event.FieldEvents.TextChangeNotifier; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.textfield.AbstractTextFieldState; import com.vaadin.shared.ui.textfield.TextFieldConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; public abstract class AbstractTextField extends AbstractField implements BlurNotifier, FocusNotifier, TextChangeNotifier, Vaadin6Component { diff --git a/server/src/com/vaadin/ui/Audio.java b/server/src/com/vaadin/ui/Audio.java index 03ed7ba6d5..d111c0c74c 100644 --- a/server/src/com/vaadin/ui/Audio.java +++ b/server/src/com/vaadin/ui/Audio.java @@ -16,7 +16,7 @@ package com.vaadin.ui; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; /** * The Audio component translates into an HTML5 <audio> element and as diff --git a/server/src/com/vaadin/ui/ComboBox.java b/server/src/com/vaadin/ui/ComboBox.java index af19ca5b96..9cc4caa7c3 100644 --- a/server/src/com/vaadin/ui/ComboBox.java +++ b/server/src/com/vaadin/ui/ComboBox.java @@ -19,9 +19,9 @@ package com.vaadin.ui; import java.util.Collection; import com.vaadin.data.Container; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; import com.vaadin.shared.ui.combobox.ComboBoxConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; /** * A filtering dropdown single-select. Suitable for newItemsAllowed, but it's diff --git a/server/src/com/vaadin/ui/Component.java b/server/src/com/vaadin/ui/Component.java index f0993aac6d..5f9a093366 100644 --- a/server/src/com/vaadin/ui/Component.java +++ b/server/src/com/vaadin/ui/Component.java @@ -23,10 +23,10 @@ import java.util.Locale; import com.vaadin.Application; import com.vaadin.event.FieldEvents; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.VariableOwner; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.Resource; +import com.vaadin.server.Sizeable; +import com.vaadin.server.VariableOwner; import com.vaadin.terminal.gwt.server.ClientConnector; /** @@ -463,7 +463,7 @@ public interface Component extends ClientConnector, Sizeable, Serializable { * *

* The image is loaded by the browser from a resource, typically a - * {@link com.vaadin.terminal.ThemeResource}. + * {@link com.vaadin.server.ThemeResource}. *

* *
diff --git a/server/src/com/vaadin/ui/ConnectorTracker.java b/server/src/com/vaadin/ui/ConnectorTracker.java
index ad62b90211..e8f7b5e8c7 100644
--- a/server/src/com/vaadin/ui/ConnectorTracker.java
+++ b/server/src/com/vaadin/ui/ConnectorTracker.java
@@ -25,7 +25,7 @@ import java.util.Set;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
-import com.vaadin.terminal.AbstractClientConnector;
+import com.vaadin.server.AbstractClientConnector;
 import com.vaadin.terminal.gwt.server.AbstractCommunicationManager;
 import com.vaadin.terminal.gwt.server.ClientConnector;
 
diff --git a/server/src/com/vaadin/ui/CustomLayout.java b/server/src/com/vaadin/ui/CustomLayout.java
index 54308b99c3..cf64af85ca 100644
--- a/server/src/com/vaadin/ui/CustomLayout.java
+++ b/server/src/com/vaadin/ui/CustomLayout.java
@@ -24,10 +24,10 @@ import java.util.Iterator;
 import java.util.Map;
 import java.util.Set;
 
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
 import com.vaadin.shared.ui.customlayout.CustomLayoutState;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
 import com.vaadin.terminal.gwt.server.JsonPaintTarget;
 
 /**
diff --git a/server/src/com/vaadin/ui/DateField.java b/server/src/com/vaadin/ui/DateField.java
index 828fa3b21d..b4bf93b5b0 100644
--- a/server/src/com/vaadin/ui/DateField.java
+++ b/server/src/com/vaadin/ui/DateField.java
@@ -36,10 +36,10 @@ import com.vaadin.event.FieldEvents.BlurEvent;
 import com.vaadin.event.FieldEvents.BlurListener;
 import com.vaadin.event.FieldEvents.FocusEvent;
 import com.vaadin.event.FieldEvents.FocusListener;
+import com.vaadin.server.PaintException;
+import com.vaadin.server.PaintTarget;
+import com.vaadin.server.Vaadin6Component;
 import com.vaadin.shared.ui.datefield.DateFieldConstants;
-import com.vaadin.terminal.PaintException;
-import com.vaadin.terminal.PaintTarget;
-import com.vaadin.terminal.Vaadin6Component;
 
 /**
  * 

diff --git a/server/src/com/vaadin/ui/DragAndDropWrapper.java b/server/src/com/vaadin/ui/DragAndDropWrapper.java index ec805ecf46..fcd0b95015 100644 --- a/server/src/com/vaadin/ui/DragAndDropWrapper.java +++ b/server/src/com/vaadin/ui/DragAndDropWrapper.java @@ -29,14 +29,14 @@ import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.DropTarget; import com.vaadin.event.dd.TargetDetails; import com.vaadin.event.dd.TargetDetailsImpl; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.StreamVariable; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.dd.HorizontalDropLocation; import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.shared.ui.draganddropwrapper.DragAndDropWrapperConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.StreamVariable; -import com.vaadin.terminal.Vaadin6Component; @SuppressWarnings("serial") public class DragAndDropWrapper extends CustomComponent implements DropTarget, diff --git a/server/src/com/vaadin/ui/Embedded.java b/server/src/com/vaadin/ui/Embedded.java index 41b93d0b27..a8663abd32 100644 --- a/server/src/com/vaadin/ui/Embedded.java +++ b/server/src/com/vaadin/ui/Embedded.java @@ -22,14 +22,14 @@ import java.util.Map; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.embedded.EmbeddedConstants; import com.vaadin.shared.ui.embedded.EmbeddedServerRpc; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; /** * Component for embedding external objects. diff --git a/server/src/com/vaadin/ui/Form.java b/server/src/com/vaadin/ui/Form.java index 55404b2e6b..8bf46ed198 100644 --- a/server/src/com/vaadin/ui/Form.java +++ b/server/src/com/vaadin/ui/Form.java @@ -36,14 +36,14 @@ import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.Action.ShortcutNotifier; import com.vaadin.event.ActionManager; +import com.vaadin.server.AbstractErrorMessage; +import com.vaadin.server.CompositeErrorMessage; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.UserError; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.form.FormState; -import com.vaadin.terminal.AbstractErrorMessage; -import com.vaadin.terminal.CompositeErrorMessage; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.UserError; -import com.vaadin.terminal.Vaadin6Component; /** * Form component provides easy way of creating and managing sets fields. diff --git a/server/src/com/vaadin/ui/GridLayout.java b/server/src/com/vaadin/ui/GridLayout.java index 3870b71611..27a25699ba 100644 --- a/server/src/com/vaadin/ui/GridLayout.java +++ b/server/src/com/vaadin/ui/GridLayout.java @@ -27,16 +27,16 @@ import java.util.Map.Entry; import com.vaadin.event.LayoutEvents.LayoutClickEvent; import com.vaadin.event.LayoutEvents.LayoutClickListener; import com.vaadin.event.LayoutEvents.LayoutClickNotifier; +import com.vaadin.server.LegacyPaint; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.Connector; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.gridlayout.GridLayoutServerRpc; import com.vaadin.shared.ui.gridlayout.GridLayoutState; -import com.vaadin.terminal.LegacyPaint; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; /** * A layout where the components are laid out on a grid using cell coordinates. diff --git a/server/src/com/vaadin/ui/Html5File.java b/server/src/com/vaadin/ui/Html5File.java index 596f83a1d8..47af708160 100644 --- a/server/src/com/vaadin/ui/Html5File.java +++ b/server/src/com/vaadin/ui/Html5File.java @@ -18,7 +18,7 @@ package com.vaadin.ui; import java.io.Serializable; import com.vaadin.event.dd.DropHandler; -import com.vaadin.terminal.StreamVariable; +import com.vaadin.server.StreamVariable; /** * {@link DragAndDropWrapper} can receive also files from client computer if diff --git a/server/src/com/vaadin/ui/Image.java b/server/src/com/vaadin/ui/Image.java index b0dbc9e629..8e43d88b37 100644 --- a/server/src/com/vaadin/ui/Image.java +++ b/server/src/com/vaadin/ui/Image.java @@ -6,11 +6,11 @@ package com.vaadin.ui; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.server.Resource; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.image.ImageServerRpc; import com.vaadin.shared.ui.image.ImageState; -import com.vaadin.terminal.Resource; /** * Component for embedding images. diff --git a/server/src/com/vaadin/ui/JavaScript.java b/server/src/com/vaadin/ui/JavaScript.java index e34ccae82a..f3e8564fab 100644 --- a/server/src/com/vaadin/ui/JavaScript.java +++ b/server/src/com/vaadin/ui/JavaScript.java @@ -21,11 +21,11 @@ import java.util.Map; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; +import com.vaadin.server.AbstractExtension; +import com.vaadin.server.Page; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.extension.javascriptmanager.ExecuteJavaScriptRpc; import com.vaadin.shared.extension.javascriptmanager.JavaScriptManagerState; -import com.vaadin.terminal.AbstractExtension; -import com.vaadin.terminal.Page; /** * Provides access to JavaScript functionality in the web browser. To get an diff --git a/server/src/com/vaadin/ui/JavaScriptFunction.java b/server/src/com/vaadin/ui/JavaScriptFunction.java index 3a17fef995..ebb5e2c073 100644 --- a/server/src/com/vaadin/ui/JavaScriptFunction.java +++ b/server/src/com/vaadin/ui/JavaScriptFunction.java @@ -20,7 +20,7 @@ import java.io.Serializable; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; -import com.vaadin.terminal.AbstractJavaScriptExtension; +import com.vaadin.server.AbstractJavaScriptExtension; /** * Defines a method that is called by a client-side JavaScript function. When diff --git a/server/src/com/vaadin/ui/Link.java b/server/src/com/vaadin/ui/Link.java index f98a2b0d2d..cb6b643c33 100644 --- a/server/src/com/vaadin/ui/Link.java +++ b/server/src/com/vaadin/ui/Link.java @@ -18,11 +18,11 @@ package com.vaadin.ui; import java.util.Map; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.BorderStyle; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; /** * Link is used to create external or internal URL links. diff --git a/server/src/com/vaadin/ui/ListSelect.java b/server/src/com/vaadin/ui/ListSelect.java index da78e24fa8..90e1c16a4d 100644 --- a/server/src/com/vaadin/ui/ListSelect.java +++ b/server/src/com/vaadin/ui/ListSelect.java @@ -19,8 +19,8 @@ package com.vaadin.ui; import java.util.Collection; import com.vaadin.data.Container; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * This is a simple list select without, for instance, support for new items, diff --git a/server/src/com/vaadin/ui/LoginForm.java b/server/src/com/vaadin/ui/LoginForm.java index 1c154699d8..7715f08a6e 100644 --- a/server/src/com/vaadin/ui/LoginForm.java +++ b/server/src/com/vaadin/ui/LoginForm.java @@ -25,12 +25,12 @@ import java.util.Iterator; import java.util.Map; import com.vaadin.Application; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.shared.ApplicationConstants; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; /** * LoginForm is a Vaadin component to handle common problem among Ajax diff --git a/server/src/com/vaadin/ui/MenuBar.java b/server/src/com/vaadin/ui/MenuBar.java index 51c06cf934..4414bef9aa 100644 --- a/server/src/com/vaadin/ui/MenuBar.java +++ b/server/src/com/vaadin/ui/MenuBar.java @@ -22,11 +22,11 @@ import java.util.List; import java.util.Map; import java.util.Stack; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.menubar.MenuBarConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; /** *

diff --git a/server/src/com/vaadin/ui/NativeSelect.java b/server/src/com/vaadin/ui/NativeSelect.java index c2969874b0..8006813276 100644 --- a/server/src/com/vaadin/ui/NativeSelect.java +++ b/server/src/com/vaadin/ui/NativeSelect.java @@ -19,8 +19,8 @@ package com.vaadin.ui; import java.util.Collection; import com.vaadin.data.Container; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** * This is a simple drop-down select without, for instance, support for diff --git a/server/src/com/vaadin/ui/Notification.java b/server/src/com/vaadin/ui/Notification.java index 22ad31dffe..758d2c86a3 100644 --- a/server/src/com/vaadin/ui/Notification.java +++ b/server/src/com/vaadin/ui/Notification.java @@ -18,9 +18,9 @@ package com.vaadin.ui; import java.io.Serializable; +import com.vaadin.server.Page; +import com.vaadin.server.Resource; import com.vaadin.shared.Position; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Resource; /** * A notification message, used to display temporary messages to the user - for diff --git a/server/src/com/vaadin/ui/OptionGroup.java b/server/src/com/vaadin/ui/OptionGroup.java index 12507442c9..8846ec36e3 100644 --- a/server/src/com/vaadin/ui/OptionGroup.java +++ b/server/src/com/vaadin/ui/OptionGroup.java @@ -27,9 +27,9 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; import com.vaadin.shared.ui.optiongroup.OptionGroupConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; /** * Configures select to be used as an option group. diff --git a/server/src/com/vaadin/ui/Panel.java b/server/src/com/vaadin/ui/Panel.java index 00810b83db..d076e4d612 100644 --- a/server/src/com/vaadin/ui/Panel.java +++ b/server/src/com/vaadin/ui/Panel.java @@ -25,14 +25,14 @@ import com.vaadin.event.Action.Handler; import com.vaadin.event.ActionManager; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Scrollable; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.panel.PanelServerRpc; import com.vaadin.shared.ui.panel.PanelState; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Scrollable; -import com.vaadin.terminal.Vaadin6Component; import com.vaadin.ui.Component.Focusable; /** @@ -195,8 +195,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /* * (non-Javadoc) * - * @see - * com.vaadin.terminal.Vaadin6Component#paintContent(com.vaadin.terminal + * @see com.vaadin.server.Vaadin6Component#paintContent(com.vaadin.server * .PaintTarget) */ @Override @@ -250,7 +249,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, * Called when one or more variables handled by the implementing class are * changed. * - * @see com.vaadin.terminal.VariableOwner#changeVariables(Object, Map) + * @see com.vaadin.server.VariableOwner#changeVariables(Object, Map) */ @Override @SuppressWarnings("unchecked") @@ -289,7 +288,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /* * (non-Javadoc) * - * @see com.vaadin.terminal.Scrollable#setScrollable(boolean) + * @see com.vaadin.server.Scrollable#setScrollable(boolean) */ @Override public int getScrollLeft() { @@ -299,7 +298,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /* * (non-Javadoc) * - * @see com.vaadin.terminal.Scrollable#setScrollable(boolean) + * @see com.vaadin.server.Scrollable#setScrollable(boolean) */ @Override public int getScrollTop() { @@ -309,7 +308,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /* * (non-Javadoc) * - * @see com.vaadin.terminal.Scrollable#setScrollLeft(int) + * @see com.vaadin.server.Scrollable#setScrollLeft(int) */ @Override public void setScrollLeft(int scrollLeft) { @@ -323,7 +322,7 @@ public class Panel extends AbstractComponentContainer implements Scrollable, /* * (non-Javadoc) * - * @see com.vaadin.terminal.Scrollable#setScrollTop(int) + * @see com.vaadin.server.Scrollable#setScrollTop(int) */ @Override public void setScrollTop(int scrollTop) { diff --git a/server/src/com/vaadin/ui/PopupDateField.java b/server/src/com/vaadin/ui/PopupDateField.java index acff49a142..39e0578301 100644 --- a/server/src/com/vaadin/ui/PopupDateField.java +++ b/server/src/com/vaadin/ui/PopupDateField.java @@ -19,8 +19,8 @@ package com.vaadin.ui; import java.util.Date; import com.vaadin.data.Property; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; /** *

diff --git a/server/src/com/vaadin/ui/PopupView.java b/server/src/com/vaadin/ui/PopupView.java index 786257c240..a4832a013f 100644 --- a/server/src/com/vaadin/ui/PopupView.java +++ b/server/src/com/vaadin/ui/PopupView.java @@ -20,10 +20,10 @@ import java.lang.reflect.Method; import java.util.Iterator; import java.util.Map; -import com.vaadin.terminal.LegacyPaint; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; +import com.vaadin.server.LegacyPaint; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; /** * @@ -309,7 +309,7 @@ public class PopupView extends AbstractComponentContainer implements /** * Paint (serialize) the component for the client. * - * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.terminal.PaintTarget) + * @see com.vaadin.ui.AbstractComponent#paintContent(com.vaadin.server.PaintTarget) */ @Override public void paintContent(PaintTarget target) throws PaintException { diff --git a/server/src/com/vaadin/ui/ProgressIndicator.java b/server/src/com/vaadin/ui/ProgressIndicator.java index 528c404ab9..4ad441a949 100644 --- a/server/src/com/vaadin/ui/ProgressIndicator.java +++ b/server/src/com/vaadin/ui/ProgressIndicator.java @@ -20,9 +20,9 @@ import java.util.Map; import com.vaadin.data.Property; import com.vaadin.data.util.ObjectProperty; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; /** * ProgressIndicator is component that shows user state of a diff --git a/server/src/com/vaadin/ui/RichTextArea.java b/server/src/com/vaadin/ui/RichTextArea.java index 51caa82136..e2beace1be 100644 --- a/server/src/com/vaadin/ui/RichTextArea.java +++ b/server/src/com/vaadin/ui/RichTextArea.java @@ -19,9 +19,9 @@ package com.vaadin.ui; import java.util.Map; import com.vaadin.data.Property; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; /** * A simple RichTextArea to edit HTML format text. diff --git a/server/src/com/vaadin/ui/Select.java b/server/src/com/vaadin/ui/Select.java index 6ff7c9c9bc..c7688df7e8 100644 --- a/server/src/com/vaadin/ui/Select.java +++ b/server/src/com/vaadin/ui/Select.java @@ -32,9 +32,9 @@ import com.vaadin.event.FieldEvents.BlurEvent; import com.vaadin.event.FieldEvents.BlurListener; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; /** *

diff --git a/server/src/com/vaadin/ui/TabSheet.java b/server/src/com/vaadin/ui/TabSheet.java index 82faedcc41..f84e6f52ad 100644 --- a/server/src/com/vaadin/ui/TabSheet.java +++ b/server/src/com/vaadin/ui/TabSheet.java @@ -30,15 +30,15 @@ import com.vaadin.event.FieldEvents.BlurNotifier; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; import com.vaadin.event.FieldEvents.FocusNotifier; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.LegacyPaint; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.ui.tabsheet.TabsheetBaseConstants; import com.vaadin.shared.ui.tabsheet.TabsheetConstants; -import com.vaadin.terminal.ErrorMessage; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.LegacyPaint; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; import com.vaadin.ui.Component.Focusable; import com.vaadin.ui.themes.Reindeer; import com.vaadin.ui.themes.Runo; diff --git a/server/src/com/vaadin/ui/Table.java b/server/src/com/vaadin/ui/Table.java index 8fc3fc2572..118e3b3fcf 100644 --- a/server/src/com/vaadin/ui/Table.java +++ b/server/src/com/vaadin/ui/Table.java @@ -52,13 +52,13 @@ import com.vaadin.event.dd.DragSource; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.DropTarget; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.LegacyPaint; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.table.TableConstants; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.LegacyPaint; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; /** *

@@ -4759,7 +4759,7 @@ public class Table extends AbstractSelect implements Action.Container, * * @see * com.vaadin.event.dd.acceptcriteria.AcceptCriterion#paintResponse( - * com.vaadin.terminal.PaintTarget) + * com.vaadin.server.PaintTarget) */ @Override diff --git a/server/src/com/vaadin/ui/Tree.java b/server/src/com/vaadin/ui/Tree.java index 2d6673a67d..529847d54c 100644 --- a/server/src/com/vaadin/ui/Tree.java +++ b/server/src/com/vaadin/ui/Tree.java @@ -49,13 +49,13 @@ import com.vaadin.event.dd.TargetDetails; import com.vaadin.event.dd.acceptcriteria.ClientSideCriterion; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; import com.vaadin.event.dd.acceptcriteria.TargetDetailIs; +import com.vaadin.server.KeyMapper; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.dd.VerticalDropLocation; import com.vaadin.shared.ui.tree.TreeConstants; -import com.vaadin.terminal.KeyMapper; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; import com.vaadin.tools.ReflectTools; /** @@ -1449,7 +1449,7 @@ public class Tree extends AbstractSelect implements Container.Hierarchical, * * @see * com.vaadin.event.dd.acceptCriteria.AcceptCriterion#paintResponse( - * com.vaadin.terminal.PaintTarget) + * com.vaadin.server.PaintTarget) */ @Override public void paintResponse(PaintTarget target) throws PaintException { diff --git a/server/src/com/vaadin/ui/TreeTable.java b/server/src/com/vaadin/ui/TreeTable.java index 05757a6d09..dd79461f37 100644 --- a/server/src/com/vaadin/ui/TreeTable.java +++ b/server/src/com/vaadin/ui/TreeTable.java @@ -32,10 +32,10 @@ import com.vaadin.data.Container.ItemSetChangeEvent; import com.vaadin.data.util.ContainerHierarchicalWrapper; import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.data.util.HierarchicalContainerOrderedWrapper; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; import com.vaadin.shared.ui.treetable.TreeTableConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; import com.vaadin.ui.Tree.CollapseEvent; import com.vaadin.ui.Tree.CollapseListener; import com.vaadin.ui.Tree.ExpandEvent; diff --git a/server/src/com/vaadin/ui/TwinColSelect.java b/server/src/com/vaadin/ui/TwinColSelect.java index 891e695a5f..76f1e1e8c7 100644 --- a/server/src/com/vaadin/ui/TwinColSelect.java +++ b/server/src/com/vaadin/ui/TwinColSelect.java @@ -19,9 +19,9 @@ package com.vaadin.ui; import java.util.Collection; import com.vaadin.data.Container; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; import com.vaadin.shared.ui.twincolselect.TwinColSelectConstants; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; /** * Multiselect component with two lists: left side for available items and right diff --git a/server/src/com/vaadin/ui/UI.java b/server/src/com/vaadin/ui/UI.java index 17a028bcdf..4731ebffe6 100644 --- a/server/src/com/vaadin/ui/UI.java +++ b/server/src/com/vaadin/ui/UI.java @@ -34,21 +34,21 @@ import com.vaadin.event.Action.Handler; import com.vaadin.event.ActionManager; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; +import com.vaadin.server.Page; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.Vaadin6Component; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page.BrowserWindowResizeListener; +import com.vaadin.server.WrappedRequest.BrowserDetails; import com.vaadin.shared.EventId; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.BorderStyle; import com.vaadin.shared.ui.ui.UIConstants; import com.vaadin.shared.ui.ui.UIServerRpc; import com.vaadin.shared.ui.ui.UIState; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.BrowserWindowResizeEvent; -import com.vaadin.terminal.Page.BrowserWindowResizeListener; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.Vaadin6Component; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; import com.vaadin.tools.ReflectTools; diff --git a/server/src/com/vaadin/ui/Upload.java b/server/src/com/vaadin/ui/Upload.java index 619db07eea..683b9ce478 100644 --- a/server/src/com/vaadin/ui/Upload.java +++ b/server/src/com/vaadin/ui/Upload.java @@ -24,10 +24,10 @@ import java.util.Iterator; import java.util.LinkedHashSet; import java.util.Map; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.StreamVariable.StreamingProgressEvent; -import com.vaadin.terminal.Vaadin6Component; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; +import com.vaadin.server.StreamVariable.StreamingProgressEvent; import com.vaadin.terminal.gwt.server.NoInputStreamException; import com.vaadin.terminal.gwt.server.NoOutputStreamException; @@ -936,11 +936,11 @@ public class Upload extends AbstractComponent implements Component.Focusable, * Handle to terminal via Upload monitors and controls the upload during it * is being streamed. */ - private com.vaadin.terminal.StreamVariable streamVariable; + private com.vaadin.server.StreamVariable streamVariable; - protected com.vaadin.terminal.StreamVariable getStreamVariable() { + protected com.vaadin.server.StreamVariable getStreamVariable() { if (streamVariable == null) { - streamVariable = new com.vaadin.terminal.StreamVariable() { + streamVariable = new com.vaadin.server.StreamVariable() { private StreamingStartEvent lastStartedEvent; @Override diff --git a/server/src/com/vaadin/ui/Video.java b/server/src/com/vaadin/ui/Video.java index b54d404da6..939614c7a1 100644 --- a/server/src/com/vaadin/ui/Video.java +++ b/server/src/com/vaadin/ui/Video.java @@ -16,8 +16,8 @@ package com.vaadin.ui; +import com.vaadin.server.Resource; import com.vaadin.shared.ui.video.VideoState; -import com.vaadin.terminal.Resource; import com.vaadin.terminal.gwt.server.ResourceReference; /** diff --git a/server/src/com/vaadin/ui/Window.java b/server/src/com/vaadin/ui/Window.java index 6102350566..af85439e23 100644 --- a/server/src/com/vaadin/ui/Window.java +++ b/server/src/com/vaadin/ui/Window.java @@ -31,12 +31,12 @@ import com.vaadin.event.ShortcutAction; import com.vaadin.event.ShortcutAction.KeyCode; import com.vaadin.event.ShortcutAction.ModifierKey; import com.vaadin.event.ShortcutListener; +import com.vaadin.server.PaintException; +import com.vaadin.server.PaintTarget; +import com.vaadin.server.Vaadin6Component; import com.vaadin.shared.MouseEventDetails; import com.vaadin.shared.ui.window.WindowServerRpc; import com.vaadin.shared.ui.window.WindowState; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.PaintTarget; -import com.vaadin.terminal.Vaadin6Component; /** * A component that represents a floating popup window that can be added to a @@ -127,7 +127,7 @@ public class Window extends Panel implements FocusNotifier, BlurNotifier, /* * (non-Javadoc) * - * @see com.vaadin.ui.Panel#paintContent(com.vaadin.terminal.PaintTarget) + * @see com.vaadin.ui.Panel#paintContent(com.vaadin.server.PaintTarget) */ @Override diff --git a/shared/src/com/vaadin/shared/ComponentState.java b/shared/src/com/vaadin/shared/ComponentState.java index ac6f1185bf..1b08f9b2d2 100644 --- a/shared/src/com/vaadin/shared/ComponentState.java +++ b/shared/src/com/vaadin/shared/ComponentState.java @@ -155,7 +155,7 @@ public class ComponentState extends SharedState { /** * Returns true if the component is in immediate mode. * - * @see com.vaadin.terminal.VariableOwner#isImmediate() + * @see com.vaadin.server.VariableOwner#isImmediate() * * @return true if the component is in immediate mode */ @@ -166,7 +166,7 @@ public class ComponentState extends SharedState { /** * Sets or resets the immediate mode for a component. * - * @see com.vaadin.terminal.VariableOwner#setImmediate() + * @see com.vaadin.server.VariableOwner#setImmediate() * * @param immediate * new mode for the component diff --git a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java index 9c7e526dad..7a240a1f1d 100644 --- a/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/AbstractContainerTest.java @@ -318,8 +318,7 @@ public abstract class AbstractContainerTest extends TestCase { FULLY_QUALIFIED_NAME, "ab", false, false)); validateContainer(container, "com.vaadin.data.BufferedValidatable", - "com.vaadin.ui.TabSheet", - "com.vaadin.client.Focusable", + "com.vaadin.ui.TabSheet", "com.vaadin.client.Focusable", "com.vaadin.data.Buffered", isFilteredOutItemNull(), 20); // Filter by "contains da" (reversed as ad here) @@ -382,7 +381,7 @@ public abstract class AbstractContainerTest extends TestCase { validateContainer(container, "com.vaadin.Application", "org.vaadin.test.LastClass", - "com.vaadin.terminal.ApplicationResource", "blah", true, + "com.vaadin.server.ApplicationResource", "blah", true, sampleData.length); sortable.sort(new Object[] { REVERSE_FULLY_QUALIFIED_NAME }, @@ -476,60 +475,52 @@ public abstract class AbstractContainerTest extends TestCase { "com.vaadin.launcher.util.BrowserLauncher", "com.vaadin.service.ApplicationContext", "com.vaadin.service.FileTypeResolver", - "com.vaadin.terminal.ApplicationResource", - "com.vaadin.terminal.ClassResource", - "com.vaadin.terminal.CompositeErrorMessage", - "com.vaadin.terminal.DownloadStream", - "com.vaadin.terminal.ErrorMessage", - "com.vaadin.terminal.ExternalResource", - "com.vaadin.terminal.FileResource", + "com.vaadin.server.ApplicationResource", + "com.vaadin.server.ClassResource", + "com.vaadin.server.CompositeErrorMessage", + "com.vaadin.server.DownloadStream", + "com.vaadin.server.ErrorMessage", + "com.vaadin.server.ExternalResource", + "com.vaadin.server.FileResource", "com.vaadin.client.ApplicationConfiguration", "com.vaadin.client.ApplicationConnection", "com.vaadin.client.BrowserInfo", "com.vaadin.client.ClientExceptionHandler", "com.vaadin.client.ComponentDetail", "com.vaadin.client.ComponentDetailMap", - "com.vaadin.client.ComponentLocator", - "com.vaadin.client.Console", + "com.vaadin.client.ComponentLocator", "com.vaadin.client.Console", "com.vaadin.client.Container", "com.vaadin.client.ContainerResizedListener", - "com.vaadin.client.CSSRule", - "com.vaadin.client.DateTimeService", + "com.vaadin.client.CSSRule", "com.vaadin.client.DateTimeService", "com.vaadin.client.DefaultWidgetSet", "com.vaadin.client.Focusable", "com.vaadin.client.HistoryImplIEVaadin", "com.vaadin.client.LocaleNotLoadedException", "com.vaadin.client.LocaleService", "com.vaadin.client.MouseEventDetails", - "com.vaadin.client.NullConsole", - "com.vaadin.client.Paintable", + "com.vaadin.client.NullConsole", "com.vaadin.client.Paintable", "com.vaadin.client.RenderInformation", "com.vaadin.client.RenderSpace", "com.vaadin.client.StyleConstants", - "com.vaadin.client.TooltipInfo", - "com.vaadin.client.ui.Action", + "com.vaadin.client.TooltipInfo", "com.vaadin.client.ui.Action", "com.vaadin.client.ui.ActionOwner", "com.vaadin.client.ui.AlignmentInfo", "com.vaadin.client.ui.CalendarEntry", "com.vaadin.client.ui.ClickEventHandler", - "com.vaadin.client.ui.Field", - "com.vaadin.client.ui.Icon", + "com.vaadin.client.ui.Field", "com.vaadin.client.ui.Icon", "com.vaadin.client.ui.layout.CellBasedLayout", "com.vaadin.client.ui.layout.ChildComponentContainer", "com.vaadin.client.ui.layout.Margins", "com.vaadin.client.ui.LayoutClickEventHandler", - "com.vaadin.client.ui.MenuBar", - "com.vaadin.client.ui.MenuItem", + "com.vaadin.client.ui.MenuBar", "com.vaadin.client.ui.MenuItem", "com.vaadin.client.ui.richtextarea.VRichTextArea", "com.vaadin.client.ui.richtextarea.VRichTextToolbar", "com.vaadin.client.ui.ShortcutActionHandler", - "com.vaadin.client.ui.SubPartAware", - "com.vaadin.client.ui.Table", + "com.vaadin.client.ui.SubPartAware", "com.vaadin.client.ui.Table", "com.vaadin.client.ui.TreeAction", "com.vaadin.client.ui.TreeImages", "com.vaadin.client.ui.VAbsoluteLayout", - "com.vaadin.client.ui.VAccordion", - "com.vaadin.client.ui.VButton", + "com.vaadin.client.ui.VAccordion", "com.vaadin.client.ui.VButton", "com.vaadin.client.ui.VCalendarPanel", "com.vaadin.client.ui.VCheckBox", "com.vaadin.client.ui.VContextMenu", @@ -539,13 +530,11 @@ public abstract class AbstractContainerTest extends TestCase { "com.vaadin.client.ui.VDateField", "com.vaadin.client.ui.VDateFieldCalendar", "com.vaadin.client.ui.VEmbedded", - "com.vaadin.client.ui.VFilterSelect", - "com.vaadin.client.ui.VForm", + "com.vaadin.client.ui.VFilterSelect", "com.vaadin.client.ui.VForm", "com.vaadin.client.ui.VFormLayout", "com.vaadin.client.ui.VGridLayout", "com.vaadin.client.ui.VHorizontalLayout", - "com.vaadin.client.ui.VLabel", - "com.vaadin.client.ui.VLink", + "com.vaadin.client.ui.VLabel", "com.vaadin.client.ui.VLink", "com.vaadin.client.ui.VListSelect", "com.vaadin.client.ui.VMarginInfo", "com.vaadin.client.ui.VMenuBar", @@ -555,15 +544,13 @@ public abstract class AbstractContainerTest extends TestCase { "com.vaadin.client.ui.VOptionGroup", "com.vaadin.client.ui.VOptionGroupBase", "com.vaadin.client.ui.VOrderedLayout", - "com.vaadin.client.ui.VOverlay", - "com.vaadin.client.ui.VPanel", + "com.vaadin.client.ui.VOverlay", "com.vaadin.client.ui.VPanel", "com.vaadin.client.ui.VPasswordField", "com.vaadin.client.ui.VPopupCalendar", "com.vaadin.client.ui.VPopupView", "com.vaadin.client.ui.VProgressIndicator", "com.vaadin.client.ui.VScrollTable", - "com.vaadin.client.ui.VSlider", - "com.vaadin.client.ui.VSplitPanel", + "com.vaadin.client.ui.VSlider", "com.vaadin.client.ui.VSplitPanel", "com.vaadin.client.ui.VSplitPanelHorizontal", "com.vaadin.client.ui.VSplitPanelVertical", "com.vaadin.client.ui.VTablePaging", @@ -572,26 +559,20 @@ public abstract class AbstractContainerTest extends TestCase { "com.vaadin.client.ui.VTabsheetPanel", "com.vaadin.client.ui.VTextArea", "com.vaadin.client.ui.VTextField", - "com.vaadin.client.ui.VTextualDate", - "com.vaadin.client.ui.VTime", + "com.vaadin.client.ui.VTextualDate", "com.vaadin.client.ui.VTime", "com.vaadin.client.ui.VTree", "com.vaadin.client.ui.VTwinColSelect", "com.vaadin.client.ui.VUnknownComponent", "com.vaadin.client.ui.VUpload", "com.vaadin.client.ui.VUriFragmentUtility", "com.vaadin.client.ui.VVerticalLayout", - "com.vaadin.client.ui.VView", - "com.vaadin.client.ui.VWindow", - "com.vaadin.client.UIDL", - "com.vaadin.client.Util", - "com.vaadin.client.ValueMap", - "com.vaadin.client.VCaption", + "com.vaadin.client.ui.VView", "com.vaadin.client.ui.VWindow", + "com.vaadin.client.UIDL", "com.vaadin.client.Util", + "com.vaadin.client.ValueMap", "com.vaadin.client.VCaption", "com.vaadin.client.VCaptionWrapper", "com.vaadin.client.VDebugConsole", - "com.vaadin.client.VErrorMessage", - "com.vaadin.client.VTooltip", - "com.vaadin.client.VUIDLBrowser", - "com.vaadin.client.WidgetMap", + "com.vaadin.client.VErrorMessage", "com.vaadin.client.VTooltip", + "com.vaadin.client.VUIDLBrowser", "com.vaadin.client.WidgetMap", "com.vaadin.client.WidgetSet", "com.vaadin.terminal.gwt.server.AbstractApplicationPortlet", "com.vaadin.terminal.gwt.server.AbstractApplicationServlet", @@ -621,18 +602,16 @@ public abstract class AbstractContainerTest extends TestCase { "com.vaadin.terminal.gwt.widgetsetutils.ClassPathExplorer", "com.vaadin.terminal.gwt.widgetsetutils.WidgetMapGenerator", "com.vaadin.terminal.gwt.widgetsetutils.WidgetSetBuilder", - "com.vaadin.terminal.KeyMapper", "com.vaadin.terminal.Paintable", - "com.vaadin.terminal.PaintException", - "com.vaadin.terminal.PaintTarget", - "com.vaadin.terminal.ParameterHandler", - "com.vaadin.terminal.Resource", "com.vaadin.terminal.Scrollable", - "com.vaadin.terminal.Sizeable", - "com.vaadin.terminal.StreamResource", - "com.vaadin.terminal.SystemError", "com.vaadin.terminal.Terminal", - "com.vaadin.terminal.ThemeResource", - "com.vaadin.terminal.UploadStream", - "com.vaadin.terminal.URIHandler", "com.vaadin.terminal.UserError", - "com.vaadin.terminal.VariableOwner", + "com.vaadin.server.KeyMapper", "com.vaadin.server.Paintable", + "com.vaadin.server.PaintException", + "com.vaadin.server.PaintTarget", + "com.vaadin.server.ParameterHandler", "com.vaadin.server.Resource", + "com.vaadin.server.Scrollable", "com.vaadin.server.Sizeable", + "com.vaadin.server.StreamResource", + "com.vaadin.server.SystemError", "com.vaadin.server.Terminal", + "com.vaadin.server.ThemeResource", + "com.vaadin.server.UploadStream", "com.vaadin.server.URIHandler", + "com.vaadin.server.UserError", "com.vaadin.server.VariableOwner", "com.vaadin.tools.ReflectTools", "com.vaadin.tools.WidgetsetCompiler", "com.vaadin.ui.AbsoluteLayout", "com.vaadin.ui.AbstractComponent", diff --git a/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java b/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java index 6bfff90c7b..918c9dfb7b 100644 --- a/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java +++ b/tests/server-side/com/vaadin/data/util/AbstractHierarchicalContainerTest.java @@ -149,7 +149,7 @@ public abstract class AbstractHierarchicalContainerTest extends int expectedSize = sampleData.length + packages; validateHierarchicalContainer(container, "com", "org.vaadin.test.LastClass", - "com.vaadin.terminal.ApplicationResource", "blah", true, + "com.vaadin.server.ApplicationResource", "blah", true, expectedSize, 2, true); } @@ -172,7 +172,7 @@ public abstract class AbstractHierarchicalContainerTest extends int expectedSize = sampleData.length + packages; validateHierarchicalContainer(container, "com", "org.vaadin.test.LastClass", - "com.vaadin.terminal.ApplicationResource", "blah", true, + "com.vaadin.server.ApplicationResource", "blah", true, expectedSize, 2, true); sortable.sort(new Object[] { REVERSE_FULLY_QUALIFIED_NAME }, @@ -181,7 +181,7 @@ public abstract class AbstractHierarchicalContainerTest extends validateHierarchicalContainer(container, "com.vaadin.terminal.gwt.server.ApplicationPortlet2", "com.vaadin.data.util.ObjectProperty", - "com.vaadin.terminal.ApplicationResource", "blah", true, + "com.vaadin.server.ApplicationResource", "blah", true, expectedSize, 2, true); } diff --git a/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java b/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java index ebe604ff3a..ff6de50651 100644 --- a/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java +++ b/tests/server-side/com/vaadin/data/util/TestContainerHierarchicalWrapper.java @@ -2,9 +2,6 @@ package com.vaadin.data.util; import java.util.Collection; -import com.vaadin.data.util.ContainerHierarchicalWrapper; -import com.vaadin.data.util.IndexedContainer; - public class TestContainerHierarchicalWrapper extends AbstractHierarchicalContainerTest { @@ -34,7 +31,7 @@ public class TestContainerHierarchicalWrapper extends int expectedSize = sampleData.length + packages - 1; validateContainer(container, "com", "com.vaadin.util.SerializerHelper", - "com.vaadin.terminal.ApplicationResource", "blah", true, + "com.vaadin.server.ApplicationResource", "blah", true, expectedSize); // rootItemIds diff --git a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java index f0cbfe7a87..d3d7d37690 100644 --- a/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java +++ b/tests/server-side/com/vaadin/data/util/TestHierarchicalContainer.java @@ -2,7 +2,6 @@ package com.vaadin.data.util; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; -import com.vaadin.data.util.HierarchicalContainer; public class TestHierarchicalContainer extends AbstractHierarchicalContainerTest { @@ -58,12 +57,10 @@ public class TestHierarchicalContainer extends container.addContainerFilter(FULLY_QUALIFIED_NAME, "ab", false, false); Object p1 = container.getParent("com.vaadin.ui.TabSheet"); assertEquals("com.vaadin.ui", p1); - p1 = container - .getParent("com.vaadin.client.ui.VPopupCalendar"); + p1 = container.getParent("com.vaadin.client.ui.VPopupCalendar"); assertNull(p1); container.removeAllContainerFilters(); - p1 = container - .getParent("com.vaadin.client.ui.VPopupCalendar"); + p1 = container.getParent("com.vaadin.client.ui.VPopupCalendar"); assertEquals("com.vaadin.client.ui", p1); } @@ -110,9 +107,8 @@ public class TestHierarchicalContainer extends int expectedRoots = 1; validateHierarchicalContainer(container, "com", - "com.vaadin.ui.TabSheet", - "com.vaadin.client.Focusable", "blah", true, - expectedSize, expectedRoots, true); + "com.vaadin.ui.TabSheet", "com.vaadin.client.Focusable", + "blah", true, expectedSize, expectedRoots, true); // only include .gwt.client classes container.removeAllContainerFilters(); @@ -127,8 +123,8 @@ public class TestHierarchicalContainer extends validateHierarchicalContainer(container, "com", "com.vaadin.client.WidgetSet", - "com.vaadin.client.ui.VSplitPanelVertical", - "blah", true, expectedSize, expectedRoots, true); + "com.vaadin.client.ui.VSplitPanelVertical", "blah", true, + expectedSize, expectedRoots, true); // Additionally remove all without 'm' in the simple name. container.addContainerFilter(SIMPLE_NAME, "m", false, false); @@ -136,12 +132,10 @@ public class TestHierarchicalContainer extends expectedSize = 7 + 18; expectedRoots = 1; - validateHierarchicalContainer( - container, - "com", + validateHierarchicalContainer(container, "com", "com.vaadin.client.ui.VUriFragmentUtility", - "com.vaadin.client.ui.layout.ChildComponentContainer", - "blah", true, expectedSize, expectedRoots, true); + "com.vaadin.client.ui.layout.ChildComponentContainer", "blah", + true, expectedSize, expectedRoots, true); } @@ -218,10 +212,10 @@ public class TestHierarchicalContainer extends // com.vaadin.client.ui.VTabsheetBase // com.vaadin.client.ui.VTabsheetPanel // com.vaadin.terminal.gwt.server.ChangeVariablesErrorEvent - // com.vaadin.terminal.Paintable - // com.vaadin.terminal.Scrollable - // com.vaadin.terminal.Sizeable - // com.vaadin.terminal.VariableOwner + // com.vaadin.server.Paintable + // com.vaadin.server.Scrollable + // com.vaadin.server.Sizeable + // com.vaadin.server.VariableOwner // com.vaadin.ui.Label // com.vaadin.ui.Table // com.vaadin.ui.TableFieldFactory @@ -232,9 +226,8 @@ public class TestHierarchicalContainer extends validateHierarchicalContainer(container, "com.vaadin.data.BufferedValidatable", - "com.vaadin.ui.TabSheet", - "com.vaadin.client.ui.VTabsheetBase", "blah", - true, expectedSize, expectedRoots, false); + "com.vaadin.ui.TabSheet", "com.vaadin.client.ui.VTabsheetBase", + "blah", true, expectedSize, expectedRoots, false); // only include .gwt.client classes container.removeAllContainerFilters(); @@ -261,11 +254,10 @@ public class TestHierarchicalContainer extends expectedSize = 13; expectedRoots = expectedSize; - validateHierarchicalContainer(container, - "com.vaadin.client.Paintable", + validateHierarchicalContainer(container, "com.vaadin.client.Paintable", "com.vaadin.client.ui.VTabsheetPanel", - "com.vaadin.client.ui.VPopupCalendar", "blah", - true, expectedSize, expectedRoots, false); + "com.vaadin.client.ui.VPopupCalendar", "blah", true, + expectedSize, expectedRoots, false); } } diff --git a/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java b/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java index 4f5f0b1431..1c1f9624c8 100644 --- a/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java +++ b/tests/server-side/com/vaadin/tests/server/TestKeyMapper.java @@ -5,7 +5,7 @@ import java.util.HashMap; import junit.framework.TestCase; -import com.vaadin.terminal.KeyMapper; +import com.vaadin.server.KeyMapper; public class TestKeyMapper extends TestCase { diff --git a/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java b/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java index 8231030666..7bb1fd0050 100644 --- a/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java +++ b/tests/server-side/com/vaadin/tests/server/TestMimeTypes.java @@ -3,7 +3,7 @@ package com.vaadin.tests.server; import junit.framework.TestCase; import com.vaadin.Application; -import com.vaadin.terminal.ClassResource; +import com.vaadin.server.ClassResource; import com.vaadin.ui.Embedded; public class TestMimeTypes extends TestCase { diff --git a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java index 5ea4bc52c4..8b35b322cb 100644 --- a/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java +++ b/tests/server-side/com/vaadin/tests/server/TestStreamVariableMapping.java @@ -5,8 +5,8 @@ import junit.framework.TestCase; import org.easymock.EasyMock; import com.vaadin.Application; -import com.vaadin.terminal.StreamVariable; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.StreamVariable; +import com.vaadin.server.WrappedRequest; import com.vaadin.terminal.gwt.server.CommunicationManager; import com.vaadin.ui.UI; import com.vaadin.ui.Upload; diff --git a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java index f7ac55b6da..efebc097bf 100644 --- a/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java +++ b/tests/server-side/com/vaadin/tests/server/TransactionListenersConcurrency.java @@ -19,8 +19,8 @@ import junit.framework.TestCase; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; +import com.vaadin.server.DeploymentConfiguration; import com.vaadin.service.ApplicationContext.TransactionListener; -import com.vaadin.terminal.DeploymentConfiguration; import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext; import com.vaadin.terminal.gwt.server.WebApplicationContext; diff --git a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java index 4458872c79..d76dcffa2f 100644 --- a/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java +++ b/tests/server-side/com/vaadin/tests/server/component/absolutelayout/ComponentPosition.java @@ -2,8 +2,8 @@ package com.vaadin.tests.server.component.absolutelayout; import junit.framework.TestCase; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.Sizeable.Unit; +import com.vaadin.server.Sizeable; +import com.vaadin.server.Sizeable.Unit; import com.vaadin.ui.AbsoluteLayout; import com.vaadin.ui.Button; diff --git a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java index 3a251ecbb9..5dbab8467e 100644 --- a/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java +++ b/tests/server-side/com/vaadin/tests/server/component/abstractfield/RemoveListenersOnDetach.java @@ -8,7 +8,7 @@ import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.util.AbstractProperty; import com.vaadin.data.util.converter.Converter.ConversionException; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.AbstractField; import com.vaadin.ui.UI; diff --git a/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java index 9b4d9492a2..906d6ccebd 100644 --- a/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java +++ b/tests/server-side/com/vaadin/tests/server/component/root/CustomUIClassLoader.java @@ -11,9 +11,9 @@ import org.easymock.EasyMock; import com.vaadin.Application; import com.vaadin.Application.ApplicationStartEvent; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.DefaultUIProvider; -import com.vaadin.terminal.DeploymentConfiguration; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.DefaultUIProvider; +import com.vaadin.server.DeploymentConfiguration; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; public class CustomUIClassLoader extends TestCase { diff --git a/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java b/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java index c9ce0ac0a2..265e5382d4 100644 --- a/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java +++ b/tests/server-side/com/vaadin/tests/server/component/upload/UploadListeners.java @@ -1,6 +1,6 @@ package com.vaadin.tests.server.component.upload; -import com.vaadin.terminal.StreamVariable.StreamingProgressEvent; +import com.vaadin.server.StreamVariable.StreamingProgressEvent; import com.vaadin.tests.server.component.AbstractListenerMethodsTest; import com.vaadin.ui.Upload; import com.vaadin.ui.Upload.FailedEvent; diff --git a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java index 2a0a733140..0fb0765c9f 100644 --- a/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java +++ b/tests/server-side/com/vaadin/tests/server/component/window/AttachDetachWindow.java @@ -6,7 +6,7 @@ import static org.junit.Assert.assertTrue; import org.junit.Test; import com.vaadin.Application; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; diff --git a/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java b/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java index e342ee9005..18ed52cc2a 100644 --- a/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java +++ b/tests/server-side/com/vaadin/tests/server/navigator/UriFragmentManagerTest.java @@ -23,8 +23,8 @@ import org.easymock.IMocksControl; import com.vaadin.navigator.Navigator; import com.vaadin.navigator.Navigator.UriFragmentManager; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.FragmentChangedEvent; +import com.vaadin.server.Page; +import com.vaadin.server.Page.FragmentChangedEvent; public class UriFragmentManagerTest extends TestCase { diff --git a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java index 8183ed2d0b..b4a339c97f 100644 --- a/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java +++ b/tests/testbench/com/vaadin/launcher/ApplicationRunnerServlet.java @@ -31,8 +31,8 @@ import javax.servlet.http.HttpServletResponse; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.AbstractUIProvider; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.AbstractUIProvider; +import com.vaadin.server.WrappedRequest; import com.vaadin.terminal.gwt.server.AbstractApplicationServlet; import com.vaadin.terminal.gwt.server.WrappedHttpServletRequest; import com.vaadin.tests.components.TestBase; diff --git a/tests/testbench/com/vaadin/tests/Components.java b/tests/testbench/com/vaadin/tests/Components.java index 66e693a1de..5882c5cdb1 100644 --- a/tests/testbench/com/vaadin/tests/Components.java +++ b/tests/testbench/com/vaadin/tests/Components.java @@ -15,9 +15,9 @@ import com.vaadin.data.util.DefaultItemSorter; import com.vaadin.data.util.HierarchicalContainer; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.Sizeable; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.Sizeable; import com.vaadin.tests.components.AbstractComponentTest; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/LayoutDemo.java b/tests/testbench/com/vaadin/tests/LayoutDemo.java index 23997ac084..3348eda7a4 100644 --- a/tests/testbench/com/vaadin/tests/LayoutDemo.java +++ b/tests/testbench/com/vaadin/tests/LayoutDemo.java @@ -16,8 +16,8 @@ package com.vaadin.tests; +import com.vaadin.server.ClassResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ClassResource; import com.vaadin.ui.Component; import com.vaadin.ui.Embedded; import com.vaadin.ui.GridLayout; diff --git a/tests/testbench/com/vaadin/tests/NativeWindowing.java b/tests/testbench/com/vaadin/tests/NativeWindowing.java index 4bce92b668..2418c74db8 100644 --- a/tests/testbench/com/vaadin/tests/NativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/NativeWindowing.java @@ -96,7 +96,7 @@ public class NativeWindowing extends Application.LegacyApplication { public void buttonClick(ClickEvent event) { try { main.open( - new com.vaadin.terminal.ExternalResource( + new com.vaadin.server.ExternalResource( new URL( getURL(), "mainwin-" diff --git a/tests/testbench/com/vaadin/tests/Parameters.java b/tests/testbench/com/vaadin/tests/Parameters.java index d6bc9007ed..b16d4ef65b 100644 --- a/tests/testbench/com/vaadin/tests/Parameters.java +++ b/tests/testbench/com/vaadin/tests/Parameters.java @@ -22,10 +22,10 @@ import java.util.Iterator; import java.util.Map; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Label; import com.vaadin.ui.Layout.MarginHandler; import com.vaadin.ui.Link; diff --git a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java index 5f92484c6c..0e76617cc5 100644 --- a/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java +++ b/tests/testbench/com/vaadin/tests/PerformanceTestBasicComponentRendering.java @@ -19,8 +19,8 @@ package com.vaadin.tests; import java.util.Date; import java.util.Map; +import com.vaadin.server.UserError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.CustomComponent; diff --git a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java index 0161a2a20e..0b6b0cf8ba 100644 --- a/tests/testbench/com/vaadin/tests/RandomLayoutStress.java +++ b/tests/testbench/com/vaadin/tests/RandomLayoutStress.java @@ -18,7 +18,7 @@ package com.vaadin.tests; import java.util.Random; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Button; import com.vaadin.ui.CustomLayout; diff --git a/tests/testbench/com/vaadin/tests/TestBench.java b/tests/testbench/com/vaadin/tests/TestBench.java index 32fff09455..67e1180d75 100644 --- a/tests/testbench/com/vaadin/tests/TestBench.java +++ b/tests/testbench/com/vaadin/tests/TestBench.java @@ -27,9 +27,9 @@ 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.terminal.Page; -import com.vaadin.terminal.Page.FragmentChangedEvent; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.Page; +import com.vaadin.server.Page.FragmentChangedEvent; import com.vaadin.ui.Component; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.HorizontalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java index d5669e5689..57a98f787f 100644 --- a/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java +++ b/tests/testbench/com/vaadin/tests/TestCaptionWrapper.java @@ -16,11 +16,11 @@ package com.vaadin.tests; +import com.vaadin.server.ClassResource; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.UserError; import com.vaadin.shared.ui.label.ContentMode; -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; diff --git a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java index e13b907f77..1a93de387a 100644 --- a/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java +++ b/tests/testbench/com/vaadin/tests/TestComponentAddAndRecursion.java @@ -3,7 +3,7 @@ */ package com.vaadin.tests; -import com.vaadin.terminal.Page; +import com.vaadin.server.Page; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; diff --git a/tests/testbench/com/vaadin/tests/TestDateField.java b/tests/testbench/com/vaadin/tests/TestDateField.java index 6cdeb3ffbd..67b2f2cc69 100644 --- a/tests/testbench/com/vaadin/tests/TestDateField.java +++ b/tests/testbench/com/vaadin/tests/TestDateField.java @@ -18,9 +18,9 @@ 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.server.ClassResource; +import com.vaadin.server.ErrorMessage; +import com.vaadin.server.UserError; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.DateField; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java index 1692c2fe7b..1d28a0a1b4 100644 --- a/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java +++ b/tests/testbench/com/vaadin/tests/TestForBasicApplicationLayout.java @@ -18,7 +18,7 @@ package com.vaadin.tests; import java.util.Locale; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; diff --git a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java index 81b21c46c3..da6b7ddf3e 100644 --- a/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForChildComponentRendering.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import java.util.ArrayList; import java.util.Iterator; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java index eb807504fa..a94198b1c8 100644 --- a/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForGridLayoutChildComponentRendering.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import java.util.ArrayList; import java.util.Iterator; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java index 41b3309c57..cef9269b53 100644 --- a/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java +++ b/tests/testbench/com/vaadin/tests/TestForNativeWindowing.java @@ -96,7 +96,7 @@ public class TestForNativeWindowing extends Application.LegacyApplication { public void buttonClick(ClickEvent event) { try { main.open( - new com.vaadin.terminal.ExternalResource( + new com.vaadin.server.ExternalResource( new URL( getURL(), "mainwin-" diff --git a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java index af41ccc37b..a6fdaf5643 100644 --- a/tests/testbench/com/vaadin/tests/TestForStyledUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForStyledUpload.java @@ -27,8 +27,8 @@ import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import com.vaadin.Application; +import com.vaadin.server.StreamResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.StreamResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java index 61cf9c1c16..ac69cbd096 100644 --- a/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java +++ b/tests/testbench/com/vaadin/tests/TestForTablesInitialColumnWidthLogicRendering.java @@ -19,7 +19,7 @@ package com.vaadin.tests; import java.util.Iterator; import java.util.Vector; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; diff --git a/tests/testbench/com/vaadin/tests/TestForUpload.java b/tests/testbench/com/vaadin/tests/TestForUpload.java index d42870b5b1..eb59ed9f1f 100644 --- a/tests/testbench/com/vaadin/tests/TestForUpload.java +++ b/tests/testbench/com/vaadin/tests/TestForUpload.java @@ -29,8 +29,8 @@ import java.lang.management.ManagementFactory; import java.lang.management.MemoryMXBean; import com.vaadin.data.Property.ValueChangeEvent; +import com.vaadin.server.StreamResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.StreamResource; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java index 3b5c7404e7..253fd3aeea 100644 --- a/tests/testbench/com/vaadin/tests/TestForWindowOpen.java +++ b/tests/testbench/com/vaadin/tests/TestForWindowOpen.java @@ -16,7 +16,7 @@ package com.vaadin.tests; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CustomComponent; diff --git a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java index a0ff6f0fc7..6121647bc1 100644 --- a/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java +++ b/tests/testbench/com/vaadin/tests/TestSizeableIncomponents.java @@ -25,7 +25,7 @@ import com.vaadin.Application; import com.vaadin.data.Container; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java index 9fa716a23e..26bf90948b 100644 --- a/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java +++ b/tests/testbench/com/vaadin/tests/appengine/GAESyncTest.java @@ -4,8 +4,8 @@ import com.google.apphosting.api.DeadlineExceededException; import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.DownloadStream; +import com.vaadin.server.ClassResource; +import com.vaadin.server.DownloadStream; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Embedded; @@ -29,7 +29,7 @@ public class GAESyncTest extends Application.LegacyApplication { } @Override - public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { + public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) { Throwable t = event.getThrowable(); // Was this caused by a GAE timeout? while (t != null) { diff --git a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java index 1e6509ab85..3013659ed7 100644 --- a/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java +++ b/tests/testbench/com/vaadin/tests/application/RefreshStatePreserve.java @@ -2,8 +2,8 @@ package com.vaadin.tests.application; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.AbstractUIProvider; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.AbstractUIProvider; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java index 992a3afbca..0dcf0a6fa8 100644 --- a/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java +++ b/tests/testbench/com/vaadin/tests/application/TerminalErrorNotification.java @@ -38,7 +38,7 @@ public class TerminalErrorNotification extends TestBase { } @Override - public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { + public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) { event.getThrowable().printStackTrace(); UI mainWindow = getMainWindow(); diff --git a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java index fa5ab7d100..f31ea76728 100644 --- a/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java +++ b/tests/testbench/com/vaadin/tests/application/ThreadLocalInstances.java @@ -2,10 +2,10 @@ package com.vaadin.tests.application; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.PaintException; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.PaintException; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.tests.util.Log; @@ -28,7 +28,7 @@ public class ThreadLocalInstances extends AbstractTestApplication { } @Override - public void paintContent(com.vaadin.terminal.PaintTarget target) + public void paintContent(com.vaadin.server.PaintTarget target) throws PaintException { if (!paintReported) { reportCurrentStatus("root paint"); diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java index cece73a14d..ece40f5b00 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTest.java @@ -14,8 +14,8 @@ import com.vaadin.event.FieldEvents.BlurNotifier; import com.vaadin.event.FieldEvents.FocusEvent; import com.vaadin.event.FieldEvents.FocusListener; import com.vaadin.event.FieldEvents.FocusNotifier; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.util.Log; import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.AbstractComponent; @@ -715,7 +715,7 @@ public abstract class AbstractComponentTest } @Override - public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { + public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) { String logMsg = "Exception occured, " + event.getThrowable().getClass().getName(); diff --git a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java index d8ae43fd6d..81ec4a9da4 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractComponentTestCase.java @@ -5,9 +5,9 @@ import java.util.Date; import java.util.List; import java.util.Locale; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Field; import com.vaadin.ui.Layout.SpacingHandler; diff --git a/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java b/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java index 7dd742952f..db5fffa761 100644 --- a/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java +++ b/tests/testbench/com/vaadin/tests/components/AbstractTestUI.java @@ -1,9 +1,9 @@ package com.vaadin.tests.components; import com.vaadin.Application; +import com.vaadin.server.WrappedRequest; import com.vaadin.service.ApplicationContext; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.AbstractWebApplicationContext; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/ErrorMessages.java b/tests/testbench/com/vaadin/tests/components/ErrorMessages.java index d4008a4dfb..0e8dcc210b 100644 --- a/tests/testbench/com/vaadin/tests/components/ErrorMessages.java +++ b/tests/testbench/com/vaadin/tests/components/ErrorMessages.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components; import java.util.ArrayList; import java.util.List; -import com.vaadin.terminal.CompositeErrorMessage; -import com.vaadin.terminal.UserError; +import com.vaadin.server.CompositeErrorMessage; +import com.vaadin.server.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.ComboBox; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/components/UnknownComponentConnectorTest.java b/tests/testbench/com/vaadin/tests/components/UnknownComponentConnectorTest.java index a64216aed1..197408a533 100644 --- a/tests/testbench/com/vaadin/tests/components/UnknownComponentConnectorTest.java +++ b/tests/testbench/com/vaadin/tests/components/UnknownComponentConnectorTest.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.AbstractComponent; public class UnknownComponentConnectorTest extends AbstractTestUI { diff --git a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java index 5deec3b4f5..d318afc34f 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java +++ b/tests/testbench/com/vaadin/tests/components/abstractcomponent/AllComponentTooltipTest.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.abstractcomponent; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.VaadinClasses; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractComponent; diff --git a/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java index fc08a4505c..3a8275bd51 100644 --- a/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java +++ b/tests/testbench/com/vaadin/tests/components/abstractfield/TextFieldConversions.java @@ -5,7 +5,7 @@ import java.util.Date; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.ObjectProperty; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent.ComponentErrorEvent; import com.vaadin.ui.AbstractComponent.ComponentErrorHandler; import com.vaadin.ui.ComboBox; diff --git a/tests/testbench/com/vaadin/tests/components/button/ButtonsAndIcons.java b/tests/testbench/com/vaadin/tests/components/button/ButtonsAndIcons.java index 56fc5f208c..4ab18e994a 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ButtonsAndIcons.java +++ b/tests/testbench/com/vaadin/tests/components/button/ButtonsAndIcons.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.button; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.NativeButton; diff --git a/tests/testbench/com/vaadin/tests/components/button/DisabledButtons.java b/tests/testbench/com/vaadin/tests/components/button/DisabledButtons.java index 3e438a5d5b..73dbd95829 100644 --- a/tests/testbench/com/vaadin/tests/components/button/DisabledButtons.java +++ b/tests/testbench/com/vaadin/tests/components/button/DisabledButtons.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.button; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java index 4fb8df678e..d0321100dd 100644 --- a/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java +++ b/tests/testbench/com/vaadin/tests/components/button/ShortCutListenerModification.java @@ -53,7 +53,7 @@ public class ShortCutListenerModification extends TestBase implements } @Override - public void terminalError(com.vaadin.terminal.Terminal.ErrorEvent event) { + public void terminalError(com.vaadin.server.Terminal.ErrorEvent event) { super.terminalError(event); getMainWindow().showNotification("Failed!", Notification.TYPE_ERROR_MESSAGE); diff --git a/tests/testbench/com/vaadin/tests/components/caption/EmptyCaptions.java b/tests/testbench/com/vaadin/tests/components/caption/EmptyCaptions.java index 8e0e8d1071..05b8333e7d 100644 --- a/tests/testbench/com/vaadin/tests/components/caption/EmptyCaptions.java +++ b/tests/testbench/com/vaadin/tests/components/caption/EmptyCaptions.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.caption; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java index 57ef9e6656..46539b42d7 100644 --- a/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java +++ b/tests/testbench/com/vaadin/tests/components/caption/IconsInCaption.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.caption; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.VaadinClasses; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; diff --git a/tests/testbench/com/vaadin/tests/components/caption/LargeCaptionIcon.java b/tests/testbench/com/vaadin/tests/components/caption/LargeCaptionIcon.java index 603fdf458b..d09b5c02ac 100644 --- a/tests/testbench/com/vaadin/tests/components/caption/LargeCaptionIcon.java +++ b/tests/testbench/com/vaadin/tests/components/caption/LargeCaptionIcon.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.caption; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java index 28abf5172d..22e260b442 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxNullValue.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.checkbox; import com.vaadin.data.Validator.InvalidValueException; -import com.vaadin.terminal.AbstractErrorMessage; +import com.vaadin.server.AbstractErrorMessage; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes.java index f4d65b8d53..24f53889b3 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckBoxes.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.checkbox; import java.util.Date; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.CheckBox; diff --git a/tests/testbench/com/vaadin/tests/components/checkbox/CheckboxIcon.java b/tests/testbench/com/vaadin/tests/components/checkbox/CheckboxIcon.java index 6fa714a6d7..50998a96eb 100644 --- a/tests/testbench/com/vaadin/tests/components/checkbox/CheckboxIcon.java +++ b/tests/testbench/com/vaadin/tests/components/checkbox/CheckboxIcon.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.checkbox; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.CheckBox; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java index 75325b798f..62ae652dd0 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxItemIcon.java @@ -1,8 +1,8 @@ package com.vaadin.tests.components.combobox; import com.vaadin.data.Item; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.ComboBox; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java index 0f8124ca20..07cd1f046c 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxLargeIcons.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components.combobox; import java.util.Date; import com.vaadin.data.Item; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.ComboBox; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java index eb28a9ff4e..05b52dee80 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxUndefinedWidthAndIcon.java @@ -1,8 +1,8 @@ package com.vaadin.tests.components.combobox; import com.vaadin.data.Item; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.ComboBox; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java index 3071ab4c2d..7b241c9fe1 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/ComboBoxes2.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.combobox; import java.util.LinkedHashMap; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; import com.vaadin.tests.components.select.SelectTest; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Select; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java index 5b1af58421..3e409069d0 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/Comboboxes.java @@ -4,7 +4,7 @@ import java.util.Date; import java.util.LinkedHashMap; import java.util.List; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.ComboBox; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java index e22482ed8b..c73bb28c43 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/PopUpWidth.java @@ -1,8 +1,8 @@ package com.vaadin.tests.components.combobox; import com.vaadin.data.Item; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.ComboBox; diff --git a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java index ce6a24d9bd..1099d03786 100644 --- a/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java +++ b/tests/testbench/com/vaadin/tests/components/combobox/RemovalOfSelectedIcon.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.combobox; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java b/tests/testbench/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java index 8a37d85b31..8170f152c2 100644 --- a/tests/testbench/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java +++ b/tests/testbench/com/vaadin/tests/components/customcomponent/EmbeddedInCustomComponent.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.customcomponent; import java.util.Date; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.CustomComponent; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/datefield/DatePopupStyleName.java b/tests/testbench/com/vaadin/tests/components/datefield/DatePopupStyleName.java index 44260e9247..66de59ffde 100644 --- a/tests/testbench/com/vaadin/tests/components/datefield/DatePopupStyleName.java +++ b/tests/testbench/com/vaadin/tests/components/datefield/DatePopupStyleName.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.datefield; import java.util.Date; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.DateField; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java index 9a412cee9d..aedfafe627 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedAltText.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java index 5091f3a929..4b318c3890 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedApplet.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java index c9b6991d8f..3c5801e90e 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedClickListenerRelativeCoordinates.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.embedded; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedFlash.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedFlash.java index fb6b55ded0..38aea4a4f0 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedFlash.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedFlash.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java index 3020942844..254d27c1dd 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedImageRefresh.java @@ -11,7 +11,7 @@ import java.util.Date; import javax.imageio.ImageIO; -import com.vaadin.terminal.StreamResource; +import com.vaadin.server.StreamResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java index 252229cbe3..ae98a55348 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedPdf.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ClassResource; +import com.vaadin.server.ClassResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedTooltip.java b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedTooltip.java index d8be22f507..aa24337013 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedTooltip.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/EmbeddedTooltip.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/embedded/FlashIsVisible.java b/tests/testbench/com/vaadin/tests/components/embedded/FlashIsVisible.java index 5d626cfc0b..1724fc11b7 100644 --- a/tests/testbench/com/vaadin/tests/components/embedded/FlashIsVisible.java +++ b/tests/testbench/com/vaadin/tests/components/embedded/FlashIsVisible.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.embedded; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java index fdf9405855..b15f33f633 100644 --- a/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java +++ b/tests/testbench/com/vaadin/tests/components/embeddedbrowser/EmbeddedBrowserIsVisible.java @@ -4,7 +4,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.UnsupportedEncodingException; -import com.vaadin.terminal.StreamResource; +import com.vaadin.server.StreamResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java index 66cb8819d4..74bb216002 100644 --- a/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java +++ b/tests/testbench/com/vaadin/tests/components/flash/FlashIsVisible.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.flash; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Flash; diff --git a/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java b/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java index 843e61ace1..5c28feb7f8 100644 --- a/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java +++ b/tests/testbench/com/vaadin/tests/components/flash/FlashPresentation.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.flash; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Flash; diff --git a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java index a73c88cf73..dc3cffffb6 100644 --- a/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java +++ b/tests/testbench/com/vaadin/tests/components/formlayout/FormLayoutErrorHover.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.formlayout; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.FormLayout; import com.vaadin.ui.PopupDateField; diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java index 1f787fd64f..e7aaf0c0e4 100644 --- a/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java +++ b/tests/testbench/com/vaadin/tests/components/image/ImageAltText.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.image; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java index 394e38a106..f1a3a09952 100644 --- a/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java +++ b/tests/testbench/com/vaadin/tests/components/image/ImageClicks.java @@ -12,7 +12,7 @@ import javax.imageio.ImageIO; import com.vaadin.event.MouseEvents.ClickEvent; import com.vaadin.event.MouseEvents.ClickListener; -import com.vaadin.terminal.StreamResource; +import com.vaadin.server.StreamResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Image; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java index a0df85a5b3..416d538e7c 100644 --- a/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java +++ b/tests/testbench/com/vaadin/tests/components/javascriptcomponent/BasicJavaScriptComponent.java @@ -22,12 +22,12 @@ import java.util.List; import com.vaadin.annotations.JavaScript; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; +import com.vaadin.server.ClassResource; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.communication.ClientRpc; import com.vaadin.shared.communication.ServerRpc; import com.vaadin.shared.communication.URLReference; import com.vaadin.shared.ui.JavaScriptComponentState; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.terminal.gwt.server.ResourceReference; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; diff --git a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.java b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.java index 5ce19bcff8..bc399e7d3c 100644 --- a/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.java +++ b/tests/testbench/com/vaadin/tests/components/label/LabelTooltip.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.label; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java index 18d3b1e8ed..060c937feb 100644 --- a/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java +++ b/tests/testbench/com/vaadin/tests/components/label/MarginsInLabels.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.label; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbstractLayout; import com.vaadin.ui.Accordion; diff --git a/tests/testbench/com/vaadin/tests/components/link/LinkIcon.java b/tests/testbench/com/vaadin/tests/components/link/LinkIcon.java index ae8eccb59a..970c2f71c7 100644 --- a/tests/testbench/com/vaadin/tests/components/link/LinkIcon.java +++ b/tests/testbench/com/vaadin/tests/components/link/LinkIcon.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.link; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Link; diff --git a/tests/testbench/com/vaadin/tests/components/link/LinkTargetSize.java b/tests/testbench/com/vaadin/tests/components/link/LinkTargetSize.java index 0b3643c3ac..822a8d5991 100644 --- a/tests/testbench/com/vaadin/tests/components/link/LinkTargetSize.java +++ b/tests/testbench/com/vaadin/tests/components/link/LinkTargetSize.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.link; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Link; diff --git a/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java b/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java index f14e1afd8c..70ddc74616 100644 --- a/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java +++ b/tests/testbench/com/vaadin/tests/components/link/LinkToPercentage.java @@ -3,9 +3,9 @@ package com.vaadin.tests.components.link; import java.io.IOException; import java.io.InputStream; -import com.vaadin.terminal.ApplicationResource; -import com.vaadin.terminal.StreamResource; -import com.vaadin.terminal.StreamResource.StreamSource; +import com.vaadin.server.ApplicationResource; +import com.vaadin.server.StreamResource; +import com.vaadin.server.StreamResource.StreamSource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Link; diff --git a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java index 480c186df7..ac4c3c8ea3 100644 --- a/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java +++ b/tests/testbench/com/vaadin/tests/components/loginform/LoginFormWithMultipleWindows.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.loginform; import com.vaadin.Application; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.LoginForm; import com.vaadin.ui.LoginForm.LoginEvent; import com.vaadin.ui.LoginForm.LoginListener; diff --git a/tests/testbench/com/vaadin/tests/components/media/Media.java b/tests/testbench/com/vaadin/tests/components/media/Media.java index ef7fc36c63..945285fbb4 100644 --- a/tests/testbench/com/vaadin/tests/components/media/Media.java +++ b/tests/testbench/com/vaadin/tests/components/media/Media.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.media; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Audio; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java index d7585af8ac..d6e79224a3 100644 --- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java +++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarHtmlItems.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components.menubar; import java.util.Arrays; import java.util.List; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.ComponentTestCase; import com.vaadin.ui.Component; import com.vaadin.ui.MenuBar; diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java index 2c4a975f9b..c88edf5bdc 100644 --- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java +++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarRunsOutOfBrowser.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.menubar; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Alignment; import com.vaadin.ui.MenuBar; diff --git a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java index 5ab2b2145f..982b16c6e2 100644 --- a/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java +++ b/tests/testbench/com/vaadin/tests/components/menubar/MenuBarTest.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components.menubar; import java.util.Date; import java.util.LinkedHashMap; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.AbstractComponentTest; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.MenuItem; diff --git a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java index 97e038dc1a..10fef434ca 100644 --- a/tests/testbench/com/vaadin/tests/components/notification/Notifications.java +++ b/tests/testbench/com/vaadin/tests/components/notification/Notifications.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.notification; -import com.vaadin.terminal.Page; +import com.vaadin.server.Page; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java index 767d16b6da..89e97c0b6a 100644 --- a/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java +++ b/tests/testbench/com/vaadin/tests/components/notification/NotificationsHtmlAllowed.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.notification; -import com.vaadin.terminal.Page; +import com.vaadin.server.Page; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java index c20de87ec7..c4c588d1ea 100644 --- a/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java +++ b/tests/testbench/com/vaadin/tests/components/optiongroup/OptionGroups.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.optiongroup; import java.util.Collection; import java.util.LinkedHashMap; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.select.AbstractSelectTestCase; import com.vaadin.ui.OptionGroup; diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java index 07562b7cfe..4122bd626a 100644 --- a/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java +++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/LayoutResizeTest.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.orderedlayout; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java index 5aaaaec6a6..864ca2e6da 100644 --- a/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java +++ b/tests/testbench/com/vaadin/tests/components/orderedlayout/OrderedLayoutCases.java @@ -7,7 +7,7 @@ import java.util.List; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbstractOrderedLayout; diff --git a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java index a4067c3dcb..fd96b08cfb 100644 --- a/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java +++ b/tests/testbench/com/vaadin/tests/components/panel/PanelChangeContents.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.panel; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java index 99bfc7acfb..d755f5961e 100644 --- a/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java +++ b/tests/testbench/com/vaadin/tests/components/popupview/ReopenPopupView.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.components.popupview; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java index 6eaffa5cf3..e775bf6aca 100644 --- a/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java +++ b/tests/testbench/com/vaadin/tests/components/richtextarea/RichTextAreaWithKeyboardShortcuts.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.richtextarea; import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.ShortcutAction; -import com.vaadin.terminal.Page; +import com.vaadin.server.Page; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java b/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java index 7c2d8dd243..b0c6c08a62 100644 --- a/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java +++ b/tests/testbench/com/vaadin/tests/components/select/AbstractSelectTestCase.java @@ -11,7 +11,7 @@ import com.vaadin.event.Action; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; import com.vaadin.event.ItemClickEvent.ItemClickNotifier; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; import com.vaadin.tests.components.abstractfield.AbstractFieldTest; import com.vaadin.ui.AbstractSelect; diff --git a/tests/testbench/com/vaadin/tests/components/select/SelectIconPlacement.java b/tests/testbench/com/vaadin/tests/components/select/SelectIconPlacement.java index 51a899a7e6..0cba74b941 100644 --- a/tests/testbench/com/vaadin/tests/components/select/SelectIconPlacement.java +++ b/tests/testbench/com/vaadin/tests/components/select/SelectIconPlacement.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.select; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Select; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java index dc361b1b27..7c0648876b 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/AbstractSplitPanelTest.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.Sizeable.Unit; +import com.vaadin.server.Sizeable; +import com.vaadin.server.Sizeable.Unit; import com.vaadin.tests.components.AbstractComponentContainerTest; import com.vaadin.ui.AbstractSplitPanel; import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java index 5554b2b9f3..342cd9de6c 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelExtraScrollbars.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java index c06ca5b0b9..a1d0fcb42b 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelInModalWindow.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java index a86d209f65..18ea015d01 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelReversePosition.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSplitPanel.SplitterClickEvent; import com.vaadin.ui.AbstractSplitPanel.SplitterClickListener; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java index 3cdc0c8913..c35838e751 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWidthOnResize.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java index 2a730da9be..beebbf4d2a 100644 --- a/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java +++ b/tests/testbench/com/vaadin/tests/components/splitpanel/SplitPanelWithMinimumAndMaximum.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.splitpanel; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.HorizontalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java index 4fca8c1742..828d184086 100644 --- a/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java +++ b/tests/testbench/com/vaadin/tests/components/table/ItemClickEvents.java @@ -4,7 +4,7 @@ import com.vaadin.data.Item; 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.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java b/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java index bc0601684f..f9a0add6fc 100644 --- a/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java +++ b/tests/testbench/com/vaadin/tests/components/table/KeyboardNavigationWithChangingContent.java @@ -3,7 +3,7 @@ package com.vaadin.tests.components.table; import java.util.Arrays; import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java index b9e7fde17a..99ad913674 100644 --- a/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java +++ b/tests/testbench/com/vaadin/tests/components/table/LabelEmbeddedClickThroughForTable.java @@ -3,8 +3,8 @@ package com.vaadin.tests.components.table; import com.vaadin.data.Item; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Component; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java b/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java index dffab6dbad..6f4436880a 100644 --- a/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java +++ b/tests/testbench/com/vaadin/tests/components/table/SafariRenderingBugWhiteSpace.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.table; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.HorizontalSplitPanel; import com.vaadin.ui.Panel; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java b/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java index 18eec814bc..039b02e801 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableAndBrowserContextMenu.java @@ -6,7 +6,7 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.event.Action; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java b/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java index 38b3a751e2..62a131cbbf 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableClickAndDragOnIconAndComponents.java @@ -7,8 +7,8 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSelect.AbstractSelectTargetDetails; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java index f54f685a1d..1c6862cf07 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableInTabsheet.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.table; import java.net.MalformedURLException; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.AbsoluteLayout; import com.vaadin.ui.HorizontalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/table/TableItemIcon.java b/tests/testbench/com/vaadin/tests/components/table/TableItemIcon.java index b8a6733e83..8b502268b1 100644 --- a/tests/testbench/com/vaadin/tests/components/table/TableItemIcon.java +++ b/tests/testbench/com/vaadin/tests/components/table/TableItemIcon.java @@ -1,8 +1,8 @@ package com.vaadin.tests.components.table; import com.vaadin.data.Item; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.Resource; +import com.vaadin.server.ClassResource; +import com.vaadin.server.Resource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Table; diff --git a/tests/testbench/com/vaadin/tests/components/table/Tables.java b/tests/testbench/com/vaadin/tests/components/table/Tables.java index 79a5fb367d..1431155b1a 100644 --- a/tests/testbench/com/vaadin/tests/components/table/Tables.java +++ b/tests/testbench/com/vaadin/tests/components/table/Tables.java @@ -8,8 +8,8 @@ import java.util.List; import com.vaadin.event.Action; import com.vaadin.event.Action.Handler; import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.server.Resource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.Resource; import com.vaadin.tests.components.select.AbstractSelectTestCase; import com.vaadin.ui.AbstractSelect.MultiSelectMode; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIcons.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIcons.java index 2e334a836e..5d814ec48f 100644 --- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIcons.java +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetIcons.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.tabsheet; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Component; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java index fea255a98d..6c39cdab73 100644 --- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabSheetTest.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.tabsheet; import java.util.LinkedHashMap; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; import com.vaadin.tests.components.AbstractComponentContainerTest; import com.vaadin.ui.Component; import com.vaadin.ui.TabSheet; diff --git a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java index 18934e9318..fefd7a0b28 100644 --- a/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java +++ b/tests/testbench/com/vaadin/tests/components/tabsheet/TabsheetTooltip.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.tabsheet; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Label; import com.vaadin.ui.TabSheet; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java b/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java index 4072610996..ab9bcd9a99 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeConnectors.java @@ -8,7 +8,7 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Tree; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeHorizontalResize.java b/tests/testbench/com/vaadin/tests/components/tree/TreeHorizontalResize.java index e25b2d6760..1fa73ccd6d 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeHorizontalResize.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeHorizontalResize.java @@ -4,7 +4,7 @@ import java.util.Iterator; import com.vaadin.data.Item; import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Panel; import com.vaadin.ui.Tree; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java b/tests/testbench/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java index 2101abb630..f885e1d1da 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeNodeCaptionWrapping.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.tree; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Tree; diff --git a/tests/testbench/com/vaadin/tests/components/tree/TreeWithIcons.java b/tests/testbench/com/vaadin/tests/components/tree/TreeWithIcons.java index fbf4a3c1d1..99618c0e5d 100644 --- a/tests/testbench/com/vaadin/tests/components/tree/TreeWithIcons.java +++ b/tests/testbench/com/vaadin/tests/components/tree/TreeWithIcons.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.tree; import java.util.Date; -import com.vaadin.terminal.Sizeable; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Sizeable; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.LoremIpsum; import com.vaadin.ui.HorizontalLayout; diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java index 0fe8a3d1b9..4cf17aef48 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/ChangeDataSourcePageLengthZero.java @@ -2,7 +2,7 @@ package com.vaadin.tests.components.treetable; import com.vaadin.data.Container.Hierarchical; import com.vaadin.data.util.HierarchicalContainer; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java index 8f9c1deaf5..d9f6dcc2ac 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/DisappearingComponents.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.treetable; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Link; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/components/treetable/ExpandAnimationsInChameleon.java b/tests/testbench/com/vaadin/tests/components/treetable/ExpandAnimationsInChameleon.java index ca1c7aeb9c..2042edeea2 100644 --- a/tests/testbench/com/vaadin/tests/components/treetable/ExpandAnimationsInChameleon.java +++ b/tests/testbench/com/vaadin/tests/components/treetable/ExpandAnimationsInChameleon.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.treetable; import com.vaadin.data.Container.Hierarchical; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; diff --git a/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java index 75a98ba14e..34bf8f6715 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java +++ b/tests/testbench/com/vaadin/tests/components/ui/LazyInitUIs.java @@ -2,10 +2,10 @@ package com.vaadin.tests.components.ui; import com.vaadin.UIRequiresMoreInformationException; import com.vaadin.annotations.EagerInit; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedRequest.BrowserDetails; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; import com.vaadin.ui.Link; diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java index 39cc598094..ec0cdf53a2 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUITheme.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.ui; import com.vaadin.annotations.Theme; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java index f26e94f243..99c3c49f72 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset.java @@ -1,7 +1,7 @@ package com.vaadin.tests.components.ui; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; diff --git a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java index 84c0780240..b9cdb7a3dc 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java +++ b/tests/testbench/com/vaadin/tests/components/ui/TestUIWidgetset2.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.ui; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.server.MissingFromDefaultWidgetsetComponent; diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java index 29de6f6ac3..e225ae73d8 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitException.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.ui; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; public class UIInitException extends AbstractTestUI { diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java index 6efe1d1b28..68e6a4da34 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UIInitTest.java @@ -4,7 +4,7 @@ package com.vaadin.tests.components.ui; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java index 8dd303a8e1..022db1bf3e 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UIsInMultipleTabs.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.ui; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.AbstractUIProvider; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.AbstractUIProvider; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestApplication; import com.vaadin.ui.Label; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java index d2167e67c7..b64770408b 100644 --- a/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java +++ b/tests/testbench/com/vaadin/tests/components/ui/UriFragmentTest.java @@ -1,8 +1,8 @@ package com.vaadin.tests.components.ui; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.FragmentChangedEvent; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.Page; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.Page.FragmentChangedEvent; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java b/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java index 76b93cae56..573f55b29d 100644 --- a/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java +++ b/tests/testbench/com/vaadin/tests/components/window/DownloadAndUpdate.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.window; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/window/EmbeddedInSubWindow.java b/tests/testbench/com/vaadin/tests/components/window/EmbeddedInSubWindow.java index cd990f94b7..6ca5837cee 100644 --- a/tests/testbench/com/vaadin/tests/components/window/EmbeddedInSubWindow.java +++ b/tests/testbench/com/vaadin/tests/components/window/EmbeddedInSubWindow.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.window; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Embedded; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java index 1cdfdef0b5..03deb4ea20 100644 --- a/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java +++ b/tests/testbench/com/vaadin/tests/components/window/ExtraWindowShown.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.window; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java index 80497528ca..bacc4c131c 100644 --- a/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java +++ b/tests/testbench/com/vaadin/tests/components/window/LazyWindowResize.java @@ -2,9 +2,9 @@ package com.vaadin.tests.components.window; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; +import com.vaadin.server.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page.BrowserWindowResizeListener; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.Page.BrowserWindowResizeEvent; -import com.vaadin.terminal.Page.BrowserWindowResizeListener; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.tests.util.Log; import com.vaadin.tests.util.LoremIpsum; diff --git a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java index 4d2f118ec7..847ee585f7 100644 --- a/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java +++ b/tests/testbench/com/vaadin/tests/components/window/RepaintWindowContents.java @@ -1,6 +1,6 @@ package com.vaadin.tests.components.window; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java index a77a1f7703..7d4efe39ce 100644 --- a/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java +++ b/tests/testbench/com/vaadin/tests/components/window/TooltipInWindow.java @@ -16,7 +16,7 @@ package com.vaadin.tests.components.window; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.TextField; import com.vaadin.ui.Window; diff --git a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java index 74d7b564db..57a125bcb7 100644 --- a/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java +++ b/tests/testbench/com/vaadin/tests/components/window/WindowResizeListener.java @@ -2,8 +2,8 @@ package com.vaadin.tests.components.window; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page; +import com.vaadin.server.Page.BrowserWindowResizeEvent; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; diff --git a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java index 4f41410ba3..8b8ad4cf70 100644 --- a/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java +++ b/tests/testbench/com/vaadin/tests/containers/BeanItemContainerFilteringTest.java @@ -4,7 +4,7 @@ import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java index b30ef3e616..a1dba3eed8 100644 --- a/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java +++ b/tests/testbench/com/vaadin/tests/containers/IndexedContainerFilteringTest.java @@ -4,7 +4,7 @@ import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest1.java b/tests/testbench/com/vaadin/tests/dd/DDTest1.java index 3f0689cdc1..161a9b423e 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest1.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest1.java @@ -10,8 +10,8 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.event.dd.acceptcriteria.ServerSideCriterion; +import com.vaadin.server.ExternalResource; import com.vaadin.shared.ui.dd.VerticalDropLocation; -import com.vaadin.terminal.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractSelect.AcceptItem; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest2.java b/tests/testbench/com/vaadin/tests/dd/DDTest2.java index 4d649c6056..7757513fc1 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest2.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest2.java @@ -15,8 +15,8 @@ import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.event.dd.acceptcriteria.And; import com.vaadin.event.dd.acceptcriteria.Or; import com.vaadin.event.dd.acceptcriteria.SourceIs; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Person; import com.vaadin.tests.util.PersonContainer; diff --git a/tests/testbench/com/vaadin/tests/dd/DDTest6.java b/tests/testbench/com/vaadin/tests/dd/DDTest6.java index f1e31c1452..05be14eb76 100644 --- a/tests/testbench/com/vaadin/tests/dd/DDTest6.java +++ b/tests/testbench/com/vaadin/tests/dd/DDTest6.java @@ -25,12 +25,12 @@ import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; import com.vaadin.event.dd.acceptcriteria.Not; import com.vaadin.event.dd.acceptcriteria.SourceIsTarget; +import com.vaadin.server.Resource; +import com.vaadin.server.StreamResource; +import com.vaadin.server.StreamVariable; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.StreamResource.StreamSource; import com.vaadin.shared.MouseEventDetails; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.StreamResource; -import com.vaadin.terminal.StreamResource.StreamSource; -import com.vaadin.terminal.StreamVariable; -import com.vaadin.terminal.ThemeResource; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.TestUtils; import com.vaadin.ui.AbsoluteLayout; diff --git a/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java b/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java index bea00ae0ad..4ecabee617 100644 --- a/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java +++ b/tests/testbench/com/vaadin/tests/dd/DragAndDropFiles.java @@ -8,7 +8,7 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.terminal.StreamVariable; +import com.vaadin.server.StreamVariable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Component; import com.vaadin.ui.CssLayout; diff --git a/tests/testbench/com/vaadin/tests/dd/DragDropPane.java b/tests/testbench/com/vaadin/tests/dd/DragDropPane.java index a94b676f2c..970e1b0141 100644 --- a/tests/testbench/com/vaadin/tests/dd/DragDropPane.java +++ b/tests/testbench/com/vaadin/tests/dd/DragDropPane.java @@ -9,8 +9,8 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; +import com.vaadin.server.StreamVariable; import com.vaadin.shared.MouseEventDetails; -import com.vaadin.terminal.StreamVariable; import com.vaadin.ui.AbsoluteLayout; import com.vaadin.ui.AbsoluteLayout.ComponentPosition; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java b/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java index 1a01564220..592ea92f80 100644 --- a/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java +++ b/tests/testbench/com/vaadin/tests/dd/StartHtml5Drag.java @@ -4,8 +4,8 @@ import com.vaadin.event.dd.DragAndDropEvent; import com.vaadin.event.dd.DropHandler; import com.vaadin.event.dd.acceptcriteria.AcceptAll; import com.vaadin.event.dd.acceptcriteria.AcceptCriterion; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.ClassResource; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.DragAndDropWrapper; import com.vaadin.ui.DragAndDropWrapper.DragStartMode; diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java index 29e37d9847..e4fc291728 100644 --- a/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java +++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtension.java @@ -16,8 +16,8 @@ package com.vaadin.tests.extensions; -import com.vaadin.terminal.AbstractClientConnector; -import com.vaadin.terminal.AbstractExtension; +import com.vaadin.server.AbstractClientConnector; +import com.vaadin.server.AbstractExtension; public class BasicExtension extends AbstractExtension { @Override diff --git a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java index daa2e78353..40856af11e 100644 --- a/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/BasicExtensionTest.java @@ -17,7 +17,7 @@ package com.vaadin.tests.extensions; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java index 60db95827c..e8a33fd3af 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtension.java @@ -15,7 +15,7 @@ */ package com.vaadin.tests.extensions; -import com.vaadin.terminal.AbstractExtension; +import com.vaadin.server.AbstractExtension; import com.vaadin.tests.widgetset.client.helloworldfeature.GreetAgainRpc; import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldRpc; import com.vaadin.tests.widgetset.client.helloworldfeature.HelloWorldState; diff --git a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java index e4646572db..576b16fbb6 100644 --- a/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/HelloWorldExtensionTest.java @@ -16,7 +16,7 @@ package com.vaadin.tests.extensions; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java index 6281f3eff4..a4e2acb31e 100644 --- a/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/JavascriptManagerTest.java @@ -19,7 +19,7 @@ package com.vaadin.tests.extensions; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; import com.vaadin.external.json.JSONObject; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.ui.JavaScript; diff --git a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java index c604516b9c..18054c8e0f 100644 --- a/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java +++ b/tests/testbench/com/vaadin/tests/extensions/SimpleJavaScriptExtensionTest.java @@ -20,11 +20,11 @@ import com.vaadin.annotations.JavaScript; import com.vaadin.annotations.StyleSheet; import com.vaadin.external.json.JSONArray; import com.vaadin.external.json.JSONException; +import com.vaadin.server.AbstractJavaScriptExtension; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.JavaScriptExtensionState; import com.vaadin.shared.communication.ClientRpc; import com.vaadin.shared.communication.ServerRpc; -import com.vaadin.terminal.AbstractJavaScriptExtension; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java index 6a9f696e75..7afdf906b5 100644 --- a/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java +++ b/tests/testbench/com/vaadin/tests/integration/EmbedSizeTest.java @@ -2,8 +2,8 @@ package com.vaadin.tests.integration; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.BrowserWindowResizeEvent; +import com.vaadin.server.Page; +import com.vaadin.server.Page.BrowserWindowResizeEvent; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.util.Log; import com.vaadin.ui.CheckBox; diff --git a/tests/testbench/com/vaadin/tests/integration/FlagSeResource.java b/tests/testbench/com/vaadin/tests/integration/FlagSeResource.java index f80e9e3a2f..76adecb7d8 100644 --- a/tests/testbench/com/vaadin/tests/integration/FlagSeResource.java +++ b/tests/testbench/com/vaadin/tests/integration/FlagSeResource.java @@ -1,7 +1,7 @@ package com.vaadin.tests.integration; import com.vaadin.Application; -import com.vaadin.terminal.ClassResource; +import com.vaadin.server.ClassResource; public class FlagSeResource extends ClassResource { diff --git a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java index b3fc9c8ffb..b089515b0e 100644 --- a/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java +++ b/tests/testbench/com/vaadin/tests/integration/IntegrationTestApplication.java @@ -4,8 +4,8 @@ import com.vaadin.Application; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.Resource; +import com.vaadin.server.ClassResource; +import com.vaadin.server.Resource; import com.vaadin.ui.Label; import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.Table; diff --git a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java index c2a01b16dd..3a17361fb7 100644 --- a/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java +++ b/tests/testbench/com/vaadin/tests/integration/JSR286PortletApplication.java @@ -20,8 +20,8 @@ import javax.portlet.WindowState; import com.vaadin.Application; import com.vaadin.annotations.StyleSheet; +import com.vaadin.server.ExternalResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; import com.vaadin.terminal.gwt.server.PortletApplicationContext2; import com.vaadin.terminal.gwt.server.PortletApplicationContext2.PortletListener; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java index a233191070..0cbf50ae1b 100644 --- a/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java +++ b/tests/testbench/com/vaadin/tests/integration/LiferayThemeDemo.java @@ -8,13 +8,13 @@ import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.event.Action; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.Page; +import com.vaadin.server.Resource; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.MarginInfo; import com.vaadin.shared.ui.label.ContentMode; import com.vaadin.shared.ui.slider.SliderOrientation; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.ThemeResource; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractSelect; import com.vaadin.ui.Accordion; diff --git a/tests/testbench/com/vaadin/tests/integration/SpecialNameResource.java b/tests/testbench/com/vaadin/tests/integration/SpecialNameResource.java index b8dd199e3d..3a0bf7cdd5 100644 --- a/tests/testbench/com/vaadin/tests/integration/SpecialNameResource.java +++ b/tests/testbench/com/vaadin/tests/integration/SpecialNameResource.java @@ -1,7 +1,7 @@ package com.vaadin.tests.integration; import com.vaadin.Application; -import com.vaadin.terminal.ClassResource; +import com.vaadin.server.ClassResource; public class SpecialNameResource extends ClassResource { public SpecialNameResource(Application application) { diff --git a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java index 77b8e249ba..03c3c43ccd 100644 --- a/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java +++ b/tests/testbench/com/vaadin/tests/layouts/CaptionsInLayouts.java @@ -6,8 +6,8 @@ import java.util.List; import com.vaadin.data.Item; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java index 7877ca3fe3..f4050ea085 100644 --- a/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java +++ b/tests/testbench/com/vaadin/tests/layouts/ComplexGLColumnExpansionWithColSpan.java @@ -1,6 +1,6 @@ package com.vaadin.tests.layouts; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.tests.components.AbstractTestCase; import com.vaadin.ui.Button; import com.vaadin.ui.GridLayout; diff --git a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java index 2d5bc8d59a..9f2715a09b 100644 --- a/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java +++ b/tests/testbench/com/vaadin/tests/layouts/GridLayoutCaptions.java @@ -3,7 +3,7 @@ package com.vaadin.tests.layouts; import com.vaadin.data.Item; import com.vaadin.data.Validator; import com.vaadin.data.util.BeanItem; -import com.vaadin.terminal.AbstractErrorMessage; +import com.vaadin.server.AbstractErrorMessage; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java b/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java index 2ceb6428ed..9e0380a1f6 100644 --- a/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java +++ b/tests/testbench/com/vaadin/tests/layouts/OrderedLayoutBasics.java @@ -4,8 +4,8 @@ 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.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Alignment; diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java index d53fda1748..8da94feb7f 100644 --- a/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java +++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/GridLayoutTests.java @@ -3,10 +3,10 @@ package com.vaadin.tests.layouts.layouttester; import java.util.Date; import com.vaadin.Application; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.Resource; +import com.vaadin.server.SystemError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Alignment; diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java index ab4bb265c5..0042f0ba11 100644 --- a/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java +++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/HorizontalLayoutTests.java @@ -1,11 +1,11 @@ package com.vaadin.tests.layouts.layouttester; import com.vaadin.Application; +import com.vaadin.server.Resource; +import com.vaadin.server.SystemError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Alignment; diff --git a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java index be32ca513b..3e668289fe 100644 --- a/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java +++ b/tests/testbench/com/vaadin/tests/layouts/layouttester/VerticalLayoutTests.java @@ -1,11 +1,11 @@ package com.vaadin.tests.layouts.layouttester; import com.vaadin.Application; +import com.vaadin.server.Resource; +import com.vaadin.server.SystemError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.Resource; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Alignment; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java index 08556e99d0..4e8d2f3160 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/AutoGeneratingForm.java @@ -19,7 +19,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.fieldgroup.BeanFieldGroup; import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.util.BeanItem; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java index f3e6653288..f55377b3f4 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/BasicApplication.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java index 39b11177b6..a96b8957c6 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CreatingPreserveState.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java index eb34747450..2cbff64117 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/CustomConverterFactoryUI.java @@ -1,6 +1,6 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java index 12938f9f12..9da6a75a45 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DefineUITheme.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.annotations.Theme; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; import com.vaadin.ui.VerticalLayout; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java index b0a33c14cf..2dad3d38b5 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DifferentFeaturesForDifferentClients.java @@ -18,8 +18,8 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.Application; import com.vaadin.UIRequiresMoreInformationException; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedRequest.BrowserDetails; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedRequest.BrowserDetails; import com.vaadin.terminal.gwt.server.WebBrowser; import com.vaadin.ui.Label; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java index f3e96aaafc..4fd9c1187b 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/DynamicImageUI.java @@ -8,10 +8,10 @@ import java.net.URL; import javax.imageio.ImageIO; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java index 9830ee6aeb..e0f53935c7 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FindCurrentUI.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.Application; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java index 2a8b228bc3..a3de39c039 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormUsingExistingLayout.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.fieldgroup.FieldGroup; import com.vaadin.data.fieldgroup.PropertyId; import com.vaadin.data.util.BeanItem; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.GridLayout; import com.vaadin.ui.TextArea; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java index 5dd9322364..ae8de83e30 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/FormatTableValue.java @@ -4,7 +4,7 @@ import java.text.NumberFormat; import java.util.Locale; import com.vaadin.data.util.converter.StringToNumberConverter; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Table; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java index 38a578189a..f0df14e158 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldDataSource.java @@ -2,7 +2,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.Property; import com.vaadin.data.util.BeanItem; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java index 9d968f360a..1e32916d0b 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/IntegerTextFieldStandalone.java @@ -2,7 +2,7 @@ package com.vaadin.tests.minitutorials.v7a1; import com.vaadin.data.util.converter.Converter.ConversionException; import com.vaadin.data.util.converter.StringToIntegerConverter; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java index d82f4b1382..2c7d6ee7ba 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/MultiTabApplication.java @@ -16,8 +16,8 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.Link; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java index 67a795a314..5834f320af 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/StringMyTypeConverter.java @@ -4,7 +4,7 @@ import java.util.Locale; import com.vaadin.data.util.converter.Converter; import com.vaadin.data.util.converter.Converter.ConversionException; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java index c2f983c9bb..4beb321cd1 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingBeanValidation.java @@ -22,7 +22,7 @@ import javax.validation.constraints.Size; import com.vaadin.data.util.BeanItem; import com.vaadin.data.validator.BeanValidator; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java index 042c02316f..cde71d5ac2 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingUriFragments.java @@ -16,9 +16,9 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.Page.FragmentChangedEvent; -import com.vaadin.terminal.Page.FragmentChangedListener; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.Page.FragmentChangedEvent; +import com.vaadin.server.Page.FragmentChangedListener; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java index 4a689d8c12..dc6c8ce7bf 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a1/UsingXyzWhenInitializing.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a1; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java index 1bde122dbf..8ad3b037b3 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ComponentInStateUI.java @@ -1,7 +1,7 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Label; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java index d9091e4287..62088f304d 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/MyComponentUI.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java index f906661b51..8c2ee0850a 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateComponent.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a2; -import com.vaadin.terminal.Resource; +import com.vaadin.server.Resource; import com.vaadin.terminal.gwt.server.ResourceReference; import com.vaadin.tests.widgetset.client.minitutorials.v7a2.ResourceInStateState; import com.vaadin.ui.AbstractComponent; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java index 37f4255cdd..35062fbf0c 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/ResourceInStateUI.java @@ -17,8 +17,8 @@ package com.vaadin.tests.minitutorials.v7a2; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; /** diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java index 8c728548c0..76e332504c 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a2/WidgetcontainerUI.java @@ -3,7 +3,7 @@ package com.vaadin.tests.minitutorials.v7a2; import java.util.Random; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java index 6f2be3c7d7..cf355f2145 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/Analytics.java @@ -17,7 +17,7 @@ package com.vaadin.tests.minitutorials.v7a3; import com.vaadin.annotations.JavaScript; -import com.vaadin.terminal.AbstractJavaScriptExtension; +import com.vaadin.server.AbstractJavaScriptExtension; import com.vaadin.terminal.gwt.server.ClientConnector; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java index bae3c4fc9c..95055cd207 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/AnalyticsUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a3; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java index 093f3269e0..b84cb5e599 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/ComplexTypesUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a3; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; public class ComplexTypesUI extends UI { diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java index 02bd8a7cce..5e519d1b7a 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/FlotJavaScriptUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a3; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java index 9384394870..793ba3dee8 100644 --- a/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java +++ b/tests/testbench/com/vaadin/tests/minitutorials/v7a3/RedButtonUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.minitutorials.v7a3; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.UI; public class RedButtonUI extends UI { diff --git a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java index 2f5c1177fa..6c3dcafc74 100644 --- a/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java +++ b/tests/testbench/com/vaadin/tests/requesthandlers/AppResource404.java @@ -1,6 +1,6 @@ package com.vaadin.tests.requesthandlers; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.tests.components.TestBase; import com.vaadin.tests.integration.FlagSeResource; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java b/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java index cb8963c3d4..00f1e4d2d6 100644 --- a/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java +++ b/tests/testbench/com/vaadin/tests/resources/DownloadLargeFileResource.java @@ -5,7 +5,7 @@ import java.io.File; import java.io.FileOutputStream; import java.io.IOException; -import com.vaadin.terminal.FileResource; +import com.vaadin.server.FileResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java b/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java index b6dbcfca97..e0c7b16318 100644 --- a/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java +++ b/tests/testbench/com/vaadin/tests/resources/NonExistingFileResource.java @@ -2,7 +2,7 @@ package com.vaadin.tests.resources; import java.io.File; -import com.vaadin.terminal.FileResource; +import com.vaadin.server.FileResource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java b/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java index 8ab6ce153d..3b4e4b9ff3 100644 --- a/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java +++ b/tests/testbench/com/vaadin/tests/resources/ResourceDownload.java @@ -4,8 +4,8 @@ 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.server.StreamResource; +import com.vaadin.server.StreamResource.StreamSource; import com.vaadin.tests.components.TestBase; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java index b775c18f8f..3a5dd0a326 100644 --- a/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/DelegateToWidgetTest.java @@ -17,7 +17,7 @@ package com.vaadin.tests.serialization; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.TestingWidgetSet; import com.vaadin.tests.widgetset.server.DelegateToWidgetComponent; diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java index 0bb3b6c542..0d939a3d18 100644 --- a/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerNamespaceTest.java @@ -17,7 +17,7 @@ package com.vaadin.tests.serialization; import com.vaadin.annotations.Widgetset; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.widgetset.TestingWidgetSet; import com.vaadin.tests.widgetset.server.DummyLabel; diff --git a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java index 6ad6b6d530..cb9d9e997d 100644 --- a/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java +++ b/tests/testbench/com/vaadin/tests/serialization/SerializerTest.java @@ -27,9 +27,9 @@ import java.util.Map.Entry; import java.util.Set; import com.vaadin.annotations.Widgetset; +import com.vaadin.server.WrappedRequest; import com.vaadin.shared.Connector; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; import com.vaadin.tests.util.Log; import com.vaadin.tests.widgetset.client.ComplexTestBean; diff --git a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java index 62160d233a..39b43f3516 100644 --- a/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java +++ b/tests/testbench/com/vaadin/tests/themes/ButtonsTest.java @@ -2,8 +2,8 @@ package com.vaadin.tests.themes; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.CheckBox; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java index 92a480c3d2..b1b652381f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1589.java @@ -11,11 +11,11 @@ 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.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Link; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java index 05fd0c3f1f..2f845a2264 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1598.java @@ -4,7 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.ui.MenuBar; import com.vaadin.ui.MenuBar.Command; import com.vaadin.ui.MenuBar.MenuItem; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java index 55d08069ed..57d2ad73e5 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1659.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java index b07e9df0e5..1ef16afe95 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1663.java @@ -1,6 +1,6 @@ package com.vaadin.tests.tickets; -import com.vaadin.terminal.SystemError; +import com.vaadin.server.SystemError; import com.vaadin.ui.UI.LegacyWindow; import com.vaadin.ui.TextField; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java index d3c2437219..c00e2f32eb 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1710.java @@ -5,10 +5,10 @@ import java.util.Iterator; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.util.MethodProperty; +import com.vaadin.server.SystemError; +import com.vaadin.server.ThemeResource; import com.vaadin.shared.ui.AlignmentInfo.Bits; import com.vaadin.shared.ui.MarginInfo; -import com.vaadin.terminal.SystemError; -import com.vaadin.terminal.ThemeResource; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java index 364ad9b6cf..44d4109203 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1737.java @@ -1,9 +1,9 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ClassResource; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.Resource; +import com.vaadin.server.ClassResource; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.Resource; import com.vaadin.ui.Embedded; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java index 780215aa2a..a77e6e843a 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1804.java @@ -5,8 +5,8 @@ import java.util.LinkedList; import com.vaadin.data.Validator; import com.vaadin.data.util.MethodProperty; +import com.vaadin.server.SystemError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.SystemError; import com.vaadin.ui.AbstractField; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java index 1b60d535cf..90a96ba0f1 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1878.java @@ -7,9 +7,9 @@ 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.server.Resource; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java index 3b50804938..92102426ca 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1916.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java index 3d79de5d1d..ac5f990915 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1921.java @@ -4,9 +4,9 @@ import java.io.IOException; import java.util.Map; import com.vaadin.Application; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java index 63634259a3..7258971f50 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1966_3.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; -import com.vaadin.terminal.UserError; +import com.vaadin.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Panel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java index b10ccea992..78c09d8914 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1969.java @@ -1,6 +1,6 @@ package com.vaadin.tests.tickets; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.tests.TestForTablesInitialColumnWidthLogicRendering; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java index 0d6a21faac..7b544ec9b0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket1983.java @@ -4,7 +4,7 @@ import com.vaadin.Application; import com.vaadin.data.Property.ValueChangeEvent; import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.IndexedContainer; -import com.vaadin.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalSplitPanel; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java index 0342b87e68..fcffbc01bf 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2007.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java index ba8936adfa..5900c76706 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2029.java @@ -5,7 +5,7 @@ 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.server.UserError; import com.vaadin.ui.Alignment; import com.vaadin.ui.Component; import com.vaadin.ui.GridLayout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java index 2efc66556d..8a10067455 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2043.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.GridLayout; import com.vaadin.ui.Link; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java index 110db06800..5ac0480fe2 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2048.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java index 362a763c2f..31973e4c92 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2053.java @@ -3,7 +3,7 @@ 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.server.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java index 186522db15..87d92ad9f6 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2061b.java @@ -5,7 +5,7 @@ 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.terminal.Sizeable; +import com.vaadin.server.Sizeable; import com.vaadin.ui.AbstractOrderedLayout; import com.vaadin.ui.Accordion; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java index e48aae7d9f..2f311b9428 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2090.java @@ -3,7 +3,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.Property.ValueChangeEvent; -import com.vaadin.terminal.UserError; +import com.vaadin.server.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java index aabafadb13..53f2aac79e 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2095.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Embedded; import com.vaadin.ui.UI.LegacyWindow; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java index 4da938351d..0dba639712 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2104.java @@ -6,8 +6,8 @@ import com.vaadin.data.Property.ValueChangeListener; import com.vaadin.data.util.MethodProperty; import com.vaadin.event.ItemClickEvent; import com.vaadin.event.ItemClickEvent.ItemClickListener; +import com.vaadin.server.ExternalResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.CheckBox; import com.vaadin.ui.HorizontalLayout; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java index d5b5041060..fb0d62ba85 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2117.java @@ -1,8 +1,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; +import com.vaadin.server.ExternalResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Button.ClickListener; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java index 621b744aa8..38cc567295 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2119.java @@ -3,8 +3,8 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; import com.vaadin.data.Property; import com.vaadin.data.util.ObjectProperty; +import com.vaadin.server.ExternalResource; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.ExternalResource; import com.vaadin.ui.Button; import com.vaadin.ui.Label; import com.vaadin.ui.Layout; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java index ceba214dc5..b67fad52c0 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2181.java @@ -6,8 +6,8 @@ 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.server.ThemeResource; +import com.vaadin.server.UserError; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java index e732ea09e0..c4c600edaa 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2292.java @@ -10,11 +10,11 @@ import java.io.IOException; import javax.imageio.ImageIO; import com.vaadin.Application; -import com.vaadin.terminal.DownloadStream; -import com.vaadin.terminal.ExternalResource; -import com.vaadin.terminal.RequestHandler; -import com.vaadin.terminal.WrappedRequest; -import com.vaadin.terminal.WrappedResponse; +import com.vaadin.server.DownloadStream; +import com.vaadin.server.ExternalResource; +import com.vaadin.server.RequestHandler; +import com.vaadin.server.WrappedRequest; +import com.vaadin.server.WrappedResponse; import com.vaadin.ui.Button; import com.vaadin.ui.CheckBox; import com.vaadin.ui.Label; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java index a76f3a711f..8be6a13e9f 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket2405.java @@ -1,7 +1,7 @@ package com.vaadin.tests.tickets; import com.vaadin.Application; -import com.vaadin.terminal.ExternalResource; +import com.vaadin.server.ExternalResource; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; import com.vaadin.ui.Embedded; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java index 67db77a5af..fd5e9c6005 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket34.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket34.java @@ -4,8 +4,8 @@ import java.util.HashMap; import java.util.Map; import com.vaadin.Application; -import com.vaadin.terminal.Page; -import com.vaadin.terminal.Page.FragmentChangedEvent; +import com.vaadin.server.Page; +import com.vaadin.server.Page.FragmentChangedEvent; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.Component; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java index 1176e87bb4..417ee86fac 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket736.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket736.java @@ -5,7 +5,7 @@ import com.vaadin.data.Validator; import com.vaadin.data.util.BeanItem; import com.vaadin.data.util.MethodProperty; import com.vaadin.data.validator.IntegerValidator; -import com.vaadin.terminal.ThemeResource; +import com.vaadin.server.ThemeResource; import com.vaadin.ui.AbstractComponent; import com.vaadin.ui.Alignment; import com.vaadin.ui.Button; diff --git a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java index 24a98d42e3..0280db0693 100644 --- a/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java +++ b/tests/testbench/com/vaadin/tests/tickets/Ticket8291.java @@ -7,7 +7,7 @@ import java.util.List; import com.vaadin.data.Container.Filter; import com.vaadin.data.Item; import com.vaadin.data.util.BeanItemContainer; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.ui.Button; import com.vaadin.ui.Button.ClickEvent; import com.vaadin.ui.HorizontalLayout; diff --git a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java index 788415d0fd..ef20da788d 100644 --- a/tests/testbench/com/vaadin/tests/util/SampleDirectory.java +++ b/tests/testbench/com/vaadin/tests/util/SampleDirectory.java @@ -19,8 +19,8 @@ package com.vaadin.tests.util; import java.io.File; import com.vaadin.Application; +import com.vaadin.server.SystemError; import com.vaadin.shared.ui.label.ContentMode; -import com.vaadin.terminal.SystemError; import com.vaadin.ui.Label; import com.vaadin.ui.Panel; import com.vaadin.ui.UI; diff --git a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java index c197bbde5d..bc3d88e2bb 100644 --- a/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java +++ b/tests/testbench/com/vaadin/tests/vaadincontext/BootstrapModifyUI.java @@ -16,7 +16,7 @@ package com.vaadin.tests.vaadincontext; -import com.vaadin.terminal.WrappedRequest; +import com.vaadin.server.WrappedRequest; import com.vaadin.tests.components.AbstractTestUI; public class BootstrapModifyUI extends AbstractTestUI { diff --git a/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java b/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java index 8cdcc0fe3a..978ed80ed5 100644 --- a/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java +++ b/tests/testbench/com/vaadin/tests/widgetset/server/SerializerTestExtension.java @@ -16,7 +16,7 @@ package com.vaadin.tests.widgetset.server; -import com.vaadin.terminal.AbstractExtension; +import com.vaadin.server.AbstractExtension; import com.vaadin.tests.widgetset.client.ComplexTestBean; import com.vaadin.tests.widgetset.client.SerializerTestRpc; -- cgit v1.2.3